1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.dataproc.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/dataproc/v1/clusters.proto"; 24import "google/longrunning/operations.proto"; 25import "google/protobuf/duration.proto"; 26 27option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; 28option java_multiple_files = true; 29option java_outer_classname = "NodeGroupsProto"; 30option java_package = "com.google.cloud.dataproc.v1"; 31option (google.api.resource_definition) = { 32 type: "dataproc.googleapis.com/ClusterRegion" 33 pattern: "projects/{project}/regions/{region}/clusters/{cluster}" 34}; 35 36// The `NodeGroupControllerService` provides methods to manage node groups 37// of Compute Engine managed instances. 38service NodeGroupController { 39 option (google.api.default_host) = "dataproc.googleapis.com"; 40 option (google.api.oauth_scopes) = 41 "https://www.googleapis.com/auth/cloud-platform"; 42 43 // Creates a node group in a cluster. The returned 44 // [Operation.metadata][google.longrunning.Operation.metadata] is 45 // [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). 46 rpc CreateNodeGroup(CreateNodeGroupRequest) 47 returns (google.longrunning.Operation) { 48 option (google.api.http) = { 49 post: "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups" 50 body: "node_group" 51 }; 52 option (google.api.method_signature) = "parent,node_group,node_group_id"; 53 option (google.longrunning.operation_info) = { 54 response_type: "NodeGroup" 55 metadata_type: "google.cloud.dataproc.v1.NodeGroupOperationMetadata" 56 }; 57 } 58 59 // Resizes a node group in a cluster. The returned 60 // [Operation.metadata][google.longrunning.Operation.metadata] is 61 // [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). 62 rpc ResizeNodeGroup(ResizeNodeGroupRequest) 63 returns (google.longrunning.Operation) { 64 option (google.api.http) = { 65 post: "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize" 66 body: "*" 67 }; 68 option (google.api.method_signature) = "name,size"; 69 option (google.longrunning.operation_info) = { 70 response_type: "NodeGroup" 71 metadata_type: "google.cloud.dataproc.v1.NodeGroupOperationMetadata" 72 }; 73 } 74 75 // Gets the resource representation for a node group in a 76 // cluster. 77 rpc GetNodeGroup(GetNodeGroupRequest) returns (NodeGroup) { 78 option (google.api.http) = { 79 get: "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}" 80 }; 81 option (google.api.method_signature) = "name"; 82 } 83} 84 85// A request to create a node group. 86message CreateNodeGroupRequest { 87 // Required. The parent resource where this node group will be created. 88 // Format: `projects/{project}/regions/{region}/clusters/{cluster}` 89 string parent = 1 [ 90 (google.api.field_behavior) = REQUIRED, 91 (google.api.resource_reference) = { 92 child_type: "dataproc.googleapis.com/NodeGroup" 93 } 94 ]; 95 96 // Required. The node group to create. 97 NodeGroup node_group = 2 [(google.api.field_behavior) = REQUIRED]; 98 99 // Optional. An optional node group ID. Generated if not specified. 100 // 101 // The ID must contain only letters (a-z, A-Z), numbers (0-9), 102 // underscores (_), and hyphens (-). Cannot begin or end with underscore 103 // or hyphen. Must consist of from 3 to 33 characters. 104 string node_group_id = 4 [(google.api.field_behavior) = OPTIONAL]; 105 106 // Optional. A unique ID used to identify the request. If the server receives 107 // two 108 // [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) 109 // with the same ID, the second request is ignored and the 110 // first [google.longrunning.Operation][google.longrunning.Operation] created 111 // and stored in the backend is returned. 112 // 113 // Recommendation: Set this value to a 114 // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). 115 // 116 // The ID must contain only letters (a-z, A-Z), numbers (0-9), 117 // underscores (_), and hyphens (-). The maximum length is 40 characters. 118 string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; 119} 120 121// A request to resize a node group. 122message ResizeNodeGroupRequest { 123 // Required. The name of the node group to resize. 124 // Format: 125 // `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` 126 string name = 1 [(google.api.field_behavior) = REQUIRED]; 127 128 // Required. The number of running instances for the node group to maintain. 129 // The group adds or removes instances to maintain the number of instances 130 // specified by this parameter. 131 int32 size = 2 [(google.api.field_behavior) = REQUIRED]; 132 133 // Optional. A unique ID used to identify the request. If the server receives 134 // two 135 // [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) 136 // with the same ID, the second request is ignored and the 137 // first [google.longrunning.Operation][google.longrunning.Operation] created 138 // and stored in the backend is returned. 139 // 140 // Recommendation: Set this value to a 141 // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). 142 // 143 // The ID must contain only letters (a-z, A-Z), numbers (0-9), 144 // underscores (_), and hyphens (-). The maximum length is 40 characters. 145 string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; 146 147 // Optional. Timeout for graceful YARN decommissioning. [Graceful 148 // decommissioning] 149 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) 150 // allows the removal of nodes from the Compute Engine node group 151 // without interrupting jobs in progress. This timeout specifies how long to 152 // wait for jobs in progress to finish before forcefully removing nodes (and 153 // potentially interrupting jobs). Default timeout is 0 (for forceful 154 // decommission), and the maximum allowed timeout is 1 day. (see JSON 155 // representation of 156 // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). 157 // 158 // Only supported on Dataproc image versions 1.2 and higher. 159 google.protobuf.Duration graceful_decommission_timeout = 4 160 [(google.api.field_behavior) = OPTIONAL]; 161} 162 163// A request to get a node group . 164message GetNodeGroupRequest { 165 // Required. The name of the node group to retrieve. 166 // Format: 167 // `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` 168 string name = 1 [ 169 (google.api.field_behavior) = REQUIRED, 170 (google.api.resource_reference) = { 171 type: "dataproc.googleapis.com/NodeGroup" 172 } 173 ]; 174} 175