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

Commit

Permalink
fix: correct return type of delete operations (#79)
Browse files Browse the repository at this point in the history
Response type of Delete LRO is changed.
Technically, a breaking change, but the previous code never worked,
so considering this to be a regular fix.
fix: increase timeout for CreateGameServerCluster
build: use bazel build

Co-authored-by: Justin Beckwith <justin.beckwith@gmail.com>
  • Loading branch information
alexander-fenster and JustinBeckwith committed Jul 9, 2020
1 parent 066459a commit e946632
Show file tree
Hide file tree
Showing 24 changed files with 421 additions and 340 deletions.
19 changes: 9 additions & 10 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 Expand Up @@ -56,7 +55,7 @@ message OperationMetadata {
// Output only. List of Locations that could not be reached.
repeated string unreachable = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Operation status for gameservices API operations. Operation status is in
// Output only. Operation status for Game Services API operations. Operation status is in
// the form of key-value pairs where keys are resource IDs and the values show
// the status of the operation. In case of failures, the value includes an
// error code and error message.
Expand Down Expand Up @@ -90,9 +89,9 @@ message LabelSelector {
map<string, string> labels = 1;
}

// The Realm selector, used to match Realm resources.
// The realm selector, used to match realm resources.
message RealmSelector {
// List of Realms to match.
// List of realms to match.
repeated string realms = 1;
}

Expand All @@ -117,13 +116,13 @@ message Schedule {

// The cron definition of the scheduled event. See
// https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as
// defined by the Realm.
// defined by the realm.
string cron_spec = 4;
}

// Encapsulates Agones fleet spec and Agones autoscaler spec sources.
message SpecSource {
// The Game Server Config resource. Uses the form:
// The game server config resource. Uses the form:
//
// `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}`.
string game_server_config_name = 1;
Expand Down Expand Up @@ -164,17 +163,17 @@ message TargetDetails {
TargetFleetAutoscaler autoscaler = 2;
}

// The Game Server Cluster name. Uses the form:
// The game server cluster name. Uses the form:
//
// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`.
string game_server_cluster_name = 1;

// The Game Server Deployment name. Uses the form:
// The game server deployment name. Uses the form:
//
// `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}`.
string game_server_deployment_name = 2;

// Agones fleet details for Game Server Clusters and Game Server Deployments.
// Agones fleet details for game server clusters and game server deployments.
repeated TargetFleetDetails fleet_details = 3;
}

Expand Down
62 changes: 36 additions & 26 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,12 +35,12 @@ 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"
}
];

// Optional. The maximum number of items to return. If unspecified, server
// will pick an appropriate default. Server may return fewer items than
// Optional. The maximum number of items to return. If unspecified, the server
// will pick an appropriate default. The server may return fewer items than
// requested. A caller should only rely on response's
// [next_page_token][google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token] to
// determine if there are more GameServerClusters left to be queried.
Expand All @@ -59,20 +59,20 @@ message ListGameServerClustersRequest {

// Response message for GameServerClustersService.ListGameServerClusters.
message ListGameServerClustersResponse {
// The list of Game Server Clusters.
// The list of game server clusters.
repeated GameServerCluster game_server_clusters = 1;

// Token to retrieve the next page of results, or empty if there are no more
// results in the list.
string next_page_token = 2;

// List of Locations that could not be reached.
// List of locations that could not be reached.
repeated string unreachable = 4;
}

// Request message for GameServerClustersService.GetGameServerCluster.
message GetGameServerClusterRequest {
// Required. The name of the Game Server Cluster to retrieve. Uses the form:
// Required. The name of the game server cluster to retrieve. Uses the form:
//
// `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`.
string name = 1 [
Expand All @@ -90,27 +90,32 @@ 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"
}
];

// Required. The ID of the Game Server Cluster resource to be created.
// Required. The ID of the game server cluster resource to be created.
string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The Game Server Cluster resource to be created.
// Required. The game server cluster resource to be created.
GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED];
}

