To create entitlements, you make a POST request with a project ID that has a cloud template version released to the project. Request bodies also include the IDs of a created catalog source or of a catalog item.
Prerequisites
- Verify that all general prerequisites have been satisfied. See Prerequisites for Requesting a Deployment from a Catalog Item.
- Verify that you have IDs of the catalog source or catalog item for which you plan to create entitlements. See Create a Catalog Source and List Discovered Items.
Procedure
Example: Create entitlements for a catalog source and catalog item
In this example, the catalog source ID is for a catalog of cloud templates. The catalog item is for a single cloud template.
Assign variables.
$ url='https://appliance.domain.com'
$ api_version='2020-08-25'
$ project_id='394a4ccb-22c6-4ef0-8c75-8b77efbefb51'
$ catalog_source_id='753d24a3-e2b0-4d5e-bba6-9e32e5964c69'
$ catalog_item_id='718917c0-1e02-3141-8142-11da5acaed8f'
Create entitlement for a catalog source.
$ curl -X POST \ $url/catalog/api/admin/entitlements?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" \ -H "Content-Type: application/json" \ -d '{ "projectId":"'$project_id'", "definition":{ "type":"CatalogSourceIdentifier", "id":"'$catalog_source_id'" } }' | jq "."
The response shows the entitlement for a catalog source.
{ "id": "6f432b9e-9085-4508-93ce-67f6fb5eaf68", "projectId": "394a4ccb-22c6-4ef0-8c75-8b77efbefb51", "definition": { "type": "CatalogSourceIdentifier", "id": "753d24a3-e2b0-4d5e-bba6-9e32e5964c69", "name": "Catalog Source from Blueprintecho s", "sourceType": "com.vmw.blueprint", "numItems": 2 } }
Or create entitlement for a discovered item.
$ curl -X POST \ $url/catalog/api/admin/entitlements?apiVersion=$api_version \ -H "Authorization: Bearer $access_token" \ -H "Content-Type: application/json" \ -d '{ "projectId":"'$project_id'", "definition":{ "type":"CatalogItemIdentifier", "id":"'$catalog_item_id'" } }' | jq "."
The response shows the entitlement for a catalog item.
{ "id": "d32ff5f7-7913-4264-9796-b28a6d385082", "projectId": "394a4ccb-22c6-4ef0-8c75-8b77efbefb51", "definition": { "type": "CatalogItemIdentifier", "id": "718917c0-1e02-3141-8142-11da5acaed8f", "name": "BasicCloudMachine", "description": "Basic Cloud Machine cloud template", "sourceName": "Catalog Source from Blueprintecho s", "sourceType": "com.vmw.blueprint" } }