google-cloud-secretmanager overview (2.23.0)

com.google.cloud.secretmanager.v1

A client to Secret Manager API

The interfaces provided are listed below, along with usage samples.

SecretManagerServiceClient

Service Description: Secret Manager Service

Manages secrets and operations using those secrets. Implements a REST model with the following objects:

  • Secret
  • SecretVersion

Sample for SecretManagerServiceClient:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (SecretManagerServiceClient secretManagerServiceClient =
     SecretManagerServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   String secretId = "secretId945974251";
   Secret secret = Secret.newBuilder().build();
   Secret response = secretManagerServiceClient.createSecret(parent, secretId, secret);
 }
 

com.google.cloud.secretmanager.v1.stub

com.google.cloud.secretmanager.v1beta1

The interfaces provided are listed below, along with usage samples.

SecretManagerServiceClient

Service Description: Secret Manager Service

Manages secrets and operations using those secrets. Implements a REST model with the following objects:

  • Secret
  • SecretVersion

Sample for SecretManagerServiceClient:


 try (SecretManagerServiceClient secretManagerServiceClient =
     SecretManagerServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   String secretId = "secretId945974251";
   Secret secret = Secret.newBuilder().build();
   Secret response = secretManagerServiceClient.createSecret(parent, secretId, secret);
 }
 

com.google.cloud.secretmanager.v1beta1.stub