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.

Entitlements are tied to projects. Depending upon the entitlements you want to display in your project, you can entitle all the items discovered in a catalog source or individual catalog items. This example includes the steps to create an entitlement for both a catalog source and a catalog item. The step to create an entitlement for a catalog item is optional, because creating entitlement for the catalog source that includes the item also creates entitlement for the catalog item.

Prerequisites

Procedure

  1. Assign the project ID variable.
    project_id='<your_project_id>'
  2. Assign the catalog source and catalog item IDs.
    catalog_source_id='<your_catalog_source_id>'
    catalog_item_id='<your_catalog_item_id>'
    
  3. To see what has been entitled for your project so far, list all available entitlements.
    curl -X GET \
      $url/catalog/api/admin/entitlements?projectId=$project_id&apiVersion=$api_version" \
      -H "Authorization: Bearer $access_token" | jq "."
  4. Examine the response to see if an entitlement for your catalog item exists.
  5. Create an 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 "."
  6. To confirm that the entitlement for a catalog source has been defined, examine the response.
  7. (Optional) Create an entitlement for a catalog 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 "."
  8. (Optional) To confirm that the entitlement for a catalog item has been defined, examine the response.

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"
  }
}

What to do next

With the entitlement created for either the item as part of the catalog source or just the catalog item, you can request a deployment from the catalog item. See Request Deployment.