Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
feat: check status of long running operation by its name (#65)
Browse files Browse the repository at this point in the history
For each client method returning a long running operation, a separate method to check its status is added.

Added methods: `checkCreateGameServerClusterProgress`, `checkCreateGameServerConfigProgress`, `checkCreateGameServerDeploymentProgress`, `checkCreateRealmProgress`, `checkDeleteGameServerClusterProgress`, `checkDeleteGameServerConfigProgress`, `checkDeleteGameServerDeploymentProgress`, `checkDeleteRealmProgress`, `checkUpdateGameServerClusterProgress`, `checkUpdateGameServerDeploymentProgress`, `checkUpdateGameServerDeploymentRolloutProgress`, `checkUpdateRealmProgress`.
  • Loading branch information
alexander-fenster committed May 6, 2020
1 parent dbccfc4 commit 3900875
Show file tree
Hide file tree
Showing 21 changed files with 1,194 additions and 186 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ has instructions for running the samples.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) |
| Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) |
| Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) |
| Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) |
| Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) |
| Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) |
| List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) |
| List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) |
| Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |

Expand Down
3 changes: 1 addition & 2 deletions protos/google/cloud/gaming/v1beta/common.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down
22 changes: 16 additions & 6 deletions protos/google/cloud/gaming/v1beta/game_server_clusters.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand All @@ -35,7 +35,7 @@ message ListGameServerClustersRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerCluster"
child_type: "gameservices.googleapis.com/GameServerCluster"
}
];

Expand Down Expand Up @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerCluster"
child_type: "gameservices.googleapis.com/GameServerCluster"
}
];

Expand All @@ -105,7 +105,12 @@ message CreateGameServerClusterRequest {
message PreviewCreateGameServerClusterRequest {
// Required. The parent resource name. Uses the form:
// `projects/{project}/locations/{location}/realms/{realm}`.
string parent = 1 [(google.api.field_behavior) = REQUIRED];
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
child_type: "gameservices.googleapis.com/GameServerCluster"
}
];

// Required. The ID of the Game Server Cluster resource to be created.
string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];
Expand Down Expand Up @@ -143,7 +148,12 @@ message DeleteGameServerClusterRequest {
message PreviewDeleteGameServerClusterRequest {
// Required. The name of the Game Server Cluster to delete. Uses the form:
// `projects/{project}/locations/{location}/gameServerClusters/{cluster}`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerCluster"
}
];

// Optional. The target timestamp to compute the preview.
google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -23,6 +22,7 @@ import "google/cloud/gaming/v1beta/game_server_clusters.proto";
import "google/longrunning/operations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand Down
8 changes: 4 additions & 4 deletions protos/google/cloud/gaming/v1beta/game_server_configs.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -24,6 +23,7 @@ import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand All @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerConfig"
child_type: "gameservices.googleapis.com/GameServerConfig"
}
];

Expand Down Expand Up @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerConfig"
child_type: "gameservices.googleapis.com/GameServerConfig"
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -23,6 +22,7 @@ import "google/cloud/gaming/v1beta/game_server_configs.proto";
import "google/longrunning/operations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand All @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerDeployment"
child_type: "gameservices.googleapis.com/GameServerDeployment"
}
];

Expand Down Expand Up @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/GameServerDeployment"
child_type: "gameservices.googleapis.com/GameServerDeployment"
}
];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -23,6 +22,7 @@ import "google/cloud/gaming/v1beta/game_server_deployments.proto";
import "google/longrunning/operations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand Down Expand Up @@ -95,6 +95,11 @@ service GameServerDeploymentsService {
}

// Patches a single Game Server Deployment Rollout.
// The method will not return an error if the update does not affect any
// existing realms. For example - if the default_game_server_config is changed
// but all existing realms use the override, that is valid. Similarly, if a
// non existing realm is explicitly called out in game_server_config_overrides
// field, that will also not result in an error.
rpc UpdateGameServerDeploymentRollout(UpdateGameServerDeploymentRolloutRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
patch: "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout"
Expand Down
8 changes: 4 additions & 4 deletions protos/google/cloud/gaming/v1beta/realms.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand All @@ -35,7 +35,7 @@ message ListRealmsRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/Realm"
child_type: "gameservices.googleapis.com/Realm"
}
];

Expand Down Expand Up @@ -90,7 +90,7 @@ message CreateRealmRequest {
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "gameservices.googleapis.com/Realm"
child_type: "gameservices.googleapis.com/Realm"
}
];

Expand Down
4 changes: 2 additions & 2 deletions protos/google/cloud/gaming/v1beta/realms_service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -23,6 +22,7 @@ import "google/cloud/gaming/v1beta/realms.proto";
import "google/longrunning/operations.proto";

option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming";

option java_multiple_files = true;
option java_package = "com.google.cloud.gaming.v1beta";

Expand Down
Loading

0 comments on commit 3900875

Please sign in to comment.