Class LicenseManagerClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) {
ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]");
Configuration response = licenseManagerClient.getConfiguration(name);
}
Note: close() needs to be called on the LicenseManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListConfigurations |
Lists Configurations in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConfiguration |
Gets details of a single Configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateConfiguration |
Creates a new Configuration in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateConfiguration |
Updates the parameters of a single Configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteConfiguration |
Deletes a single Configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListInstances |
Lists Instances in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetInstance |
Gets details of a single Instance. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeactivateConfiguration |
Deactivates the given configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ReactivateConfiguration |
Reactivates the given configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
QueryConfigurationLicenseUsage |
License Usage information for a Configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AggregateUsage |
Aggregates Usage per Instance for a Configuration. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListProducts |
Lists Products in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetProduct |
Gets details of a single Product. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 LicenseManagerSettings 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
LicenseManagerSettings licenseManagerSettings =
LicenseManagerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
LicenseManagerClient licenseManagerClient = LicenseManagerClient.create(licenseManagerSettings);
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
LicenseManagerSettings licenseManagerSettings =
LicenseManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
LicenseManagerClient licenseManagerClient = LicenseManagerClient.create(licenseManagerSettings);
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
LicenseManagerSettings licenseManagerSettings =
LicenseManagerSettings.newHttpJsonBuilder().build();
LicenseManagerClient licenseManagerClient = LicenseManagerClient.create(licenseManagerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLicenseManagerClient(LicenseManagerSettings settings) Constructs an instance of LicenseManagerClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionaggregateUsage(AggregateUsageRequest request) Aggregates Usage per Instance for a Configuration.aggregateUsage(ConfigurationName name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) Aggregates Usage per Instance for a Configuration.aggregateUsage(String name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) Aggregates Usage per Instance for a Configuration.Aggregates Usage per Instance for a Configuration.Aggregates Usage per Instance for a Configuration.booleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final LicenseManagerClientcreate()Constructs an instance of LicenseManagerClient with default settings.static final LicenseManagerClientcreate(LicenseManagerSettings settings) Constructs an instance of LicenseManagerClient, using the given settings.static final LicenseManagerClientcreate(LicenseManagerStub stub) Constructs an instance of LicenseManagerClient, using the given stub for making calls.Creates a new Configuration in a given project and location.createConfigurationAsync(LocationName parent, Configuration configuration, String configurationId) Creates a new Configuration in a given project and location.createConfigurationAsync(String parent, Configuration configuration, String configurationId) Creates a new Configuration in a given project and location.Creates a new Configuration in a given project and location.Creates a new Configuration in a given project and location.Deactivates the given configuration.Deactivates the given configuration.Deactivates the given configuration.Deactivates the given configuration.Deactivates the given configuration.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Configuration.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Configuration.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Configuration.Deletes a single Configuration.final OperationCallable<DeleteConfigurationRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Configuration.final ConfigurationGets details of a single Configuration.final ConfigurationgetConfiguration(GetConfigurationRequest request) Gets details of a single Configuration.final ConfigurationgetConfiguration(String name) Gets details of a single Configuration.Gets details of a single Configuration.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final InstancegetInstance(GetInstanceRequest request) Gets details of a single Instance.final InstancegetInstance(InstanceName name) Gets details of a single Instance.final InstancegetInstance(String name) Gets details of a single Instance.Gets details of a single Instance.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ProductgetProduct(GetProductRequest request) Gets details of a single Product.final ProductgetProduct(ProductName name) Gets details of a single Product.final ProductgetProduct(String name) Gets details of a single Product.Gets details of a single Product.final LicenseManagerSettingsgetStub()booleanbooleanLists Configurations in a given project and location.listConfigurations(LocationName parent) Lists Configurations in a given project and location.listConfigurations(String parent) Lists Configurations in a given project and location.Lists Configurations in a given project and location.Lists Configurations in a given project and location.listInstances(ListInstancesRequest request) Lists Instances in a given project and location.listInstances(LocationName parent) Lists Instances in a given project and location.listInstances(String parent) Lists Instances in a given project and location.Lists Instances in a given project and location.Lists Instances in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listProducts(ListProductsRequest request) Lists Products in a given project and location.listProducts(LocationName parent) Lists Products in a given project and location.listProducts(String parent) Lists Products in a given project and location.Lists Products in a given project and location.Lists Products in a given project and location.queryConfigurationLicenseUsage(ConfigurationName name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) License Usage information for a Configuration.License Usage information for a Configuration.queryConfigurationLicenseUsage(String name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) License Usage information for a Configuration.License Usage information for a Configuration.Reactivates the given configuration.Reactivates the given configuration.Reactivates the given configuration.Reactivates the given configuration.Reactivates the given configuration.voidshutdown()voidupdateConfigurationAsync(Configuration configuration, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Configuration.Updates the parameters of a single Configuration.Updates the parameters of a single Configuration.Updates the parameters of a single Configuration.
-
Constructor Details
-
LicenseManagerClient
Constructs an instance of LicenseManagerClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
LicenseManagerClient
-
-
Method Details
-
create
Constructs an instance of LicenseManagerClient with default settings.- Throws:
IOException
-
create
Constructs an instance of LicenseManagerClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of LicenseManagerClient, using the given stub for making calls. This is for advanced usage - prefer using create(LicenseManagerSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listConfigurations
public final LicenseManagerClient.ListConfigurationsPagedResponse listConfigurations(LocationName parent) Lists Configurations in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Configuration element : licenseManagerClient.listConfigurations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListConfigurationsRequest- Throws:
ApiException- if the remote call fails
-
listConfigurations
Lists Configurations in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Configuration element : licenseManagerClient.listConfigurations(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListConfigurationsRequest- Throws:
ApiException- if the remote call fails
-
listConfigurations
public final LicenseManagerClient.ListConfigurationsPagedResponse listConfigurations(ListConfigurationsRequest request) Lists Configurations in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListConfigurationsRequest request = ListConfigurationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Configuration element : licenseManagerClient.listConfigurations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listConfigurationsPagedCallable
public final UnaryCallable<ListConfigurationsRequest,LicenseManagerClient.ListConfigurationsPagedResponse> listConfigurationsPagedCallable()Lists Configurations in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListConfigurationsRequest request = ListConfigurationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Configuration> future = licenseManagerClient.listConfigurationsPagedCallable().futureCall(request); // Do something. for (Configuration element : future.get().iterateAll()) { // doThingsWith(element); } } -
listConfigurationsCallable
public final UnaryCallable<ListConfigurationsRequest,ListConfigurationsResponse> listConfigurationsCallable()Lists Configurations in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListConfigurationsRequest request = ListConfigurationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListConfigurationsResponse response = licenseManagerClient.listConfigurationsCallable().call(request); for (Configuration element : response.getConfigurationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getConfiguration
Gets details of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]"); Configuration response = licenseManagerClient.getConfiguration(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getConfiguration
Gets details of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString(); Configuration response = licenseManagerClient.getConfiguration(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getConfiguration
Gets details of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetConfigurationRequest request = GetConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .build(); Configuration response = licenseManagerClient.getConfiguration(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getConfigurationCallable
Gets details of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetConfigurationRequest request = GetConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .build(); ApiFuture<Configuration> future = licenseManagerClient.getConfigurationCallable().futureCall(request); // Do something. Configuration response = future.get(); } -
createConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> createConfigurationAsync(LocationName parent, Configuration configuration, String configurationId) Creates a new Configuration in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Configuration configuration = Configuration.newBuilder().build(); String configurationId = "configurationId1948915889"; Configuration response = licenseManagerClient .createConfigurationAsync(parent, configuration, configurationId) .get(); }- Parameters:
parent- Required. Value for parent.configuration- Required. The resource being createdconfigurationId- Required. Id of the requesting object- Throws:
ApiException- if the remote call fails
-
createConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> createConfigurationAsync(String parent, Configuration configuration, String configurationId) Creates a new Configuration in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Configuration configuration = Configuration.newBuilder().build(); String configurationId = "configurationId1948915889"; Configuration response = licenseManagerClient .createConfigurationAsync(parent, configuration, configurationId) .get(); }- Parameters:
parent- Required. Value for parent.configuration- Required. The resource being createdconfigurationId- Required. Id of the requesting object- Throws:
ApiException- if the remote call fails
-
createConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> createConfigurationAsync(CreateConfigurationRequest request) Creates a new Configuration in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { CreateConfigurationRequest request = CreateConfigurationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConfigurationId("configurationId1948915889") .setConfiguration(Configuration.newBuilder().build()) .setRequestId("requestId693933066") .build(); Configuration response = licenseManagerClient.createConfigurationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createConfigurationOperationCallable
public final OperationCallable<CreateConfigurationRequest,Configuration, createConfigurationOperationCallable()OperationMetadata> Creates a new Configuration in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { CreateConfigurationRequest request = CreateConfigurationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConfigurationId("configurationId1948915889") .setConfiguration(Configuration.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Configuration, OperationMetadata> future = licenseManagerClient.createConfigurationOperationCallable().futureCall(request); // Do something. Configuration response = future.get(); } -
createConfigurationCallable
Creates a new Configuration in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { CreateConfigurationRequest request = CreateConfigurationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setConfigurationId("configurationId1948915889") .setConfiguration(Configuration.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = licenseManagerClient.createConfigurationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> updateConfigurationAsync(Configuration configuration, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { Configuration configuration = Configuration.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Configuration response = licenseManagerClient.updateConfigurationAsync(configuration, updateMask).get(); }- Parameters:
configuration- Required. The resource being updatedupdateMask- Optional. Field mask is used to specify the fields to be overwritten in the Configuration resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> updateConfigurationAsync(UpdateConfigurationRequest request) Updates the parameters of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { UpdateConfigurationRequest request = UpdateConfigurationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConfiguration(Configuration.newBuilder().build()) .setRequestId("requestId693933066") .build(); Configuration response = licenseManagerClient.updateConfigurationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateConfigurationOperationCallable
public final OperationCallable<UpdateConfigurationRequest,Configuration, updateConfigurationOperationCallable()OperationMetadata> Updates the parameters of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { UpdateConfigurationRequest request = UpdateConfigurationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConfiguration(Configuration.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Configuration, OperationMetadata> future = licenseManagerClient.updateConfigurationOperationCallable().futureCall(request); // Do something. Configuration response = future.get(); } -
updateConfigurationCallable
Updates the parameters of a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { UpdateConfigurationRequest request = UpdateConfigurationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setConfiguration(Configuration.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = licenseManagerClient.updateConfigurationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteConfigurationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConfigurationAsync(ConfigurationName name) Deletes a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]"); licenseManagerClient.deleteConfigurationAsync(name).get(); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
deleteConfigurationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConfigurationAsync(String name) Deletes a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString(); licenseManagerClient.deleteConfigurationAsync(name).get(); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
deleteConfigurationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteConfigurationAsync(DeleteConfigurationRequest request) Deletes a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { DeleteConfigurationRequest request = DeleteConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); licenseManagerClient.deleteConfigurationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteConfigurationOperationCallable
public final OperationCallable<DeleteConfigurationRequest,com.google.protobuf.Empty, deleteConfigurationOperationCallable()OperationMetadata> Deletes a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { DeleteConfigurationRequest request = DeleteConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = licenseManagerClient.deleteConfigurationOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteConfigurationCallable
Deletes a single Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { DeleteConfigurationRequest request = DeleteConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = licenseManagerClient.deleteConfigurationCallable().futureCall(request); // Do something. future.get(); } -
listInstances
Lists Instances in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Instance element : licenseManagerClient.listInstances(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListInstancesRequest- Throws:
ApiException- if the remote call fails
-
listInstances
Lists Instances in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Instance element : licenseManagerClient.listInstances(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListInstancesRequest- Throws:
ApiException- if the remote call fails
-
listInstances
public final LicenseManagerClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request) Lists Instances in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Instance element : licenseManagerClient.listInstances(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listInstancesPagedCallable
public final UnaryCallable<ListInstancesRequest,LicenseManagerClient.ListInstancesPagedResponse> listInstancesPagedCallable()Lists Instances in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Instance> future = licenseManagerClient.listInstancesPagedCallable().futureCall(request); // Do something. for (Instance element : future.get().iterateAll()) { // doThingsWith(element); } } -
listInstancesCallable
Lists Instances in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListInstancesRequest request = ListInstancesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListInstancesResponse response = licenseManagerClient.listInstancesCallable().call(request); for (Instance element : response.getInstancesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getInstance
Gets details of a single Instance.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); Instance response = licenseManagerClient.getInstance(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getInstance
Gets details of a single Instance.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); Instance response = licenseManagerClient.getInstance(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getInstance
Gets details of a single Instance.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); Instance response = licenseManagerClient.getInstance(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getInstanceCallable
Gets details of a single Instance.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetInstanceRequest request = GetInstanceRequest.newBuilder() .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) .build(); ApiFuture<Instance> future = licenseManagerClient.getInstanceCallable().futureCall(request); // Do something. Instance response = future.get(); } -
deactivateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> deactivateConfigurationAsync(ConfigurationName name) Deactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]"); Configuration response = licenseManagerClient.deactivateConfigurationAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deactivateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> deactivateConfigurationAsync(String name) Deactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString(); Configuration response = licenseManagerClient.deactivateConfigurationAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deactivateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> deactivateConfigurationAsync(DeactivateConfigurationRequest request) Deactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { DeactivateConfigurationRequest request = DeactivateConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); Configuration response = licenseManagerClient.deactivateConfigurationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deactivateConfigurationOperationCallable
public final OperationCallable<DeactivateConfigurationRequest,Configuration, deactivateConfigurationOperationCallable()OperationMetadata> Deactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { DeactivateConfigurationRequest request = DeactivateConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Configuration, OperationMetadata> future = licenseManagerClient.deactivateConfigurationOperationCallable().futureCall(request); // Do something. Configuration response = future.get(); } -
deactivateConfigurationCallable
public final UnaryCallable<DeactivateConfigurationRequest,Operation> deactivateConfigurationCallable()Deactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { DeactivateConfigurationRequest request = DeactivateConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = licenseManagerClient.deactivateConfigurationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
reactivateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> reactivateConfigurationAsync(ConfigurationName name) Reactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]"); Configuration response = licenseManagerClient.reactivateConfigurationAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
reactivateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> reactivateConfigurationAsync(String name) Reactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString(); Configuration response = licenseManagerClient.reactivateConfigurationAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
reactivateConfigurationAsync
public final OperationFuture<Configuration,OperationMetadata> reactivateConfigurationAsync(ReactivateConfigurationRequest request) Reactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ReactivateConfigurationRequest request = ReactivateConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); Configuration response = licenseManagerClient.reactivateConfigurationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
reactivateConfigurationOperationCallable
public final OperationCallable<ReactivateConfigurationRequest,Configuration, reactivateConfigurationOperationCallable()OperationMetadata> Reactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ReactivateConfigurationRequest request = ReactivateConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Configuration, OperationMetadata> future = licenseManagerClient.reactivateConfigurationOperationCallable().futureCall(request); // Do something. Configuration response = future.get(); } -
reactivateConfigurationCallable
public final UnaryCallable<ReactivateConfigurationRequest,Operation> reactivateConfigurationCallable()Reactivates the given configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ReactivateConfigurationRequest request = ReactivateConfigurationRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = licenseManagerClient.reactivateConfigurationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
queryConfigurationLicenseUsage
public final QueryConfigurationLicenseUsageResponse queryConfigurationLicenseUsage(ConfigurationName name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) License Usage information for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]"); Timestamp startTime = Timestamp.newBuilder().build(); Timestamp endTime = Timestamp.newBuilder().build(); QueryConfigurationLicenseUsageResponse response = licenseManagerClient.queryConfigurationLicenseUsage(name, startTime, endTime); }- Parameters:
name- Required. The resource path of the Configuration.startTime- Required. The start time for retrieving the usage. If not specified, we will use the first day of the current billing period.endTime- Required. The end time for retrieving the usage. If not specified, we will use the last day of the current billing period.- Throws:
ApiException- if the remote call fails
-
queryConfigurationLicenseUsage
public final QueryConfigurationLicenseUsageResponse queryConfigurationLicenseUsage(String name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) License Usage information for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString(); Timestamp startTime = Timestamp.newBuilder().build(); Timestamp endTime = Timestamp.newBuilder().build(); QueryConfigurationLicenseUsageResponse response = licenseManagerClient.queryConfigurationLicenseUsage(name, startTime, endTime); }- Parameters:
name- Required. The resource path of the Configuration.startTime- Required. The start time for retrieving the usage. If not specified, we will use the first day of the current billing period.endTime- Required. The end time for retrieving the usage. If not specified, we will use the last day of the current billing period.- Throws:
ApiException- if the remote call fails
-
queryConfigurationLicenseUsage
public final QueryConfigurationLicenseUsageResponse queryConfigurationLicenseUsage(QueryConfigurationLicenseUsageRequest request) License Usage information for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { QueryConfigurationLicenseUsageRequest request = QueryConfigurationLicenseUsageRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .build(); QueryConfigurationLicenseUsageResponse response = licenseManagerClient.queryConfigurationLicenseUsage(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
queryConfigurationLicenseUsageCallable
public final UnaryCallable<QueryConfigurationLicenseUsageRequest,QueryConfigurationLicenseUsageResponse> queryConfigurationLicenseUsageCallable()License Usage information for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { QueryConfigurationLicenseUsageRequest request = QueryConfigurationLicenseUsageRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .build(); ApiFuture<QueryConfigurationLicenseUsageResponse> future = licenseManagerClient.queryConfigurationLicenseUsageCallable().futureCall(request); // Do something. QueryConfigurationLicenseUsageResponse response = future.get(); } -
aggregateUsage
public final LicenseManagerClient.AggregateUsagePagedResponse aggregateUsage(ConfigurationName name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) Aggregates Usage per Instance for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ConfigurationName name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]"); Timestamp startTime = Timestamp.newBuilder().build(); Timestamp endTime = Timestamp.newBuilder().build(); for (Usage element : licenseManagerClient.aggregateUsage(name, startTime, endTime).iterateAll()) { // doThingsWith(element); } }- Parameters:
name- Required. Parent value for AggregateUsageRequeststartTime- Required. Licenses are purchased per month - so usage track needs start time of a month.endTime- Required. Usage track is always for a month. This parameter is for the end time of the month.- Throws:
ApiException- if the remote call fails
-
aggregateUsage
public final LicenseManagerClient.AggregateUsagePagedResponse aggregateUsage(String name, com.google.protobuf.Timestamp startTime, com.google.protobuf.Timestamp endTime) Aggregates Usage per Instance for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString(); Timestamp startTime = Timestamp.newBuilder().build(); Timestamp endTime = Timestamp.newBuilder().build(); for (Usage element : licenseManagerClient.aggregateUsage(name, startTime, endTime).iterateAll()) { // doThingsWith(element); } }- Parameters:
name- Required. Parent value for AggregateUsageRequeststartTime- Required. Licenses are purchased per month - so usage track needs start time of a month.endTime- Required. Usage track is always for a month. This parameter is for the end time of the month.- Throws:
ApiException- if the remote call fails
-
aggregateUsage
public final LicenseManagerClient.AggregateUsagePagedResponse aggregateUsage(AggregateUsageRequest request) Aggregates Usage per Instance for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { AggregateUsageRequest request = AggregateUsageRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .build(); for (Usage element : licenseManagerClient.aggregateUsage(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
aggregateUsagePagedCallable
public final UnaryCallable<AggregateUsageRequest,LicenseManagerClient.AggregateUsagePagedResponse> aggregateUsagePagedCallable()Aggregates Usage per Instance for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { AggregateUsageRequest request = AggregateUsageRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .build(); ApiFuture<Usage> future = licenseManagerClient.aggregateUsagePagedCallable().futureCall(request); // Do something. for (Usage element : future.get().iterateAll()) { // doThingsWith(element); } } -
aggregateUsageCallable
Aggregates Usage per Instance for a Configuration.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { AggregateUsageRequest request = AggregateUsageRequest.newBuilder() .setName( ConfigurationName.of("[PROJECT]", "[LOCATION]", "[CONFIGURATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .build(); while (true) { AggregateUsageResponse response = licenseManagerClient.aggregateUsageCallable().call(request); for (Usage element : response.getUsagesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listProducts
Lists Products in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Product element : licenseManagerClient.listProducts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListProductsRequest- Throws:
ApiException- if the remote call fails
-
listProducts
Lists Products in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Product element : licenseManagerClient.listProducts(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListProductsRequest- Throws:
ApiException- if the remote call fails
-
listProducts
public final LicenseManagerClient.ListProductsPagedResponse listProducts(ListProductsRequest request) Lists Products in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListProductsRequest request = ListProductsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Product element : licenseManagerClient.listProducts(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listProductsPagedCallable
public final UnaryCallable<ListProductsRequest,LicenseManagerClient.ListProductsPagedResponse> listProductsPagedCallable()Lists Products in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListProductsRequest request = ListProductsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Product> future = licenseManagerClient.listProductsPagedCallable().futureCall(request); // Do something. for (Product element : future.get().iterateAll()) { // doThingsWith(element); } } -
listProductsCallable
Lists Products in a given project and location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListProductsRequest request = ListProductsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListProductsResponse response = licenseManagerClient.listProductsCallable().call(request); for (Product element : response.getProductsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getProduct
Gets details of a single Product.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ProductName name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]"); Product response = licenseManagerClient.getProduct(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getProduct
Gets details of a single Product.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { String name = ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString(); Product response = licenseManagerClient.getProduct(name); }- Parameters:
name- Required. Name of the resource- Throws:
ApiException- if the remote call fails
-
getProduct
Gets details of a single Product.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetProductRequest request = GetProductRequest.newBuilder() .setName(ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString()) .build(); Product response = licenseManagerClient.getProduct(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getProductCallable
Gets details of a single Product.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetProductRequest request = GetProductRequest.newBuilder() .setName(ProductName.of("[PROJECT]", "[LOCATION]", "[PRODUCT]").toString()) .build(); ApiFuture<Product> future = licenseManagerClient.getProductCallable().futureCall(request); // Do something. Product response = future.get(); } -
listLocations
public final LicenseManagerClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : licenseManagerClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,LicenseManagerClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = licenseManagerClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = licenseManagerClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = licenseManagerClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.Sample code:
// 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 (LicenseManagerClient licenseManagerClient = LicenseManagerClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = licenseManagerClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-