Updating and deleting custom runtime definitions

If you use a custom runtime image and you want to update or delete its configuration, you must edit the runtime definition for this image.

Before you begin:
  • Get an authorization token and export it as the TOKEN environment variable. See Generating an API authorization token.
  • Find your runtime definition and save its GUID as the myRuntimeDefinitionID environment variable. To get the list of available runtime definitions and their GUID’s, run this code:
    curl -k -X GET -H "Authorization: ZenApiKey ${TOKEN}" "${CPD_URL}/v2/runtime_definitions" | jq -r '.resources[] | "\(.entity.name) -- \(.metadata.guid)"'

Updating an existing runtime definition

To update an existing runtime definition, call the update endpoint with the name of the existing runtime definition:
curl -kX PUT  "${CPD_URL}/v2/runtime_definitions/$myRuntimeDefinitionID"  --header "Authorization: ZenApiKey ${TOKEN}" -d @${myRuntimeDefinition}.json

Deleting a runtime definition

To delete runtime definitions that are not in use anymore, call the delete endpoint:
curl -kX DELETE \
"${CPD_URL}/v2/runtime_definitions/${myRuntimeDefinitionID}" \
--header "Authorization: ZenApiKey ${TOKEN}"