Class ProvisioningClient (0.51.0)
Stay organized with collections
Save and categorize content based on your preferences.
- 0.80.0 (latest)
- 0.78.0
- 0.76.0
- 0.75.0
- 0.74.0
- 0.73.0
- 0.72.0
- 0.70.0
- 0.68.0
- 0.67.0
- 0.64.0
- 0.63.0
- 0.62.0
- 0.60.0
- 0.59.0
- 0.58.0
- 0.57.0
- 0.56.0
- 0.55.0
- 0.54.0
- 0.53.0
- 0.52.0
- 0.51.0
- 0.49.0
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.37.0
- 0.36.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.21.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.0
- 0.13.0
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.1
- 0.2.2
- 0.1.1
Service Description: The service that is used for managing the data plane provisioning of the Registry.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
InstanceNamename=InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]");
Instanceresponse=provisioningClient.getInstance(name);
}
Note: close() needs to be called on the ProvisioningClient 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 |
|---|---|---|
CreateInstance |
Provisions instance resources for the Registry. |
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
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteInstance |
Deletes the Registry instance. |
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
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.
|
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.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return |
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.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
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.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
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 ProvisioningSettings 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
ProvisioningSettingsprovisioningSettings=
ProvisioningSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ProvisioningClientprovisioningClient=ProvisioningClient.create(provisioningSettings);
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
ProvisioningSettingsprovisioningSettings=
ProvisioningSettings.newBuilder().setEndpoint(myEndpoint).build();
ProvisioningClientprovisioningClient=ProvisioningClient.create(provisioningSettings);
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
ProvisioningSettingsprovisioningSettings=ProvisioningSettings.newHttpJsonBuilder().build();
ProvisioningClientprovisioningClient=ProvisioningClient.create(provisioningSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
publicstaticfinalProvisioningClientcreate()Constructs an instance of ProvisioningClient with default settings.
| Returns | |
|---|---|
| Type | Description |
ProvisioningClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(ProvisioningSettings settings)
publicstaticfinalProvisioningClientcreate(ProvisioningSettingssettings)Constructs an instance of ProvisioningClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
| Parameter | |
|---|---|
| Name | Description |
settings |
ProvisioningSettings |
| Returns | |
|---|---|
| Type | Description |
ProvisioningClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(ProvisioningStub stub)
publicstaticfinalProvisioningClientcreate(ProvisioningStubstub)Constructs an instance of ProvisioningClient, using the given stub for making calls. This is for advanced usage - prefer using create(ProvisioningSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
ProvisioningStub |
| Returns | |
|---|---|
| Type | Description |
ProvisioningClient |
|
Constructors
ProvisioningClient(ProvisioningSettings settings)
protectedProvisioningClient(ProvisioningSettingssettings)Constructs an instance of ProvisioningClient, 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.
| Parameter | |
|---|---|
| Name | Description |
settings |
ProvisioningSettings |
ProvisioningClient(ProvisioningStub stub)
protectedProvisioningClient(ProvisioningStubstub)| Parameter | |
|---|---|
| Name | Description |
stub |
ProvisioningStub |
Methods
awaitTermination(long duration, TimeUnit unit)
publicbooleanawaitTermination(longduration,TimeUnitunit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
publicfinalvoidclose()createInstanceAsync(CreateInstanceRequest request)
publicfinalOperationFuture<Instance,OperationMetadata>createInstanceAsync(CreateInstanceRequestrequest)Provisions instance resources for the Registry.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
CreateInstanceRequestrequest=
CreateInstanceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setInstanceId("instanceId902024336")
.setInstance(Instance.newBuilder().build())
.build();
Instanceresponse=provisioningClient.createInstanceAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
CreateInstanceRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Instance,OperationMetadata> |
|
createInstanceAsync(LocationName parent, Instance instance, String instanceId)
publicfinalOperationFuture<Instance,OperationMetadata>createInstanceAsync(LocationNameparent,Instanceinstance,StringinstanceId)Provisions instance resources for the Registry.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
Instanceinstance=Instance.newBuilder().build();
StringinstanceId="instanceId902024336";
Instanceresponse=
provisioningClient.createInstanceAsync(parent,instance,instanceId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationName Required. Parent resource of the Instance, of the form:
|
instance |
Instance Required. The Instance. |
instanceId |
String Required. Identifier to assign to the Instance. Must be unique within scope of the parent resource. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Instance,OperationMetadata> |
|
createInstanceAsync(String parent, Instance instance, String instanceId)
publicfinalOperationFuture<Instance,OperationMetadata>createInstanceAsync(Stringparent,Instanceinstance,StringinstanceId)Provisions instance resources for the Registry.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
Instanceinstance=Instance.newBuilder().build();
StringinstanceId="instanceId902024336";
Instanceresponse=
provisioningClient.createInstanceAsync(parent,instance,instanceId).get();
}
| Parameters | |
|---|---|
| Name | Description |
parent |
String Required. Parent resource of the Instance, of the form:
|
instance |
Instance Required. The Instance. |
instanceId |
String Required. Identifier to assign to the Instance. Must be unique within scope of the parent resource. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Instance,OperationMetadata> |
|
createInstanceCallable()
publicfinalUnaryCallable<CreateInstanceRequest,Operation>createInstanceCallable()Provisions instance resources for the Registry.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
CreateInstanceRequestrequest=
CreateInstanceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setInstanceId("instanceId902024336")
.setInstance(Instance.newBuilder().build())
.build();
ApiFuture<Operation>future=provisioningClient.createInstanceCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<CreateInstanceRequest,Operation> |
|
createInstanceOperationCallable()
publicfinalOperationCallable<CreateInstanceRequest,Instance,OperationMetadata>createInstanceOperationCallable()Provisions instance resources for the Registry.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
CreateInstanceRequestrequest=
CreateInstanceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setInstanceId("instanceId902024336")
.setInstance(Instance.newBuilder().build())
.build();
OperationFuture<Instance,OperationMetadata>future=
provisioningClient.createInstanceOperationCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<CreateInstanceRequest,Instance,OperationMetadata> |
|
deleteInstanceAsync(DeleteInstanceRequest request)
publicfinalOperationFuture<Empty,OperationMetadata>deleteInstanceAsync(DeleteInstanceRequestrequest)Deletes the Registry 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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
DeleteInstanceRequestrequest=
DeleteInstanceRequest.newBuilder()
.setName(InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString())
.build();
provisioningClient.deleteInstanceAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteInstanceRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteInstanceAsync(InstanceName name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteInstanceAsync(InstanceNamename)Deletes the Registry 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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
InstanceNamename=InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]");
provisioningClient.deleteInstanceAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
InstanceName Required. The name of the Instance to delete. Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteInstanceAsync(String name)
publicfinalOperationFuture<Empty,OperationMetadata>deleteInstanceAsync(Stringname)Deletes the Registry 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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
Stringname=InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString();
provisioningClient.deleteInstanceAsync(name).get();
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. The name of the Instance to delete. Format:
|
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Empty,OperationMetadata> |
|
deleteInstanceCallable()
publicfinalUnaryCallable<DeleteInstanceRequest,Operation>deleteInstanceCallable()Deletes the Registry 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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
DeleteInstanceRequestrequest=
DeleteInstanceRequest.newBuilder()
.setName(InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString())
.build();
ApiFuture<Operation>future=provisioningClient.deleteInstanceCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteInstanceRequest,Operation> |
|
deleteInstanceOperationCallable()
publicfinalOperationCallable<DeleteInstanceRequest,Empty,OperationMetadata>deleteInstanceOperationCallable()Deletes the Registry 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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
DeleteInstanceRequestrequest=
DeleteInstanceRequest.newBuilder()
.setName(InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString())
.build();
OperationFuture<Empty,OperationMetadata>future=
provisioningClient.deleteInstanceOperationCallable().futureCall(request);
// Do something.
future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata> |
|
getHttpJsonOperationsClient()
publicfinalOperationsClientgetHttpJsonOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getIamPolicy(GetIamPolicyRequest request)
publicfinalPolicygetIamPolicy(GetIamPolicyRequestrequest)Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource(ApiName.of("[PROJECT]","[LOCATION]","[API]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policyresponse=provisioningClient.getIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.GetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
getIamPolicyCallable()
publicfinalUnaryCallable<GetIamPolicyRequest,Policy>getIamPolicyCallable()Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
GetIamPolicyRequestrequest=
GetIamPolicyRequest.newBuilder()
.setResource(ApiName.of("[PROJECT]","[LOCATION]","[API]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy>future=provisioningClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
|
getInstance(GetInstanceRequest request)
publicfinalInstancegetInstance(GetInstanceRequestrequest)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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
GetInstanceRequestrequest=
GetInstanceRequest.newBuilder()
.setName(InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString())
.build();
Instanceresponse=provisioningClient.getInstance(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetInstanceRequest The request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
Instance |
|
getInstance(InstanceName name)
publicfinalInstancegetInstance(InstanceNamename)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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
InstanceNamename=InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]");
Instanceresponse=provisioningClient.getInstance(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
InstanceName Required. The name of the Instance to retrieve. Format:
|
| Returns | |
|---|---|
| Type | Description |
Instance |
|
getInstance(String name)
publicfinalInstancegetInstance(Stringname)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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
Stringname=InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString();
Instanceresponse=provisioningClient.getInstance(name);
}
| Parameter | |
|---|---|
| Name | Description |
name |
String Required. The name of the Instance to retrieve. Format:
|
| Returns | |
|---|---|
| Type | Description |
Instance |
|
getInstanceCallable()
publicfinalUnaryCallable<GetInstanceRequest,Instance>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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
GetInstanceRequestrequest=
GetInstanceRequest.newBuilder()
.setName(InstanceName.of("[PROJECT]","[LOCATION]","[INSTANCE]").toString())
.build();
ApiFuture<Instance>future=provisioningClient.getInstanceCallable().futureCall(request);
// Do something.
Instanceresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetInstanceRequest,Instance> |
|
getLocation(GetLocationRequest request)
publicfinalLocationgetLocation(GetLocationRequestrequest)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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
Locationresponse=provisioningClient.getLocation(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.GetLocationRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.cloud.location.Location |
|
getLocationCallable()
publicfinalUnaryCallable<GetLocationRequest,Location>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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location>future=provisioningClient.getLocationCallable().futureCall(request);
// Do something.
Locationresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getOperationsClient()
publicfinalOperationsClientgetOperationsClient()Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
| Returns | |
|---|---|
| Type | Description |
OperationsClient |
|
getSettings()
publicfinalProvisioningSettingsgetSettings()| Returns | |
|---|---|
| Type | Description |
ProvisioningSettings |
|
getStub()
publicProvisioningStubgetStub()| Returns | |
|---|---|
| Type | Description |
ProvisioningStub |
|
isShutdown()
publicbooleanisShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
publicbooleanisTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
listLocations(ListLocationsRequest request)
publicfinalProvisioningClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Locationelement:provisioningClient.listLocations(request).iterateAll()){
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.cloud.location.ListLocationsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
ProvisioningClient.ListLocationsPagedResponse |
|
listLocationsCallable()
publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListLocationsResponseresponse=provisioningClient.listLocationsCallable().call(request);
for(Locationelement:response.getLocationsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
|
listLocationsPagedCallable()
publicfinalUnaryCallable<ListLocationsRequest,ProvisioningClient.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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location>future=
provisioningClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for(Locationelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
|
setIamPolicy(SetIamPolicyRequest request)
publicfinalPolicysetIamPolicy(SetIamPolicyRequestrequest)Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
SetIamPolicyRequestrequest=
SetIamPolicyRequest.newBuilder()
.setResource(ApiName.of("[PROJECT]","[LOCATION]","[API]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policyresponse=provisioningClient.setIamPolicy(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.SetIamPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.Policy |
|
setIamPolicyCallable()
publicfinalUnaryCallable<SetIamPolicyRequest,Policy>setIamPolicyCallable()Sets the access control policy on the specified resource. Replacesany existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
SetIamPolicyRequestrequest=
SetIamPolicyRequest.newBuilder()
.setResource(ApiName.of("[PROJECT]","[LOCATION]","[API]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy>future=provisioningClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policyresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
|
shutdown()
publicvoidshutdown()shutdownNow()
publicvoidshutdownNow()testIamPermissions(TestIamPermissionsRequest request)
publicfinalTestIamPermissionsResponsetestIamPermissions(TestIamPermissionsRequestrequest)Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource(ApiName.of("[PROJECT]","[LOCATION]","[API]").toString())
.addAllPermissions(newArrayList<String>())
.build();
TestIamPermissionsResponseresponse=provisioningClient.testIamPermissions(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
com.google.iam.v1.TestIamPermissionsRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
|
testIamPermissionsCallable()
publicfinalUnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse>testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist,
this will return an empty set ofpermissions, not a NOT_FOUND error.
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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(ProvisioningClientprovisioningClient=ProvisioningClient.create()){
TestIamPermissionsRequestrequest=
TestIamPermissionsRequest.newBuilder()
.setResource(ApiName.of("[PROJECT]","[LOCATION]","[API]").toString())
.addAllPermissions(newArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse>future=
provisioningClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponseresponse=future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
|