use of bio.terra.cli.serialization.userfacing.input.CreateResourceParams in project terra-cli by DataBiosphere.
the class GcsObject method execute.
/**
* Add a referenced GCS bucket object to the workspace.
*/
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
// build the resource object to add
CreateResourceParams.Builder createResourceParams = resourceCreationOptions.populateMetadataFields().stewardshipType(StewardshipType.REFERENCED);
AddGcsObjectParams.Builder createParams = new AddGcsObjectParams.Builder().resourceFields(createResourceParams.build()).bucketName(bucketNameOption.getBucketName()).objectName(objectName);
bio.terra.cli.businessobject.resource.GcsObject addedResource = bio.terra.cli.businessobject.resource.GcsObject.addReferenced(createParams.build());
formatOption.printReturnValue(new UFGcsObject(addedResource), GcsObject::printText);
}
use of bio.terra.cli.serialization.userfacing.input.CreateResourceParams in project terra-cli by DataBiosphere.
the class GitRepo method execute.
/**
* Add a referenced git repo to the workspace.
*/
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
// build the resource object to add
CreateResourceParams.Builder createResourceParams = resourceCreationOptions.populateMetadataFields().stewardshipType(StewardshipType.REFERENCED);
AddGitRepoParams.Builder createParams = new AddGitRepoParams.Builder().resourceFields(createResourceParams.build()).gitRepoUrl(repoUrl);
bio.terra.cli.businessobject.resource.GitRepo addedResource = bio.terra.cli.businessobject.resource.GitRepo.addReferenced(createParams.build());
formatOption.printReturnValue(new UFGitRepo(addedResource), GitRepo::printText);
}
use of bio.terra.cli.serialization.userfacing.input.CreateResourceParams in project terra-cli by DataBiosphere.
the class BqDataset method execute.
/**
* Add a referenced BigQuery dataset to the workspace.
*/
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
// build the resource object to add
CreateResourceParams.Builder createResourceParams = resourceCreationOptions.populateMetadataFields().stewardshipType(StewardshipType.REFERENCED);
CreateBqDatasetParams.Builder createParams = new CreateBqDatasetParams.Builder().resourceFields(createResourceParams.build()).projectId(bigQueryIds.getGcpProjectId()).datasetId(bigQueryIds.getBigQueryDatasetId());
bio.terra.cli.businessobject.resource.BqDataset createdResource = bio.terra.cli.businessobject.resource.BqDataset.addReferenced(createParams.build());
formatOption.printReturnValue(new UFBqDataset(createdResource), BqDataset::printText);
}
use of bio.terra.cli.serialization.userfacing.input.CreateResourceParams in project terra-cli by DataBiosphere.
the class GcsBucket method execute.
/**
* Add a referenced GCS bucket to the workspace.
*/
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
// build the resource object to add
CreateResourceParams.Builder createResourceParams = resourceCreationOptions.populateMetadataFields().stewardshipType(StewardshipType.REFERENCED);
CreateGcsBucketParams.Builder createParams = new CreateGcsBucketParams.Builder().resourceFields(createResourceParams.build()).bucketName(bucketNameOption.getBucketName());
bio.terra.cli.businessobject.resource.GcsBucket addedResource = bio.terra.cli.businessobject.resource.GcsBucket.addReferenced(createParams.build());
formatOption.printReturnValue(new UFGcsBucket(addedResource), GcsBucket::printText);
}
use of bio.terra.cli.serialization.userfacing.input.CreateResourceParams in project terra-cli by DataBiosphere.
the class BqDataset method execute.
/**
* Add a controlled BigQuery dataset to the workspace.
*/
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
// build the resource object to create
CreateResourceParams.Builder createResourceParams = controlledResourceCreationOptions.populateMetadataFields().stewardshipType(StewardshipType.CONTROLLED);
CreateBqDatasetParams.Builder createParams = new CreateBqDatasetParams.Builder().resourceFields(createResourceParams.build()).datasetId(bigQueryDatasetId).location(location).defaultPartitionLifetimeSeconds(bqDatasetLifetimeOptions.getDefaultPartitionLifetimeSeconds()).defaultTableLifetimeSeconds(bqDatasetLifetimeOptions.getDefaultTableLifetimeSeconds());
bio.terra.cli.businessobject.resource.BqDataset createdResource = bio.terra.cli.businessobject.resource.BqDataset.createControlled(createParams.build());
formatOption.printReturnValue(new UFBqDataset(createdResource), BqDataset::printText);
}
Aggregations