@Generated(value="by gapic-generator") @BetaApi public class NodeGroupClient 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:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource);
}
Note: close() needs to be called on the nodeGroupClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
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 NodeGroupSettings to create(). For example:
To customize credentials:
NodeGroupSettings nodeGroupSettings =
NodeGroupSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
NodeGroupClient nodeGroupClient =
NodeGroupClient.create(nodeGroupSettings);
To customize the endpoint:
NodeGroupSettings nodeGroupSettings =
NodeGroupSettings.newBuilder().setEndpoint(myEndpoint).build();
NodeGroupClient nodeGroupClient =
NodeGroupClient.create(nodeGroupSettings);
Modifier and Type | Class and Description |
---|---|
static class |
NodeGroupClient.AggregatedListNodeGroupsFixedSizeCollection |
static class |
NodeGroupClient.AggregatedListNodeGroupsPage |
static class |
NodeGroupClient.AggregatedListNodeGroupsPagedResponse |
static class |
NodeGroupClient.ListNodeGroupsFixedSizeCollection |
static class |
NodeGroupClient.ListNodeGroupsPage |
static class |
NodeGroupClient.ListNodeGroupsPagedResponse |
static class |
NodeGroupClient.ListNodesNodeGroupsFixedSizeCollection |
static class |
NodeGroupClient.ListNodesNodeGroupsPage |
static class |
NodeGroupClient.ListNodesNodeGroupsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
NodeGroupClient(NodeGroupSettings settings)
Constructs an instance of NodeGroupClient, using the given settings.
|
protected |
NodeGroupClient(NodeGroupStub stub) |
Modifier and Type | Method and Description |
---|---|
Operation |
addNodesNodeGroup(AddNodesNodeGroupHttpRequest request)
Adds specified number of nodes to the node group.
|
Operation |
addNodesNodeGroup(ProjectZoneNodeGroupName nodeGroup,
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource)
Adds specified number of nodes to the node group.
|
Operation |
addNodesNodeGroup(String nodeGroup,
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource)
Adds specified number of nodes to the node group.
|
com.google.api.gax.rpc.UnaryCallable<AddNodesNodeGroupHttpRequest,Operation> |
addNodesNodeGroupCallable()
Adds specified number of nodes to the node group.
|
NodeGroupClient.AggregatedListNodeGroupsPagedResponse |
aggregatedListNodeGroups(AggregatedListNodeGroupsHttpRequest request)
Retrieves an aggregated list of node groups.
|
NodeGroupClient.AggregatedListNodeGroupsPagedResponse |
aggregatedListNodeGroups(ProjectName project)
Retrieves an aggregated list of node groups.
|
NodeGroupClient.AggregatedListNodeGroupsPagedResponse |
aggregatedListNodeGroups(String project)
Retrieves an aggregated list of node groups.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListNodeGroupsHttpRequest,NodeGroupAggregatedList> |
aggregatedListNodeGroupsCallable()
Retrieves an aggregated list of node groups.
|
com.google.api.gax.rpc.UnaryCallable<AggregatedListNodeGroupsHttpRequest,NodeGroupClient.AggregatedListNodeGroupsPagedResponse> |
aggregatedListNodeGroupsPagedCallable()
Retrieves an aggregated list of node groups.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static NodeGroupClient |
create()
Constructs an instance of NodeGroupClient with default settings.
|
static NodeGroupClient |
create(NodeGroupSettings settings)
Constructs an instance of NodeGroupClient, using the given settings.
|
static NodeGroupClient |
create(NodeGroupStub stub)
Constructs an instance of NodeGroupClient, using the given stub for making calls.
|
Operation |
deleteNodeGroup(DeleteNodeGroupHttpRequest request)
Deletes the specified NodeGroup resource.
|
Operation |
deleteNodeGroup(ProjectZoneNodeGroupName nodeGroup)
Deletes the specified NodeGroup resource.
|
Operation |
deleteNodeGroup(String nodeGroup)
Deletes the specified NodeGroup resource.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNodeGroupHttpRequest,Operation> |
deleteNodeGroupCallable()
Deletes the specified NodeGroup resource.
|
Operation |
deleteNodesNodeGroup(DeleteNodesNodeGroupHttpRequest request)
Deletes specified nodes from the node group.
|
Operation |
deleteNodesNodeGroup(ProjectZoneNodeGroupName nodeGroup,
NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource)
Deletes specified nodes from the node group.
|
Operation |
deleteNodesNodeGroup(String nodeGroup,
NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource)
Deletes specified nodes from the node group.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNodesNodeGroupHttpRequest,Operation> |
deleteNodesNodeGroupCallable()
Deletes specified nodes from the node group.
|
Policy |
getIamPolicyNodeGroup(GetIamPolicyNodeGroupHttpRequest request)
Gets the access control policy for a resource.
|
Policy |
getIamPolicyNodeGroup(ProjectZoneNodeGroupResourceName resource)
Gets the access control policy for a resource.
|
Policy |
getIamPolicyNodeGroup(String resource)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<GetIamPolicyNodeGroupHttpRequest,Policy> |
getIamPolicyNodeGroupCallable()
Gets the access control policy for a resource.
|
NodeGroup |
getNodeGroup(GetNodeGroupHttpRequest request)
Returns the specified NodeGroup.
|
NodeGroup |
getNodeGroup(ProjectZoneNodeGroupName nodeGroup)
Returns the specified NodeGroup.
|
NodeGroup |
getNodeGroup(String nodeGroup)
Returns the specified NodeGroup.
|
com.google.api.gax.rpc.UnaryCallable<GetNodeGroupHttpRequest,NodeGroup> |
getNodeGroupCallable()
Returns the specified NodeGroup.
|
NodeGroupSettings |
getSettings() |
NodeGroupStub |
getStub() |
Operation |
insertNodeGroup(InsertNodeGroupHttpRequest request)
Creates a NodeGroup resource in the specified project using the data included in the request.
|
Operation |
insertNodeGroup(Integer initialNodeCount,
ProjectZoneName zone,
NodeGroup nodeGroupResource)
Creates a NodeGroup resource in the specified project using the data included in the request.
|
Operation |
insertNodeGroup(Integer initialNodeCount,
String zone,
NodeGroup nodeGroupResource)
Creates a NodeGroup resource in the specified project using the data included in the request.
|
com.google.api.gax.rpc.UnaryCallable<InsertNodeGroupHttpRequest,Operation> |
insertNodeGroupCallable()
Creates a NodeGroup resource in the specified project using the data included in the request.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
NodeGroupClient.ListNodeGroupsPagedResponse |
listNodeGroups(ListNodeGroupsHttpRequest request)
Retrieves a list of node groups available to the specified project.
|
NodeGroupClient.ListNodeGroupsPagedResponse |
listNodeGroups(ProjectZoneName zone)
Retrieves a list of node groups available to the specified project.
|
NodeGroupClient.ListNodeGroupsPagedResponse |
listNodeGroups(String zone)
Retrieves a list of node groups available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListNodeGroupsHttpRequest,NodeGroupList> |
listNodeGroupsCallable()
Retrieves a list of node groups available to the specified project.
|
com.google.api.gax.rpc.UnaryCallable<ListNodeGroupsHttpRequest,NodeGroupClient.ListNodeGroupsPagedResponse> |
listNodeGroupsPagedCallable()
Retrieves a list of node groups available to the specified project.
|
NodeGroupClient.ListNodesNodeGroupsPagedResponse |
listNodesNodeGroups(ListNodesNodeGroupsHttpRequest request)
Lists nodes in the node group.
|
NodeGroupClient.ListNodesNodeGroupsPagedResponse |
listNodesNodeGroups(ProjectZoneNodeGroupName nodeGroup)
Lists nodes in the node group.
|
NodeGroupClient.ListNodesNodeGroupsPagedResponse |
listNodesNodeGroups(String nodeGroup)
Lists nodes in the node group.
|
com.google.api.gax.rpc.UnaryCallable<ListNodesNodeGroupsHttpRequest,NodeGroupsListNodes> |
listNodesNodeGroupsCallable()
Lists nodes in the node group.
|
com.google.api.gax.rpc.UnaryCallable<ListNodesNodeGroupsHttpRequest,NodeGroupClient.ListNodesNodeGroupsPagedResponse> |
listNodesNodeGroupsPagedCallable()
Lists nodes in the node group.
|
Policy |
setIamPolicyNodeGroup(ProjectZoneNodeGroupResourceName resource,
ZoneSetPolicyRequest zoneSetPolicyRequestResource)
Sets the access control policy on the specified resource.
|
Policy |
setIamPolicyNodeGroup(SetIamPolicyNodeGroupHttpRequest request)
Sets the access control policy on the specified resource.
|
Policy |
setIamPolicyNodeGroup(String resource,
ZoneSetPolicyRequest zoneSetPolicyRequestResource)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<SetIamPolicyNodeGroupHttpRequest,Policy> |
setIamPolicyNodeGroupCallable()
Sets the access control policy on the specified resource.
|
Operation |
setNodeTemplateNodeGroup(ProjectZoneNodeGroupName nodeGroup,
NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource)
Updates the node template of the node group.
|
Operation |
setNodeTemplateNodeGroup(SetNodeTemplateNodeGroupHttpRequest request)
Updates the node template of the node group.
|
Operation |
setNodeTemplateNodeGroup(String nodeGroup,
NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource)
Updates the node template of the node group.
|
com.google.api.gax.rpc.UnaryCallable<SetNodeTemplateNodeGroupHttpRequest,Operation> |
setNodeTemplateNodeGroupCallable()
Updates the node template of the node group.
|
void |
shutdown() |
void |
shutdownNow() |
TestPermissionsResponse |
testIamPermissionsNodeGroup(ProjectZoneNodeGroupResourceName resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissionsNodeGroup(String resource,
TestPermissionsRequest testPermissionsRequestResource)
Returns permissions that a caller has on the specified resource.
|
TestPermissionsResponse |
testIamPermissionsNodeGroup(TestIamPermissionsNodeGroupHttpRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNodeGroupHttpRequest,TestPermissionsResponse> |
testIamPermissionsNodeGroupCallable()
Returns permissions that a caller has on the specified resource.
|
protected NodeGroupClient(NodeGroupSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected NodeGroupClient(NodeGroupStub stub)
public static final NodeGroupClient create() throws IOException
IOException
public static final NodeGroupClient create(NodeGroupSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final NodeGroupClient create(NodeGroupStub stub)
public final NodeGroupSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public NodeGroupStub getStub()
@BetaApi public final Operation addNodesNodeGroup(ProjectZoneNodeGroupName nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup, nodeGroupsAddNodesRequestResource);
}
nodeGroup
- Name of the NodeGroup resource.nodeGroupsAddNodesRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation addNodesNodeGroup(String nodeGroup, NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
Operation response = nodeGroupClient.addNodesNodeGroup(nodeGroup.toString(), nodeGroupsAddNodesRequestResource);
}
nodeGroup
- Name of the NodeGroup resource.nodeGroupsAddNodesRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation addNodesNodeGroup(AddNodesNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
AddNodesNodeGroupHttpRequest request = AddNodesNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.setNodeGroupsAddNodesRequestResource(nodeGroupsAddNodesRequestResource)
.build();
Operation response = nodeGroupClient.addNodesNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AddNodesNodeGroupHttpRequest,Operation> addNodesNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsAddNodesRequest nodeGroupsAddNodesRequestResource = NodeGroupsAddNodesRequest.newBuilder().build();
AddNodesNodeGroupHttpRequest request = AddNodesNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.setNodeGroupsAddNodesRequestResource(nodeGroupsAddNodesRequestResource)
.build();
ApiFuture<Operation> future = nodeGroupClient.addNodesNodeGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final NodeGroupClient.AggregatedListNodeGroupsPagedResponse aggregatedListNodeGroups(ProjectName project)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (NodeGroupsScopedList element : nodeGroupClient.aggregatedListNodeGroups(project).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroupClient.AggregatedListNodeGroupsPagedResponse aggregatedListNodeGroups(String project)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
for (NodeGroupsScopedList element : nodeGroupClient.aggregatedListNodeGroups(project.toString()).iterateAll()) {
// doThingsWith(element);
}
}
project
- Project ID for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroupClient.AggregatedListNodeGroupsPagedResponse aggregatedListNodeGroups(AggregatedListNodeGroupsHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListNodeGroupsHttpRequest request = AggregatedListNodeGroupsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
for (NodeGroupsScopedList element : nodeGroupClient.aggregatedListNodeGroups(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNodeGroupsHttpRequest,NodeGroupClient.AggregatedListNodeGroupsPagedResponse> aggregatedListNodeGroupsPagedCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListNodeGroupsHttpRequest request = AggregatedListNodeGroupsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
ApiFuture<AggregatedListNodeGroupsPagedResponse> future = nodeGroupClient.aggregatedListNodeGroupsPagedCallable().futureCall(request);
// Do something
for (NodeGroupsScopedList element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<AggregatedListNodeGroupsHttpRequest,NodeGroupAggregatedList> aggregatedListNodeGroupsCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedProject = ProjectName.format("[PROJECT]");
AggregatedListNodeGroupsHttpRequest request = AggregatedListNodeGroupsHttpRequest.newBuilder()
.setProject(formattedProject)
.build();
while (true) {
NodeGroupAggregatedList response = nodeGroupClient.aggregatedListNodeGroupsCallable().call(request);
for (NodeGroupsScopedList element : response.getItemsMap()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Operation deleteNodeGroup(ProjectZoneNodeGroupName nodeGroup)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
Operation response = nodeGroupClient.deleteNodeGroup(nodeGroup);
}
nodeGroup
- Name of the NodeGroup resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteNodeGroup(String nodeGroup)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
Operation response = nodeGroupClient.deleteNodeGroup(nodeGroup.toString());
}
nodeGroup
- Name of the NodeGroup resource to delete.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteNodeGroup(DeleteNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
DeleteNodeGroupHttpRequest request = DeleteNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
Operation response = nodeGroupClient.deleteNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DeleteNodeGroupHttpRequest,Operation> deleteNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
DeleteNodeGroupHttpRequest request = DeleteNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
ApiFuture<Operation> future = nodeGroupClient.deleteNodeGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final Operation deleteNodesNodeGroup(ProjectZoneNodeGroupName nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
Operation response = nodeGroupClient.deleteNodesNodeGroup(nodeGroup, nodeGroupsDeleteNodesRequestResource);
}
nodeGroup
- Name of the NodeGroup resource whose nodes will be deleted.nodeGroupsDeleteNodesRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteNodesNodeGroup(String nodeGroup, NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
Operation response = nodeGroupClient.deleteNodesNodeGroup(nodeGroup.toString(), nodeGroupsDeleteNodesRequestResource);
}
nodeGroup
- Name of the NodeGroup resource whose nodes will be deleted.nodeGroupsDeleteNodesRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation deleteNodesNodeGroup(DeleteNodesNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
DeleteNodesNodeGroupHttpRequest request = DeleteNodesNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.setNodeGroupsDeleteNodesRequestResource(nodeGroupsDeleteNodesRequestResource)
.build();
Operation response = nodeGroupClient.deleteNodesNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<DeleteNodesNodeGroupHttpRequest,Operation> deleteNodesNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsDeleteNodesRequest nodeGroupsDeleteNodesRequestResource = NodeGroupsDeleteNodesRequest.newBuilder().build();
DeleteNodesNodeGroupHttpRequest request = DeleteNodesNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.setNodeGroupsDeleteNodesRequestResource(nodeGroupsDeleteNodesRequestResource)
.build();
ApiFuture<Operation> future = nodeGroupClient.deleteNodesNodeGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final NodeGroup getNodeGroup(ProjectZoneNodeGroupName nodeGroup)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroup response = nodeGroupClient.getNodeGroup(nodeGroup);
}
nodeGroup
- Name of the node group to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroup getNodeGroup(String nodeGroup)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroup response = nodeGroupClient.getNodeGroup(nodeGroup.toString());
}
nodeGroup
- Name of the node group to return.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroup getNodeGroup(GetNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
GetNodeGroupHttpRequest request = GetNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
NodeGroup response = nodeGroupClient.getNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetNodeGroupHttpRequest,NodeGroup> getNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
GetNodeGroupHttpRequest request = GetNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
ApiFuture<NodeGroup> future = nodeGroupClient.getNodeGroupCallable().futureCall(request);
// Do something
NodeGroup response = future.get();
}
@BetaApi public final Policy getIamPolicyNodeGroup(ProjectZoneNodeGroupResourceName resource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
Policy response = nodeGroupClient.getIamPolicyNodeGroup(resource);
}
resource
- Name or id of the resource for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Policy getIamPolicyNodeGroup(String resource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
Policy response = nodeGroupClient.getIamPolicyNodeGroup(resource.toString());
}
resource
- Name or id of the resource for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Policy getIamPolicyNodeGroup(GetIamPolicyNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedResource = ProjectZoneNodeGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
GetIamPolicyNodeGroupHttpRequest request = GetIamPolicyNodeGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.build();
Policy response = nodeGroupClient.getIamPolicyNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<GetIamPolicyNodeGroupHttpRequest,Policy> getIamPolicyNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedResource = ProjectZoneNodeGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
GetIamPolicyNodeGroupHttpRequest request = GetIamPolicyNodeGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.build();
ApiFuture<Policy> future = nodeGroupClient.getIamPolicyNodeGroupCallable().futureCall(request);
// Do something
Policy response = future.get();
}
@BetaApi public final Operation insertNodeGroup(Integer initialNodeCount, ProjectZoneName zone, NodeGroup nodeGroupResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
Integer initialNodeCount = 0;
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
Operation response = nodeGroupClient.insertNodeGroup(initialNodeCount, zone, nodeGroupResource);
}
initialNodeCount
- Initial count of nodes in the node group.zone
- The name of the zone for this request.nodeGroupResource
- Represent a sole-tenant Node Group resource.
A sole-tenant node is a physical server that is dedicated to hosting VM instances only for your specific project. Use sole-tenant nodes to keep your instances physically separated from instances in other projects, or to group your instances together on the same host hardware. For more information, read Sole-tenant nodes. (== resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==) NextID: 15
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertNodeGroup(Integer initialNodeCount, String zone, NodeGroup nodeGroupResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
Integer initialNodeCount = 0;
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
Operation response = nodeGroupClient.insertNodeGroup(initialNodeCount, zone.toString(), nodeGroupResource);
}
initialNodeCount
- Initial count of nodes in the node group.zone
- The name of the zone for this request.nodeGroupResource
- Represent a sole-tenant Node Group resource.
A sole-tenant node is a physical server that is dedicated to hosting VM instances only for your specific project. Use sole-tenant nodes to keep your instances physically separated from instances in other projects, or to group your instances together on the same host hardware. For more information, read Sole-tenant nodes. (== resource_for beta.nodeGroups ==) (== resource_for v1.nodeGroups ==) NextID: 15
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation insertNodeGroup(InsertNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
Integer initialNodeCount = 0;
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
InsertNodeGroupHttpRequest request = InsertNodeGroupHttpRequest.newBuilder()
.setInitialNodeCount(initialNodeCount)
.setZone(formattedZone)
.setNodeGroupResource(nodeGroupResource)
.build();
Operation response = nodeGroupClient.insertNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<InsertNodeGroupHttpRequest,Operation> insertNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
Integer initialNodeCount = 0;
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
NodeGroup nodeGroupResource = NodeGroup.newBuilder().build();
InsertNodeGroupHttpRequest request = InsertNodeGroupHttpRequest.newBuilder()
.setInitialNodeCount(initialNodeCount)
.setZone(formattedZone)
.setNodeGroupResource(nodeGroupResource)
.build();
ApiFuture<Operation> future = nodeGroupClient.insertNodeGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final NodeGroupClient.ListNodeGroupsPagedResponse listNodeGroups(ProjectZoneName zone)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
for (NodeGroup element : nodeGroupClient.listNodeGroups(zone).iterateAll()) {
// doThingsWith(element);
}
}
zone
- The name of the zone for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroupClient.ListNodeGroupsPagedResponse listNodeGroups(String zone)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneName zone = ProjectZoneName.of("[PROJECT]", "[ZONE]");
for (NodeGroup element : nodeGroupClient.listNodeGroups(zone.toString()).iterateAll()) {
// doThingsWith(element);
}
}
zone
- The name of the zone for this request.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroupClient.ListNodeGroupsPagedResponse listNodeGroups(ListNodeGroupsHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
ListNodeGroupsHttpRequest request = ListNodeGroupsHttpRequest.newBuilder()
.setZone(formattedZone)
.build();
for (NodeGroup element : nodeGroupClient.listNodeGroups(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNodeGroupsHttpRequest,NodeGroupClient.ListNodeGroupsPagedResponse> listNodeGroupsPagedCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
ListNodeGroupsHttpRequest request = ListNodeGroupsHttpRequest.newBuilder()
.setZone(formattedZone)
.build();
ApiFuture<ListNodeGroupsPagedResponse> future = nodeGroupClient.listNodeGroupsPagedCallable().futureCall(request);
// Do something
for (NodeGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNodeGroupsHttpRequest,NodeGroupList> listNodeGroupsCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedZone = ProjectZoneName.format("[PROJECT]", "[ZONE]");
ListNodeGroupsHttpRequest request = ListNodeGroupsHttpRequest.newBuilder()
.setZone(formattedZone)
.build();
while (true) {
NodeGroupList response = nodeGroupClient.listNodeGroupsCallable().call(request);
for (NodeGroup element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final NodeGroupClient.ListNodesNodeGroupsPagedResponse listNodesNodeGroups(ProjectZoneNodeGroupName nodeGroup)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
for (NodeGroupNode element : nodeGroupClient.listNodesNodeGroups(nodeGroup).iterateAll()) {
// doThingsWith(element);
}
}
nodeGroup
- Name of the NodeGroup resource whose nodes you want to list.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroupClient.ListNodesNodeGroupsPagedResponse listNodesNodeGroups(String nodeGroup)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
for (NodeGroupNode element : nodeGroupClient.listNodesNodeGroups(nodeGroup.toString()).iterateAll()) {
// doThingsWith(element);
}
}
nodeGroup
- Name of the NodeGroup resource whose nodes you want to list.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final NodeGroupClient.ListNodesNodeGroupsPagedResponse listNodesNodeGroups(ListNodesNodeGroupsHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
for (NodeGroupNode element : nodeGroupClient.listNodesNodeGroups(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 fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNodesNodeGroupsHttpRequest,NodeGroupClient.ListNodesNodeGroupsPagedResponse> listNodesNodeGroupsPagedCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
ApiFuture<ListNodesNodeGroupsPagedResponse> future = nodeGroupClient.listNodesNodeGroupsPagedCallable().futureCall(request);
// Do something
for (NodeGroupNode element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
@BetaApi public final com.google.api.gax.rpc.UnaryCallable<ListNodesNodeGroupsHttpRequest,NodeGroupsListNodes> listNodesNodeGroupsCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
ListNodesNodeGroupsHttpRequest request = ListNodesNodeGroupsHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.build();
while (true) {
NodeGroupsListNodes response = nodeGroupClient.listNodesNodeGroupsCallable().call(request);
for (NodeGroupNode element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
@BetaApi public final Policy setIamPolicyNodeGroup(ProjectZoneNodeGroupResourceName resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
Policy response = nodeGroupClient.setIamPolicyNodeGroup(resource, zoneSetPolicyRequestResource);
}
resource
- Name or id of the resource for this request.zoneSetPolicyRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Policy setIamPolicyNodeGroup(String resource, ZoneSetPolicyRequest zoneSetPolicyRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
Policy response = nodeGroupClient.setIamPolicyNodeGroup(resource.toString(), zoneSetPolicyRequestResource);
}
resource
- Name or id of the resource for this request.zoneSetPolicyRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Policy setIamPolicyNodeGroup(SetIamPolicyNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedResource = ProjectZoneNodeGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
SetIamPolicyNodeGroupHttpRequest request = SetIamPolicyNodeGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
.build();
Policy response = nodeGroupClient.setIamPolicyNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<SetIamPolicyNodeGroupHttpRequest,Policy> setIamPolicyNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedResource = ProjectZoneNodeGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
ZoneSetPolicyRequest zoneSetPolicyRequestResource = ZoneSetPolicyRequest.newBuilder().build();
SetIamPolicyNodeGroupHttpRequest request = SetIamPolicyNodeGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.setZoneSetPolicyRequestResource(zoneSetPolicyRequestResource)
.build();
ApiFuture<Policy> future = nodeGroupClient.setIamPolicyNodeGroupCallable().futureCall(request);
// Do something
Policy response = future.get();
}
@BetaApi public final Operation setNodeTemplateNodeGroup(ProjectZoneNodeGroupName nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
Operation response = nodeGroupClient.setNodeTemplateNodeGroup(nodeGroup, nodeGroupsSetNodeTemplateRequestResource);
}
nodeGroup
- Name of the NodeGroup resource to update.nodeGroupsSetNodeTemplateRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setNodeTemplateNodeGroup(String nodeGroup, NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupName nodeGroup = ProjectZoneNodeGroupName.of("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
Operation response = nodeGroupClient.setNodeTemplateNodeGroup(nodeGroup.toString(), nodeGroupsSetNodeTemplateRequestResource);
}
nodeGroup
- Name of the NodeGroup resource to update.nodeGroupsSetNodeTemplateRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final Operation setNodeTemplateNodeGroup(SetNodeTemplateNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
SetNodeTemplateNodeGroupHttpRequest request = SetNodeTemplateNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.setNodeGroupsSetNodeTemplateRequestResource(nodeGroupsSetNodeTemplateRequestResource)
.build();
Operation response = nodeGroupClient.setNodeTemplateNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<SetNodeTemplateNodeGroupHttpRequest,Operation> setNodeTemplateNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedNodeGroup = ProjectZoneNodeGroupName.format("[PROJECT]", "[ZONE]", "[NODE_GROUP]");
NodeGroupsSetNodeTemplateRequest nodeGroupsSetNodeTemplateRequestResource = NodeGroupsSetNodeTemplateRequest.newBuilder().build();
SetNodeTemplateNodeGroupHttpRequest request = SetNodeTemplateNodeGroupHttpRequest.newBuilder()
.setNodeGroup(formattedNodeGroup)
.setNodeGroupsSetNodeTemplateRequestResource(nodeGroupsSetNodeTemplateRequestResource)
.build();
ApiFuture<Operation> future = nodeGroupClient.setNodeTemplateNodeGroupCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi public final TestPermissionsResponse testIamPermissionsNodeGroup(ProjectZoneNodeGroupResourceName resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response = nodeGroupClient.testIamPermissionsNodeGroup(resource, testPermissionsRequestResource);
}
resource
- Name or id of the resource for this request.testPermissionsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final TestPermissionsResponse testIamPermissionsNodeGroup(String resource, TestPermissionsRequest testPermissionsRequestResource)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
ProjectZoneNodeGroupResourceName resource = ProjectZoneNodeGroupResourceName.of("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestPermissionsResponse response = nodeGroupClient.testIamPermissionsNodeGroup(resource.toString(), testPermissionsRequestResource);
}
resource
- Name or id of the resource for this request.testPermissionsRequestResource
- com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final TestPermissionsResponse testIamPermissionsNodeGroup(TestIamPermissionsNodeGroupHttpRequest request)
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedResource = ProjectZoneNodeGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestIamPermissionsNodeGroupHttpRequest request = TestIamPermissionsNodeGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.setTestPermissionsRequestResource(testPermissionsRequestResource)
.build();
TestPermissionsResponse response = nodeGroupClient.testIamPermissionsNodeGroup(request);
}
request
- The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi public final com.google.api.gax.rpc.UnaryCallable<TestIamPermissionsNodeGroupHttpRequest,TestPermissionsResponse> testIamPermissionsNodeGroupCallable()
Sample code:
try (NodeGroupClient nodeGroupClient = NodeGroupClient.create()) {
String formattedResource = ProjectZoneNodeGroupResourceName.format("[PROJECT]", "[ZONE]", "[RESOURCE]");
TestPermissionsRequest testPermissionsRequestResource = TestPermissionsRequest.newBuilder().build();
TestIamPermissionsNodeGroupHttpRequest request = TestIamPermissionsNodeGroupHttpRequest.newBuilder()
.setResource(formattedResource)
.setTestPermissionsRequestResource(testPermissionsRequestResource)
.build();
ApiFuture<TestPermissionsResponse> future = nodeGroupClient.testIamPermissionsNodeGroupCallable().futureCall(request);
// Do something
TestPermissionsResponse response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.