CategoriesResource


Create a category


If you provide a link to the enterprise in the data entity, this method will create a local category. If you do not provide a link, it will try to create a global category, which requires the APPLIB_MANAGE_GLOBAL_CATEGORIES role.

POST https://example.com/api/config/categories

Roles : [ROLE_APPLIB_MANAGE_GLOBAL_CATEGORIES, ROLE_APPLIB_MANAGE_CATEGORIES]

Content-Type : category Accept : category

Error Codes

  • CATEGORY-2 - A category with this name already exists.
  • CATEGORY-7 - Current user does not have enough privileges to create a global category.
  • GEN-4 - Not enough permissions to perform this action

Example

List categories


List categories of VM templates in the Apps library, for an enterprise or all enterprises

GET https://example.com/api/config/categories

Roles : [ROLE_APPLIB_VIEW, ROLE_SYSCONFIG_VIEW, ROLE_AUTHENTICATED]

Parameter Type Default Value Description
idEnterprise Integer If you supply, the id of an enterprise, the global categories and the local categories of the the given enterprise will be retrieved. If no id is supplied, global categories will be retrieved.

Accept : categories

Example

Delete a category


When you delete a category, the platform will move all templates in this category to the "Others" category.

DELETE https://example.com/api/config/categories/{category}

Roles : [ROLE_APPLIB_MANAGE_GLOBAL_CATEGORIES, ROLE_APPLIB_MANAGE_CATEGORIES]

Example

Get a category


GET https://example.com/api/config/categories/{category}

Roles : [ROLE_APPLIB_VIEW, ROLE_SYSCONFIG_VIEW]

Accept : category

Error Codes

  • CATEGORY-1 - The requested category does not exist

Example

Update a category


If you have the privilege to manage global categories, you can promote a category from local to global.

PUT https://example.com/api/config/categories/{category}

Roles : [ROLE_APPLIB_MANAGE_GLOBAL_CATEGORIES, ROLE_APPLIB_MANAGE_CATEGORIES]

Content-Type : category Accept : category

Error Codes

  • CATEGORY-1 - The requested category does not exist
  • CATEGORY-12 - Current user does not have enough privileges to modify a local category.
  • CATEGORY-2 - A category with this name already exists.
  • GEN-4 - Not enough permissions to perform this action

Example