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/sessions.proto"; 24import "google/cloud/dataproc/v1/shared.proto"; 25import "google/protobuf/empty.proto"; 26import "google/protobuf/timestamp.proto"; 27 28option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; 29option java_multiple_files = true; 30option java_outer_classname = "SessionTemplatesProto"; 31option java_package = "com.google.cloud.dataproc.v1"; 32 33// The SessionTemplateController provides methods to manage session templates. 34service SessionTemplateController { 35 option (google.api.default_host) = "dataproc.googleapis.com"; 36 option (google.api.oauth_scopes) = 37 "https://www.googleapis.com/auth/cloud-platform"; 38 39 // Create a session template synchronously. 40 rpc CreateSessionTemplate(CreateSessionTemplateRequest) 41 returns (SessionTemplate) { 42 option (google.api.http) = { 43 post: "/v1/{parent=projects/*/locations/*}/sessionTemplates" 44 body: "session_template" 45 }; 46 option (google.api.method_signature) = "parent,session_template"; 47 } 48 49 // Updates the session template synchronously. 50 rpc UpdateSessionTemplate(UpdateSessionTemplateRequest) 51 returns (SessionTemplate) { 52 option (google.api.http) = { 53 patch: "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}" 54 body: "session_template" 55 }; 56 option (google.api.method_signature) = "session_template"; 57 } 58 59 // Gets the resource representation for a session template. 60 rpc GetSessionTemplate(GetSessionTemplateRequest) returns (SessionTemplate) { 61 option (google.api.http) = { 62 get: "/v1/{name=projects/*/locations/*/sessionTemplates/*}" 63 }; 64 option (google.api.method_signature) = "name"; 65 } 66 67 // Lists session templates. 68 rpc ListSessionTemplates(ListSessionTemplatesRequest) 69 returns (ListSessionTemplatesResponse) { 70 option (google.api.http) = { 71 get: "/v1/{parent=projects/*/locations/*}/sessionTemplates" 72 }; 73 option (google.api.method_signature) = "parent"; 74 } 75 76 // Deletes a session template. 77 rpc DeleteSessionTemplate(DeleteSessionTemplateRequest) 78 returns (google.protobuf.Empty) { 79 option (google.api.http) = { 80 delete: "/v1/{name=projects/*/locations/*/sessionTemplates/*}" 81 }; 82 option (google.api.method_signature) = "name"; 83 } 84} 85 86// A request to create a session template. 87message CreateSessionTemplateRequest { 88 // Required. The parent resource where this session template will be created. 89 string parent = 1 [ 90 (google.api.field_behavior) = REQUIRED, 91 (google.api.resource_reference) = { 92 child_type: "dataproc.googleapis.com/SessionTemplate" 93 } 94 ]; 95 96 // Required. The session template to create. 97 SessionTemplate session_template = 3 [(google.api.field_behavior) = REQUIRED]; 98} 99 100// A request to update a session template. 101message UpdateSessionTemplateRequest { 102 // Required. The updated session template. 103 SessionTemplate session_template = 1 [(google.api.field_behavior) = REQUIRED]; 104} 105 106// A request to get the resource representation for a session template. 107message GetSessionTemplateRequest { 108 // Required. The name of the session template to retrieve. 109 string name = 1 [ 110 (google.api.field_behavior) = REQUIRED, 111 (google.api.resource_reference) = { 112 type: "dataproc.googleapis.com/SessionTemplate" 113 } 114 ]; 115} 116 117// A request to list session templates in a project. 118message ListSessionTemplatesRequest { 119 // Required. The parent that owns this collection of session templates. 120 string parent = 1 [ 121 (google.api.field_behavior) = REQUIRED, 122 (google.api.resource_reference) = { 123 child_type: "dataproc.googleapis.com/SessionTemplate" 124 } 125 ]; 126 127 // Optional. The maximum number of sessions to return in each response. 128 // The service may return fewer than this value. 129 int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; 130 131 // Optional. A page token received from a previous `ListSessions` call. 132 // Provide this token to retrieve the subsequent page. 133 string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; 134 135 // Optional. A filter for the session templates to return in the response. 136 // Filters are case sensitive and have the following syntax: 137 // 138 // [field = value] AND [field [= value]] ... 139 string filter = 4 [(google.api.field_behavior) = OPTIONAL]; 140} 141 142// A list of session templates. 143message ListSessionTemplatesResponse { 144 // Output only. Session template list 145 repeated SessionTemplate session_templates = 1 146 [(google.api.field_behavior) = OUTPUT_ONLY]; 147 148 // A token, which can be sent as `page_token` to retrieve the next page. 149 // If this field is omitted, there are no subsequent pages. 150 string next_page_token = 2; 151} 152 153// A request to delete a session template. 154message DeleteSessionTemplateRequest { 155 // Required. The name of the session template resource to delete. 156 string name = 1 [ 157 (google.api.field_behavior) = REQUIRED, 158 (google.api.resource_reference) = { 159 type: "dataproc.googleapis.com/SessionTemplate" 160 } 161 ]; 162} 163 164// A representation of a session template. 165message SessionTemplate { 166 option (google.api.resource) = { 167 type: "dataproc.googleapis.com/SessionTemplate" 168 pattern: "projects/{project}/locations/{location}/sessionTemplates/{template}" 169 }; 170 171 // Required. The resource name of the session template. 172 string name = 1 [(google.api.field_behavior) = REQUIRED]; 173 174 // Optional. Brief description of the template. 175 string description = 9 [(google.api.field_behavior) = OPTIONAL]; 176 177 // Output only. The time when the template was created. 178 google.protobuf.Timestamp create_time = 2 179 [(google.api.field_behavior) = OUTPUT_ONLY]; 180 181 // The session configuration. 182 oneof session_config { 183 // Optional. Jupyter session config. 184 JupyterConfig jupyter_session = 3 [(google.api.field_behavior) = OPTIONAL]; 185 } 186 187 // Output only. The email address of the user who created the template. 188 string creator = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 189 190 // Optional. Labels to associate with sessions created using this template. 191 // Label **keys** must contain 1 to 63 characters, and must conform to 192 // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). 193 // Label **values** can be empty, but, if present, must contain 1 to 63 194 // characters and conform to [RFC 195 // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be 196 // associated with a session. 197 map<string, string> labels = 6 [(google.api.field_behavior) = OPTIONAL]; 198 199 // Optional. Runtime configuration for session execution. 200 RuntimeConfig runtime_config = 7 [(google.api.field_behavior) = OPTIONAL]; 201 202 // Optional. Environment configuration for session execution. 203 EnvironmentConfig environment_config = 8 204 [(google.api.field_behavior) = OPTIONAL]; 205 206 // Output only. The time the template was last updated. 207 google.protobuf.Timestamp update_time = 10 208 [(google.api.field_behavior) = OUTPUT_ONLY]; 209 210 // Output only. A session template UUID (Unique Universal Identifier). The 211 // service generates this value when it creates the session template. 212 string uuid = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; 213} 214