assuredworkloads_service.proto 4.2 KB

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