@Generated(value="by gapic-generator") @BetaApi public class GameServerDeploymentsServiceClient 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 (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(formattedName);
}
Note: close() needs to be called on the gameServerDeploymentsServiceClient 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 GameServerDeploymentsServiceSettings to create(). For example:
To customize credentials:
GameServerDeploymentsServiceSettings gameServerDeploymentsServiceSettings =
GameServerDeploymentsServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
GameServerDeploymentsServiceClient.create(gameServerDeploymentsServiceSettings);
To customize the endpoint:
GameServerDeploymentsServiceSettings gameServerDeploymentsServiceSettings =
GameServerDeploymentsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient =
GameServerDeploymentsServiceClient.create(gameServerDeploymentsServiceSettings);
Modifier and Type | Class and Description |
---|---|
static class |
GameServerDeploymentsServiceClient.ListGameServerDeploymentsFixedSizeCollection |
static class |
GameServerDeploymentsServiceClient.ListGameServerDeploymentsPage |
static class |
GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
GameServerDeploymentsServiceClient(GameServerDeploymentsServiceSettings settings)
Constructs an instance of GameServerDeploymentsServiceClient, using the given settings.
|
protected |
GameServerDeploymentsServiceClient(GameServerDeploymentsServiceStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
commitRolloutAsync(CommitRolloutRequest request)
Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
commitRolloutAsync(String name)
Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.rpc.UnaryCallable<CommitRolloutRequest,com.google.longrunning.Operation> |
commitRolloutCallable()
Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.rpc.OperationCallable<CommitRolloutRequest,GameServerDeployment,Empty> |
commitRolloutOperationCallable()
Commits the ongoing game server deployment rollout by setting the rollout percentage to 100 in
all clusters whose labels match labels in the game server template.
|
static GameServerDeploymentsServiceClient |
create()
Constructs an instance of GameServerDeploymentsServiceClient with default settings.
|
static GameServerDeploymentsServiceClient |
create(GameServerDeploymentsServiceSettings settings)
Constructs an instance of GameServerDeploymentsServiceClient, using the given settings.
|
static GameServerDeploymentsServiceClient |
create(GameServerDeploymentsServiceStub stub)
Constructs an instance of GameServerDeploymentsServiceClient, using the given stub for making
calls.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
createGameServerDeploymentAsync(CreateGameServerDeploymentRequest request)
Creates a new game server deployment in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
createGameServerDeploymentAsync(String parent,
String deploymentId,
GameServerDeployment gameServerDeployment)
Creates a new game server deployment in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateGameServerDeploymentRequest,com.google.longrunning.Operation> |
createGameServerDeploymentCallable()
Creates a new game server deployment in a given project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateGameServerDeploymentRequest,GameServerDeployment,Empty> |
createGameServerDeploymentOperationCallable()
Creates a new game server deployment in a given project and location.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Empty> |
deleteGameServerDeploymentAsync(DeleteGameServerDeploymentRequest request)
Deletes a single game server deployment.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Empty> |
deleteGameServerDeploymentAsync(String name)
Deletes a single game server deployment.
|
com.google.api.gax.rpc.UnaryCallable<DeleteGameServerDeploymentRequest,com.google.longrunning.Operation> |
deleteGameServerDeploymentCallable()
Deletes a single game server deployment.
|
com.google.api.gax.rpc.OperationCallable<DeleteGameServerDeploymentRequest,Empty,Empty> |
deleteGameServerDeploymentOperationCallable()
Deletes a single game server deployment.
|
static String |
formatGameServerDeploymentName(String project,
String location,
String gameServerDeployment)
Deprecated.
Use the
GameServerDeploymentName class instead. |
static String |
formatLocationName(String project,
String location)
Deprecated.
Use the
LocationName class instead. |
DeploymentTarget |
getDeploymentTarget(GetDeploymentTargetRequest request)
Retrieves information on the rollout target of the deployment, e.g.
|
DeploymentTarget |
getDeploymentTarget(String name)
Retrieves information on the rollout target of the deployment, e.g.
|
com.google.api.gax.rpc.UnaryCallable<GetDeploymentTargetRequest,DeploymentTarget> |
getDeploymentTargetCallable()
Retrieves information on the rollout target of the deployment, e.g.
|
GameServerDeployment |
getGameServerDeployment(GetGameServerDeploymentRequest request)
Gets details of a single game server deployment.
|
GameServerDeployment |
getGameServerDeployment(String name)
Gets details of a single game server deployment.
|
com.google.api.gax.rpc.UnaryCallable<GetGameServerDeploymentRequest,GameServerDeployment> |
getGameServerDeploymentCallable()
Gets details of a single game server deployment.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
GameServerDeploymentsServiceSettings |
getSettings() |
GameServerDeploymentsServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse |
listGameServerDeployments(ListGameServerDeploymentsRequest request)
Lists game server deployments in a given project and location.
|
GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse |
listGameServerDeployments(String parent)
Lists game server deployments in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListGameServerDeploymentsRequest,ListGameServerDeploymentsResponse> |
listGameServerDeploymentsCallable()
Lists game server deployments in a given project and location.
|
com.google.api.gax.rpc.UnaryCallable<ListGameServerDeploymentsRequest,GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse> |
listGameServerDeploymentsPagedCallable()
Lists game server deployments in a given project and location.
|
static String |
parseGameServerDeploymentFromGameServerDeploymentName(String gameServerDeploymentName)
Deprecated.
Use the
GameServerDeploymentName class instead. |
static String |
parseLocationFromGameServerDeploymentName(String gameServerDeploymentName)
Deprecated.
Use the
GameServerDeploymentName class instead. |
static String |
parseLocationFromLocationName(String locationName)
Deprecated.
Use the
LocationName class instead. |
static String |
parseProjectFromGameServerDeploymentName(String gameServerDeploymentName)
Deprecated.
Use the
GameServerDeploymentName class instead. |
static String |
parseProjectFromLocationName(String locationName)
Deprecated.
Use the
LocationName class instead. |
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
revertRolloutAsync(RevertRolloutRequest request)
Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
revertRolloutAsync(String name)
Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.rpc.UnaryCallable<RevertRolloutRequest,com.google.longrunning.Operation> |
revertRolloutCallable()
Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.rpc.OperationCallable<RevertRolloutRequest,GameServerDeployment,Empty> |
revertRolloutOperationCallable()
Rolls back the ongoing game server deployment rollout by setting the rollout percentage to 0 in
all clusters whose labels match labels in the game server template.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
setRolloutTargetAsync(SetRolloutTargetRequest request)
Sets rollout target for the ongoing game server deployment rollout in the specified clusters
and based on the given rollout percentage.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
setRolloutTargetAsync(String name,
List<ClusterPercentageSelector> clusterPercentageSelector)
Sets rollout target for the ongoing game server deployment rollout in the specified clusters
and based on the given rollout percentage.
|
com.google.api.gax.rpc.UnaryCallable<SetRolloutTargetRequest,com.google.longrunning.Operation> |
setRolloutTargetCallable()
Sets rollout target for the ongoing game server deployment rollout in the specified clusters
and based on the given rollout percentage.
|
com.google.api.gax.rpc.OperationCallable<SetRolloutTargetRequest,GameServerDeployment,Empty> |
setRolloutTargetOperationCallable()
Sets rollout target for the ongoing game server deployment rollout in the specified clusters
and based on the given rollout percentage.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
startRolloutAsync(StartRolloutRequest request)
Starts rollout of this game server deployment based on the given game server template.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
startRolloutAsync(String name,
GameServerTemplate newGameServerTemplate)
Starts rollout of this game server deployment based on the given game server template.
|
com.google.api.gax.rpc.UnaryCallable<StartRolloutRequest,com.google.longrunning.Operation> |
startRolloutCallable()
Starts rollout of this game server deployment based on the given game server template.
|
com.google.api.gax.rpc.OperationCallable<StartRolloutRequest,GameServerDeployment,Empty> |
startRolloutOperationCallable()
Starts rollout of this game server deployment based on the given game server template.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
updateGameServerDeploymentAsync(GameServerDeployment gameServerDeployment,
FieldMask updateMask)
Patches a game server deployment.
|
com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> |
updateGameServerDeploymentAsync(UpdateGameServerDeploymentRequest request)
Patches a game server deployment.
|
com.google.api.gax.rpc.UnaryCallable<UpdateGameServerDeploymentRequest,com.google.longrunning.Operation> |
updateGameServerDeploymentCallable()
Patches a game server deployment.
|
com.google.api.gax.rpc.OperationCallable<UpdateGameServerDeploymentRequest,GameServerDeployment,Empty> |
updateGameServerDeploymentOperationCallable()
Patches a game server deployment.
|
protected GameServerDeploymentsServiceClient(GameServerDeploymentsServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected GameServerDeploymentsServiceClient(GameServerDeploymentsServiceStub stub)
@Deprecated public static final String formatGameServerDeploymentName(String project, String location, String gameServerDeployment)
GameServerDeploymentName
class instead.@Deprecated public static final String formatLocationName(String project, String location)
LocationName
class instead.@Deprecated public static final String parseProjectFromGameServerDeploymentName(String gameServerDeploymentName)
GameServerDeploymentName
class instead.@Deprecated public static final String parseLocationFromGameServerDeploymentName(String gameServerDeploymentName)
GameServerDeploymentName
class instead.@Deprecated public static final String parseGameServerDeploymentFromGameServerDeploymentName(String gameServerDeploymentName)
GameServerDeploymentName
class instead.@Deprecated public static final String parseProjectFromLocationName(String locationName)
LocationName
class instead.@Deprecated public static final String parseLocationFromLocationName(String locationName)
LocationName
class instead.public static final GameServerDeploymentsServiceClient create() throws IOException
IOException
public static final GameServerDeploymentsServiceClient create(GameServerDeploymentsServiceSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final GameServerDeploymentsServiceClient create(GameServerDeploymentsServiceStub stub)
public final GameServerDeploymentsServiceSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public GameServerDeploymentsServiceStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.longrunning.OperationsClient getOperationsClient()
public final GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse listGameServerDeployments(String parent)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
for (GameServerDeployment element : gameServerDeploymentsServiceClient.listGameServerDeployments(formattedParent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The parent resource name, using the form:
`projects/{project_id}/locations/{location}`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse listGameServerDeployments(ListGameServerDeploymentsRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
ListGameServerDeploymentsRequest request = ListGameServerDeploymentsRequest.newBuilder()
.setParent(formattedParent)
.build();
for (GameServerDeployment element : gameServerDeploymentsServiceClient.listGameServerDeployments(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<ListGameServerDeploymentsRequest,GameServerDeploymentsServiceClient.ListGameServerDeploymentsPagedResponse> listGameServerDeploymentsPagedCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
ListGameServerDeploymentsRequest request = ListGameServerDeploymentsRequest.newBuilder()
.setParent(formattedParent)
.build();
ApiFuture<ListGameServerDeploymentsPagedResponse> future = gameServerDeploymentsServiceClient.listGameServerDeploymentsPagedCallable().futureCall(request);
// Do something
for (GameServerDeployment element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListGameServerDeploymentsRequest,ListGameServerDeploymentsResponse> listGameServerDeploymentsCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
ListGameServerDeploymentsRequest request = ListGameServerDeploymentsRequest.newBuilder()
.setParent(formattedParent)
.build();
while (true) {
ListGameServerDeploymentsResponse response = gameServerDeploymentsServiceClient.listGameServerDeploymentsCallable().call(request);
for (GameServerDeployment element : response.getGameServerDeploymentsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final GameServerDeployment getGameServerDeployment(String name)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(formattedName);
}
name
- Required. The name of the game server deployment to retrieve, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final GameServerDeployment getGameServerDeployment(GetGameServerDeploymentRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GetGameServerDeploymentRequest request = GetGameServerDeploymentRequest.newBuilder()
.setName(formattedName)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.getGameServerDeployment(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<GetGameServerDeploymentRequest,GameServerDeployment> getGameServerDeploymentCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GetGameServerDeploymentRequest request = GetGameServerDeploymentRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<GameServerDeployment> future = gameServerDeploymentsServiceClient.getGameServerDeploymentCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> createGameServerDeploymentAsync(String parent, String deploymentId, GameServerDeployment gameServerDeployment)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
String deploymentId = "";
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
GameServerDeployment response = gameServerDeploymentsServiceClient.createGameServerDeploymentAsync(formattedParent, deploymentId, gameServerDeployment).get();
}
parent
- Required. The parent resource name, using the form:
`projects/{project_id}/locations/{location}`.deploymentId
- Required. The ID of the game server deployment resource to be created.gameServerDeployment
- Required. The game server deployment resource to be created.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> createGameServerDeploymentAsync(CreateGameServerDeploymentRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
String deploymentId = "";
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
CreateGameServerDeploymentRequest request = CreateGameServerDeploymentRequest.newBuilder()
.setParent(formattedParent)
.setDeploymentId(deploymentId)
.setGameServerDeployment(gameServerDeployment)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.createGameServerDeploymentAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<CreateGameServerDeploymentRequest,GameServerDeployment,Empty> createGameServerDeploymentOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
String deploymentId = "";
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
CreateGameServerDeploymentRequest request = CreateGameServerDeploymentRequest.newBuilder()
.setParent(formattedParent)
.setDeploymentId(deploymentId)
.setGameServerDeployment(gameServerDeployment)
.build();
OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.createGameServerDeploymentOperationCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateGameServerDeploymentRequest,com.google.longrunning.Operation> createGameServerDeploymentCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedParent = GameServerDeploymentsServiceClient.formatLocationName("[PROJECT]", "[LOCATION]");
String deploymentId = "";
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
CreateGameServerDeploymentRequest request = CreateGameServerDeploymentRequest.newBuilder()
.setParent(formattedParent)
.setDeploymentId(deploymentId)
.setGameServerDeployment(gameServerDeployment)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.createGameServerDeploymentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Empty,Empty> deleteGameServerDeploymentAsync(String name)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(formattedName).get();
}
name
- Required. The name of the game server deployment to delete, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<Empty,Empty> deleteGameServerDeploymentAsync(DeleteGameServerDeploymentRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
DeleteGameServerDeploymentRequest request = DeleteGameServerDeploymentRequest.newBuilder()
.setName(formattedName)
.build();
gameServerDeploymentsServiceClient.deleteGameServerDeploymentAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<DeleteGameServerDeploymentRequest,Empty,Empty> deleteGameServerDeploymentOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
DeleteGameServerDeploymentRequest request = DeleteGameServerDeploymentRequest.newBuilder()
.setName(formattedName)
.build();
OperationFuture<Empty, Empty> future = gameServerDeploymentsServiceClient.deleteGameServerDeploymentOperationCallable().futureCall(request);
// Do something
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteGameServerDeploymentRequest,com.google.longrunning.Operation> deleteGameServerDeploymentCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
DeleteGameServerDeploymentRequest request = DeleteGameServerDeploymentRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.deleteGameServerDeploymentCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> updateGameServerDeploymentAsync(GameServerDeployment gameServerDeployment, FieldMask updateMask)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
GameServerDeployment response = gameServerDeploymentsServiceClient.updateGameServerDeploymentAsync(gameServerDeployment, updateMask).get();
}
gameServerDeployment
- Required. The game server deployment to be updated. Only fields
specified in update_mask are updated.updateMask
- Required. Mask of fields to update. At least one path must be supplied in
this field. For the `FieldMask` definition, see
https: //developers.google.com/protocol-buffers // /docs/reference/google.protobuf#fieldmask
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> updateGameServerDeploymentAsync(UpdateGameServerDeploymentRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateGameServerDeploymentRequest request = UpdateGameServerDeploymentRequest.newBuilder()
.setGameServerDeployment(gameServerDeployment)
.setUpdateMask(updateMask)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.updateGameServerDeploymentAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<UpdateGameServerDeploymentRequest,GameServerDeployment,Empty> updateGameServerDeploymentOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateGameServerDeploymentRequest request = UpdateGameServerDeploymentRequest.newBuilder()
.setGameServerDeployment(gameServerDeployment)
.setUpdateMask(updateMask)
.build();
OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.updateGameServerDeploymentOperationCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateGameServerDeploymentRequest,com.google.longrunning.Operation> updateGameServerDeploymentCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
GameServerDeployment gameServerDeployment = GameServerDeployment.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateGameServerDeploymentRequest request = UpdateGameServerDeploymentRequest.newBuilder()
.setGameServerDeployment(gameServerDeployment)
.setUpdateMask(updateMask)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.updateGameServerDeploymentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> startRolloutAsync(String name, GameServerTemplate newGameServerTemplate)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
GameServerDeployment response = gameServerDeploymentsServiceClient.startRolloutAsync(formattedName, newGameServerTemplate).get();
}
name
- Required. The name of the game server deployment, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
newGameServerTemplate
- Required. The game server template for the new rollout.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> startRolloutAsync(StartRolloutRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
StartRolloutRequest request = StartRolloutRequest.newBuilder()
.setName(formattedName)
.setNewGameServerTemplate(newGameServerTemplate)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.startRolloutAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<StartRolloutRequest,GameServerDeployment,Empty> startRolloutOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
StartRolloutRequest request = StartRolloutRequest.newBuilder()
.setName(formattedName)
.setNewGameServerTemplate(newGameServerTemplate)
.build();
OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.startRolloutOperationCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<StartRolloutRequest,com.google.longrunning.Operation> startRolloutCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerTemplate newGameServerTemplate = GameServerTemplate.newBuilder().build();
StartRolloutRequest request = StartRolloutRequest.newBuilder()
.setName(formattedName)
.setNewGameServerTemplate(newGameServerTemplate)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.startRolloutCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> setRolloutTargetAsync(String name, List<ClusterPercentageSelector> clusterPercentageSelector)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
GameServerDeployment response = gameServerDeploymentsServiceClient.setRolloutTargetAsync(formattedName, clusterPercentageSelector).get();
}
name
- Required. The name of the game server deployment, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
clusterPercentageSelector
- Required. The percentage of game servers that should run the
new game server template in the specified clusters. Default is 0.com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> setRolloutTargetAsync(SetRolloutTargetRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
.setName(formattedName)
.addAllClusterPercentageSelector(clusterPercentageSelector)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.setRolloutTargetAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<SetRolloutTargetRequest,GameServerDeployment,Empty> setRolloutTargetOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
.setName(formattedName)
.addAllClusterPercentageSelector(clusterPercentageSelector)
.build();
OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.setRolloutTargetOperationCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<SetRolloutTargetRequest,com.google.longrunning.Operation> setRolloutTargetCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
List<ClusterPercentageSelector> clusterPercentageSelector = new ArrayList<>();
SetRolloutTargetRequest request = SetRolloutTargetRequest.newBuilder()
.setName(formattedName)
.addAllClusterPercentageSelector(clusterPercentageSelector)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.setRolloutTargetCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> commitRolloutAsync(String name)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerDeployment response = gameServerDeploymentsServiceClient.commitRolloutAsync(formattedName).get();
}
name
- Required. The name of the game server deployment, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> commitRolloutAsync(CommitRolloutRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
.setName(formattedName)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.commitRolloutAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<CommitRolloutRequest,GameServerDeployment,Empty> commitRolloutOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
.setName(formattedName)
.build();
OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.commitRolloutOperationCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CommitRolloutRequest,com.google.longrunning.Operation> commitRolloutCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
CommitRolloutRequest request = CommitRolloutRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.commitRolloutCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> revertRolloutAsync(String name)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GameServerDeployment response = gameServerDeploymentsServiceClient.revertRolloutAsync(formattedName).get();
}
name
- Required. The name of the game server deployment to deploy, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
com.google.api.gax.rpc.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final com.google.api.gax.longrunning.OperationFuture<GameServerDeployment,Empty> revertRolloutAsync(RevertRolloutRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
.setName(formattedName)
.build();
GameServerDeployment response = gameServerDeploymentsServiceClient.revertRolloutAsync(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 fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final com.google.api.gax.rpc.OperationCallable<RevertRolloutRequest,GameServerDeployment,Empty> revertRolloutOperationCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
.setName(formattedName)
.build();
OperationFuture<GameServerDeployment, Empty> future = gameServerDeploymentsServiceClient.revertRolloutOperationCallable().futureCall(request);
// Do something
GameServerDeployment response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<RevertRolloutRequest,com.google.longrunning.Operation> revertRolloutCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
RevertRolloutRequest request = RevertRolloutRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<Operation> future = gameServerDeploymentsServiceClient.revertRolloutCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final DeploymentTarget getDeploymentTarget(String name)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
DeploymentTarget response = gameServerDeploymentsServiceClient.getDeploymentTarget(formattedName);
}
name
- Required. The name of the game server deployment, using the form:
`projects/{project_id}/locations/{location}/gameServerDeployments/{deployment_id}`
com.google.api.gax.rpc.ApiException
- if the remote call failspublic final DeploymentTarget getDeploymentTarget(GetDeploymentTargetRequest request)
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GetDeploymentTargetRequest request = GetDeploymentTargetRequest.newBuilder()
.setName(formattedName)
.build();
DeploymentTarget response = gameServerDeploymentsServiceClient.getDeploymentTarget(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<GetDeploymentTargetRequest,DeploymentTarget> getDeploymentTargetCallable()
Sample code:
try (GameServerDeploymentsServiceClient gameServerDeploymentsServiceClient = GameServerDeploymentsServiceClient.create()) {
String formattedName = GameServerDeploymentsServiceClient.formatGameServerDeploymentName("[PROJECT]", "[LOCATION]", "[GAME_SERVER_DEPLOYMENT]");
GetDeploymentTargetRequest request = GetDeploymentTargetRequest.newBuilder()
.setName(formattedName)
.build();
ApiFuture<DeploymentTarget> future = gameServerDeploymentsServiceClient.getDeploymentTargetCallable().futureCall(request);
// Do something
DeploymentTarget 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.