// Request message for GameServerClustersService.PreviewCreateGameServerCluster.
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.
// Required. The ID of the game server cluster resource to be created.
string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];

// Required. The Game Server Cluster resource to be created.
// Required. The game server cluster resource to be created.
GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED];

// Optional. The target timestamp to compute the preview.
Expand All @@ -129,7 +134,7 @@ message PreviewCreateGameServerClusterResponse {

// Request message for GameServerClustersService.DeleteGameServerCluster.
message DeleteGameServerClusterRequest {
// Required. The name of the Game Server Cluster to delete. Uses the form:
// 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,
Expand All @@ -141,9 +146,14 @@ message DeleteGameServerClusterRequest {

// Request message for GameServerClustersService.PreviewDeleteGameServerCluster.
message PreviewDeleteGameServerClusterRequest {
// Required. The name of the Game Server Cluster to delete. Uses the form:
// 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 All @@ -161,7 +171,7 @@ message PreviewDeleteGameServerClusterResponse {

// Request message for GameServerClustersService.UpdateGameServerCluster.
message UpdateGameServerClusterRequest {
// Required. The Game Server Cluster to be updated.
// Required. The game server cluster to be updated.
// Only fields specified in update_mask are updated.
GameServerCluster game_server_cluster = 1 [(google.api.field_behavior) = REQUIRED];

Expand All @@ -176,7 +186,7 @@ message UpdateGameServerClusterRequest {

// Request message for GameServerClustersService.UpdateGameServerCluster.
message PreviewUpdateGameServerClusterRequest {
// Required. The Game Server Cluster to be updated.
// Required. The game server cluster to be updated.
// Only fields specified in update_mask are updated.
GameServerCluster game_server_cluster = 1 [(google.api.field_behavior) = REQUIRED];

Expand All @@ -201,15 +211,15 @@ message PreviewUpdateGameServerClusterResponse {
TargetState target_state = 3;
}

// The Game Server Cluster connection information.
// The game server cluster connection information.
message GameServerClusterConnectionInfo {
// The location of the Kubernetes cluster.
oneof cluster_reference {
// Reference to the GKE cluster where the game servers are installed.
GkeClusterReference gke_cluster_reference = 7;
}

// Namespace designated on the Game Server Cluster where the Agones game
// Namespace designated on the game server cluster where the Agones game
// server instances will be created. Existence of the namespace will be
// validated during creation.
string namespace = 5;
Expand All @@ -228,14 +238,14 @@ message GkeClusterReference {
string cluster = 1;
}

// A Game Server Cluster resource.
// A game server cluster resource.
message GameServerCluster {
option (google.api.resource) = {
type: "gameservices.googleapis.com/GameServerCluster"
pattern: "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}"
};

// Required. The resource name of the Game Server Cluster. Uses the form:
// Required. The resource name of the game server cluster. Uses the form:
//
// `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`.
// For example,
Expand All @@ -249,12 +259,12 @@ message GameServerCluster {
// Output only. The last-modified time.
google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

// The labels associated with this Game Server Cluster. Each label is a
// The labels associated with this game server cluster. Each label is a
// key-value pair.
map<string, string> labels = 4;

// Game Server Cluster connection information. This information is used to
// manage Game Server Clusters.
// The game server cluster connection information. This information is used to
// manage game server clusters.
GameServerClusterConnectionInfo connection_info = 5;

// ETag of the resource.
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 All @@ -32,7 +32,7 @@ service GameServerClustersService {
option (google.api.default_host) = "gameservices.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";

// Lists Game Server Clusters in a given project and location.
// Lists game server clusters in a given project and location.
rpc ListGameServerClusters(ListGameServerClustersRequest) returns (ListGameServerClustersResponse) {
option (google.api.http) = {
get: "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters"
Expand Down Expand Up @@ -77,7 +77,7 @@ service GameServerClustersService {
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "GameServerCluster"
response_type: "google.protobuf.Empty"
metadata_type: "OperationMetadata"
};
}
Expand Down
Loading

0 comments on commit e946632

Please sign in to comment.