google-cloud-shell-v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,327 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Shell
23
+ module V1
24
+ # A Cloud Shell environment, which is defined as the combination of a Docker
25
+ # image specifying what is installed on the environment and a home directory
26
+ # containing the user's data that will remain across sessions. Each user has
27
+ # at least an environment with the ID "default".
28
+ # @!attribute [rw] name
29
+ # @return [::String]
30
+ # Immutable. Full name of this resource, in the format
31
+ # `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the
32
+ # email address of the user to whom this environment belongs, and
33
+ # `{environment_id}` is the identifier of this environment. For example,
34
+ # `users/someone@example.com/environments/default`.
35
+ # @!attribute [r] id
36
+ # @return [::String]
37
+ # Output only. The environment's identifier, unique among the user's
38
+ # environments.
39
+ # @!attribute [rw] docker_image
40
+ # @return [::String]
41
+ # Required. Immutable. Full path to the Docker image used to run this environment, e.g.
42
+ # "gcr.io/dev-con/cloud-devshell:latest".
43
+ # @!attribute [r] state
44
+ # @return [::Google::Cloud::Shell::V1::Environment::State]
45
+ # Output only. Current execution state of this environment.
46
+ # @!attribute [r] web_host
47
+ # @return [::String]
48
+ # Output only. Host to which clients can connect to initiate HTTPS or WSS
49
+ # connections with the environment.
50
+ # @!attribute [r] ssh_username
51
+ # @return [::String]
52
+ # Output only. Username that clients should use when initiating SSH sessions
53
+ # with the environment.
54
+ # @!attribute [r] ssh_host
55
+ # @return [::String]
56
+ # Output only. Host to which clients can connect to initiate SSH sessions
57
+ # with the environment.
58
+ # @!attribute [r] ssh_port
59
+ # @return [::Integer]
60
+ # Output only. Port to which clients can connect to initiate SSH sessions
61
+ # with the environment.
62
+ # @!attribute [r] public_keys
63
+ # @return [::Array<::String>]
64
+ # Output only. Public keys associated with the environment. Clients can
65
+ # connect to this environment via SSH only if they possess a private key
66
+ # corresponding to at least one of these public keys. Keys can be added to or
67
+ # removed from the environment using the AddPublicKey and RemovePublicKey
68
+ # methods.
69
+ class Environment
70
+ include ::Google::Protobuf::MessageExts
71
+ extend ::Google::Protobuf::MessageExts::ClassMethods
72
+
73
+ # Possible execution states for an environment.
74
+ module State
75
+ # The environment's states is unknown.
76
+ STATE_UNSPECIFIED = 0
77
+
78
+ # The environment is not running and can't be connected to. Starting the
79
+ # environment will transition it to the PENDING state.
80
+ SUSPENDED = 1
81
+
82
+ # The environment is being started but is not yet ready to accept
83
+ # connections.
84
+ PENDING = 2
85
+
86
+ # The environment is running and ready to accept connections. It will
87
+ # automatically transition back to DISABLED after a period of inactivity or
88
+ # if another environment is started.
89
+ RUNNING = 3
90
+
91
+ # The environment is being deleted and can't be connected to.
92
+ DELETING = 4
93
+ end
94
+ end
95
+
96
+ # Request message for
97
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#get_environment GetEnvironment}.
98
+ # @!attribute [rw] name
99
+ # @return [::String]
100
+ # Required. Name of the requested resource, for example `users/me/environments/default`
101
+ # or `users/someone@example.com/environments/default`.
102
+ class GetEnvironmentRequest
103
+ include ::Google::Protobuf::MessageExts
104
+ extend ::Google::Protobuf::MessageExts::ClassMethods
105
+ end
106
+
107
+ # Message included in the metadata field of operations returned from
108
+ # [CreateEnvironment][google.cloud.shell.v1.CloudShellService.CreateEnvironment].
109
+ class CreateEnvironmentMetadata
110
+ include ::Google::Protobuf::MessageExts
111
+ extend ::Google::Protobuf::MessageExts::ClassMethods
112
+ end
113
+
114
+ # Message included in the metadata field of operations returned from
115
+ # [DeleteEnvironment][google.cloud.shell.v1.CloudShellService.DeleteEnvironment].
116
+ class DeleteEnvironmentMetadata
117
+ include ::Google::Protobuf::MessageExts
118
+ extend ::Google::Protobuf::MessageExts::ClassMethods
119
+ end
120
+
121
+ # Request message for
122
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}.
123
+ # @!attribute [rw] name
124
+ # @return [::String]
125
+ # Name of the resource that should be started, for example
126
+ # `users/me/environments/default` or
127
+ # `users/someone@example.com/environments/default`.
128
+ # @!attribute [rw] access_token
129
+ # @return [::String]
130
+ # The initial access token passed to the environment. If this is present and
131
+ # valid, the environment will be pre-authenticated with gcloud so that the
132
+ # user can run gcloud commands in Cloud Shell without having to log in. This
133
+ # code can be updated later by calling AuthorizeEnvironment.
134
+ # @!attribute [rw] public_keys
135
+ # @return [::Array<::String>]
136
+ # Public keys that should be added to the environment before it is started.
137
+ class StartEnvironmentRequest
138
+ include ::Google::Protobuf::MessageExts
139
+ extend ::Google::Protobuf::MessageExts::ClassMethods
140
+ end
141
+
142
+ # Request message for
143
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}.
144
+ # @!attribute [rw] name
145
+ # @return [::String]
146
+ # Name of the resource that should receive the credentials, for example
147
+ # `users/me/environments/default` or
148
+ # `users/someone@example.com/environments/default`.
149
+ # @!attribute [rw] access_token
150
+ # @return [::String]
151
+ # The OAuth access token that should be sent to the environment.
152
+ # @!attribute [rw] id_token
153
+ # @return [::String]
154
+ # The OAuth ID token that should be sent to the environment.
155
+ # @!attribute [rw] expire_time
156
+ # @return [::Google::Protobuf::Timestamp]
157
+ # The time when the credentials expire. If not set, defaults to one hour from
158
+ # when the server received the request.
159
+ class AuthorizeEnvironmentRequest
160
+ include ::Google::Protobuf::MessageExts
161
+ extend ::Google::Protobuf::MessageExts::ClassMethods
162
+ end
163
+
164
+ # Response message for
165
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}.
166
+ class AuthorizeEnvironmentResponse
167
+ include ::Google::Protobuf::MessageExts
168
+ extend ::Google::Protobuf::MessageExts::ClassMethods
169
+ end
170
+
171
+ # Message included in the metadata field of operations returned from
172
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment AuthorizeEnvironment}.
173
+ class AuthorizeEnvironmentMetadata
174
+ include ::Google::Protobuf::MessageExts
175
+ extend ::Google::Protobuf::MessageExts::ClassMethods
176
+ end
177
+
178
+ # Message included in the metadata field of operations returned from
179
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}.
180
+ # @!attribute [rw] state
181
+ # @return [::Google::Cloud::Shell::V1::StartEnvironmentMetadata::State]
182
+ # Current state of the environment being started.
183
+ class StartEnvironmentMetadata
184
+ include ::Google::Protobuf::MessageExts
185
+ extend ::Google::Protobuf::MessageExts::ClassMethods
186
+
187
+ # Possible states an environment might transition between during startup.
188
+ # These states are not normally actionable by clients, but may be used to
189
+ # show a progress message to the user. An environment won't necessarily go
190
+ # through all of these states when starting. More states are likely to be
191
+ # added in the future.
192
+ module State
193
+ # The environment's start state is unknown.
194
+ STATE_UNSPECIFIED = 0
195
+
196
+ # The environment is in the process of being started, but no additional
197
+ # details are available.
198
+ STARTING = 1
199
+
200
+ # Startup is waiting for the user's disk to be unarchived. This can happen
201
+ # when the user returns to Cloud Shell after not having used it for a
202
+ # while, and suggests that startup will take longer than normal.
203
+ UNARCHIVING_DISK = 2
204
+
205
+ # Startup is waiting for compute resources to be assigned to the
206
+ # environment. This should normally happen very quickly, but an environment
207
+ # might stay in this state for an extended period of time if the system is
208
+ # experiencing heavy load.
209
+ AWAITING_COMPUTE_RESOURCES = 4
210
+
211
+ # Startup has completed. If the start operation was successful, the user
212
+ # should be able to establish an SSH connection to their environment.
213
+ # Otherwise, the operation will contain details of the failure.
214
+ FINISHED = 3
215
+ end
216
+ end
217
+
218
+ # Message included in the response field of operations returned from
219
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#start_environment StartEnvironment}
220
+ # once the operation is complete.
221
+ # @!attribute [rw] environment
222
+ # @return [::Google::Cloud::Shell::V1::Environment]
223
+ # Environment that was started.
224
+ class StartEnvironmentResponse
225
+ include ::Google::Protobuf::MessageExts
226
+ extend ::Google::Protobuf::MessageExts::ClassMethods
227
+ end
228
+
229
+ # Request message for
230
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}.
231
+ # @!attribute [rw] environment
232
+ # @return [::String]
233
+ # Environment this key should be added to, e.g.
234
+ # `users/me/environments/default`.
235
+ # @!attribute [rw] key
236
+ # @return [::String]
237
+ # Key that should be added to the environment. Supported formats are
238
+ # `ssh-dss` (see RFC4253), `ssh-rsa` (see RFC4253), `ecdsa-sha2-nistp256`
239
+ # (see RFC5656), `ecdsa-sha2-nistp384` (see RFC5656) and
240
+ # `ecdsa-sha2-nistp521` (see RFC5656). It should be structured as
241
+ # &lt;format&gt; &lt;content&gt;, where &lt;content&gt; part is encoded with
242
+ # Base64.
243
+ class AddPublicKeyRequest
244
+ include ::Google::Protobuf::MessageExts
245
+ extend ::Google::Protobuf::MessageExts::ClassMethods
246
+ end
247
+
248
+ # Response message for
249
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}.
250
+ # @!attribute [rw] key
251
+ # @return [::String]
252
+ # Key that was added to the environment.
253
+ class AddPublicKeyResponse
254
+ include ::Google::Protobuf::MessageExts
255
+ extend ::Google::Protobuf::MessageExts::ClassMethods
256
+ end
257
+
258
+ # Message included in the metadata field of operations returned from
259
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key AddPublicKey}.
260
+ class AddPublicKeyMetadata
261
+ include ::Google::Protobuf::MessageExts
262
+ extend ::Google::Protobuf::MessageExts::ClassMethods
263
+ end
264
+
265
+ # Request message for
266
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}.
267
+ # @!attribute [rw] environment
268
+ # @return [::String]
269
+ # Environment this key should be removed from, e.g.
270
+ # `users/me/environments/default`.
271
+ # @!attribute [rw] key
272
+ # @return [::String]
273
+ # Key that should be removed from the environment.
274
+ class RemovePublicKeyRequest
275
+ include ::Google::Protobuf::MessageExts
276
+ extend ::Google::Protobuf::MessageExts::ClassMethods
277
+ end
278
+
279
+ # Response message for
280
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}.
281
+ class RemovePublicKeyResponse
282
+ include ::Google::Protobuf::MessageExts
283
+ extend ::Google::Protobuf::MessageExts::ClassMethods
284
+ end
285
+
286
+ # Message included in the metadata field of operations returned from
287
+ # {::Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key RemovePublicKey}.
288
+ class RemovePublicKeyMetadata
289
+ include ::Google::Protobuf::MessageExts
290
+ extend ::Google::Protobuf::MessageExts::ClassMethods
291
+ end
292
+
293
+ # Cloud-shell specific information that will be included as details in failure
294
+ # responses.
295
+ # @!attribute [rw] code
296
+ # @return [::Google::Cloud::Shell::V1::CloudShellErrorDetails::CloudShellErrorCode]
297
+ # Code indicating the specific error the occurred.
298
+ class CloudShellErrorDetails
299
+ include ::Google::Protobuf::MessageExts
300
+ extend ::Google::Protobuf::MessageExts::ClassMethods
301
+
302
+ # Set of possible errors returned from API calls.
303
+ module CloudShellErrorCode
304
+ # An unknown error occurred.
305
+ CLOUD_SHELL_ERROR_CODE_UNSPECIFIED = 0
306
+
307
+ # The image used by the Cloud Shell environment either does not exist or
308
+ # the user does not have access to it.
309
+ IMAGE_UNAVAILABLE = 1
310
+
311
+ # Cloud Shell has been disabled by an administrator for the user making the
312
+ # request.
313
+ CLOUD_SHELL_DISABLED = 2
314
+
315
+ # Cloud Shell has been permanently disabled due to a Terms of Service
316
+ # violation by the user.
317
+ TOS_VIOLATION = 4
318
+
319
+ # The user has exhausted their weekly Cloud Shell quota, and Cloud Shell
320
+ # will be disabled until the quota resets.
321
+ QUOTA_EXCEEDED = 5
322
+ end
323
+ end
324
+ end
325
+ end
326
+ end
327
+ end
@@ -0,0 +1,164 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Longrunning
22
+ # This resource represents a long-running operation that is the result of a
23
+ # network API call.
24
+ # @!attribute [rw] name
25
+ # @return [::String]
26
+ # The server-assigned name, which is only unique within the same service that
27
+ # originally returns it. If you use the default HTTP mapping, the
28
+ # `name` should be a resource name ending with `operations/{unique_id}`.
29
+ # @!attribute [rw] metadata
30
+ # @return [::Google::Protobuf::Any]
31
+ # Service-specific metadata associated with the operation. It typically
32
+ # contains progress information and common metadata such as create time.
33
+ # Some services might not provide such metadata. Any method that returns a
34
+ # long-running operation should document the metadata type, if any.
35
+ # @!attribute [rw] done
36
+ # @return [::Boolean]
37
+ # If the value is `false`, it means the operation is still in progress.
38
+ # If `true`, the operation is completed, and either `error` or `response` is
39
+ # available.
40
+ # @!attribute [rw] error
41
+ # @return [::Google::Rpc::Status]
42
+ # The error result of the operation in case of failure or cancellation.
43
+ # @!attribute [rw] response
44
+ # @return [::Google::Protobuf::Any]
45
+ # The normal response of the operation in case of success. If the original
46
+ # method returns no data on success, such as `Delete`, the response is
47
+ # `google.protobuf.Empty`. If the original method is standard
48
+ # `Get`/`Create`/`Update`, the response should be the resource. For other
49
+ # methods, the response should have the type `XxxResponse`, where `Xxx`
50
+ # is the original method name. For example, if the original method name
51
+ # is `TakeSnapshot()`, the inferred response type is
52
+ # `TakeSnapshotResponse`.
53
+ class Operation
54
+ include ::Google::Protobuf::MessageExts
55
+ extend ::Google::Protobuf::MessageExts::ClassMethods
56
+ end
57
+
58
+ # The request message for Operations.GetOperation.
59
+ # @!attribute [rw] name
60
+ # @return [::String]
61
+ # The name of the operation resource.
62
+ class GetOperationRequest
63
+ include ::Google::Protobuf::MessageExts
64
+ extend ::Google::Protobuf::MessageExts::ClassMethods
65
+ end
66
+
67
+ # The request message for Operations.ListOperations.
68
+ # @!attribute [rw] name
69
+ # @return [::String]
70
+ # The name of the operation's parent resource.
71
+ # @!attribute [rw] filter
72
+ # @return [::String]
73
+ # The standard list filter.
74
+ # @!attribute [rw] page_size
75
+ # @return [::Integer]
76
+ # The standard list page size.
77
+ # @!attribute [rw] page_token
78
+ # @return [::String]
79
+ # The standard list page token.
80
+ class ListOperationsRequest
81
+ include ::Google::Protobuf::MessageExts
82
+ extend ::Google::Protobuf::MessageExts::ClassMethods
83
+ end
84
+
85
+ # The response message for Operations.ListOperations.
86
+ # @!attribute [rw] operations
87
+ # @return [::Array<::Google::Longrunning::Operation>]
88
+ # A list of operations that matches the specified filter in the request.
89
+ # @!attribute [rw] next_page_token
90
+ # @return [::String]
91
+ # The standard List next-page token.
92
+ class ListOperationsResponse
93
+ include ::Google::Protobuf::MessageExts
94
+ extend ::Google::Protobuf::MessageExts::ClassMethods
95
+ end
96
+
97
+ # The request message for Operations.CancelOperation.
98
+ # @!attribute [rw] name
99
+ # @return [::String]
100
+ # The name of the operation resource to be cancelled.
101
+ class CancelOperationRequest
102
+ include ::Google::Protobuf::MessageExts
103
+ extend ::Google::Protobuf::MessageExts::ClassMethods
104
+ end
105
+
106
+ # The request message for Operations.DeleteOperation.
107
+ # @!attribute [rw] name
108
+ # @return [::String]
109
+ # The name of the operation resource to be deleted.
110
+ class DeleteOperationRequest
111
+ include ::Google::Protobuf::MessageExts
112
+ extend ::Google::Protobuf::MessageExts::ClassMethods
113
+ end
114
+
115
+ # The request message for Operations.WaitOperation.
116
+ # @!attribute [rw] name
117
+ # @return [::String]
118
+ # The name of the operation resource to wait on.
119
+ # @!attribute [rw] timeout
120
+ # @return [::Google::Protobuf::Duration]
121
+ # The maximum duration to wait before timing out. If left blank, the wait
122
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
123
+ # If RPC context deadline is also specified, the shorter one will be used.
124
+ class WaitOperationRequest
125
+ include ::Google::Protobuf::MessageExts
126
+ extend ::Google::Protobuf::MessageExts::ClassMethods
127
+ end
128
+
129
+ # A message representing the message types used by a long-running operation.
130
+ #
131
+ # Example:
132
+ #
133
+ # rpc LongRunningRecognize(LongRunningRecognizeRequest)
134
+ # returns (google.longrunning.Operation) {
135
+ # option (google.longrunning.operation_info) = {
136
+ # response_type: "LongRunningRecognizeResponse"
137
+ # metadata_type: "LongRunningRecognizeMetadata"
138
+ # };
139
+ # }
140
+ # @!attribute [rw] response_type
141
+ # @return [::String]
142
+ # Required. The message name of the primary return type for this
143
+ # long-running operation.
144
+ # This type will be used to deserialize the LRO's response.
145
+ #
146
+ # If the response is in a different package from the rpc, a fully-qualified
147
+ # message name must be used (e.g. `google.protobuf.Struct`).
148
+ #
149
+ # Note: Altering this value constitutes a breaking change.
150
+ # @!attribute [rw] metadata_type
151
+ # @return [::String]
152
+ # Required. The message name of the metadata type for this long-running
153
+ # operation.
154
+ #
155
+ # If the response is in a different package from the rpc, a fully-qualified
156
+ # message name must be used (e.g. `google.protobuf.Struct`).
157
+ #
158
+ # Note: Altering this value constitutes a breaking change.
159
+ class OperationInfo
160
+ include ::Google::Protobuf::MessageExts
161
+ extend ::Google::Protobuf::MessageExts::ClassMethods
162
+ end
163
+ end
164
+ end