cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4215
Views
3
Helpful
5
Replies

Create Advanced catalog workflow

nelson.balbo
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

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!!!

View solution in original post

5 Replies 5

Orf Gelbrich
Cisco Employee
Cisco Employee

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);

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!

Orf Gelbrich
Cisco Employee
Cisco Employee

I published it

https://communities.cisco.com/docs/DOC-77298

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!!!

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? 

Cisco UCS X-Series Energy Efficiency Offer