02-28-2018 11:09 AM - edited 03-01-2019 06:27 AM
In the Cisco UCS Director tasks I was able to find only tasks about standard catalogs, but nothing to advanced catalogs.
So my question is how could I create a workflow that bublich a advanced catalog to end user? If someone have a cloupiaScript base share with us.
Solved! Go to Solution.
03-01-2018 04:03 AM
Hi Orf Gelbrich,
Your script work very well!!! Thanks so much for you share it.
In my case, I change some lines that you see below
importPackage(com.cloupia.model.cIM);
importPackage(com.cloupia.feature.catalog.api.models);
var catalogName = input.CATALOGNAME;
var workflowName = input.WORKFLOWNAME; //Create to define the workflow to be executed in the adv. catalog
var description = input.DESCRIPTION; // to define description in the adv catalog
var groupName = input.GROUPNAME; //to define user group where the adv catalog will be created
var apiCatalogItem = new APICatalogItem();
var advancedCatalog = new AdvancedCatalogParameters();
advancedCatalog.setWorkflowName(workflowName);
apiCatalogItem.setCatalogItemName(catalogName);
apiCatalogItem.setCatalogType("Advanced");
apiCatalogItem.setCatalogItemDescription(description);
apiCatalogItem.setCatalogIcon("Workflow Icon");
apiCatalogItem.setAppliedToAllGroups(false);
apiCatalogItem.setGroups(groupName);
apiCatalogItem.setPublishToEndUsers(true);
apiCatalogItem.setFolderName("Advanced");
apiCatalogItem.setAdvancedCatalog(advancedCatalog);
var isCatalogCreated = ctxt.getAPI().userAPICreateCatalogItem(apiCatalogItem);
logger.addInfo("Is Catalog Created ? "+isCatalogCreated);
One more time thanks so much!!!
02-28-2018 11:38 AM
Here is the API call
userAPICreateCatalogItem
Here is a code example on how to use it.
importPackage(com.cloupia.model.cIM);
importPackage(com.cloupia.feature.catalog.api.models);
var catalogName = input.CATALOGNAME;
var apiCatalogItem = new APICatalogItem();
var advancedCatalog = new AdvancedCatalogParameters();
advancedCatalog.setWorkflowName("add ucsd user");
apiCatalogItem.setCatalogItemName(catalogName);
apiCatalogItem.setCatalogType("Advanced");
apiCatalogItem.setCatalogItemDescription("This is sdk_advanceCatalog");
apiCatalogItem.setCatalogIcon("IBM");
apiCatalogItem.setAppliedToAllGroups(false);
apiCatalogItem.setGroups("Default Group");
apiCatalogItem.setPublishToEndUsers(true);
apiCatalogItem.setFolderName("Advanced");
apiCatalogItem.setAdvancedCatalog(advancedCatalog);
var isCatalogCreated = ctxt.getAPI().userAPICreateCatalogItem(apiCatalogItem);
logger.addInfo("Is Catalog Created ? "+isCatalogCreated);
03-01-2018 02:36 AM
Hi Orf Gelbrich,
Thanks for your help! I will try to use your example and so soon, I will post the results.
One more time, Thanks!
02-28-2018 11:46 AM
I published it
https://communities.cisco.com/docs/DOC-77298
03-01-2018 04:03 AM
Hi Orf Gelbrich,
Your script work very well!!! Thanks so much for you share it.
In my case, I change some lines that you see below
importPackage(com.cloupia.model.cIM);
importPackage(com.cloupia.feature.catalog.api.models);
var catalogName = input.CATALOGNAME;
var workflowName = input.WORKFLOWNAME; //Create to define the workflow to be executed in the adv. catalog
var description = input.DESCRIPTION; // to define description in the adv catalog
var groupName = input.GROUPNAME; //to define user group where the adv catalog will be created
var apiCatalogItem = new APICatalogItem();
var advancedCatalog = new AdvancedCatalogParameters();
advancedCatalog.setWorkflowName(workflowName);
apiCatalogItem.setCatalogItemName(catalogName);
apiCatalogItem.setCatalogType("Advanced");
apiCatalogItem.setCatalogItemDescription(description);
apiCatalogItem.setCatalogIcon("Workflow Icon");
apiCatalogItem.setAppliedToAllGroups(false);
apiCatalogItem.setGroups(groupName);
apiCatalogItem.setPublishToEndUsers(true);
apiCatalogItem.setFolderName("Advanced");
apiCatalogItem.setAdvancedCatalog(advancedCatalog);
var isCatalogCreated = ctxt.getAPI().userAPICreateCatalogItem(apiCatalogItem);
logger.addInfo("Is Catalog Created ? "+isCatalogCreated);
One more time thanks so much!!!
07-09-2020 08:47 AM
Hi Orf Gelbrich,
Unfortunately it doesn't work on UCSD 6.7. Advanced Catalog is created, but it seems the workflow is not assigned. If you edit created catalog without changing anything it starts to work but otherwise no.
Can you help with some tip?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide