Search in sources :

Example 1 with ControlledResourceMetadata

use of bio.terra.workspace.model.ControlledResourceMetadata in project terra-workspace-manager by DataBiosphere.

the class EnumerateResources method logResult.

private void logResult(String tag, ResourceList resourceList) {
    List<ResourceDescription> descList = resourceList.getResources();
    logger.info("Enumeration results for {} - {} resources", tag, descList.size());
    for (ResourceDescription desc : descList) {
        ResourceMetadata metadata = desc.getMetadata();
        String access = "<null>";
        String managed = "<null>";
        String user = "<null>";
        if (metadata.getStewardshipType() == StewardshipType.CONTROLLED && metadata.getControlledResourceMetadata() != null) {
            ControlledResourceMetadata controlled = metadata.getControlledResourceMetadata();
            access = controlled.getAccessScope().toString();
            managed = controlled.getManagedBy().toString();
            user = controlled.getPrivateResourceUser().getUserName();
        }
        logger.info("  {}: id={} type={} stew={} cloud={} access={} managed={} user={}", metadata.getName(), metadata.getResourceId(), metadata.getResourceType(), metadata.getStewardshipType(), metadata.getCloudPlatform(), access, managed, user);
    }
}
Also used : ControlledResourceMetadata(bio.terra.workspace.model.ControlledResourceMetadata) ResourceDescription(bio.terra.workspace.model.ResourceDescription) Matchers.containsString(org.hamcrest.Matchers.containsString) ControlledResourceMetadata(bio.terra.workspace.model.ControlledResourceMetadata) ResourceMetadata(bio.terra.workspace.model.ResourceMetadata)

Aggregations

ControlledResourceMetadata (bio.terra.workspace.model.ControlledResourceMetadata)1 ResourceDescription (bio.terra.workspace.model.ResourceDescription)1 ResourceMetadata (bio.terra.workspace.model.ResourceMetadata)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1