• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2022 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.assuredworkloads.v1beta1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto";
22import "google/longrunning/operations.proto";
23import "google/protobuf/empty.proto";
24
25option csharp_namespace = "Google.Cloud.AssuredWorkloads.V1Beta1";
26option go_package = "cloud.google.com/go/assuredworkloads/apiv1beta1/assuredworkloadspb;assuredworkloadspb";
27option java_multiple_files = true;
28option java_outer_classname = "AssuredworkloadsServiceProto";
29option java_package = "com.google.cloud.assuredworkloads.v1beta1";
30option php_namespace = "Google\\Cloud\\AssuredWorkloads\\V1beta1";
31option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1";
32
33// Service to manage AssuredWorkloads.
34service AssuredWorkloadsService {
35  option (google.api.default_host) = "assuredworkloads.googleapis.com";
36  option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
37
38  // Creates Assured Workload.
39  rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) {
40    option (google.api.http) = {
41      post: "/v1beta1/{parent=organizations/*/locations/*}/workloads"
42      body: "workload"
43    };
44    option (google.api.method_signature) = "parent,workload";
45    option (google.longrunning.operation_info) = {
46      response_type: "Workload"
47      metadata_type: "CreateWorkloadOperationMetadata"
48    };
49  }
50
51  // Updates an existing workload.
52  // Currently allows updating of workload display_name and labels.
53  // For force updates don't set etag field in the Workload.
54  // Only one update operation per workload can be in progress.
55  rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) {
56    option (google.api.method_signature) = "workload,update_mask";
57  }
58
59  // Restrict the list of resources allowed in the Workload environment.
60  // The current list of allowed products can be found at
61  // https://cloud.google.com/assured-workloads/docs/supported-products
62  // In addition to assuredworkloads.workload.update permission, the user should
63  // also have orgpolicy.policy.set permission on the folder resource
64  // to use this functionality.
65  rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) returns (RestrictAllowedResourcesResponse) {
66    option (google.api.http) = {
67      post: "/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources"
68      body: "*"
69    };
70  }
71
72  // Deletes the workload. Make sure that workload's direct children are already
73  // in a deleted state, otherwise the request will fail with a
74  // FAILED_PRECONDITION error.
75  // In addition to assuredworkloads.workload.delete permission, the user should
76  // also have orgpolicy.policy.set permission on the deleted folder to remove
77  // Assured Workloads OrgPolicies.
78  rpc DeleteWorkload(DeleteWorkloadRequest) returns (google.protobuf.Empty) {
79    option (google.api.http) = {
80      delete: "/v1beta1/{name=organizations/*/locations/*/workloads/*}"
81    };
82    option (google.api.method_signature) = "name";
83  }
84
85  // Gets Assured Workload associated with a CRM Node
86  rpc GetWorkload(GetWorkloadRequest) returns (Workload) {
87    option (google.api.method_signature) = "name";
88  }
89
90  // Analyze if the source Assured Workloads can be moved to the target Assured
91  // Workload
92  rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest) returns (AnalyzeWorkloadMoveResponse) {
93    option (google.api.method_signature) = "project,target";
94  }
95
96  // Lists Assured Workloads under a CRM Node.
97  rpc ListWorkloads(ListWorkloadsRequest) returns (ListWorkloadsResponse) {
98    option (google.api.method_signature) = "parent";
99  }
100}
101