클라이언트 라이브러리를 사용하면 지원되는 언어로 Google Cloud API에 쉽게 액세스할 수 있습니다. 서버에 원시 요청을 수행해서 Google Cloud API를 직접 사용할 수 있지만 클라이언트 라이브러리는 작성할 코드 양을 크게 줄여 주는 간소화 기능을 제공합니다.
이 문서에서는 Cloud API를 위해 Google에서 제공되는 여러 유형의 클라이언트 라이브러리에 대해 설명합니다. 또한 원하는 제품 또는 언어에 제공되는 라이브러리에 대한 자세한 내용은 해당 제품 또는 언어의 문서를 참조하세요.
Cloud 클라이언트 라이브러리
Cloud 클라이언트 라이브러리는 가능한 경우 Cloud API에 프로그래매틱 방식으로 액세스하기 위해 권장되는 옵션입니다. Cloud 클라이언트 라이브러리에는 최신 클라이언트 라이브러리 모델이 사용됩니다.
각 언어에서 관용적인 코드를 제공함으로써 Cloud API를 직관적으로 간단하게 사용할 수 있게 해줍니다.
클라이언트 라이브러리가 일관된 스타일로 제공되어, 클라우드 서비스가 여러 개여도 쉽게 사용할 수 있습니다.
Google 인증을 포함해 서버와 이루어지는 통신에 대한 하위 수준의 세부 정보를 모두 처리합니다.
npm 및 pip와 같은 익숙한 패키지 관리 도구를 사용하여 설치할 수 있습니다.
일부 경우에는 gRPC를 사용한 성능 이점을 제공합니다. 자세한 내용은 gRPC API를 참조하세요.
사용 중인 Cloud API에 대한 클라이언트 라이브러리 페이지에서 Cloud 클라이언트 라이브러리에 대한 설치 안내 및 참조 자료를 찾아볼 수 있습니다. Cloud 클라이언트 라이브러리를 시작하기 위한 링크 및 참조 문서를 보려면 Cloud 클라이언트 라이브러리 페이지를 참조하세요.
직접 사용해 보기
Google Cloud를 처음 사용하는 경우 계정을 만들고 Google 제품의 실제 성능을 평가해 보세요. 신규 고객에게는 워크로드를 실행, 테스트, 배포하는 데 사용할 수 있는 $300의 무료 크레딧이 제공됩니다.
일부 Google Cloud API의 경우 Cloud 클라이언트 라이브러리가 모든 언어로 제공되지는 않습니다. 이러한 API 중 하나를 사용할 때 원하는 언어의 Cloud 클라이언트 라이브러리가 없으면 Google API 클라이언트 라이브러리라고 부르는 이전 스타일의 클라이언트 라이브러리를 사용할 수 있습니다.
또한 이미 이를 사용하는 프로젝트를 업로드하는 경우에도 이러한 라이브러리를 사용할 수 있습니다. 이전 버전의 라이브러리는 다음과 같습니다.
API의 REST 인터페이스에 한해 액세스를 제공하며, gRPC는 지원되지 않습니다.
Cloud 클라이언트 라이브러리처럼 관용적이진 않을 수 있는 자동 생성된 인터페이스 코드를 지원합니다.
Google 인증을 포함해 서버와 이루어지는 통신에 대한 하위 수준의 세부 정보를 모두 처리합니다.
npm 및 pip와 같은 익숙한 패키지 관리 도구를 사용하여 설치할 수 있습니다.
이러한 라이브러리는 관련된 Cloud API를 위해 클라이언트 라이브러리 페이지에 연결되어 있습니다.
Firebase 모바일 플랫폼 사용
Firebase는 휴대기기 애플리케이션을 개발할 수 있는 Google 전체 솔루션입니다. 이 솔루션은 SDK를 클라이언트 코드와 함께 제공하기 때문에 iOS, Android 및 웹 앱에서 모바일 관련 Cloud API에 액세스할 수 있습니다. 지원되는 Cloud API 및 Firebase 시작 방법에 대한 자세한 내용은 Firebase 문서를 참조하세요.
고유 클라이언트 코드 사용
숙련된 개발자이고 Google의 클라이언트 라이브러리가 특정 요구에 부합되지 않는 경우에는 서비스의 로우 레벨 서비스 API에 직접 액세스하기 위해 고유의 커스텀 코드를 작성할 수 있습니다.
REST/HTTP API
모든 Cloud API는 기존 JSON/REST 인터페이스를 하나만 제공합니다. 커스텀 코드를 작성해 제3의 HTTP 클라이언트 라이브러리를 사용하여 REST API에 직접 액세스해야 한다면 HTTP 가이드라인에서 Cloud API와 여러 HTTP 버전 및 구현체의 호환성에 대해 자세한 내용을 찾아볼 수 있습니다.
gRPC API
gRPC는 언어 중립적이고, 플랫폼 중립적이며, 오픈소스를 기반으로 하고, Google에서 처음 개발된 리모트 프로시져 콜(RPC) 시스템입니다. 자세한 내용은 grpc.io를 참조하세요. gRPC를 지원하는 Cloud API는 일반적으로 REST 및 RPC 인터페이스를 모두 포함합니다. 따라서 REST 인터페이스와 통신하기 위해 HTTP 기반 JSON만 사용하는 대신 gRPC 지원 API 클라이언트가 프로토콜 버퍼와 HTTP2 기반 gRPC를 사용해서 RPC 인터페이스와 통신할 수도 있습니다. API의 gRPC 기반 여부는 API 및 참조 섹션을 살펴보면 알아낼 수 있습니다.
Cloud API가 gRPC 기반일 경우 gRPC가 지원되는 모든 언어에서 고유의 gRPC 클라이언트 라이브러리를 생성할 수 있습니다. 이를 위해서는 API의 프로토콜 버퍼 서비스 정의(일반적으로 GitHub 저장소에서 제공)가 필요합니다.
그런 다음 grpc.io에서 원하는 언어에 해당하는 안내를 따라 클라이언트를 생성하여 사용할 수 있습니다.
고유 gRPC 코드를 생성하지 않더라도 gRPC의 이점을 이용할 수 있습니다. 점차 늘어나고 있는 gRPC 기반 API용 Cloud 클라이언트 라이브러리는 gRPC를 '알지 못하게' 사용하여 Google의 서버와 통신하기 때문입니다. 처리량과 CPU 사용량의 관점에서 보았을 때 이러한 방법이 훨씬 더 효율적입니다. gRPC를 사용하여 API에 액세스하면 JSON REST API와 비교 시 CPU당 처리량을 최대 10배까지 늘릴 수 있습니다 Google은 가능한 한 많은 Cloud 클라이언트 라이브러리를 gRPC로 업그레이드할 계획입니다. 그 동안에는 Google 클라이언트 라이브러리 코드의 다른 모든 장점도 계속 지원됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eCloud Client Libraries are the recommended method for accessing Cloud APIs programmatically, offering idiomatic code, consistent style, and handling low-level server communication.\u003c/p\u003e\n"],["\u003cp\u003eGoogle API Client Libraries serve as an alternative for APIs that lack Cloud Client Libraries in certain languages, providing access to the REST interface only, but with autogenerated interface code.\u003c/p\u003e\n"],["\u003cp\u003eFirebase SDK provides client code for accessing mobile-relevant Cloud APIs from iOS, Android, and Web applications, which is the go to solution for mobile device application development.\u003c/p\u003e\n"],["\u003cp\u003eExperienced developers can opt to write their own custom code to directly interact with the service's lower-level APIs, using the JSON/REST interface or gRPC.\u003c/p\u003e\n"],["\u003cp\u003egRPC-enabled Cloud APIs offer a performance advantage through the use of protocol buffers and gRPC over HTTP2, with some Cloud Client Libraries leveraging gRPC for improved efficiency.\u003c/p\u003e\n"]]],[],null,["# Client libraries explained\n\nClient libraries make it easier to access\n[Google Cloud APIs](/apis/docs/overview)\nfrom a supported language. While you can use Google Cloud APIs directly\nby making raw requests to the server, client libraries provide simplifications\nthat significantly reduce the amount of code you need to write.\n\nThis document explains the different types of client libraries that Google\nprovides for Cloud APIs. You can also find out more about the available\nlibraries for your product or language of choice in the product or language's\ndocumentation.\n\nCloud Client Libraries\n----------------------\n\n[Cloud Client Libraries](/apis/docs/cloud-client-libraries)\nare the recommended option for accessing Cloud APIs programmatically, where\navailable. Cloud Client Libraries use the latest client library model and:\n\n- Provide idiomatic code in each language to make Cloud APIs simple and intuitive to use.\n- Provide a consistent style across client libraries to simplify working with multiple Cloud services.\n- Handle all the low-level details of communication with the server, including [authenticating with Google](/docs/authentication/client-libraries).\n- Can be installed using familiar package management tools such as `npm` and `pip`.\n- In some cases, give you performance benefits by using gRPC. For more information, see the [gRPC APIs](#grpc_apis).\n\nYou can find installation instructions and reference material for the\nCloud Client Library on the Client Libraries page for the\n[Cloud API](/apis/docs/overview)s\nyou're using. You can find links to get started with the\nCloud Client Libraries and their reference documentation on the\n[Cloud Client Libraries page](/apis/docs/cloud-client-libraries).\n\nTry it for yourself\n-------------------\n\n\nIf you're new to Google Cloud, create an account to evaluate how our\nproducts perform in real-world scenarios. New customers also get $300 in\nfree credits to run, test, and deploy workloads.\n[Get started for free](https://console.cloud.google.com/freetrial)\n\nGoogle API Client Libraries\n---------------------------\n\nA few Google Cloud APIs don't have Cloud Client Libraries available in all\nlanguages. If you want to use one of these APIs and there is no\nCloud Client Library for your preferred language, you can still use the previous\nstyle of client library, called\n[Google API Client Libraries](https://developers.google.com/api-client-library/).\nYou might also use these libraries if you're upgrading a project that already\nuses them. These libraries:\n\n- Provide access to the API's REST interface only; gRPC is not supported.\n- Have autogenerated interface code that might not be as idiomatic as the Cloud Client Libraries.\n- Handle all the low-level details of communication with the server, including [authenticating with Google](/docs/authentication/client-libraries).\n- Can be installed using familiar package management tools such as `npm` and `pip`.\n\nThese libraries are linked on the Client Libraries page for the relevant Cloud\nAPIs.\n\nUsing the Firebase mobile platform\n----------------------------------\n\nFirebase is the Google-wide solution for building applications on mobile\ndevices. It offers an SDK with client code that lets you access mobile-relevant\nCloud APIs from iOS, Android, and Web apps. For information on the supported\nCloud APIs and how to get started with Firebase, see the\n[Firebase documentation](https://firebase.google.com/docs).\n\nUsing your own client code\n--------------------------\n\nIf you're an experienced developer and Google's client libraries don't meet your\nspecific needs, you can write your own custom code to access the service's\nlower-level service APIs directly.\n\n### REST/HTTP APIs\n\nAll Cloud APIs expose a simple traditional JSON/REST interface. If you need to\nwrite your own custom code to directly access the REST API using a third-party\nHTTP client library, you can find out more about how Cloud APIs work with\ndifferent HTTP versions and implementations in the\n[HTTP Guidelines](/apis/docs/http).\n\n### gRPC APIs\n\ngRPC is a language-neutral, platform-neutral, open source, remote procedure call\n(RPC) system initially developed at Google. You can find out about it at\n[grpc.io](http://www.grpc.io/).\ngRPC-enabled Cloud APIs generally have both REST and RPC interfaces, so rather\nthan just using JSON over HTTP to talk to the REST interface, gRPC-enabled API\nclients can also use\n[protocol buffers](https://developers.google.com/protocol-buffers/)\nand gRPC over HTTP2 to talk to the RPC interface. You can find out if an API is\ngRPC-enabled by checking its APIs and Reference section.\n\nIf a Cloud API is gRPC-enabled, you can generate your own gRPC client libraries\nfor it in any gRPC-supported language. To do this, you'll need the API's\n[protocol buffers](https://developers.google.com/protocol-buffers/)\nservice definition (typically available from\n[the repository on GitHub](https://github.com/googleapis/googleapis)).\nYou can then follow the instructions for your preferred language on\n[grpc.io](http://www.grpc.io/)\nto generate and use your client.\n\nIf you don't want to generate your own gRPC code, you can still benefit from\ngRPC: a growing number of Cloud Client Libraries for gRPC-enabled APIs use gRPC\n\"under the hood\" to communicate with Google's servers. This is significantly\nmore efficient in terms of throughput and CPU usage --- accessing an API\nusing gRPC can increase throughput per CPU by as much as a factor of 10 compared\nto the JSON REST API. Google plans to upgrade as many Cloud Client Libraries as\npossible to gRPC; in the meantime, you'll still get all the other advantages of\nGoogle's client library code.\n\nOther ways to access Cloud APIs\n-------------------------------\n\nIf you don't want to access an API programmatically, you can access some\nof the same functionality using the tools in\n[Google Cloud CLI](/sdk/docs) or using the\n[Google Cloud console](https://console.cloud.google.com/)."]]