Skip to content

Commit

Permalink
feat: Updated v1beta1 analyzeWorkloadMove documentation
Browse files Browse the repository at this point in the history
Committer: @ketanbshah
PiperOrigin-RevId: 469606602
  • Loading branch information
Google APIs authored and copybara-github committed Aug 24, 2022
1 parent 7c3a38d commit 32d2f9b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 86 deletions.
88 changes: 29 additions & 59 deletions google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto
Original file line number Diff line number Diff line change
Expand Up @@ -67,39 +67,6 @@ message UpdateWorkloadRequest {
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request for restricting list of available services in Workload environment.
message RestrictAllowedServicesRequest {
// The type of restriction.
enum RestrictionType {
// Unknown restriction type.
RESTRICTION_TYPE_UNSPECIFIED = 0;

// Allow the use all services. This effectively remove all restrictions
// placed on the Folder.
ALLOW_ALL_GCP_SERVICES = 1;

// Based on Workload's compliance regime, allowed list changes.
// See - https://cloud.google.com/assured-workloads/docs/supported-products
// for the list of allowed services.
ALLOW_COMPLIANT_SERVICES = 2;
}

// Required. The resource name of the Workload. This is the workloads's
// relative path in the API, formatted as
// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
// For example,
// "organizations/123/locations/us-east1/workloads/assured-workload-1".
string name = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The type of restriction for using gcp services in the Workload environment.
RestrictionType restriction_type = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response for restricting the list of allowed services.
message RestrictAllowedServicesResponse {

}

// Request for restricting list of available resources in Workload environment.
message RestrictAllowedResourcesRequest {
// The type of restriction.
Expand Down Expand Up @@ -166,41 +133,41 @@ message GetWorkloadRequest {
];
}

// Request to check if source workload can be moved to target workload.
// A request to analyze a hypothetical move of a source project or project-based
// workload to a target (destination) folder-based workload.
message AnalyzeWorkloadMoveRequest {
// Kind of resource to be moved to the destination workload
// The resource type to be moved to the destination workload. It can be either
// an existing project or a project-based workload.
oneof projectOrWorkloadResource {
// The Source is project based Workload to be moved. This is the workloads's
// relative path in the API, formatted as
// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
// For example,
// "organizations/123/locations/us-east1/workloads/assured-workload-1".
// The source type is a project-based workload. Specify the workloads's
// relative resource name, formatted as:
// "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}"
// For example:
// "organizations/123/locations/us-east1/workloads/assured-workload-1"
string source = 1;

// The Source is a project based to be moved.
// This is the project's relative path in the API, formatted as
// "cloudresourcemanager.googleapis.com/projects/{project_number}"
// "projects/{project_number}"
// "cloudresourcemanager.googleapis.com/projects/{project_id}"
// "projects/{project_id}"
// For example,
// "organizations/123/locations/us-east1/workloads/assured-workload-1".
// The source type is a project. Specify the project's relative resource
// name, formatted as either a project number or a project ID:
// "projects/{PROJECT_NUMBER}" or "projects/{PROJECT_ID}"
// For example:
// "projects/951040570662" when specifying a project number, or
// "projects/my-project-123" when specifying a project ID.
string project = 3;
}

// Required. The resource name of the Workload to fetch. This is the workloads's
// relative path in the API, formatted as
// "organizations/{organization_id}/locations/{location_id}/workloads/{workload_id}".
// For example,
// "organizations/123/locations/us-east1/workloads/assured-workload-2".
// Required. The resource ID of the folder-based destination workload. This workload is
// where the source project will hypothetically be moved to. Specify the
// workload's relative resource name, formatted as:
// "organizations/{ORGANIZATION_ID}/locations/{LOCATION_ID}/workloads/{WORKLOAD_ID}"
// For example:
// "organizations/123/locations/us-east1/workloads/assured-workload-2"
string target = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response with the analysis if the source workload can be moved to the target
// workload
// A response that includes the analysis of the hypothetical resource move.
message AnalyzeWorkloadMoveResponse {
// List of blockers that prevent moving the source workload to the target
// workload
// A list of blockers that should be addressed before moving the source
// project or project-based workload to the destination folder-based workload.
repeated string blockers = 1;
}

Expand Down Expand Up @@ -308,6 +275,9 @@ message Workload {

// International Traffic in Arms Regulations
ITAR = 10;

// Assured Workloads for Australia Regions and Support controls
AU_REGIONS_AND_US_SUPPORT = 11;
}

// Settings specific to the Key Management Service.
Expand Down Expand Up @@ -483,15 +453,15 @@ message Workload {
(google.api.field_behavior) = IMMUTABLE
];

// Input only. The billing account used for the resources which are
// Output only. The billing account used for the resources which are
// direct children of workload. This billing account is initially associated
// with the resources created as part of Workload creation.
// After the initial creation of these resources, the customer can change
// the assigned billing account.
// The resource name has the form
// `billingAccounts/{billing_account_id}`. For example,
// `billingAccounts/012345-567890-ABCDEF`.
string billing_account = 6 [(google.api.field_behavior) = INPUT_ONLY];
string billing_account = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// Settings specific to the selected [compliance_regime]
oneof compliance_regime_settings {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
"service": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"method": "AnalyzeWorkloadMove"
},
{
"service": "google.cloud.assuredworkloads.v1beta1.AssuredWorkloadsService",
"method": "AnalyzeWorkloadMove"
},
{
"service": "google.longrunning.Operations",
"method": "GetOperation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ option ruby_package = "Google::Cloud::AssuredWorkloads::V1beta1";
// Service to manage AssuredWorkloads.
service AssuredWorkloadsService {
option (google.api.default_host) = "assuredworkloads.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";

// Creates Assured Workload.
rpc CreateWorkload(CreateWorkloadRequest)
returns (google.longrunning.Operation) {
rpc CreateWorkload(CreateWorkloadRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1beta1/{parent=organizations/*/locations/*}/workloads"
body: "workload"
Expand All @@ -55,30 +53,16 @@ service AssuredWorkloadsService {
// For force updates don't set etag field in the Workload.
// Only one update operation per workload can be in progress.
rpc UpdateWorkload(UpdateWorkloadRequest) returns (Workload) {
option (google.api.http) = {
patch: "/v1beta1/{workload.name=organizations/*/locations/*/workloads/*}"
body: "workload"
};
option (google.api.method_signature) = "workload,update_mask";
}

// Restrict the list of services allowed in the Workload environment.
// The current list of allowed services can be found at
// https://cloud.google.com/assured-workloads/docs/supported-products
// In addition to assuredworkloads.workload.update permission, the user should
// also have orgpolicy.policy.set permission on the folder resource
// to use this functionality.
rpc RestrictAllowedServices(RestrictAllowedServicesRequest)
returns (RestrictAllowedServicesResponse) {}

// Restrict the list of resources allowed in the Workload environment.
// The current list of allowed products can be found at
// https://cloud.google.com/assured-workloads/docs/supported-products
// In addition to assuredworkloads.workload.update permission, the user should
// also have orgpolicy.policy.set permission on the folder resource
// to use this functionality.
rpc RestrictAllowedResources(RestrictAllowedResourcesRequest)
returns (RestrictAllowedResourcesResponse) {
rpc RestrictAllowedResources(RestrictAllowedResourcesRequest) returns (RestrictAllowedResourcesResponse) {
option (google.api.http) = {
post: "/v1beta1/{name=organizations/*/locations/*/workloads/*}:restrictAllowedResources"
body: "*"
Expand All @@ -103,10 +87,9 @@ service AssuredWorkloadsService {
option (google.api.method_signature) = "name";
}

// Analyze if the source Assured Workloads can be moved to the target Assured
// Workload
rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest)
returns (AnalyzeWorkloadMoveResponse) {
// A request to analyze a hypothetical move of a source project or
// project-based workload to a target (destination) folder-based workload.
rpc AnalyzeWorkloadMove(AnalyzeWorkloadMoveRequest) returns (AnalyzeWorkloadMoveResponse) {
option (google.api.method_signature) = "project,target";
}

Expand Down

0 comments on commit 32d2f9b

Please sign in to comment.