use of com.emc.storageos.model.customservices.CustomServicesWorkflowRestRep in project coprhd-controller by CoprHD.
the class WorkflowBuilder method getWorkflow.
public static void getWorkflow(final URI workflowId) {
CustomServicesWorkflowRestRep customServicesWorkflowRestRep = getCatalogClient().customServicesPrimitives().getWorkflow(workflowId);
renderJSON(customServicesWorkflowRestRep);
}
use of com.emc.storageos.model.customservices.CustomServicesWorkflowRestRep in project coprhd-controller by CoprHD.
the class WorkflowBuilder method updateWorkflowInventoryFiles.
private static boolean updateWorkflowInventoryFiles(final String localAnsiblePrimitiveId) {
boolean updatedWorkflows = false;
final CustomServicesWorkflowList customServicesWorkflowList = getCatalogClient().customServicesPrimitives().getWorkflows(localAnsiblePrimitiveId);
if (customServicesWorkflowList != null && CollectionUtils.isNotEmpty(customServicesWorkflowList.getWorkflows())) {
for (final NamedRelatedResourceRep resourceRep : customServicesWorkflowList.getWorkflows()) {
final URI workflowId = resourceRep.getId();
final CustomServicesWorkflowRestRep customServicesWorkflowRestRep = getCatalogClient().customServicesPrimitives().getWorkflow(workflowId);
if (null != customServicesWorkflowRestRep) {
Logger.info("Updating workflow {} with new host inventory files", workflowId);
final CustomServicesWorkflowUpdateParam param = new CustomServicesWorkflowUpdateParam();
for (final CustomServicesWorkflowDocument.Step step : customServicesWorkflowRestRep.getDocument().getSteps()) {
addInventoryFileInputs(step);
}
param.setDocument(customServicesWorkflowRestRep.getDocument());
getCatalogClient().customServicesPrimitives().editWorkflow(workflowId, param);
updatedWorkflows = true;
}
}
}
return updatedWorkflows;
}
use of com.emc.storageos.model.customservices.CustomServicesWorkflowRestRep in project coprhd-controller by CoprHD.
the class WorkflowBuilder method createWorkflow.
public static void createWorkflow(final String workflowName, final String dirID) throws URISyntaxException {
// Create workflow with just name
final CustomServicesWorkflowCreateParam param = new CustomServicesWorkflowCreateParam();
final CustomServicesWorkflowDocument document = new CustomServicesWorkflowDocument();
document.setName(workflowName);
List<CustomServicesWorkflowDocument.Step> steps = getStartEndSteps();
document.setSteps(steps);
param.setDocument(document);
final CustomServicesWorkflowRestRep customServicesWorkflowRestRep = getCatalogClient().customServicesPrimitives().createWorkflow(param);
// Add this workflowid to directory
if (null != customServicesWorkflowRestRep) {
addResourceToWFDirectory(customServicesWorkflowRestRep.getId(), dirID);
} else {
flash.error("Error creating workflow");
}
renderJSON(customServicesWorkflowRestRep);
}
use of com.emc.storageos.model.customservices.CustomServicesWorkflowRestRep in project coprhd-controller by CoprHD.
the class WorkflowBuilder method saveWorkflow.
public static void saveWorkflow(final URI workflowId, final CustomServicesWorkflowDocument workflowDoc) {
final CustomServicesWorkflowUpdateParam param = new CustomServicesWorkflowUpdateParam();
for (final CustomServicesWorkflowDocument.Step step : workflowDoc.getSteps()) {
final String success_criteria = ESAPI.encoder().decodeForHTML(step.getSuccessCriteria());
step.setSuccessCriteria(success_criteria);
// If this workflow has any ansible steps add host_file input
addInventoryFileInputs(step);
}
param.setDocument(workflowDoc);
final CustomServicesWorkflowRestRep customServicesWorkflowRestRep = getCatalogClient().customServicesPrimitives().editWorkflow(workflowId, param);
}
use of com.emc.storageos.model.customservices.CustomServicesWorkflowRestRep in project coprhd-controller by CoprHD.
the class WorkflowBuilder method publishWorkflow.
public static void publishWorkflow(final URI workflowId) {
CustomServicesWorkflowRestRep customServicesWorkflowRestRep = getCatalogClient().customServicesPrimitives().publishWorkflow(workflowId);
renderJSON(customServicesWorkflowRestRep);
}
Aggregations