Package com.google.cloud.kms.inventory.v1 (0.18.0)

A client to KMS Inventory API

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

KeyDashboardServiceClient

Service Description: Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

Sample for KeyDashboardServiceClient:


 // 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 (KeyDashboardServiceClient keyDashboardServiceClient = KeyDashboardServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (CryptoKey element : keyDashboardServiceClient.listCryptoKeys(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 

KeyTrackingServiceClient

Service Description: Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

Sample for KeyTrackingServiceClient:


 // 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 (KeyTrackingServiceClient keyTrackingServiceClient = KeyTrackingServiceClient.create()) {
   ProtectedResourcesSummaryName name =
       ProtectedResourcesSummaryName.ofProjectLocationKeyRingCryptoKeyName(
           "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
   ProtectedResourcesSummary response =
       keyTrackingServiceClient.getProtectedResourcesSummary(name);
 }
 

Classes

GetProtectedResourcesSummaryRequest

Request message for KeyTrackingService.GetProtectedResourcesSummary.

Protobuf type google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest

GetProtectedResourcesSummaryRequest.Builder

Request message for KeyTrackingService.GetProtectedResourcesSummary.

Protobuf type google.cloud.kms.inventory.v1.GetProtectedResourcesSummaryRequest

KeyDashboardServiceClient

