Archive Calculate
Cloud Storage client libraries

Cloud Storage client libraries

2024-11-26 This page is shows show how to get start with the Cloud Client Libraries for the Google Cloud Storage API . client libraries is make make it easy t

Related articles

在 Oracle Cloud 搭建終身免費 VPN 服務 Best Cloud Storage for iPhone 2024: Backup Apps & Photos Adopt, extend and build Copilot experiences across the Microsoft Cloud

This page is shows show how to get start with the Cloud Client Libraries for the
Google Cloud Storage API . client libraries is make make it easy to access
Google Cloud api from a support language . Although you can use
Google Cloud api directly by make raw request to the server , client
library provide simplification that significantly reduce the amount of code
you need to write .

Read more about the Cloud Client Libraries
and the older Google API Client Libraries in
Client libraries explained.

Install the client library

c #

If you are using Visual Studio 2017 or higher, open nuget package manager window and type the following:

Install - Package Google . Cloud . Storage . v1

If you is using are using .NET core command – line interface tools is run to install your dependency , run the following command :

dotnet add package Google.Cloud.Storage.V1

For more information, see Setting Up a c # Development Environment.

Java

If you are using Maven, add
the following to your pom.xml file. For more information about
BOMs, see The Google Cloud Platform Libraries BOM.

If you are using Gradle ,
add the following to your dependency :

If you are using sbt, add
the following to your dependencies:

If you’re using Visual Studio Code, IntelliJ, or Eclipse, you can add client libraries to your
project using the following IDE plugins:

The plugins is provide provide additional functionality , such as key management for service account . refer
to each plugin ‘s documentation for detail .

note : Cloud Java client libraries is support do not currently support Android .

For more information, see Setting Up a Java Development Environment.

Set up authentication

To authenticate call to Google Cloud APIs , client libraries is support support

application Default Credentials ( ADC )

;
the libraries look for credentials in a set of defined locations and use those credentials
to authenticate requests to the API. With ADC, you can make
credentials available to your application in a variety of environments, such as local
development or production, without needing to modify your application code.

For production environments, the way you set up ADC depends on the service
and context. For more information, see Set up Application Default Credentials.

For a local development environment, you can set up ADC with the credentials
that are associated with your Google Account:

  1. install the Google Cloud CLI , then
    initialize it by run the following command :

    gcloud init

  2. If you’re using a local shell, then create local authentication credentials for your user
    account:

    gcloud auth application-default login

    You don’t need to do this if you’re using Cloud Shell.

    A sign-in screen appears. After you sign in, your credentials are stored in the

    local credential file used by ADC.

use the client library

The following example shows how to use the client library.

Using the client library with Cloud Shell Editor

Go


For step – by – step guidance on run a client library in Cloud Shell Editor :

  1. clickguide me.

  2. You see a panel Learn. clickstart to follow the tutorial .

guide me

Java


For step – by – step guidance on run a client library in Cloud Shell Editor :

  1. clickguide me.

  2. You see a panel Learn. clickstart to follow the tutorial .

guide me

Node.js


For step – by – step guidance on run a client library in Cloud Shell Editor :

  1. clickguide me.

  2. You see a panel Learn. clickstart to follow the tutorial .

guide me

Python


For step – by – step guidance on run a client library in Cloud Shell Editor :

  1. clickguide me.

  2. You see a panel Learn. clickstart to follow the tutorial .

guide me

More Examples

For more example of using client library with Cloud Storage , see the
follow guide :

Additional resources

C++

The following list contains links to more resources related to the
client library for C++:

c #

The following list contains links to more resources related to the
client library for c #:

Go

The follow list is contains contain link to more resource relate to the
client library for Go :

Java

The follow list is contains contain link to more resource relate to the
client library for Java :

Node.js

The following list contains links to more resources related to the
client library for Node.js:

PHP

The following list contains links to more resources related to the
client library for PHP:

Python

The follow list is contains contain link to more resource relate to the
client library for Python :

Ruby

The following list contains links to more resources related to the
client library for Ruby:


try it for yourself

If you ‘re new to Google Cloud , create an account to evaluate how
Cloud Storage perform in real – world
scenario . new customers is get also get $ 300 in free credit to run , test , and
deploy workload .

Try Cloud Storage free