ANNOUNCEMENT - The community will be down for maintenace this Thursday August 13 from 12:00 AM PT to 02:00 AM PT. As a precaution save your work.
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
521
Views
3
Helpful
5
Replies
Highlighted
Beginner

Create Advanced catalog workflow

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.

Everyone's tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Beginner

Re: Create Advanced catalog workflow

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
Highlighted
Cisco Employee

Re: Create Advanced catalog workflow

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

Highlighted
Beginner

Re: Create Advanced catalog workflow

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!

Highlighted
Cisco Employee

Re: Create Advanced catalog workflow

I published it

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

Highlighted
Beginner

Re: Create Advanced catalog workflow

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

Highlighted
Beginner

Re: Create Advanced catalog workflow

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? 

Content for Community-Ad
This widget could not be displayed.