| GitHub Repository | Product Reference |
Service Description: The GlobalVmExtensionPolicies API.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
String globalVmExtensionPolicy = "globalVmExtensionPolicy-869114569";
GlobalVmExtensionPolicy response =
globalVmExtensionPoliciesClient.get(project, globalVmExtensionPolicy);
}
Note: close() needs to be called on the GlobalVmExtensionPoliciesClient 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 |
|---|---|---|
AggregatedList |
Retrieves the list of all VM Extension Policy resources available to the specified project. To prevent failure, it's recommended that you set the |
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.
|
Delete |
Purge scoped resources (zonal policies) from a global VM extension policy, and then delete the global VM extension policy. Purge of the scoped resources is a pre-condition of the global VM extension policy deletion. The deletion of the global VM extension policy happens after the purge rollout is done, so it's not a part of the LRO. It's an automatic process that triggers in the backend. |
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.
|
Get |
Gets details of a global VM extension policy. |
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.
|
Insert |
Creates a new project level GlobalVmExtensionPolicy. |
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.
|
List |
Lists global VM extension policies. |
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.
|
Update |
Updates a global VM extension policy. |
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.
|
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 GlobalVmExtensionPoliciesSettings 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
GlobalVmExtensionPoliciesSettings globalVmExtensionPoliciesSettings =
GlobalVmExtensionPoliciesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create(globalVmExtensionPoliciesSettings);
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
GlobalVmExtensionPoliciesSettings globalVmExtensionPoliciesSettings =
GlobalVmExtensionPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create(globalVmExtensionPoliciesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final GlobalVmExtensionPoliciesClient create()Constructs an instance of GlobalVmExtensionPoliciesClient with default settings.
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(GlobalVmExtensionPoliciesSettings settings)
public static final GlobalVmExtensionPoliciesClient create(GlobalVmExtensionPoliciesSettings settings)Constructs an instance of GlobalVmExtensionPoliciesClient, 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 |
GlobalVmExtensionPoliciesSettings |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
create(GlobalVmExtensionPoliciesStub stub)
public static final GlobalVmExtensionPoliciesClient create(GlobalVmExtensionPoliciesStub stub)Constructs an instance of GlobalVmExtensionPoliciesClient, using the given stub for making calls. This is for advanced usage - prefer using create(GlobalVmExtensionPoliciesSettings).
| Parameter | |
|---|---|
| Name | Description |
stub |
GlobalVmExtensionPoliciesStub |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient |
|
Constructors
GlobalVmExtensionPoliciesClient(GlobalVmExtensionPoliciesSettings settings)
protected GlobalVmExtensionPoliciesClient(GlobalVmExtensionPoliciesSettings settings)Constructs an instance of GlobalVmExtensionPoliciesClient, 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 |
GlobalVmExtensionPoliciesSettings |
GlobalVmExtensionPoliciesClient(GlobalVmExtensionPoliciesStub stub)
protected GlobalVmExtensionPoliciesClient(GlobalVmExtensionPoliciesStub stub)| Parameter | |
|---|---|
| Name | Description |
stub |
GlobalVmExtensionPoliciesStub |
Methods
aggregatedList(AggregatedListGlobalVmExtensionPoliciesRequest request)
public final GlobalVmExtensionPoliciesClient.AggregatedListPagedResponse aggregatedList(AggregatedListGlobalVmExtensionPoliciesRequest request)Retrieves the list of all VM Extension Policy resources available to the specified project.
To prevent failure, it's recommended that you set the returnPartialSuccess parameter to
true.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
AggregatedListGlobalVmExtensionPoliciesRequest request =
AggregatedListGlobalVmExtensionPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
for (Map.Entry<String, VmExtensionPoliciesScopedList> element :
globalVmExtensionPoliciesClient.aggregatedList(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
AggregatedListGlobalVmExtensionPoliciesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient.AggregatedListPagedResponse |
|
aggregatedList(String project)
public final GlobalVmExtensionPoliciesClient.AggregatedListPagedResponse aggregatedList(String project)Retrieves the list of all VM Extension Policy resources available to the specified project.
To prevent failure, it's recommended that you set the returnPartialSuccess parameter to
true.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
for (Map.Entry<String, VmExtensionPoliciesScopedList> element :
globalVmExtensionPoliciesClient.aggregatedList(project).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
project |
StringName of the project scoping this request. |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient.AggregatedListPagedResponse |
|
aggregatedListCallable()
public final UnaryCallable<AggregatedListGlobalVmExtensionPoliciesRequest,VmExtensionPolicyAggregatedListResponse> aggregatedListCallable()Retrieves the list of all VM Extension Policy resources available to the specified project.
To prevent failure, it's recommended that you set the returnPartialSuccess parameter to
true.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
AggregatedListGlobalVmExtensionPoliciesRequest request =
AggregatedListGlobalVmExtensionPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
while (true) {
VmExtensionPolicyAggregatedListResponse response =
globalVmExtensionPoliciesClient.aggregatedListCallable().call(request);
for (Map.Entry<String, VmExtensionPoliciesScopedList> element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<AggregatedListGlobalVmExtensionPoliciesRequest,VmExtensionPolicyAggregatedListResponse> |
|
aggregatedListPagedCallable()
public final UnaryCallable<AggregatedListGlobalVmExtensionPoliciesRequest,GlobalVmExtensionPoliciesClient.AggregatedListPagedResponse> aggregatedListPagedCallable()Retrieves the list of all VM Extension Policy resources available to the specified project.
To prevent failure, it's recommended that you set the returnPartialSuccess parameter to
true.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
AggregatedListGlobalVmExtensionPoliciesRequest request =
AggregatedListGlobalVmExtensionPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setIncludeAllScopes(true)
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.setServiceProjectNumber(-1293855239)
.build();
ApiFuture<Map.Entry<String, VmExtensionPoliciesScopedList>> future =
globalVmExtensionPoliciesClient.aggregatedListPagedCallable().futureCall(request);
// Do something.
for (Map.Entry<String, VmExtensionPoliciesScopedList> element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<AggregatedListGlobalVmExtensionPoliciesRequest,AggregatedListPagedResponse> |
|
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)| Parameters | |
|---|---|
| Name | Description |
duration |
long |
unit |
TimeUnit |
| Returns | |
|---|---|
| Type | Description |
boolean |
|
| Exceptions | |
|---|---|
| Type | Description |
InterruptedException |
|
close()
public final void close()deleteAsync(DeleteGlobalVmExtensionPolicyRequest request)
public final OperationFuture<Operation,Operation> deleteAsync(DeleteGlobalVmExtensionPolicyRequest request)Purge scoped resources (zonal policies) from a global VM extension policy, and then delete the global VM extension policy. Purge of the scoped resources is a pre-condition of the global VM extension policy deletion. The deletion of the global VM extension policy happens after the purge rollout is done, so it's not a part of the LRO. It's an automatic process that triggers in the backend.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
DeleteGlobalVmExtensionPolicyRequest request =
DeleteGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setGlobalVmExtensionPolicyRolloutOperationRolloutInputResource(
GlobalVmExtensionPolicyRolloutOperationRolloutInput.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = globalVmExtensionPoliciesClient.deleteAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
DeleteGlobalVmExtensionPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
deleteAsync(String project, String globalVmExtensionPolicy, GlobalVmExtensionPolicyRolloutOperationRolloutInput globalVmExtensionPolicyRolloutOperationRolloutInputResource)
public final OperationFuture<Operation,Operation> deleteAsync(String project, String globalVmExtensionPolicy, GlobalVmExtensionPolicyRolloutOperationRolloutInput globalVmExtensionPolicyRolloutOperationRolloutInputResource)Purge scoped resources (zonal policies) from a global VM extension policy, and then delete the global VM extension policy. Purge of the scoped resources is a pre-condition of the global VM extension policy deletion. The deletion of the global VM extension policy happens after the purge rollout is done, so it's not a part of the LRO. It's an automatic process that triggers in the backend.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
String globalVmExtensionPolicy = "globalVmExtensionPolicy-869114569";
GlobalVmExtensionPolicyRolloutOperationRolloutInput
globalVmExtensionPolicyRolloutOperationRolloutInputResource =
GlobalVmExtensionPolicyRolloutOperationRolloutInput.newBuilder().build();
Operation response =
globalVmExtensionPoliciesClient
.deleteAsync(
project,
globalVmExtensionPolicy,
globalVmExtensionPolicyRolloutOperationRolloutInputResource)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
globalVmExtensionPolicy |
StringName of the global VM extension policy to purge scoped resources for. |
globalVmExtensionPolicyRolloutOperationRolloutInputResource |
GlobalVmExtensionPolicyRolloutOperationRolloutInputThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
deleteCallable()
public final UnaryCallable<DeleteGlobalVmExtensionPolicyRequest,Operation> deleteCallable()Purge scoped resources (zonal policies) from a global VM extension policy, and then delete the global VM extension policy. Purge of the scoped resources is a pre-condition of the global VM extension policy deletion. The deletion of the global VM extension policy happens after the purge rollout is done, so it's not a part of the LRO. It's an automatic process that triggers in the backend.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
DeleteGlobalVmExtensionPolicyRequest request =
DeleteGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setGlobalVmExtensionPolicyRolloutOperationRolloutInputResource(
GlobalVmExtensionPolicyRolloutOperationRolloutInput.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
globalVmExtensionPoliciesClient.deleteCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<DeleteGlobalVmExtensionPolicyRequest,Operation> |
|
deleteOperationCallable()
public final OperationCallable<DeleteGlobalVmExtensionPolicyRequest,Operation,Operation> deleteOperationCallable()Purge scoped resources (zonal policies) from a global VM extension policy, and then delete the global VM extension policy. Purge of the scoped resources is a pre-condition of the global VM extension policy deletion. The deletion of the global VM extension policy happens after the purge rollout is done, so it's not a part of the LRO. It's an automatic process that triggers in the backend.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
DeleteGlobalVmExtensionPolicyRequest request =
DeleteGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setGlobalVmExtensionPolicyRolloutOperationRolloutInputResource(
GlobalVmExtensionPolicyRolloutOperationRolloutInput.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
globalVmExtensionPoliciesClient.deleteOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<DeleteGlobalVmExtensionPolicyRequest,Operation,Operation> |
|
get(GetGlobalVmExtensionPolicyRequest request)
public final GlobalVmExtensionPolicy get(GetGlobalVmExtensionPolicyRequest request)Gets details of a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
GetGlobalVmExtensionPolicyRequest request =
GetGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setProject("project-309310695")
.build();
GlobalVmExtensionPolicy response = globalVmExtensionPoliciesClient.get(request);
}
| Parameter | |
|---|---|
| Name | Description |
request |
GetGlobalVmExtensionPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPolicy |
|
get(String project, String globalVmExtensionPolicy)
public final GlobalVmExtensionPolicy get(String project, String globalVmExtensionPolicy)Gets details of a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
String globalVmExtensionPolicy = "globalVmExtensionPolicy-869114569";
GlobalVmExtensionPolicy response =
globalVmExtensionPoliciesClient.get(project, globalVmExtensionPolicy);
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
globalVmExtensionPolicy |
StringName of the GlobalVmExtensionPolicy resource to return. |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPolicy |
|
getCallable()
public final UnaryCallable<GetGlobalVmExtensionPolicyRequest,GlobalVmExtensionPolicy> getCallable()Gets details of a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
GetGlobalVmExtensionPolicyRequest request =
GetGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setProject("project-309310695")
.build();
ApiFuture<GlobalVmExtensionPolicy> future =
globalVmExtensionPoliciesClient.getCallable().futureCall(request);
// Do something.
GlobalVmExtensionPolicy response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<GetGlobalVmExtensionPolicyRequest,GlobalVmExtensionPolicy> |
|
getSettings()
public final @Nullable GlobalVmExtensionPoliciesSettings getSettings()| Returns | |
|---|---|
| Type | Description |
@org.jspecify.annotations.Nullable com.google.cloud.compute.v1.GlobalVmExtensionPoliciesSettings |
|
getStub()
public GlobalVmExtensionPoliciesStub getStub()| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesStub |
|
insertAsync(InsertGlobalVmExtensionPolicyRequest request)
public final OperationFuture<Operation,Operation> insertAsync(InsertGlobalVmExtensionPolicyRequest request)Creates a new project level GlobalVmExtensionPolicy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
InsertGlobalVmExtensionPolicyRequest request =
InsertGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicyResource(GlobalVmExtensionPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = globalVmExtensionPoliciesClient.insertAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
InsertGlobalVmExtensionPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
insertAsync(String project, GlobalVmExtensionPolicy globalVmExtensionPolicyResource)
public final OperationFuture<Operation,Operation> insertAsync(String project, GlobalVmExtensionPolicy globalVmExtensionPolicyResource)Creates a new project level GlobalVmExtensionPolicy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
GlobalVmExtensionPolicy globalVmExtensionPolicyResource =
GlobalVmExtensionPolicy.newBuilder().build();
Operation response =
globalVmExtensionPoliciesClient
.insertAsync(project, globalVmExtensionPolicyResource)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
globalVmExtensionPolicyResource |
GlobalVmExtensionPolicyThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
insertCallable()
public final UnaryCallable<InsertGlobalVmExtensionPolicyRequest,Operation> insertCallable()Creates a new project level GlobalVmExtensionPolicy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
InsertGlobalVmExtensionPolicyRequest request =
InsertGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicyResource(GlobalVmExtensionPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
globalVmExtensionPoliciesClient.insertCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<InsertGlobalVmExtensionPolicyRequest,Operation> |
|
insertOperationCallable()
public final OperationCallable<InsertGlobalVmExtensionPolicyRequest,Operation,Operation> insertOperationCallable()Creates a new project level GlobalVmExtensionPolicy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
InsertGlobalVmExtensionPolicyRequest request =
InsertGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicyResource(GlobalVmExtensionPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
globalVmExtensionPoliciesClient.insertOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<InsertGlobalVmExtensionPolicyRequest,Operation,Operation> |
|
isShutdown()
public boolean isShutdown()| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTerminated()
public boolean isTerminated()| Returns | |
|---|---|
| Type | Description |
boolean |
|
list(ListGlobalVmExtensionPoliciesRequest request)
public final GlobalVmExtensionPoliciesClient.ListPagedResponse list(ListGlobalVmExtensionPoliciesRequest request)Lists global VM extension policies.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
ListGlobalVmExtensionPoliciesRequest request =
ListGlobalVmExtensionPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
for (GlobalVmExtensionPolicy element :
globalVmExtensionPoliciesClient.list(request).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
request |
ListGlobalVmExtensionPoliciesRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient.ListPagedResponse |
|
list(String project)
public final GlobalVmExtensionPoliciesClient.ListPagedResponse list(String project)Lists global VM extension policies.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
for (GlobalVmExtensionPolicy element :
globalVmExtensionPoliciesClient.list(project).iterateAll()) {
// doThingsWith(element);
}
}
| Parameter | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
| Returns | |
|---|---|
| Type | Description |
GlobalVmExtensionPoliciesClient.ListPagedResponse |
|
listCallable()
public final UnaryCallable<ListGlobalVmExtensionPoliciesRequest,GlobalVmExtensionPolicyList> listCallable()Lists global VM extension policies.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
ListGlobalVmExtensionPoliciesRequest request =
ListGlobalVmExtensionPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
while (true) {
GlobalVmExtensionPolicyList response =
globalVmExtensionPoliciesClient.listCallable().call(request);
for (GlobalVmExtensionPolicy element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListGlobalVmExtensionPoliciesRequest,GlobalVmExtensionPolicyList> |
|
listPagedCallable()
public final UnaryCallable<ListGlobalVmExtensionPoliciesRequest,GlobalVmExtensionPoliciesClient.ListPagedResponse> listPagedCallable()Lists global VM extension policies.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
ListGlobalVmExtensionPoliciesRequest request =
ListGlobalVmExtensionPoliciesRequest.newBuilder()
.setFilter("filter-1274492040")
.setMaxResults(1128457243)
.setOrderBy("orderBy-1207110587")
.setPageToken("pageToken873572522")
.setProject("project-309310695")
.setReturnPartialSuccess(true)
.build();
ApiFuture<GlobalVmExtensionPolicy> future =
globalVmExtensionPoliciesClient.listPagedCallable().futureCall(request);
// Do something.
for (GlobalVmExtensionPolicy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<ListGlobalVmExtensionPoliciesRequest,ListPagedResponse> |
|
shutdown()
public void shutdown()shutdownNow()
public void shutdownNow()updateAsync(UpdateGlobalVmExtensionPolicyRequest request)
public final OperationFuture<Operation,Operation> updateAsync(UpdateGlobalVmExtensionPolicyRequest request)Updates a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
UpdateGlobalVmExtensionPolicyRequest request =
UpdateGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setGlobalVmExtensionPolicyResource(GlobalVmExtensionPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
Operation response = globalVmExtensionPoliciesClient.updateAsync(request).get();
}
| Parameter | |
|---|---|
| Name | Description |
request |
UpdateGlobalVmExtensionPolicyRequestThe request object containing all of the parameters for the API call. |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
updateAsync(String project, String globalVmExtensionPolicy, GlobalVmExtensionPolicy globalVmExtensionPolicyResource)
public final OperationFuture<Operation,Operation> updateAsync(String project, String globalVmExtensionPolicy, GlobalVmExtensionPolicy globalVmExtensionPolicyResource)Updates a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
String project = "project-309310695";
String globalVmExtensionPolicy = "globalVmExtensionPolicy-869114569";
GlobalVmExtensionPolicy globalVmExtensionPolicyResource =
GlobalVmExtensionPolicy.newBuilder().build();
Operation response =
globalVmExtensionPoliciesClient
.updateAsync(project, globalVmExtensionPolicy, globalVmExtensionPolicyResource)
.get();
}
| Parameters | |
|---|---|
| Name | Description |
project |
StringProject ID for this request. |
globalVmExtensionPolicy |
StringName of the global VM extension policy to update. |
globalVmExtensionPolicyResource |
GlobalVmExtensionPolicyThe body resource for this request |
| Returns | |
|---|---|
| Type | Description |
OperationFuture<Operation,Operation> |
|
updateCallable()
public final UnaryCallable<UpdateGlobalVmExtensionPolicyRequest,Operation> updateCallable()Updates a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
UpdateGlobalVmExtensionPolicyRequest request =
UpdateGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setGlobalVmExtensionPolicyResource(GlobalVmExtensionPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
ApiFuture<Operation> future =
globalVmExtensionPoliciesClient.updateCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
UnaryCallable<UpdateGlobalVmExtensionPolicyRequest,Operation> |
|
updateOperationCallable()
public final OperationCallable<UpdateGlobalVmExtensionPolicyRequest,Operation,Operation> updateOperationCallable()Updates a global VM extension policy.
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 (GlobalVmExtensionPoliciesClient globalVmExtensionPoliciesClient =
GlobalVmExtensionPoliciesClient.create()) {
UpdateGlobalVmExtensionPolicyRequest request =
UpdateGlobalVmExtensionPolicyRequest.newBuilder()
.setGlobalVmExtensionPolicy("globalVmExtensionPolicy-869114569")
.setGlobalVmExtensionPolicyResource(GlobalVmExtensionPolicy.newBuilder().build())
.setProject("project-309310695")
.setRequestId("requestId693933066")
.build();
OperationFuture<Operation, Operation> future =
globalVmExtensionPoliciesClient.updateOperationCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
| Returns | |
|---|---|
| Type | Description |
OperationCallable<UpdateGlobalVmExtensionPolicyRequest,Operation,Operation> |
|