Search in sources :

Example 1 with ProvisionResourceParametersDTO

use of com.peterphi.servicemanager.service.rest.resource.type.ProvisionResourceParametersDTO in project stdlib by petergeneric.

the class ServiceManagerResourceMarshaller method marshal.

public ResourceInstanceDTO marshal(final ResourceInstanceEntity entity) {
    ResourceInstanceDTO obj = new ResourceInstanceDTO();
    obj.id = entity.getId();
    obj.templateName = entity.getTemplate().getId();
    obj.parameters = new ProvisionResourceParametersDTO();
    obj.parameters.metadata = ResourceKVP.fromMap(entity.getMetadata());
    obj.provider = entity.getProvider();
    obj.providerInstanceId = entity.getProviderInstanceId();
    obj.state = entity.getState();
    obj.created = marshal(entity.getCreated());
    obj.updated = marshal(entity.getUpdated());
    return obj;
}
Also used : ResourceInstanceDTO(com.peterphi.servicemanager.service.rest.resource.type.ResourceInstanceDTO) ProvisionResourceParametersDTO(com.peterphi.servicemanager.service.rest.resource.type.ProvisionResourceParametersDTO)

Aggregations

ProvisionResourceParametersDTO (com.peterphi.servicemanager.service.rest.resource.type.ProvisionResourceParametersDTO)1 ResourceInstanceDTO (com.peterphi.servicemanager.service.rest.resource.type.ResourceInstanceDTO)1