xref: /aosp_15_r20/external/googleapis/google/cloud/workstations/v1/workstations.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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.workstations.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/longrunning/operations.proto";
24import "google/protobuf/duration.proto";
25import "google/protobuf/field_mask.proto";
26import "google/protobuf/timestamp.proto";
27import "google/rpc/status.proto";
28
29option go_package = "cloud.google.com/go/workstations/apiv1/workstationspb;workstationspb";
30option java_multiple_files = true;
31option java_outer_classname = "WorkstationsProto";
32option java_package = "com.google.cloud.workstations.v1";
33
34// Service for interacting with Cloud Workstations.
35service Workstations {
36  option (google.api.default_host) = "workstations.googleapis.com";
37  option (google.api.oauth_scopes) =
38      "https://www.googleapis.com/auth/cloud-platform";
39
40  // Returns the requested workstation cluster.
41  rpc GetWorkstationCluster(GetWorkstationClusterRequest)
42      returns (WorkstationCluster) {
43    option (google.api.http) = {
44      get: "/v1/{name=projects/*/locations/*/workstationClusters/*}"
45    };
46    option (google.api.method_signature) = "name";
47  }
48
49  // Returns all workstation clusters in the specified location.
50  rpc ListWorkstationClusters(ListWorkstationClustersRequest)
51      returns (ListWorkstationClustersResponse) {
52    option (google.api.http) = {
53      get: "/v1/{parent=projects/*/locations/*}/workstationClusters"
54    };
55    option (google.api.method_signature) = "parent";
56  }
57
58  // Creates a new workstation cluster.
59  rpc CreateWorkstationCluster(CreateWorkstationClusterRequest)
60      returns (google.longrunning.Operation) {
61    option (google.api.http) = {
62      post: "/v1/{parent=projects/*/locations/*}/workstationClusters"
63      body: "workstation_cluster"
64    };
65    option (google.api.method_signature) =
66        "parent,workstation_cluster,workstation_cluster_id";
67    option (google.longrunning.operation_info) = {
68      response_type: "WorkstationCluster"
69      metadata_type: "OperationMetadata"
70    };
71  }
72
73  // Updates an existing workstation cluster.
74  rpc UpdateWorkstationCluster(UpdateWorkstationClusterRequest)
75      returns (google.longrunning.Operation) {
76    option (google.api.http) = {
77      patch: "/v1/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}"
78      body: "workstation_cluster"
79    };
80    option (google.api.method_signature) = "workstation_cluster,update_mask";
81    option (google.longrunning.operation_info) = {
82      response_type: "WorkstationCluster"
83      metadata_type: "OperationMetadata"
84    };
85  }
86
87  // Deletes the specified workstation cluster.
88  rpc DeleteWorkstationCluster(DeleteWorkstationClusterRequest)
89      returns (google.longrunning.Operation) {
90    option (google.api.http) = {
91      delete: "/v1/{name=projects/*/locations/*/workstationClusters/*}"
92    };
93    option (google.api.method_signature) = "name";
94    option (google.longrunning.operation_info) = {
95      response_type: "WorkstationCluster"
96      metadata_type: "OperationMetadata"
97    };
98  }
99
100  // Returns the requested workstation configuration.
101  rpc GetWorkstationConfig(GetWorkstationConfigRequest)
102      returns (WorkstationConfig) {
103    option (google.api.http) = {
104      get: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}"
105    };
106    option (google.api.method_signature) = "name";
107  }
108
109  // Returns all workstation configurations in the specified cluster.
110  rpc ListWorkstationConfigs(ListWorkstationConfigsRequest)
111      returns (ListWorkstationConfigsResponse) {
112    option (google.api.http) = {
113      get: "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs"
114    };
115    option (google.api.method_signature) = "parent";
116  }
117
118  // Returns all workstation configurations in the specified cluster on which
119  // the caller has the "workstations.workstation.create" permission.
120  rpc ListUsableWorkstationConfigs(ListUsableWorkstationConfigsRequest)
121      returns (ListUsableWorkstationConfigsResponse) {
122    option (google.api.http) = {
123      get: "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable"
124    };
125    option (google.api.method_signature) = "parent";
126  }
127
128  // Creates a new workstation configuration.
129  rpc CreateWorkstationConfig(CreateWorkstationConfigRequest)
130      returns (google.longrunning.Operation) {
131    option (google.api.http) = {
132      post: "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs"
133      body: "workstation_config"
134    };
135    option (google.api.method_signature) =
136        "parent,workstation_config,workstation_config_id";
137    option (google.longrunning.operation_info) = {
138      response_type: "WorkstationConfig"
139      metadata_type: "OperationMetadata"
140    };
141  }
142
143  // Updates an existing workstation configuration.
144  rpc UpdateWorkstationConfig(UpdateWorkstationConfigRequest)
145      returns (google.longrunning.Operation) {
146    option (google.api.http) = {
147      patch: "/v1/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}"
148      body: "workstation_config"
149    };
150    option (google.api.method_signature) = "workstation_config,update_mask";
151    option (google.longrunning.operation_info) = {
152      response_type: "WorkstationConfig"
153      metadata_type: "OperationMetadata"
154    };
155  }
156
157  // Deletes the specified workstation configuration.
158  rpc DeleteWorkstationConfig(DeleteWorkstationConfigRequest)
159      returns (google.longrunning.Operation) {
160    option (google.api.http) = {
161      delete: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}"
162    };
163    option (google.api.method_signature) = "name";
164    option (google.longrunning.operation_info) = {
165      response_type: "WorkstationConfig"
166      metadata_type: "OperationMetadata"
167    };
168  }
169
170  // Returns the requested workstation.
171  rpc GetWorkstation(GetWorkstationRequest) returns (Workstation) {
172    option (google.api.http) = {
173      get: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}"
174    };
175    option (google.api.method_signature) = "name";
176  }
177
178  // Returns all Workstations using the specified workstation configuration.
179  rpc ListWorkstations(ListWorkstationsRequest)
180      returns (ListWorkstationsResponse) {
181    option (google.api.http) = {
182      get: "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations"
183    };
184    option (google.api.method_signature) = "parent";
185  }
186
187  // Returns all workstations using the specified workstation configuration
188  // on which the caller has the "workstations.workstations.use" permission.
189  rpc ListUsableWorkstations(ListUsableWorkstationsRequest)
190      returns (ListUsableWorkstationsResponse) {
191    option (google.api.http) = {
192      get: "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable"
193    };
194    option (google.api.method_signature) = "parent";
195  }
196
197  // Creates a new workstation.
198  rpc CreateWorkstation(CreateWorkstationRequest)
199      returns (google.longrunning.Operation) {
200    option (google.api.http) = {
201      post: "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations"
202      body: "workstation"
203    };
204    option (google.api.method_signature) = "parent,workstation,workstation_id";
205    option (google.longrunning.operation_info) = {
206      response_type: "Workstation"
207      metadata_type: "OperationMetadata"
208    };
209  }
210
211  // Updates an existing workstation.
212  rpc UpdateWorkstation(UpdateWorkstationRequest)
213      returns (google.longrunning.Operation) {
214    option (google.api.http) = {
215      patch: "/v1/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}"
216      body: "workstation"
217    };
218    option (google.api.method_signature) = "workstation,update_mask";
219    option (google.longrunning.operation_info) = {
220      response_type: "Workstation"
221      metadata_type: "OperationMetadata"
222    };
223  }
224
225  // Deletes the specified workstation.
226  rpc DeleteWorkstation(DeleteWorkstationRequest)
227      returns (google.longrunning.Operation) {
228    option (google.api.http) = {
229      delete: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}"
230    };
231    option (google.api.method_signature) = "name";
232    option (google.longrunning.operation_info) = {
233      response_type: "Workstation"
234      metadata_type: "OperationMetadata"
235    };
236  }
237
238  // Starts running a workstation so that users can connect to it.
239  rpc StartWorkstation(StartWorkstationRequest)
240      returns (google.longrunning.Operation) {
241    option (google.api.http) = {
242      post: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start"
243      body: "*"
244    };
245    option (google.api.method_signature) = "name";
246    option (google.longrunning.operation_info) = {
247      response_type: "Workstation"
248      metadata_type: "OperationMetadata"
249    };
250  }
251
252  // Stops running a workstation, reducing costs.
253  rpc StopWorkstation(StopWorkstationRequest)
254      returns (google.longrunning.Operation) {
255    option (google.api.http) = {
256      post: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop"
257      body: "*"
258    };
259    option (google.api.method_signature) = "name";
260    option (google.longrunning.operation_info) = {
261      response_type: "Workstation"
262      metadata_type: "OperationMetadata"
263    };
264  }
265
266  // Returns a short-lived credential that can be used to send authenticated and
267  // authorized traffic to a workstation.
268  rpc GenerateAccessToken(GenerateAccessTokenRequest)
269      returns (GenerateAccessTokenResponse) {
270    option (google.api.http) = {
271      post: "/v1/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken"
272      body: "*"
273    };
274    option (google.api.method_signature) = "workstation";
275  }
276}
277
278// A workstation cluster resource in the Cloud Workstations API.
279//
280// Defines a group of workstations in a particular region and the
281// VPC network they're attached to.
282message WorkstationCluster {
283  option (google.api.resource) = {
284    type: "workstations.googleapis.com/WorkstationCluster"
285    pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}"
286    plural: "workstationClusters"
287    singular: "workstationCluster"
288    style: DECLARATIVE_FRIENDLY
289  };
290
291  // Configuration options for private workstation clusters.
292  message PrivateClusterConfig {
293    // Immutable. Whether Workstations endpoint is private.
294    bool enable_private_endpoint = 1 [(google.api.field_behavior) = IMMUTABLE];
295
296    // Output only. Hostname for the workstation cluster. This field will be
297    // populated only when private endpoint is enabled. To access workstations
298    // in the workstation cluster, create a new DNS zone mapping this domain
299    // name to an internal IP address and a forwarding rule mapping that address
300    // to the service attachment.
301    string cluster_hostname = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
302
303    // Output only. Service attachment URI for the workstation cluster. The
304    // service attachemnt is created when private endpoint is enabled. To access
305    // workstations in the workstation cluster, configure access to the managed
306    // service using [Private Service
307    // Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services).
308    string service_attachment_uri = 3
309        [(google.api.field_behavior) = OUTPUT_ONLY];
310
311    // Optional. Additional projects that are allowed to attach to the
312    // workstation cluster's service attachment. By default, the workstation
313    // cluster's project and the VPC host project (if different) are allowed.
314    repeated string allowed_projects = 4
315        [(google.api.field_behavior) = OPTIONAL];
316  }
317
318  // Full name of this workstation cluster.
319  string name = 1;
320
321  // Optional. Human-readable name for this workstation cluster.
322  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
323
324  // Output only. A system-assigned unique identifier for this workstation
325  // cluster.
326  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
327
328  // Output only. Indicates whether this workstation cluster is currently being
329  // updated to match its intended state.
330  bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
331
332  // Optional. Client-specified annotations.
333  map<string, string> annotations = 5 [(google.api.field_behavior) = OPTIONAL];
334
335  // Optional.
336  // [Labels](https://cloud.google.com/workstations/docs/label-resources) that
337  // are applied to the workstation cluster and that are also propagated to the
338  // underlying Compute Engine resources.
339  map<string, string> labels = 15 [(google.api.field_behavior) = OPTIONAL];
340
341  // Output only. Time when this workstation cluster was created.
342  google.protobuf.Timestamp create_time = 6
343      [(google.api.field_behavior) = OUTPUT_ONLY];
344
345  // Output only. Time when this workstation cluster was most recently updated.
346  google.protobuf.Timestamp update_time = 7
347      [(google.api.field_behavior) = OUTPUT_ONLY];
348
349  // Output only. Time when this workstation cluster was soft-deleted.
350  google.protobuf.Timestamp delete_time = 8
351      [(google.api.field_behavior) = OUTPUT_ONLY];
352
353  // Optional. Checksum computed by the server. May be sent on update and delete
354  // requests to make sure that the client has an up-to-date value before
355  // proceeding.
356  string etag = 9 [(google.api.field_behavior) = OPTIONAL];
357
358  // Immutable. Name of the Compute Engine network in which instances associated
359  // with this workstation cluster will be created.
360  string network = 10 [(google.api.field_behavior) = IMMUTABLE];
361
362  // Immutable. Name of the Compute Engine subnetwork in which instances
363  // associated with this workstation cluster will be created. Must be part of
364  // the subnetwork specified for this workstation cluster.
365  string subnetwork = 11 [(google.api.field_behavior) = IMMUTABLE];
366
367  // Output only. The private IP address of the control plane for this
368  // workstation cluster. Workstation VMs need access to this IP address to work
369  // with the service, so make sure that your firewall rules allow egress from
370  // the workstation VMs to this address.
371  string control_plane_ip = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
372
373  // Optional. Configuration for private workstation cluster.
374  PrivateClusterConfig private_cluster_config = 12
375      [(google.api.field_behavior) = OPTIONAL];
376
377  // Output only. Whether this workstation cluster is in degraded mode, in which
378  // case it may require user action to restore full functionality. Details can
379  // be found in
380  // [conditions][google.cloud.workstations.v1.WorkstationCluster.conditions].
381  bool degraded = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
382
383  // Output only. Status conditions describing the workstation cluster's current
384  // state.
385  repeated google.rpc.Status conditions = 14
386      [(google.api.field_behavior) = OUTPUT_ONLY];
387}
388
389// A workstation configuration resource in the Cloud Workstations API.
390//
391// Workstation configurations act as templates for workstations. The workstation
392// configuration defines details such as the workstation virtual machine (VM)
393// instance type, persistent storage, container image defining environment,
394// which IDE or Code Editor to use, and more. Administrators and platform teams
395// can also use [Identity and Access Management
396// (IAM)](https://cloud.google.com/iam/docs/overview) rules to grant access to
397// teams or to individual developers.
398message WorkstationConfig {
399  option (google.api.resource) = {
400    type: "workstations.googleapis.com/WorkstationConfig"
401    pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}"
402    plural: "workstationConfigs"
403    singular: "workstationConfig"
404    style: DECLARATIVE_FRIENDLY
405  };
406
407  // Runtime host for a workstation.
408  message Host {
409    // A runtime using a Compute Engine instance.
410    message GceInstance {
411      // A set of Compute Engine Shielded instance options.
412      message GceShieldedInstanceConfig {
413        // Optional. Whether the instance has Secure Boot enabled.
414        bool enable_secure_boot = 1 [(google.api.field_behavior) = OPTIONAL];
415
416        // Optional. Whether the instance has the vTPM enabled.
417        bool enable_vtpm = 2 [(google.api.field_behavior) = OPTIONAL];
418
419        // Optional. Whether the instance has integrity monitoring enabled.
420        bool enable_integrity_monitoring = 3
421            [(google.api.field_behavior) = OPTIONAL];
422      }
423
424      // A set of Compute Engine Confidential VM instance options.
425      message GceConfidentialInstanceConfig {
426        // Optional. Whether the instance has confidential compute enabled.
427        bool enable_confidential_compute = 1
428            [(google.api.field_behavior) = OPTIONAL];
429      }
430
431      // Optional. The type of machine to use for VM instances—for example,
432      // `"e2-standard-4"`. For more information about machine types that
433      // Cloud Workstations supports, see the list of
434      // [available machine
435      // types](https://cloud.google.com/workstations/docs/available-machine-types).
436      string machine_type = 1 [(google.api.field_behavior) = OPTIONAL];
437
438      // Optional. The email address of the service account for Cloud
439      // Workstations VMs created with this configuration. When specified, be
440      // sure that the service account has `logginglogEntries.create` permission
441      // on the project so it can write logs out to Cloud Logging. If using a
442      // custom container image, the service account must have permissions to
443      // pull the specified image.
444      //
445      // If you as the administrator want to be able to `ssh` into the
446      // underlying VM, you need to set this value to a service account
447      // for which you have the `iam.serviceAccounts.actAs` permission.
448      // Conversely, if you don't want anyone to be able to `ssh` into the
449      // underlying VM, use a service account where no one has that
450      // permission.
451      //
452      // If not set, VMs run with a service account provided by the
453      // Cloud Workstations service, and the image must be publicly
454      // accessible.
455      string service_account = 2 [(google.api.field_behavior) = OPTIONAL];
456
457      // Optional. Scopes to grant to the
458      // [service_account][google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.service_account].
459      // Various scopes are automatically added based on feature usage. When
460      // specified, users of workstations under this configuration must have
461      // `iam.serviceAccounts.actAs` on the service account.
462      repeated string service_account_scopes = 3
463          [(google.api.field_behavior) = OPTIONAL];
464
465      // Optional. Network tags to add to the Compute Engine VMs backing the
466      // workstations. This option applies
467      // [network
468      // tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs
469      // created with this configuration. These network tags enable the creation
470      // of [firewall
471      // rules](https://cloud.google.com/workstations/docs/configure-firewall-rules).
472      repeated string tags = 4 [(google.api.field_behavior) = OPTIONAL];
473
474      // Optional. The number of VMs that the system should keep idle so that
475      // new workstations can be started quickly for new users. Defaults to `0`
476      // in the API.
477      int32 pool_size = 5 [(google.api.field_behavior) = OPTIONAL];
478
479      // Output only. Number of instances currently available in the pool for
480      // faster workstation startup.
481      int32 pooled_instances = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
482
483      // Optional. When set to true, disables public IP addresses for VMs. If
484      // you disable public IP addresses, you must set up Private Google Access
485      // or Cloud NAT on your network. If you use Private Google Access and you
486      // use `private.googleapis.com` or `restricted.googleapis.com` for
487      // Container Registry and Artifact Registry, make sure that you set
488      // up DNS records for domains `*.gcr.io` and `*.pkg.dev`.
489      // Defaults to false (VMs have public IP addresses).
490      bool disable_public_ip_addresses = 6
491          [(google.api.field_behavior) = OPTIONAL];
492
493      // Optional. Whether to enable nested virtualization on Cloud Workstations
494      // VMs created under this workstation configuration.
495      //
496      // Nested virtualization lets you run virtual machine (VM) instances
497      // inside your workstation. Before enabling nested virtualization,
498      // consider the following important considerations. Cloud Workstations
499      // instances are subject to the [same restrictions as Compute Engine
500      // instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions):
501      //
502      // * **Organization policy**: projects, folders, or
503      // organizations may be restricted from creating nested VMs if the
504      // **Disable VM nested virtualization** constraint is enforced in
505      // the organization policy. For more information, see the
506      // Compute Engine section,
507      // [Checking whether nested virtualization is
508      // allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed).
509      // * **Performance**: nested VMs might experience a 10% or greater
510      // decrease in performance for workloads that are CPU-bound and
511      // possibly greater than a 10% decrease for workloads that are
512      // input/output bound.
513      // * **Machine Type**: nested virtualization can only be enabled on
514      // workstation configurations that specify a
515      // [machine_type][google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.machine_type]
516      // in the N1 or N2 machine series.
517      // * **GPUs**: nested virtualization may not be enabled on workstation
518      // configurations with accelerators.
519      // * **Operating System**: Because
520      // [Container-Optimized
521      // OS](https://cloud.google.com/compute/docs/images/os-details#container-optimized_os_cos)
522      // does not support nested virtualization, when nested virtualization is
523      // enabled, the underlying Compute Engine VM instances boot from an
524      // [Ubuntu
525      // LTS](https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts)
526      // image.
527      bool enable_nested_virtualization = 7
528          [(google.api.field_behavior) = OPTIONAL];
529
530      // Optional. A set of Compute Engine Shielded instance options.
531      GceShieldedInstanceConfig shielded_instance_config = 8
532          [(google.api.field_behavior) = OPTIONAL];
533
534      // Optional. A set of Compute Engine Confidential VM instance options.
535      GceConfidentialInstanceConfig confidential_instance_config = 10
536          [(google.api.field_behavior) = OPTIONAL];
537
538      // Optional. The size of the boot disk for the VM in gigabytes (GB).
539      // The minimum boot disk size is `30` GB. Defaults to `50` GB.
540      int32 boot_disk_size_gb = 9 [(google.api.field_behavior) = OPTIONAL];
541    }
542
543    // Type of host that will be used for the workstation's runtime.
544    oneof config {
545      // Specifies a Compute Engine instance as the host.
546      GceInstance gce_instance = 1;
547    }
548  }
549
550  // A directory to persist across workstation sessions.
551  message PersistentDirectory {
552    // A PersistentDirectory backed by a Compute Engine regional persistent
553    // disk. The
554    // [persistent_directories][google.cloud.workstations.v1.WorkstationConfig.persistent_directories]
555    // field is repeated, but it may contain only one entry. It creates a
556    // [persistent
557    // disk](https://cloud.google.com/compute/docs/disks/persistent-disks) that
558    // mounts to the workstation VM at `/home` when the session starts and
559    // detaches when the session ends. If this field is empty, workstations
560    // created with this configuration do not have a persistent home
561    // directory.
562    message GceRegionalPersistentDisk {
563      // Value representing what should happen to the disk after the workstation
564      // is deleted.
565      enum ReclaimPolicy {
566        // Do not use.
567        RECLAIM_POLICY_UNSPECIFIED = 0;
568
569        // Delete the persistent disk when deleting the workstation.
570        DELETE = 1;
571
572        // Keep the persistent disk when deleting the workstation.
573        // An administrator must manually delete the disk.
574        RETAIN = 2;
575      }
576
577      // Optional. The GB capacity of a persistent home directory for each
578      // workstation created with this configuration. Must be empty if
579      // [source_snapshot][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.source_snapshot]
580      // is set.
581      //
582      // Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`.
583      // Defaults to `200`. If less than `200` GB, the
584      // [disk_type][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.disk_type]
585      // must be
586      // `"pd-balanced"` or `"pd-ssd"`.
587      int32 size_gb = 1 [(google.api.field_behavior) = OPTIONAL];
588
589      // Optional. Type of file system that the disk should be formatted with.
590      // The workstation image must support this file system type. Must be empty
591      // if
592      // [source_snapshot][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.source_snapshot]
593      // is set. Defaults to `"ext4"`.
594      string fs_type = 2 [(google.api.field_behavior) = OPTIONAL];
595
596      // Optional. The [type of the persistent
597      // disk](https://cloud.google.com/compute/docs/disks#disk-types) for the
598      // home directory. Defaults to `"pd-standard"`.
599      string disk_type = 3 [(google.api.field_behavior) = OPTIONAL];
600
601      // Optional. Name of the snapshot to use as the source for the disk. If
602      // set,
603      // [size_gb][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.size_gb]
604      // and
605      // [fs_type][google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.fs_type]
606      // must be empty.
607      string source_snapshot = 5 [(google.api.field_behavior) = OPTIONAL];
608
609      // Optional. Whether the persistent disk should be deleted when the
610      // workstation is deleted. Valid values are `DELETE` and `RETAIN`.
611      // Defaults to `DELETE`.
612      ReclaimPolicy reclaim_policy = 4 [(google.api.field_behavior) = OPTIONAL];
613    }
614
615    // How a persistent directory should be implemented.
616    oneof directory_type {
617      // A PersistentDirectory backed by a Compute Engine persistent disk.
618      GceRegionalPersistentDisk gce_pd = 2;
619    }
620
621    // Optional. Location of this directory in the running workstation.
622    string mount_path = 1 [(google.api.field_behavior) = OPTIONAL];
623  }
624
625  // A Docker container.
626  message Container {
627    // Optional. A Docker container image that defines a custom environment.
628    //
629    // Cloud Workstations provides a number of
630    // [preconfigured
631    // images](https://cloud.google.com/workstations/docs/preconfigured-base-images),
632    // but you can create your own
633    // [custom container
634    // images](https://cloud.google.com/workstations/docs/custom-container-images).
635    // If using a private image, the `host.gceInstance.serviceAccount` field
636    // must be specified in the workstation configuration and must have
637    // permission to pull the specified image. Otherwise, the image must be
638    // publicly accessible.
639    string image = 1 [(google.api.field_behavior) = OPTIONAL];
640
641    // Optional. If set, overrides the default ENTRYPOINT specified by the
642    // image.
643    repeated string command = 2 [(google.api.field_behavior) = OPTIONAL];
644
645    // Optional. Arguments passed to the entrypoint.
646    repeated string args = 3 [(google.api.field_behavior) = OPTIONAL];
647
648    // Optional. Environment variables passed to the container's entrypoint.
649    map<string, string> env = 4 [(google.api.field_behavior) = OPTIONAL];
650
651    // Optional. If set, overrides the default DIR specified by the image.
652    string working_dir = 5 [(google.api.field_behavior) = OPTIONAL];
653
654    // Optional. If set, overrides the USER specified in the image with the
655    // given uid.
656    int32 run_as_user = 6 [(google.api.field_behavior) = OPTIONAL];
657  }
658
659  // A customer-managed encryption key (CMEK) for the Compute Engine
660  // resources of the associated workstation configuration. Specify the name of
661  // your Cloud KMS encryption key and the default service account.
662  // We recommend that you use a separate service account and follow
663  // [Cloud KMS best
664  // practices](https://cloud.google.com/kms/docs/separation-of-duties).
665  message CustomerEncryptionKey {
666    // Immutable. The name of the Google Cloud KMS encryption key. For example,
667    // `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`.
668    // The key must be in the same region as the workstation configuration.
669    string kms_key = 1 [(google.api.field_behavior) = IMMUTABLE];
670
671    // Immutable. The service account to use with the specified
672    // KMS key. We recommend that you use a separate service account
673    // and follow KMS best practices. For more information, see
674    // [Separation of
675    // duties](https://cloud.google.com/kms/docs/separation-of-duties) and
676    // `gcloud kms keys add-iam-policy-binding`
677    // [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member).
678    string kms_key_service_account = 2
679        [(google.api.field_behavior) = IMMUTABLE];
680  }
681
682  // A readiness check to be performed on a workstation.
683  message ReadinessCheck {
684    // Optional. Path to which the request should be sent.
685    string path = 1 [(google.api.field_behavior) = OPTIONAL];
686
687    // Optional. Port to which the request should be sent.
688    int32 port = 2 [(google.api.field_behavior) = OPTIONAL];
689  }
690
691  // Full name of this workstation configuration.
692  string name = 1;
693
694  // Optional. Human-readable name for this workstation configuration.
695  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
696
697  // Output only. A system-assigned unique identifier for this workstation
698  // configuration.
699  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
700
701  // Output only. Indicates whether this workstation configuration is currently
702  // being updated to match its intended state.
703  bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
704
705  // Optional. Client-specified annotations.
706  map<string, string> annotations = 5 [(google.api.field_behavior) = OPTIONAL];
707
708  // Optional.
709  // [Labels](https://cloud.google.com/workstations/docs/label-resources) that
710  // are applied to the workstation configuration and that are also propagated
711  // to the underlying Compute Engine resources.
712  map<string, string> labels = 18 [(google.api.field_behavior) = OPTIONAL];
713
714  // Output only. Time when this workstation configuration was created.
715  google.protobuf.Timestamp create_time = 6
716      [(google.api.field_behavior) = OUTPUT_ONLY];
717
718  // Output only. Time when this workstation configuration was most recently
719  // updated.
720  google.protobuf.Timestamp update_time = 7
721      [(google.api.field_behavior) = OUTPUT_ONLY];
722
723  // Output only. Time when this workstation configuration was soft-deleted.
724  google.protobuf.Timestamp delete_time = 8
725      [(google.api.field_behavior) = OUTPUT_ONLY];
726
727  // Optional. Checksum computed by the server. May be sent on update and delete
728  // requests to make sure that the client has an up-to-date value before
729  // proceeding.
730  string etag = 9 [(google.api.field_behavior) = OPTIONAL];
731
732  // Optional. Number of seconds to wait before automatically stopping a
733  // workstation after it last received user traffic.
734  //
735  // A value of `"0s"` indicates that Cloud Workstations VMs created with this
736  // configuration should never time out due to idleness.
737  // Provide
738  // [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration)
739  // terminated by `s` for seconds—for example, `"7200s"` (2 hours).
740  // The default is `"1200s"` (20 minutes).
741  google.protobuf.Duration idle_timeout = 10
742      [(google.api.field_behavior) = OPTIONAL];
743
744  // Optional. Number of seconds that a workstation can run until it is
745  // automatically shut down. We recommend that workstations be shut down daily
746  // to reduce costs and so that security updates can be applied upon restart.
747  // The
748  // [idle_timeout][google.cloud.workstations.v1.WorkstationConfig.idle_timeout]
749  // and
750  // [running_timeout][google.cloud.workstations.v1.WorkstationConfig.running_timeout]
751  // fields are independent of each other. Note that the
752  // [running_timeout][google.cloud.workstations.v1.WorkstationConfig.running_timeout]
753  // field shuts down VMs after the specified time, regardless of whether or not
754  // the VMs are idle.
755  //
756  // Provide duration terminated by `s` for seconds—for example, `"54000s"`
757  // (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates
758  // that workstations using this configuration should never time out. If
759  // [encryption_key][google.cloud.workstations.v1.WorkstationConfig.encryption_key]
760  // is set, it must be greater than `"0s"` and less than
761  // `"86400s"` (24 hours).
762  //
763  // Warning: A value of `"0s"` indicates that Cloud Workstations VMs created
764  // with this configuration have no maximum running time. This is strongly
765  // discouraged because you incur costs and will not pick up security updates.
766  google.protobuf.Duration running_timeout = 11
767      [(google.api.field_behavior) = OPTIONAL];
768
769  // Optional. Runtime host for the workstation.
770  Host host = 12 [(google.api.field_behavior) = OPTIONAL];
771
772  // Optional. Directories to persist across workstation sessions.
773  repeated PersistentDirectory persistent_directories = 13
774      [(google.api.field_behavior) = OPTIONAL];
775
776  // Optional. Container that runs upon startup for each workstation using this
777  // workstation configuration.
778  Container container = 14 [(google.api.field_behavior) = OPTIONAL];
779
780  // Immutable. Encrypts resources of this workstation configuration using a
781  // customer-managed encryption key (CMEK).
782  //
783  // If specified, the boot disk of the Compute Engine instance and the
784  // persistent disk are encrypted using this encryption key. If
785  // this field is not set, the disks are encrypted using a generated
786  // key. Customer-managed encryption keys do not protect disk metadata.
787  //
788  // If the customer-managed encryption key is rotated, when the workstation
789  // instance is stopped, the system attempts to recreate the
790  // persistent disk with the new version of the key. Be sure to keep
791  // older versions of the key until the persistent disk is recreated.
792  // Otherwise, data on the persistent disk might be lost.
793  //
794  // If the encryption key is revoked, the workstation session automatically
795  // stops within 7 hours.
796  //
797  // Immutable after the workstation configuration is created.
798  CustomerEncryptionKey encryption_key = 17
799      [(google.api.field_behavior) = IMMUTABLE];
800
801  // Optional. Readiness checks to perform when starting a workstation using
802  // this workstation configuration. Mark a workstation as running only after
803  // all specified readiness checks return 200 status codes.
804  repeated ReadinessCheck readiness_checks = 19
805      [(google.api.field_behavior) = OPTIONAL];
806
807  // Optional. Immutable. Specifies the zones used to replicate the VM and disk
808  // resources within the region. If set, exactly two zones within the
809  // workstation cluster's region must be specified—for example,
810  // `['us-central1-a', 'us-central1-f']`. If this field is empty, two default
811  // zones within the region are used.
812  //
813  // Immutable after the workstation configuration is created.
814  repeated string replica_zones = 23 [
815    (google.api.field_behavior) = OPTIONAL,
816    (google.api.field_behavior) = IMMUTABLE
817  ];
818
819  // Output only. Whether this resource is degraded, in which case it may
820  // require user action to restore full functionality. See also the
821  // [conditions][google.cloud.workstations.v1.WorkstationConfig.conditions]
822  // field.
823  bool degraded = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
824
825  // Output only. Status conditions describing the current resource state.
826  repeated google.rpc.Status conditions = 16
827      [(google.api.field_behavior) = OUTPUT_ONLY];
828}
829
830// A single instance of a developer workstation with its own persistent storage.
831message Workstation {
832  option (google.api.resource) = {
833    type: "workstations.googleapis.com/Workstation"
834    pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}"
835    plural: "workstations"
836    singular: "workstation"
837    style: DECLARATIVE_FRIENDLY
838  };
839
840  // Whether a workstation is running and ready to receive user requests.
841  enum State {
842    // Do not use.
843    STATE_UNSPECIFIED = 0;
844
845    // The workstation is not yet ready to accept requests from users but will
846    // be soon.
847    STATE_STARTING = 1;
848
849    // The workstation is ready to accept requests from users.
850    STATE_RUNNING = 2;
851
852    // The workstation is being stopped.
853    STATE_STOPPING = 3;
854
855    // The workstation is stopped and will not be able to receive requests until
856    // it is started.
857    STATE_STOPPED = 4;
858  }
859
860  // Full name of this workstation.
861  string name = 1;
862
863  // Optional. Human-readable name for this workstation.
864  string display_name = 2 [(google.api.field_behavior) = OPTIONAL];
865
866  // Output only. A system-assigned unique identifier for this workstation.
867  string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
868
869  // Output only. Indicates whether this workstation is currently being updated
870  // to match its intended state.
871  bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
872
873  // Optional. Client-specified annotations.
874  map<string, string> annotations = 5 [(google.api.field_behavior) = OPTIONAL];
875
876  // Optional.
877  // [Labels](https://cloud.google.com/workstations/docs/label-resources) that
878  // are applied to the workstation and that are also propagated to the
879  // underlying Compute Engine resources.
880  map<string, string> labels = 13 [(google.api.field_behavior) = OPTIONAL];
881
882  // Output only. Time when this workstation was created.
883  google.protobuf.Timestamp create_time = 6
884      [(google.api.field_behavior) = OUTPUT_ONLY];
885
886  // Output only. Time when this workstation was most recently updated.
887  google.protobuf.Timestamp update_time = 7
888      [(google.api.field_behavior) = OUTPUT_ONLY];
889
890  // Output only. Time when this workstation was most recently successfully
891  // started, regardless of the workstation's initial state.
892  google.protobuf.Timestamp start_time = 14
893      [(google.api.field_behavior) = OUTPUT_ONLY];
894
895  // Output only. Time when this workstation was soft-deleted.
896  google.protobuf.Timestamp delete_time = 8
897      [(google.api.field_behavior) = OUTPUT_ONLY];
898
899  // Optional. Checksum computed by the server. May be sent on update and delete
900  // requests to make sure that the client has an up-to-date value before
901  // proceeding.
902  string etag = 9 [(google.api.field_behavior) = OPTIONAL];
903
904  // Output only. Current state of the workstation.
905  State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
906
907  // Output only. Host to which clients can send HTTPS traffic that will be
908  // received by the workstation. Authorized traffic will be received to the
909  // workstation as HTTP on port 80. To send traffic to a different port,
910  // clients may prefix the host with the destination port in the format
911  // `{port}-{host}`.
912  string host = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
913}
914
915// Request message for GetWorkstationCluster.
916message GetWorkstationClusterRequest {
917  // Required. Name of the requested resource.
918  string name = 1 [
919    (google.api.field_behavior) = REQUIRED,
920    (google.api.resource_reference) = {
921      type: "workstations.googleapis.com/WorkstationCluster"
922    }
923  ];
924}
925
926// Request message for ListWorkstationClusters.
927message ListWorkstationClustersRequest {
928  // Required. Parent resource name.
929  string parent = 1 [
930    (google.api.field_behavior) = REQUIRED,
931    (google.api.resource_reference) = {
932      child_type: "workstations.googleapis.com/WorkstationCluster"
933    }
934  ];
935
936  // Optional. Maximum number of items to return.
937  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
938
939  // Optional. next_page_token value returned from a previous List request, if
940  // any.
941  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
942}
943
944// Response message for ListWorkstationClusters.
945message ListWorkstationClustersResponse {
946  // The requested workstation clusters.
947  repeated WorkstationCluster workstation_clusters = 1;
948
949  // Token to retrieve the next page of results, or empty if there are no more
950  // results in the list.
951  string next_page_token = 2;
952
953  // Unreachable resources.
954  repeated string unreachable = 3;
955}
956
957// Message for creating a CreateWorkstationCluster.
958message CreateWorkstationClusterRequest {
959  // Required. Parent resource name.
960  string parent = 1 [
961    (google.api.field_behavior) = REQUIRED,
962    (google.api.resource_reference) = {
963      child_type: "workstations.googleapis.com/WorkstationCluster"
964    }
965  ];
966
967  // Required. ID to use for the workstation cluster.
968  string workstation_cluster_id = 2 [(google.api.field_behavior) = REQUIRED];
969
970  // Required. Workstation cluster to create.
971  WorkstationCluster workstation_cluster = 3
972      [(google.api.field_behavior) = REQUIRED];
973
974  // Optional. If set, validate the request and preview the review, but do not
975  // actually apply it.
976  bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL];
977}
978
979// Request message for UpdateWorkstationCluster.
980message UpdateWorkstationClusterRequest {
981  // Required. Workstation cluster to update.
982  WorkstationCluster workstation_cluster = 1
983      [(google.api.field_behavior) = REQUIRED];
984
985  // Required. Mask that specifies which fields in the workstation cluster
986  // should be updated.
987  google.protobuf.FieldMask update_mask = 2
988      [(google.api.field_behavior) = REQUIRED];
989
990  // Optional. If set, validate the request and preview the review, but do not
991  // actually apply it.
992  bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
993
994  // Optional. If set, and the workstation cluster is not found, a new
995  // workstation cluster will be created. In this situation, update_mask is
996  // ignored.
997  bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL];
998}
999
1000// Message for deleting a workstation cluster.
1001message DeleteWorkstationClusterRequest {
1002  // Required. Name of the workstation cluster to delete.
1003  string name = 1 [
1004    (google.api.field_behavior) = REQUIRED,
1005    (google.api.resource_reference) = {
1006      type: "workstations.googleapis.com/WorkstationCluster"
1007    }
1008  ];
1009
1010  // Optional. If set, validate the request and preview the review, but do not
1011  // apply it.
1012  bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL];
1013
1014  // Optional. If set, the request will be rejected if the latest version of the
1015  // workstation cluster on the server does not have this ETag.
1016  string etag = 3 [(google.api.field_behavior) = OPTIONAL];
1017
1018  // Optional. If set, any workstation configurations and workstations in the
1019  // workstation cluster are also deleted. Otherwise, the request only
1020  // works if the workstation cluster has no configurations or workstations.
1021  bool force = 4 [(google.api.field_behavior) = OPTIONAL];
1022}
1023
1024// Request message for GetWorkstationConfig.
1025message GetWorkstationConfigRequest {
1026  // Required. Name of the requested resource.
1027  string name = 1 [
1028    (google.api.field_behavior) = REQUIRED,
1029    (google.api.resource_reference) = {
1030      type: "workstations.googleapis.com/WorkstationConfig"
1031    }
1032  ];
1033}
1034
1035// Request message for ListWorkstationConfigs.
1036message ListWorkstationConfigsRequest {
1037  // Required. Parent resource name.
1038  string parent = 1 [
1039    (google.api.field_behavior) = REQUIRED,
1040    (google.api.resource_reference) = {
1041      type: "workstations.googleapis.com/WorkstationCluster"
1042    }
1043  ];
1044
1045  // Optional. Maximum number of items to return.
1046  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1047
1048  // Optional. next_page_token value returned from a previous List request, if
1049  // any.
1050  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1051}
1052
1053// Response message for ListWorkstationConfigs.
1054message ListWorkstationConfigsResponse {
1055  // The requested configs.
1056  repeated WorkstationConfig workstation_configs = 1;
1057
1058  // Token to retrieve the next page of results, or empty if there are no more
1059  // results in the list.
1060  string next_page_token = 2;
1061
1062  // Unreachable resources.
1063  repeated string unreachable = 3;
1064}
1065
1066// Request message for ListUsableWorkstationConfigs.
1067message ListUsableWorkstationConfigsRequest {
1068  // Required. Parent resource name.
1069  string parent = 1 [
1070    (google.api.field_behavior) = REQUIRED,
1071    (google.api.resource_reference) = {
1072      type: "workstations.googleapis.com/WorkstationCluster"
1073    }
1074  ];
1075
1076  // Optional. Maximum number of items to return.
1077  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1078
1079  // Optional. next_page_token value returned from a previous List request, if
1080  // any.
1081  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1082}
1083
1084// Response message for ListUsableWorkstationConfigs.
1085message ListUsableWorkstationConfigsResponse {
1086  // The requested configs.
1087  repeated WorkstationConfig workstation_configs = 1;
1088
1089  // Token to retrieve the next page of results, or empty if there are no more
1090  // results in the list.
1091  string next_page_token = 2;
1092
1093  // Unreachable resources.
1094  repeated string unreachable = 3;
1095}
1096
1097// Message for creating a CreateWorkstationConfig.
1098message CreateWorkstationConfigRequest {
1099  // Required. Parent resource name.
1100  string parent = 1 [
1101    (google.api.field_behavior) = REQUIRED,
1102    (google.api.resource_reference) = {
1103      type: "workstations.googleapis.com/WorkstationCluster"
1104    }
1105  ];
1106
1107  // Required. ID to use for the workstation configuration.
1108  string workstation_config_id = 2 [(google.api.field_behavior) = REQUIRED];
1109
1110  // Required. Config to create.
1111  WorkstationConfig workstation_config = 3
1112      [(google.api.field_behavior) = REQUIRED];
1113
1114  // Optional. If set, validate the request and preview the review, but do not
1115  // actually apply it.
1116  bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL];
1117}
1118
1119// Request message for UpdateWorkstationConfig.
1120message UpdateWorkstationConfigRequest {
1121  // Required. Config to update.
1122  WorkstationConfig workstation_config = 1
1123      [(google.api.field_behavior) = REQUIRED];
1124
1125  // Required. Mask specifying which fields in the workstation configuration
1126  // should be updated.
1127  google.protobuf.FieldMask update_mask = 2
1128      [(google.api.field_behavior) = REQUIRED];
1129
1130  // Optional. If set, validate the request and preview the review, but do not
1131  // actually apply it.
1132  bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
1133
1134  // Optional. If set and the workstation configuration is not found, a new
1135  // workstation configuration will be created. In this situation,
1136  // update_mask is ignored.
1137  bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL];
1138}
1139
1140// Message for deleting a workstation configuration.
1141message DeleteWorkstationConfigRequest {
1142  // Required. Name of the workstation configuration to delete.
1143  string name = 1 [
1144    (google.api.field_behavior) = REQUIRED,
1145    (google.api.resource_reference) = {
1146      type: "workstations.googleapis.com/WorkstationConfig"
1147    }
1148  ];
1149
1150  // Optional. If set, validate the request and preview the review, but do not
1151  // actually apply it.
1152  bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL];
1153
1154  // Optional. If set, the request is rejected if the latest version of the
1155  // workstation configuration on the server does not have this ETag.
1156  string etag = 3 [(google.api.field_behavior) = OPTIONAL];
1157
1158  // Optional. If set, any workstations in the workstation configuration are
1159  // also deleted. Otherwise, the request works only if the workstation
1160  // configuration has no workstations.
1161  bool force = 4 [(google.api.field_behavior) = OPTIONAL];
1162}
1163
1164// Request message for GetWorkstation.
1165message GetWorkstationRequest {
1166  // Required. Name of the requested resource.
1167  string name = 1 [
1168    (google.api.field_behavior) = REQUIRED,
1169    (google.api.resource_reference) = {
1170      type: "workstations.googleapis.com/Workstation"
1171    }
1172  ];
1173}
1174
1175// Request message for ListWorkstations.
1176message ListWorkstationsRequest {
1177  // Required. Parent resource name.
1178  string parent = 1 [
1179    (google.api.field_behavior) = REQUIRED,
1180    (google.api.resource_reference) = {
1181      type: "workstations.googleapis.com/WorkstationConfig"
1182    }
1183  ];
1184
1185  // Optional. Maximum number of items to return.
1186  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1187
1188  // Optional. next_page_token value returned from a previous List request, if
1189  // any.
1190  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1191}
1192
1193// Response message for ListWorkstations.
1194message ListWorkstationsResponse {
1195  // The requested workstations.
1196  repeated Workstation workstations = 1;
1197
1198  // Optional. Token to retrieve the next page of results, or empty if there are
1199  // no more results in the list.
1200  string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL];
1201
1202  // Optional. Unreachable resources.
1203  repeated string unreachable = 3 [(google.api.field_behavior) = OPTIONAL];
1204}
1205
1206// Request message for ListUsableWorkstations.
1207message ListUsableWorkstationsRequest {
1208  // Required. Parent resource name.
1209  string parent = 1 [
1210    (google.api.field_behavior) = REQUIRED,
1211    (google.api.resource_reference) = {
1212      type: "workstations.googleapis.com/WorkstationConfig"
1213    }
1214  ];
1215
1216  // Optional. Maximum number of items to return.
1217  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
1218
1219  // Optional. next_page_token value returned from a previous List request, if
1220  // any.
1221  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
1222}
1223
1224// Response message for ListUsableWorkstations.
1225message ListUsableWorkstationsResponse {
1226  // The requested workstations.
1227  repeated Workstation workstations = 1;
1228
1229  // Token to retrieve the next page of results, or empty if there are no more
1230  // results in the list.
1231  string next_page_token = 2;
1232
1233  // Unreachable resources.
1234  repeated string unreachable = 3;
1235}
1236
1237// Message for creating a CreateWorkstation.
1238message CreateWorkstationRequest {
1239  // Required. Parent resource name.
1240  string parent = 1 [
1241    (google.api.field_behavior) = REQUIRED,
1242    (google.api.resource_reference) = {
1243      type: "workstations.googleapis.com/WorkstationConfig"
1244    }
1245  ];
1246
1247  // Required. ID to use for the workstation.
1248  string workstation_id = 2 [(google.api.field_behavior) = REQUIRED];
1249
1250  // Required. Workstation to create.
1251  Workstation workstation = 3 [(google.api.field_behavior) = REQUIRED];
1252
1253  // Optional. If set, validate the request and preview the review, but do not
1254  // actually apply it.
1255  bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL];
1256}
1257
1258// Request message for UpdateWorkstation.
1259message UpdateWorkstationRequest {
1260  // Required. Workstation to update.
1261  Workstation workstation = 1 [(google.api.field_behavior) = REQUIRED];
1262
1263  // Required. Mask specifying which fields in the workstation configuration
1264  // should be updated.
1265  google.protobuf.FieldMask update_mask = 2
1266      [(google.api.field_behavior) = REQUIRED];
1267
1268  // Optional. If set, validate the request and preview the review, but do not
1269  // actually apply it.
1270  bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL];
1271
1272  // Optional. If set and the workstation configuration is not found, a new
1273  // workstation configuration is created. In this situation, update_mask
1274  // is ignored.
1275  bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL];
1276}
1277
1278// Request message for DeleteWorkstation.
1279message DeleteWorkstationRequest {
1280  // Required. Name of the workstation to delete.
1281  string name = 1 [
1282    (google.api.field_behavior) = REQUIRED,
1283    (google.api.resource_reference) = {
1284      type: "workstations.googleapis.com/Workstation"
1285    }
1286  ];
1287
1288  // Optional. If set, validate the request and preview the review, but do not
1289  // actually apply it.
1290  bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL];
1291
1292  // Optional. If set, the request will be rejected if the latest version of the
1293  // workstation on the server does not have this ETag.
1294  string etag = 3 [(google.api.field_behavior) = OPTIONAL];
1295}
1296
1297// Request message for StartWorkstation.
1298message StartWorkstationRequest {
1299  // Required. Name of the workstation to start.
1300  string name = 1 [
1301    (google.api.field_behavior) = REQUIRED,
1302    (google.api.resource_reference) = {
1303      type: "workstations.googleapis.com/Workstation"
1304    }
1305  ];
1306
1307  // Optional. If set, validate the request and preview the review, but do not
1308  // actually apply it.
1309  bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL];
1310
1311  // Optional. If set, the request will be rejected if the latest version of the
1312  // workstation on the server does not have this ETag.
1313  string etag = 3 [(google.api.field_behavior) = OPTIONAL];
1314}
1315
1316// Request message for StopWorkstation.
1317message StopWorkstationRequest {
1318  // Required. Name of the workstation to stop.
1319  string name = 1 [
1320    (google.api.field_behavior) = REQUIRED,
1321    (google.api.resource_reference) = {
1322      type: "workstations.googleapis.com/Workstation"
1323    }
1324  ];
1325
1326  // Optional. If set, validate the request and preview the review, but do not
1327  // actually apply it.
1328  bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL];
1329
1330  // Optional. If set, the request will be rejected if the latest version of the
1331  // workstation on the server does not have this ETag.
1332  string etag = 3 [(google.api.field_behavior) = OPTIONAL];
1333}
1334
1335// Request message for GenerateAccessToken.
1336message GenerateAccessTokenRequest {
1337  // Desired expiration or lifetime of the access token.
1338  oneof expiration {
1339    // Desired expiration time of the access token. This value must
1340    // be at most 24 hours in the future. If a value is not specified, the
1341    // token's expiration time will be set to a default value of 1 hour in the
1342    // future.
1343    google.protobuf.Timestamp expire_time = 2;
1344
1345    // Desired lifetime duration of the access token. This value must
1346    // be at most 24 hours. If a value is not specified, the token's lifetime
1347    // will be set to a default value of 1 hour.
1348    google.protobuf.Duration ttl = 3;
1349  }
1350
1351  // Required. Name of the workstation for which the access token should be
1352  // generated.
1353  string workstation = 1 [
1354    (google.api.field_behavior) = REQUIRED,
1355    (google.api.resource_reference) = {
1356      type: "workstations.googleapis.com/Workstation"
1357    }
1358  ];
1359}
1360
1361// Response message for GenerateAccessToken.
1362message GenerateAccessTokenResponse {
1363  // The generated bearer access token. To use this token, include it in an
1364  // Authorization header of an HTTP request sent to the associated
1365  // workstation's hostname—for example, `Authorization: Bearer
1366  // <access_token>`.
1367  string access_token = 1;
1368
1369  // Time at which the generated token will expire.
1370  google.protobuf.Timestamp expire_time = 2;
1371}
1372
1373// Metadata for long-running operations.
1374message OperationMetadata {
1375  // Output only. Time that the operation was created.
1376  google.protobuf.Timestamp create_time = 1
1377      [(google.api.field_behavior) = OUTPUT_ONLY];
1378
1379  // Output only. Time that the operation finished running.
1380  google.protobuf.Timestamp end_time = 2
1381      [(google.api.field_behavior) = OUTPUT_ONLY];
1382
1383  // Output only. Server-defined resource path for the target of the operation.
1384  string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
1385
1386  // Output only. Name of the verb executed by the operation.
1387  string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
1388
1389  // Output only. Human-readable status of the operation, if any.
1390  string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
1391
1392  // Output only. Identifies whether the user has requested cancellation
1393  // of the operation.
1394  bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
1395
1396  // Output only. API version used to start the operation.
1397  string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
1398}
1399