use of bio.terra.workspace.model.UpdateControlledGcpGcsBucketRequestBody in project terra-workspace-manager by DataBiosphere.
the class ControlledGcsBucketLifecycle method updateBucketAttempt.
private GcpGcsBucketResource updateBucketAttempt(ControlledGcpResourceApi resourceApi, UUID resourceId, @Nullable String updatedResourceName, @Nullable String updatedDescription, @Nullable GcpGcsBucketUpdateParameters updateParameters) throws ApiException {
var body = new UpdateControlledGcpGcsBucketRequestBody().name(updatedResourceName).description(updatedDescription).updateParameters(updateParameters);
logger.info("Attempting to update bucket {} resource ID {} workspace {}", bucketName, resourceId, getWorkspaceId());
return resourceApi.updateGcsBucket(body, getWorkspaceId(), resourceId);
}
use of bio.terra.workspace.model.UpdateControlledGcpGcsBucketRequestBody in project terra-cli by DataBiosphere.
the class WorkspaceManagerService method updateControlledGcsBucket.
/**
* Call the Workspace Manager POST
* "/api/workspaces/v1/{workspaceId}/resources/controlled/gcp/buckets/{resourceId}" endpoint to
* update a GCS bucket controlled resource in the workspace.
*
* @param workspaceId the workspace where the resource exists
* @param resourceId the resource id
* @param updateParams resource properties to update
*/
public void updateControlledGcsBucket(UUID workspaceId, UUID resourceId, UpdateControlledGcsBucketParams updateParams) {
// convert the CLI lifecycle rule object into the WSM request objects
List<GcpGcsBucketLifecycleRule> lifecycleRules = fromCLIObject(updateParams.lifecycle);
// convert the CLI object to a WSM request object
UpdateControlledGcpGcsBucketRequestBody updateRequest = new UpdateControlledGcpGcsBucketRequestBody().name(updateParams.resourceFields.name).description(updateParams.resourceFields.description).updateParameters(new GcpGcsBucketUpdateParameters().defaultStorageClass(updateParams.defaultStorageClass).lifecycle(new GcpGcsBucketLifecycle().rules(lifecycleRules)));
callWithRetries(() -> new ControlledGcpResourceApi(apiClient).updateGcsBucket(updateRequest, workspaceId, resourceId), "Error updating controlled GCS bucket in the workspace.");
}
Aggregations