@Generated(value="by gapic-generator-java") public class ProjectsClient extends Object implements com.google.api.gax.core.BackgroundResource
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
Project response = projectsClient.get(project);
}
Note: close() needs to be called on the ProjectsClient 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 |
|---|---|---|
DisableXpnHost |
Disable this project as a shared VPC host project. |
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.
|
DisableXpnResource |
Disable a service resource (also known as service project) associated with this host project. |
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.
|
EnableXpnHost |
Enable this project as a shared VPC host project. |
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.
|
EnableXpnResource |
Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. |
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.
|
Get |
Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the `quotas` field). To exclude one or more fields, set your request's `fields` query parameter to only include the fields you need. For example, to only include the `id` and `selfLink` fields, add the query parameter `?fields=id,selfLink` to your request. |
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.
|
GetXpnHost |
Gets the shared VPC host project that this project links to. May be empty if no link exists. |
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.
|
GetXpnResources |
Gets service resources (a.k.a service project) associated with this host project. |
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.
|
ListXpnHosts |
Lists all shared VPC host projects visible to the user in an organization. |
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.
|
MoveDisk |
Moves a persistent disk from one zone to another. |
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.
|
MoveInstance |
Moves an instance and its attached persistent disks from one zone to another. *Note*: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the [known issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See [moving instance across zones](/compute/docs/instances/moving-instance-across-zones) instead. |
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.
|
SetCloudArmorTier |
Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information. |
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.
|
SetCommonInstanceMetadata |
Sets metadata common to all instances within the specified project using the data included in the request. |
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.
|
SetDefaultNetworkTier |
Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. |
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.
|
SetUsageExportBucket |
Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. |
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.
|
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 ProjectsSettings 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
ProjectsSettings projectsSettings =
ProjectsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ProjectsClient projectsClient = ProjectsClient.create(projectsSettings);
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
ProjectsSettings projectsSettings =
ProjectsSettings.newBuilder().setEndpoint(myEndpoint).build();
ProjectsClient projectsClient = ProjectsClient.create(projectsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
ProjectsClient.GetXpnResourcesFixedSizeCollection |
static class |
ProjectsClient.GetXpnResourcesPage |
static class |
ProjectsClient.GetXpnResourcesPagedResponse |
static class |
ProjectsClient.ListXpnHostsFixedSizeCollection |
static class |
ProjectsClient.ListXpnHostsPage |
static class |
ProjectsClient.ListXpnHostsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
ProjectsClient(ProjectsSettings settings)
Constructs an instance of ProjectsClient, using the given settings.
|
protected |
ProjectsClient(ProjectsStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static ProjectsClient |
create()
Constructs an instance of ProjectsClient with default settings.
|
static ProjectsClient |
create(ProjectsSettings settings)
Constructs an instance of ProjectsClient, using the given settings.
|
static ProjectsClient |
create(ProjectsStub stub)
Constructs an instance of ProjectsClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
disableXpnHostAsync(DisableXpnHostProjectRequest request)
Disable this project as a shared VPC host project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
disableXpnHostAsync(String project)
Disable this project as a shared VPC host project.
|
com.google.api.gax.rpc.UnaryCallable<DisableXpnHostProjectRequest,Operation> |
disableXpnHostCallable()
Disable this project as a shared VPC host project.
|
com.google.api.gax.rpc.OperationCallable<DisableXpnHostProjectRequest,Operation,Operation> |
disableXpnHostOperationCallable()
Disable this project as a shared VPC host project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
disableXpnResourceAsync(DisableXpnResourceProjectRequest request)
Disable a service resource (also known as service project) associated with this host project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
disableXpnResourceAsync(String project,
ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource)
Disable a service resource (also known as service project) associated with this host project.
|
com.google.api.gax.rpc.UnaryCallable<DisableXpnResourceProjectRequest,Operation> |
disableXpnResourceCallable()
Disable a service resource (also known as service project) associated with this host project.
|
com.google.api.gax.rpc.OperationCallable<DisableXpnResourceProjectRequest,Operation,Operation> |
disableXpnResourceOperationCallable()
Disable a service resource (also known as service project) associated with this host project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
enableXpnHostAsync(EnableXpnHostProjectRequest request)
Enable this project as a shared VPC host project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
enableXpnHostAsync(String project)
Enable this project as a shared VPC host project.
|
com.google.api.gax.rpc.UnaryCallable<EnableXpnHostProjectRequest,Operation> |
enableXpnHostCallable()
Enable this project as a shared VPC host project.
|
com.google.api.gax.rpc.OperationCallable<EnableXpnHostProjectRequest,Operation,Operation> |
enableXpnHostOperationCallable()
Enable this project as a shared VPC host project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
enableXpnResourceAsync(EnableXpnResourceProjectRequest request)
Enable service resource (a.k.a service project) for a host project, so that subnets in the host
project can be used by instances in the service project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
enableXpnResourceAsync(String project,
ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource)
Enable service resource (a.k.a service project) for a host project, so that subnets in the host
project can be used by instances in the service project.
|
com.google.api.gax.rpc.UnaryCallable<EnableXpnResourceProjectRequest,Operation> |
enableXpnResourceCallable()
Enable service resource (a.k.a service project) for a host project, so that subnets in the host
project can be used by instances in the service project.
|
com.google.api.gax.rpc.OperationCallable<EnableXpnResourceProjectRequest,Operation,Operation> |
enableXpnResourceOperationCallable()
Enable service resource (a.k.a service project) for a host project, so that subnets in the host
project can be used by instances in the service project.
|
Project |
get(GetProjectRequest request)
Returns the specified Project resource.
|
Project |
get(String project)
Returns the specified Project resource.
|
com.google.api.gax.rpc.UnaryCallable<GetProjectRequest,Project> |
getCallable()
Returns the specified Project resource.
|
ProjectsSettings |
getSettings() |
ProjectsStub |
getStub() |
Project |
getXpnHost(GetXpnHostProjectRequest request)
Gets the shared VPC host project that this project links to.
|
Project |
getXpnHost(String project)
Gets the shared VPC host project that this project links to.
|
com.google.api.gax.rpc.UnaryCallable<GetXpnHostProjectRequest,Project> |
getXpnHostCallable()
Gets the shared VPC host project that this project links to.
|
ProjectsClient.GetXpnResourcesPagedResponse |
getXpnResources(GetXpnResourcesProjectsRequest request)
Gets service resources (a.k.a service project) associated with this host project.
|
ProjectsClient.GetXpnResourcesPagedResponse |
getXpnResources(String project)
Gets service resources (a.k.a service project) associated with this host project.
|
com.google.api.gax.rpc.UnaryCallable<GetXpnResourcesProjectsRequest,ProjectsGetXpnResources> |
getXpnResourcesCallable()
Gets service resources (a.k.a service project) associated with this host project.
|
com.google.api.gax.rpc.UnaryCallable<GetXpnResourcesProjectsRequest,ProjectsClient.GetXpnResourcesPagedResponse> |
getXpnResourcesPagedCallable()
Gets service resources (a.k.a service project) associated with this host project.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
ProjectsClient.ListXpnHostsPagedResponse |
listXpnHosts(ListXpnHostsProjectsRequest request)
Lists all shared VPC host projects visible to the user in an organization.
|
ProjectsClient.ListXpnHostsPagedResponse |
listXpnHosts(String project,
ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource)
Lists all shared VPC host projects visible to the user in an organization.
|
com.google.api.gax.rpc.UnaryCallable<ListXpnHostsProjectsRequest,XpnHostList> |
listXpnHostsCallable()
Lists all shared VPC host projects visible to the user in an organization.
|
com.google.api.gax.rpc.UnaryCallable<ListXpnHostsProjectsRequest,ProjectsClient.ListXpnHostsPagedResponse> |
listXpnHostsPagedCallable()
Lists all shared VPC host projects visible to the user in an organization.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveDiskAsync(MoveDiskProjectRequest request)
Moves a persistent disk from one zone to another.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveDiskAsync(String project,
DiskMoveRequest diskMoveRequestResource)
Moves a persistent disk from one zone to another.
|
com.google.api.gax.rpc.UnaryCallable<MoveDiskProjectRequest,Operation> |
moveDiskCallable()
Moves a persistent disk from one zone to another.
|
com.google.api.gax.rpc.OperationCallable<MoveDiskProjectRequest,Operation,Operation> |
moveDiskOperationCallable()
Moves a persistent disk from one zone to another.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveInstanceAsync(MoveInstanceProjectRequest request)
Moves an instance and its attached persistent disks from one zone to another. *Note*:
Moving VMs or disks by using this method might cause unexpected behavior.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
moveInstanceAsync(String project,
InstanceMoveRequest instanceMoveRequestResource)
Moves an instance and its attached persistent disks from one zone to another. *Note*:
Moving VMs or disks by using this method might cause unexpected behavior.
|
com.google.api.gax.rpc.UnaryCallable<MoveInstanceProjectRequest,Operation> |
moveInstanceCallable()
Moves an instance and its attached persistent disks from one zone to another. *Note*:
Moving VMs or disks by using this method might cause unexpected behavior.
|
com.google.api.gax.rpc.OperationCallable<MoveInstanceProjectRequest,Operation,Operation> |
moveInstanceOperationCallable()
Moves an instance and its attached persistent disks from one zone to another. *Note*:
Moving VMs or disks by using this method might cause unexpected behavior.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setCloudArmorTierAsync(SetCloudArmorTierProjectRequest request)
Sets the Cloud Armor tier of the project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setCloudArmorTierAsync(String project,
ProjectsSetCloudArmorTierRequest projectsSetCloudArmorTierRequestResource)
Sets the Cloud Armor tier of the project.
|
com.google.api.gax.rpc.UnaryCallable<SetCloudArmorTierProjectRequest,Operation> |
setCloudArmorTierCallable()
Sets the Cloud Armor tier of the project.
|
com.google.api.gax.rpc.OperationCallable<SetCloudArmorTierProjectRequest,Operation,Operation> |
setCloudArmorTierOperationCallable()
Sets the Cloud Armor tier of the project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request)
Sets metadata common to all instances within the specified project using the data included in
the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setCommonInstanceMetadataAsync(String project,
Metadata metadataResource)
Sets metadata common to all instances within the specified project using the data included in
the request.
|
com.google.api.gax.rpc.UnaryCallable<SetCommonInstanceMetadataProjectRequest,Operation> |
setCommonInstanceMetadataCallable()
Sets metadata common to all instances within the specified project using the data included in
the request.
|
com.google.api.gax.rpc.OperationCallable<SetCommonInstanceMetadataProjectRequest,Operation,Operation> |
setCommonInstanceMetadataOperationCallable()
Sets metadata common to all instances within the specified project using the data included in
the request.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request)
Sets the default network tier of the project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setDefaultNetworkTierAsync(String project,
ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource)
Sets the default network tier of the project.
|
com.google.api.gax.rpc.UnaryCallable<SetDefaultNetworkTierProjectRequest,Operation> |
setDefaultNetworkTierCallable()
Sets the default network tier of the project.
|
com.google.api.gax.rpc.OperationCallable<SetDefaultNetworkTierProjectRequest,Operation,Operation> |
setDefaultNetworkTierOperationCallable()
Sets the default network tier of the project.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setUsageExportBucketAsync(SetUsageExportBucketProjectRequest request)
Enables the usage export feature and sets the usage export bucket where reports are stored.
|
com.google.api.gax.longrunning.OperationFuture<Operation,Operation> |
setUsageExportBucketAsync(String project,
UsageExportLocation usageExportLocationResource)
Enables the usage export feature and sets the usage export bucket where reports are stored.
|
com.google.api.gax.rpc.UnaryCallable<SetUsageExportBucketProjectRequest,Operation> |
setUsageExportBucketCallable()
Enables the usage export feature and sets the usage export bucket where reports are stored.
|
com.google.api.gax.rpc.OperationCallable<SetUsageExportBucketProjectRequest,Operation,Operation> |
setUsageExportBucketOperationCallable()
Enables the usage export feature and sets the usage export bucket where reports are stored.
|
void |
shutdown() |
void |
shutdownNow() |
protected ProjectsClient(ProjectsSettings settings) throws IOException
IOExceptionprotected ProjectsClient(ProjectsStub stub)
public static final ProjectsClient create() throws IOException
IOExceptionpublic static final ProjectsClient create(ProjectsSettings settings) throws IOException
IOExceptionpublic static final ProjectsClient create(ProjectsStub stub)
public final ProjectsSettings getSettings()
public ProjectsStub getStub()
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> disableXpnHostAsync(String project)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
Operation response = projectsClient.disableXpnHostAsync(project).get();
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> disableXpnHostAsync(DisableXpnHostProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
DisableXpnHostProjectRequest request =
DisableXpnHostProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.disableXpnHostAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DisableXpnHostProjectRequest,Operation,Operation> disableXpnHostOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
DisableXpnHostProjectRequest request =
DisableXpnHostProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.disableXpnHostOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DisableXpnHostProjectRequest,Operation> disableXpnHostCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
DisableXpnHostProjectRequest request =
DisableXpnHostProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.disableXpnHostCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> disableXpnResourceAsync(String project, ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
ProjectsDisableXpnResourceRequest projectsDisableXpnResourceRequestResource =
ProjectsDisableXpnResourceRequest.newBuilder().build();
Operation response =
projectsClient
.disableXpnResourceAsync(project, projectsDisableXpnResourceRequestResource)
.get();
}
project - Project ID for this request.projectsDisableXpnResourceRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> disableXpnResourceAsync(DisableXpnResourceProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
DisableXpnResourceProjectRequest request =
DisableXpnResourceProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsDisableXpnResourceRequestResource(
ProjectsDisableXpnResourceRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.disableXpnResourceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DisableXpnResourceProjectRequest,Operation,Operation> disableXpnResourceOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
DisableXpnResourceProjectRequest request =
DisableXpnResourceProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsDisableXpnResourceRequestResource(
ProjectsDisableXpnResourceRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.disableXpnResourceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DisableXpnResourceProjectRequest,Operation> disableXpnResourceCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
DisableXpnResourceProjectRequest request =
DisableXpnResourceProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsDisableXpnResourceRequestResource(
ProjectsDisableXpnResourceRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.disableXpnResourceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> enableXpnHostAsync(String project)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
Operation response = projectsClient.enableXpnHostAsync(project).get();
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> enableXpnHostAsync(EnableXpnHostProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
EnableXpnHostProjectRequest request =
EnableXpnHostProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.enableXpnHostAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<EnableXpnHostProjectRequest,Operation,Operation> enableXpnHostOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
EnableXpnHostProjectRequest request =
EnableXpnHostProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.enableXpnHostOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<EnableXpnHostProjectRequest,Operation> enableXpnHostCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
EnableXpnHostProjectRequest request =
EnableXpnHostProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.enableXpnHostCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> enableXpnResourceAsync(String project, ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
ProjectsEnableXpnResourceRequest projectsEnableXpnResourceRequestResource =
ProjectsEnableXpnResourceRequest.newBuilder().build();
Operation response =
projectsClient
.enableXpnResourceAsync(project, projectsEnableXpnResourceRequestResource)
.get();
}
project - Project ID for this request.projectsEnableXpnResourceRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> enableXpnResourceAsync(EnableXpnResourceProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
EnableXpnResourceProjectRequest request =
EnableXpnResourceProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsEnableXpnResourceRequestResource(
ProjectsEnableXpnResourceRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.enableXpnResourceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<EnableXpnResourceProjectRequest,Operation,Operation> enableXpnResourceOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
EnableXpnResourceProjectRequest request =
EnableXpnResourceProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsEnableXpnResourceRequestResource(
ProjectsEnableXpnResourceRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.enableXpnResourceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<EnableXpnResourceProjectRequest,Operation> enableXpnResourceCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
EnableXpnResourceProjectRequest request =
EnableXpnResourceProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsEnableXpnResourceRequestResource(
ProjectsEnableXpnResourceRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.enableXpnResourceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Project get(String project)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
Project response = projectsClient.get(project);
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Project get(GetProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetProjectRequest request =
GetProjectRequest.newBuilder().setProject("project-309310695").build();
Project response = projectsClient.get(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetProjectRequest,Project> getCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetProjectRequest request =
GetProjectRequest.newBuilder().setProject("project-309310695").build();
ApiFuture<Project> future = projectsClient.getCallable().futureCall(request);
// Do something.
Project response = future.get();
}
public final Project getXpnHost(String project)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
Project response = projectsClient.getXpnHost(project);
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Project getXpnHost(GetXpnHostProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetXpnHostProjectRequest request =
GetXpnHostProjectRequest.newBuilder().setProject("project-309310695").build();
Project response = projectsClient.getXpnHost(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetXpnHostProjectRequest,Project> getXpnHostCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetXpnHostProjectRequest request =
GetXpnHostProjectRequest.newBuilder().setProject("project-309310695").build();
ApiFuture<Project> future = projectsClient.getXpnHostCallable().futureCall(request);
// Do something.
Project response = future.get();
}
public final ProjectsClient.GetXpnResourcesPagedResponse getXpnResources(String project)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
for (XpnResourceId element : projectsClient.getXpnResources(project).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ProjectsClient.GetXpnResourcesPagedResponse getXpnResources(GetXpnResourcesProjectsRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetXpnResourcesProjectsRequest request =
GetXpnResourcesProjectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
for (XpnResourceId element : projectsClient.getXpnResources(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetXpnResourcesProjectsRequest,ProjectsClient.GetXpnResourcesPagedResponse> getXpnResourcesPagedCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetXpnResourcesProjectsRequest request =
GetXpnResourcesProjectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
ApiFuture<XpnResourceId> future =
projectsClient.getXpnResourcesPagedCallable().futureCall(request);
// Do something.
for (XpnResourceId element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<GetXpnResourcesProjectsRequest,ProjectsGetXpnResources> getXpnResourcesCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
GetXpnResourcesProjectsRequest request =
GetXpnResourcesProjectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
while (true) {
ProjectsGetXpnResources response = projectsClient.getXpnResourcesCallable().call(request);
for (XpnResourceId element : response.getResourcesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ProjectsClient.ListXpnHostsPagedResponse listXpnHosts(String project, ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
ProjectsListXpnHostsRequest projectsListXpnHostsRequestResource =
ProjectsListXpnHostsRequest.newBuilder().build();
for (Project element :
projectsClient.listXpnHosts(project, projectsListXpnHostsRequestResource).iterateAll()) {
// doThingsWith(element);
}
}
project - Project ID for this request.projectsListXpnHostsRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final ProjectsClient.ListXpnHostsPagedResponse listXpnHosts(ListXpnHostsProjectsRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
ListXpnHostsProjectsRequest request =
ListXpnHostsProjectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setProjectsListXpnHostsRequestResource(
ProjectsListXpnHostsRequest.newBuilder().build())
.setReturnPartialSuccess(true)
.build();
for (Project element : projectsClient.listXpnHosts(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListXpnHostsProjectsRequest,ProjectsClient.ListXpnHostsPagedResponse> listXpnHostsPagedCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
ListXpnHostsProjectsRequest request =
ListXpnHostsProjectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setProjectsListXpnHostsRequestResource(
ProjectsListXpnHostsRequest.newBuilder().build())
.setReturnPartialSuccess(true)
.build();
ApiFuture<Project> future = projectsClient.listXpnHostsPagedCallable().futureCall(request);
// Do something.
for (Project element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListXpnHostsProjectsRequest,XpnHostList> listXpnHostsCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
ListXpnHostsProjectsRequest request =
ListXpnHostsProjectsRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setProjectsListXpnHostsRequestResource(
ProjectsListXpnHostsRequest.newBuilder().build())
.setReturnPartialSuccess(true)
.build();
while (true) {
XpnHostList response = projectsClient.listXpnHostsCallable().call(request);
for (Project element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveDiskAsync(String project, DiskMoveRequest diskMoveRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
DiskMoveRequest diskMoveRequestResource = DiskMoveRequest.newBuilder().build();
Operation response = projectsClient.moveDiskAsync(project, diskMoveRequestResource).get();
}
project - Project ID for this request.diskMoveRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveDiskAsync(MoveDiskProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
MoveDiskProjectRequest request =
MoveDiskProjectRequest.newBuilder()
.setDiskMoveRequestResource(DiskMoveRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.moveDiskAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<MoveDiskProjectRequest,Operation,Operation> moveDiskOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
MoveDiskProjectRequest request =
MoveDiskProjectRequest.newBuilder()
.setDiskMoveRequestResource(DiskMoveRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.moveDiskOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<MoveDiskProjectRequest,Operation> moveDiskCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
MoveDiskProjectRequest request =
MoveDiskProjectRequest.newBuilder()
.setDiskMoveRequestResource(DiskMoveRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.moveDiskCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveInstanceAsync(String project, InstanceMoveRequest instanceMoveRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
InstanceMoveRequest instanceMoveRequestResource = InstanceMoveRequest.newBuilder().build();
Operation response =
projectsClient.moveInstanceAsync(project, instanceMoveRequestResource).get();
}
project - Project ID for this request.instanceMoveRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> moveInstanceAsync(MoveInstanceProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
MoveInstanceProjectRequest request =
MoveInstanceProjectRequest.newBuilder()
.setInstanceMoveRequestResource(InstanceMoveRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.moveInstanceAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<MoveInstanceProjectRequest,Operation,Operation> moveInstanceOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
MoveInstanceProjectRequest request =
MoveInstanceProjectRequest.newBuilder()
.setInstanceMoveRequestResource(InstanceMoveRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.moveInstanceOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<MoveInstanceProjectRequest,Operation> moveInstanceCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
MoveInstanceProjectRequest request =
MoveInstanceProjectRequest.newBuilder()
.setInstanceMoveRequestResource(InstanceMoveRequest.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.moveInstanceCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setCloudArmorTierAsync(String project, ProjectsSetCloudArmorTierRequest projectsSetCloudArmorTierRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
ProjectsSetCloudArmorTierRequest projectsSetCloudArmorTierRequestResource =
ProjectsSetCloudArmorTierRequest.newBuilder().build();
Operation response =
projectsClient
.setCloudArmorTierAsync(project, projectsSetCloudArmorTierRequestResource)
.get();
}
project - Project ID for this request.projectsSetCloudArmorTierRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setCloudArmorTierAsync(SetCloudArmorTierProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetCloudArmorTierProjectRequest request =
SetCloudArmorTierProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsSetCloudArmorTierRequestResource(
ProjectsSetCloudArmorTierRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.setCloudArmorTierAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetCloudArmorTierProjectRequest,Operation,Operation> setCloudArmorTierOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetCloudArmorTierProjectRequest request =
SetCloudArmorTierProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsSetCloudArmorTierRequestResource(
ProjectsSetCloudArmorTierRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.setCloudArmorTierOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetCloudArmorTierProjectRequest,Operation> setCloudArmorTierCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetCloudArmorTierProjectRequest request =
SetCloudArmorTierProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsSetCloudArmorTierRequestResource(
ProjectsSetCloudArmorTierRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future = projectsClient.setCloudArmorTierCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setCommonInstanceMetadataAsync(String project, Metadata metadataResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
Metadata metadataResource = Metadata.newBuilder().build();
Operation response =
projectsClient.setCommonInstanceMetadataAsync(project, metadataResource).get();
}
project - Project ID for this request.metadataResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setCommonInstanceMetadataAsync(SetCommonInstanceMetadataProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetCommonInstanceMetadataProjectRequest request =
SetCommonInstanceMetadataProjectRequest.newBuilder()
.setMetadataResource(Metadata.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.setCommonInstanceMetadataAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetCommonInstanceMetadataProjectRequest,Operation,Operation> setCommonInstanceMetadataOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetCommonInstanceMetadataProjectRequest request =
SetCommonInstanceMetadataProjectRequest.newBuilder()
.setMetadataResource(Metadata.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.setCommonInstanceMetadataOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetCommonInstanceMetadataProjectRequest,Operation> setCommonInstanceMetadataCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetCommonInstanceMetadataProjectRequest request =
SetCommonInstanceMetadataProjectRequest.newBuilder()
.setMetadataResource(Metadata.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
projectsClient.setCommonInstanceMetadataCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setDefaultNetworkTierAsync(String project, ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
ProjectsSetDefaultNetworkTierRequest projectsSetDefaultNetworkTierRequestResource =
ProjectsSetDefaultNetworkTierRequest.newBuilder().build();
Operation response =
projectsClient
.setDefaultNetworkTierAsync(project, projectsSetDefaultNetworkTierRequestResource)
.get();
}
project - Project ID for this request.projectsSetDefaultNetworkTierRequestResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setDefaultNetworkTierAsync(SetDefaultNetworkTierProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetDefaultNetworkTierProjectRequest request =
SetDefaultNetworkTierProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsSetDefaultNetworkTierRequestResource(
ProjectsSetDefaultNetworkTierRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
Operation response = projectsClient.setDefaultNetworkTierAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetDefaultNetworkTierProjectRequest,Operation,Operation> setDefaultNetworkTierOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetDefaultNetworkTierProjectRequest request =
SetDefaultNetworkTierProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsSetDefaultNetworkTierRequestResource(
ProjectsSetDefaultNetworkTierRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
projectsClient.setDefaultNetworkTierOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetDefaultNetworkTierProjectRequest,Operation> setDefaultNetworkTierCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetDefaultNetworkTierProjectRequest request =
SetDefaultNetworkTierProjectRequest.newBuilder()
.setProject("project-309310695")
.setProjectsSetDefaultNetworkTierRequestResource(
ProjectsSetDefaultNetworkTierRequest.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
projectsClient.setDefaultNetworkTierCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setUsageExportBucketAsync(String project, UsageExportLocation usageExportLocationResource)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
String project = "project-309310695";
UsageExportLocation usageExportLocationResource = UsageExportLocation.newBuilder().build();
Operation response =
projectsClient.setUsageExportBucketAsync(project, usageExportLocationResource).get();
}
project - Project ID for this request.usageExportLocationResource - The body resource for this requestcom.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Operation,Operation> setUsageExportBucketAsync(SetUsageExportBucketProjectRequest request)
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetUsageExportBucketProjectRequest request =
SetUsageExportBucketProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUsageExportLocationResource(UsageExportLocation.newBuilder().build())
.build();
Operation response = projectsClient.setUsageExportBucketAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<SetUsageExportBucketProjectRequest,Operation,Operation> setUsageExportBucketOperationCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetUsageExportBucketProjectRequest request =
SetUsageExportBucketProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUsageExportLocationResource(UsageExportLocation.newBuilder().build())
.build();
OperationFuture<Operation, Operation> future =
projectsClient.setUsageExportBucketOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetUsageExportBucketProjectRequest,Operation> setUsageExportBucketCallable()
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 (ProjectsClient projectsClient = ProjectsClient.create()) {
SetUsageExportBucketProjectRequest request =
SetUsageExportBucketProjectRequest.newBuilder()
.setProject("project-309310695")
.setRequestId("requestId693933066")
.setUsageExportLocationResource(UsageExportLocation.newBuilder().build())
.build();
ApiFuture<Operation> future =
projectsClient.setUsageExportBucketCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.