Skip to content

Commit 1163399

Browse files
feat: [dataproc] add session and session_template controllers (#4994)
* feat: add session and session_template controllers PiperOrigin-RevId: 602428194 Source-Link: googleapis/googleapis@71ea538 Source-Link: googleapis/googleapis-gen@c4c4a52 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiJjNGM0YTUyYzRiYmQ1Zjc5ZjFmMjkwNzcyNTA3MzUzZmViZTI1M2I0In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 48d3918 commit 1163399

51 files changed

Lines changed: 21804 additions & 18 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-dataproc/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/
202202
| Node_group_controller.create_node_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js,packages/google-cloud-dataproc/samples/README.md) |
203203
| Node_group_controller.get_node_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js,packages/google-cloud-dataproc/samples/README.md) |
204204
| Node_group_controller.resize_node_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js,packages/google-cloud-dataproc/samples/README.md) |
205+
| Session_controller.create_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js,packages/google-cloud-dataproc/samples/README.md) |
206+
| Session_controller.delete_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js,packages/google-cloud-dataproc/samples/README.md) |
207+
| Session_controller.get_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js,packages/google-cloud-dataproc/samples/README.md) |
208+
| Session_controller.list_sessions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js,packages/google-cloud-dataproc/samples/README.md) |
209+
| Session_controller.terminate_session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js,packages/google-cloud-dataproc/samples/README.md) |
210+
| Session_template_controller.create_session_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js,packages/google-cloud-dataproc/samples/README.md) |
211+
| Session_template_controller.delete_session_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js,packages/google-cloud-dataproc/samples/README.md) |
212+
| Session_template_controller.get_session_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js,packages/google-cloud-dataproc/samples/README.md) |
213+
| Session_template_controller.list_session_templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js,packages/google-cloud-dataproc/samples/README.md) |
214+
| Session_template_controller.update_session_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js,packages/google-cloud-dataproc/samples/README.md) |
205215
| Workflow_template_service.create_workflow_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js,packages/google-cloud-dataproc/samples/README.md) |
206216
| Workflow_template_service.delete_workflow_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js,packages/google-cloud-dataproc/samples/README.md) |
207217
| Workflow_template_service.get_workflow_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js,packages/google-cloud-dataproc/samples/README.md) |

packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -60,6 +60,48 @@ message BatchOperationMetadata {
6060
repeated string warnings = 9;
6161
}
6262

63+
// Metadata describing the Session operation.
64+
message SessionOperationMetadata {
65+
// Operation type for Session resources
66+
enum SessionOperationType {
67+
// Session operation type is unknown.
68+
SESSION_OPERATION_TYPE_UNSPECIFIED = 0;
69+
70+
// Create Session operation type.
71+
CREATE = 1;
72+
73+
// Terminate Session operation type.
74+
TERMINATE = 2;
75+
76+
// Delete Session operation type.
77+
DELETE = 3;
78+
}
79+
80+
// Name of the session for the operation.
81+
string session = 1;
82+
83+
// Session UUID for the operation.
84+
string session_uuid = 2;
85+
86+
// The time when the operation was created.
87+
google.protobuf.Timestamp create_time = 3;
88+
89+
// The time when the operation was finished.
90+
google.protobuf.Timestamp done_time = 4;
91+
92+
// The operation type.
93+
SessionOperationType operation_type = 6;
94+
95+
// Short description of the operation.
96+
string description = 7;
97+
98+
// Labels associated with the operation.
99+
map<string, string> labels = 8;
100+
101+
// Warnings encountered during operation execution.
102+
repeated string warnings = 9;
103+
}
104+
63105
// The status of the operation.
64106
message ClusterOperationStatus {
65107
// The operation state.
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.dataproc.v1;
18+
19+
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
23+
import "google/cloud/dataproc/v1/sessions.proto";
24+
import "google/cloud/dataproc/v1/shared.proto";
25+
import "google/protobuf/empty.proto";
26+
import "google/protobuf/timestamp.proto";
27+
28+
option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb";
29+
option java_multiple_files = true;
30+
option java_outer_classname = "SessionTemplatesProto";
31+
option java_package = "com.google.cloud.dataproc.v1";
32+
33+
// The SessionTemplateController provides methods to manage session templates.
34+
service 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.
87+
message 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.
101+
message 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.
107+
message 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.
118+
message 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.
143+
message 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.
154+
message 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.
165+
message 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+
}

0 commit comments

Comments
 (0)