Service Description: Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // 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 (KeyDashboardServiceClient keyDashboardServiceClient = KeyDashboardServiceClient.create()) {
   ProjectName parent = ProjectName.of("[PROJECT]");
   for (CryptoKey element : keyDashboardServiceClient.listCryptoKeys(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 

Note: close() needs to be called on the KeyDashboardServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of KeyDashboardServiceSettings to create(). For example:

To customize credentials:


 // 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
 KeyDashboardServiceSettings keyDashboardServiceSettings =
     KeyDashboardServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 KeyDashboardServiceClient keyDashboardServiceClient =
     KeyDashboardServiceClient.create(keyDashboardServiceSettings);
 

To customize the endpoint:


 // 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
 KeyDashboardServiceSettings keyDashboardServiceSettings =
     KeyDashboardServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 KeyDashboardServiceClient keyDashboardServiceClient =
     KeyDashboardServiceClient.create(keyDashboardServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // 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
 KeyDashboardServiceSettings keyDashboardServiceSettings =
     KeyDashboardServiceSettings.newHttpJsonBuilder().build();
 KeyDashboardServiceClient keyDashboardServiceClient =
     KeyDashboardServiceClient.create(keyDashboardServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

KeyDashboardServiceClient.ListCryptoKeysFixedSizeCollection

KeyDashboardServiceClient.ListCryptoKeysPage

KeyDashboardServiceClient.ListCryptoKeysPagedResponse

KeyDashboardServiceGrpc

Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

KeyDashboardServiceGrpc.KeyDashboardServiceBlockingStub

A stub to allow clients to do synchronous rpc calls to service KeyDashboardService.

Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

KeyDashboardServiceGrpc.KeyDashboardServiceFutureStub

A stub to allow clients to do ListenableFuture-style rpc calls to service KeyDashboardService.

Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

KeyDashboardServiceGrpc.KeyDashboardServiceImplBase

Base class for the server implementation of the service KeyDashboardService.

Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

KeyDashboardServiceGrpc.KeyDashboardServiceStub

A stub to allow clients to do asynchronous rpc calls to service KeyDashboardService.

Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

KeyDashboardServiceProto

KeyDashboardServiceSettings

Settings class to configure an instance of KeyDashboardServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (kmsinventory.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of listCryptoKeys to 30 seconds:


 // 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
 KeyDashboardServiceSettings.Builder keyDashboardServiceSettingsBuilder =
     KeyDashboardServiceSettings.newBuilder();
 keyDashboardServiceSettingsBuilder
     .listCryptoKeysSettings()
     .setRetrySettings(
         keyDashboardServiceSettingsBuilder
             .listCryptoKeysSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 KeyDashboardServiceSettings keyDashboardServiceSettings =
     keyDashboardServiceSettingsBuilder.build();
 

KeyDashboardServiceSettings.Builder

Builder for KeyDashboardServiceSettings.

KeyTrackingServiceClient

Service Description: Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // 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 (KeyTrackingServiceClient keyTrackingServiceClient = KeyTrackingServiceClient.create()) {
   ProtectedResourcesSummaryName name =
       ProtectedResourcesSummaryName.ofProjectLocationKeyRingCryptoKeyName(
           "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]");
   ProtectedResourcesSummary response =
       keyTrackingServiceClient.getProtectedResourcesSummary(name);
 }
 

Note: close() needs to be called on the KeyTrackingServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of KeyTrackingServiceSettings to create(). For example:

To customize credentials:


 // 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
 KeyTrackingServiceSettings keyTrackingServiceSettings =
     KeyTrackingServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 KeyTrackingServiceClient keyTrackingServiceClient =
     KeyTrackingServiceClient.create(keyTrackingServiceSettings);
 

To customize the endpoint:


 // 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
 KeyTrackingServiceSettings keyTrackingServiceSettings =
     KeyTrackingServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 KeyTrackingServiceClient keyTrackingServiceClient =
     KeyTrackingServiceClient.create(keyTrackingServiceSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // 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
 KeyTrackingServiceSettings keyTrackingServiceSettings =
     KeyTrackingServiceSettings.newHttpJsonBuilder().build();
 KeyTrackingServiceClient keyTrackingServiceClient =
     KeyTrackingServiceClient.create(keyTrackingServiceSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

KeyTrackingServiceClient.SearchProtectedResourcesFixedSizeCollection

KeyTrackingServiceClient.SearchProtectedResourcesPage

KeyTrackingServiceClient.SearchProtectedResourcesPagedResponse

KeyTrackingServiceGrpc

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

KeyTrackingServiceGrpc.KeyTrackingServiceBlockingStub

A stub to allow clients to do synchronous rpc calls to service KeyTrackingService.

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

KeyTrackingServiceGrpc.KeyTrackingServiceFutureStub

A stub to allow clients to do ListenableFuture-style rpc calls to service KeyTrackingService.

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

KeyTrackingServiceGrpc.KeyTrackingServiceImplBase

Base class for the server implementation of the service KeyTrackingService.

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

KeyTrackingServiceGrpc.KeyTrackingServiceStub

A stub to allow clients to do asynchronous rpc calls to service KeyTrackingService.

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

KeyTrackingServiceProto

KeyTrackingServiceSettings

Settings class to configure an instance of KeyTrackingServiceClient.

The default instance has everything set to sensible defaults:

  • The default service address (kmsinventory.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getProtectedResourcesSummary to 30 seconds:


 // 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
 KeyTrackingServiceSettings.Builder keyTrackingServiceSettingsBuilder =
     KeyTrackingServiceSettings.newBuilder();
 keyTrackingServiceSettingsBuilder
     .getProtectedResourcesSummarySettings()
     .setRetrySettings(
         keyTrackingServiceSettingsBuilder
             .getProtectedResourcesSummarySettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 KeyTrackingServiceSettings keyTrackingServiceSettings =
     keyTrackingServiceSettingsBuilder.build();
 

KeyTrackingServiceSettings.Builder

Builder for KeyTrackingServiceSettings.

ListCryptoKeysRequest

Request message for KeyDashboardService.ListCryptoKeys.

Protobuf type google.cloud.kms.inventory.v1.ListCryptoKeysRequest

ListCryptoKeysRequest.Builder

Request message for KeyDashboardService.ListCryptoKeys.

Protobuf type google.cloud.kms.inventory.v1.ListCryptoKeysRequest

ListCryptoKeysResponse

Response message for KeyDashboardService.ListCryptoKeys.

Protobuf type google.cloud.kms.inventory.v1.ListCryptoKeysResponse

ListCryptoKeysResponse.Builder

Response message for KeyDashboardService.ListCryptoKeys.

Protobuf type google.cloud.kms.inventory.v1.ListCryptoKeysResponse

OrganizationName

OrganizationName.Builder

Builder for organizations/{organization}.

ProjectName

ProjectName.Builder

Builder for projects/{project}.

ProtectedResource

Metadata about a resource protected by a Cloud KMS key.

Protobuf type google.cloud.kms.inventory.v1.ProtectedResource

ProtectedResource.Builder

Metadata about a resource protected by a Cloud KMS key.

Protobuf type google.cloud.kms.inventory.v1.ProtectedResource

ProtectedResourcesSummary

Aggregate information about the resources protected by a Cloud KMS key in the same Cloud organization as the key.

Protobuf type google.cloud.kms.inventory.v1.ProtectedResourcesSummary

ProtectedResourcesSummary.Builder

Aggregate information about the resources protected by a Cloud KMS key in the same Cloud organization as the key.

Protobuf type google.cloud.kms.inventory.v1.ProtectedResourcesSummary

ProtectedResourcesSummaryName

ProtectedResourcesSummaryName.Builder

Builder for projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/protectedResourcesSummary.

ProtectedResourcesSummaryName.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionBuilder

Builder for projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}/protectedResourcesSummary.

SearchProtectedResourcesRequest

Request message for KeyTrackingService.SearchProtectedResources.

Protobuf type google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest

SearchProtectedResourcesRequest.Builder

Request message for KeyTrackingService.SearchProtectedResources.

Protobuf type google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest

SearchProtectedResourcesResponse

Response message for KeyTrackingService.SearchProtectedResources.

Protobuf type google.cloud.kms.inventory.v1.SearchProtectedResourcesResponse

SearchProtectedResourcesResponse.Builder

Response message for KeyTrackingService.SearchProtectedResources.

Protobuf type google.cloud.kms.inventory.v1.SearchProtectedResourcesResponse

Interfaces

GetProtectedResourcesSummaryRequestOrBuilder

KeyDashboardServiceGrpc.AsyncService

Provides a cross-region view of all Cloud KMS keys in a given Cloud project.

KeyTrackingServiceGrpc.AsyncService

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.

ListCryptoKeysRequestOrBuilder

ListCryptoKeysResponseOrBuilder

ProtectedResourceOrBuilder

ProtectedResourcesSummaryOrBuilder

SearchProtectedResourcesRequestOrBuilder

SearchProtectedResourcesResponseOrBuilder