use of bio.terra.workspace.model.UpdateBigQueryDatasetReferenceRequestBody in project terra-workspace-manager by DataBiosphere.
the class BqDatasetUtils method updateBigQueryDatasetReference.
/**
* Updates the name, description or referencing target of a BQ dataset reference.
*/
public static void updateBigQueryDatasetReference(ReferencedGcpResourceApi resourceApi, UUID workspace, UUID resourceId, @Nullable String name, @Nullable String description, @Nullable String projectId, @Nullable String datasetId) throws ApiException {
UpdateBigQueryDatasetReferenceRequestBody body = new UpdateBigQueryDatasetReferenceRequestBody();
if (name != null) {
body.setName(name);
}
if (description != null) {
body.setDescription(description);
}
if (projectId != null) {
body.setProjectId(projectId);
}
if (datasetId != null) {
body.setDatasetId(datasetId);
}
resourceApi.updateBigQueryDatasetReferenceResource(body, workspace, resourceId);
}
use of bio.terra.workspace.model.UpdateBigQueryDatasetReferenceRequestBody in project terra-cli by DataBiosphere.
the class WorkspaceManagerService method updateReferencedBigQueryDataset.
/**
* Call the Workspace Manager POST
* "/api/workspaces/v1/{workspaceId}/resources/referenced/gcp/bigquerydatasets/{resourceId}"
* endpoint to update a BigQuery dataset referenced 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 updateReferencedBigQueryDataset(UUID workspaceId, UUID resourceId, UpdateReferencedBqDatasetParams updateParams) {
// convert the CLI object to a WSM request object
UpdateBigQueryDatasetReferenceRequestBody updateRequest = new UpdateBigQueryDatasetReferenceRequestBody().name(updateParams.resourceParams.name).description(updateParams.resourceParams.description).projectId(updateParams.projectId).datasetId(updateParams.datasetId);
callWithRetries(() -> new ReferencedGcpResourceApi(apiClient).updateBigQueryDatasetReferenceResource(updateRequest, workspaceId, resourceId), "Error updating referenced BigQuery dataset in the workspace.");
}
Aggregations