Creating and maintaining data contracts and their manifest files through CLI and API

You can interact with the Data Contract service through a Command Line Interface (CLI) or through direct API calls.
You can also perform most actions in Collibra. For more information, go to create and maintain data contracts from Collibra.

Data Contract CLI

The Data Contract CLI is a tool that packages API calls into an easy-to-use tool, enabling automation and integration. To use the CLI, you have to set it up and configure it locally. Once the CLI is installed and configured, you can use the commands to create and maintain data contracts.

From the CLI, you can perform the following actions. Detailed information and examples are available in the CLI.

Action Definition Required global permission Required resource permission
collibra data-contract init

Initialize a Data Contract asset with an initial manifest.

Tip This operation is the first step in creating a new data contract asset and linking it to its initial manifest. You can provide an existing manifest to upload, or a template will be generated from the associated Collibra content if none is provided. Once a data contact has been initialized, you are able to use all other actions on it.

Product Rights > Data Contract
  • View permission on the Data Product Port asset.
  • Asset > Attribute > Update on the Data Product Port asset.
  • Asset > Attribute > Add on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.

When creating a new Data Contract asset:

  • View permission on the domain.
  • Asset > Add on the domain.
  • Asset > Attribute > Add on the Data Product Port asset.

When linking to an existing Data Contract asset:

  • View permission on the Data Contract asset.
collibra data-contract draft Generate a new manifest draft using Collibra metadata. Product Rights > Data Contract
  • View permission on the Data Contract asset.
collibra data-contract push Upload a new version of a Data Contract manifest to Collibra. Product Rights > Data Contract
  • View permission on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.
  • Asset > Attribute > Add on the Data Contract asset.
collibra data-contract fetch Retrieve a Data Contract.  
  • View permission on the asset
collibra data-contract list List all Data Contracts and their metadata.  
  • View permission on the asset
collibra data-contract list-versions For a Data Contract, list the Data Contract versions and their metadata.

 

  • View permission on the asset
collibra data-contract set-active Set a specific Data Contract version as active. Product Rights > Data Contract
  • View permission on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.
  • Asset > Attribute > Add on the Data Contract asset.
collibra data-contract clear

Based on deleteAsset value clears the asset, meaning deleting all versions and unlinking the Manifest ID from the Data Contract asset, or clears the asset and deletes the Data Contract asset.

Product Rights > Data Contract
  • View permission on the Data Contract asset.

When clearing the Data Contract asset:

  • Asset > Attribute > Remove on the Data Contract asset.

When also deleting the Data Contract asset:

  • Asset > Remove on the Data Contract asset.

collibra data-contract delete Permanently deletes a specific data contract manifest version. Product Rights > Data Contract
  • View permission on the Data Contract asset.
  • Asset > Attribute > Remove on the Data Contract asset.

Tip The CLI includes a --help flag to retrieve the built-in reference documentation.
For example: ./collibra data-contract --help

Data Products API

If you prefer working directly with API calls, you don't require the CLI setup. You can use any API tool, such as Postman, cURL, or Insomnia, to interact with the Data Contract service. In that case, you can refer to the API specifications for detailed information on all available endpoints, including those for listing contract metadata, managing versions, and setting the active version.

Initializing a data contract is the first step in creating a new Data Contract asset and linking it to its initial manifest. You can provide an existing manifest to upload, or a template will be generated from the associated Collibra content if none is provided. Once a Data Contact has been initialized, you are able to use all other API calls on it.

The Data Product API also includes an apply endpoint. This action applies the active manifest version to the Collibra Knowledge Graph, updating the SLA (Service Level Agreement) attributes properties that match existing out-of-the-box SLA attributes on the Data Contract asset. For more information, go to SLA mappings.

The required permissions are as follows:

API End point Required global permission Required resource permission

POST /dataContracts

Initializes the Data Contract.

Product Rights > Data Contract
  • View permission on the Data Product Port asset
  • Asset > Attribute > Update on the Data Product Port asset
  • Asset > Attribute > Update on the Data Contract asset
  • Asset > Attribute > Add on the Data Contract asset

When creating a new Data Contract asset:

  • View permission on the domain.
  • Asset > Add on the domain.
  • Asset > Attribute > Add on the Data Product Port asset.

When linking to an existing Data Contract asset:

  • View permission on the Data Contract asset.
GET /dataContracts   View permission on the Data Contract asset
GET /dataContracts/{id}   View permission on the Data Contract asset
DELETE /dataContracts/{id} Product Rights > Data Contract

View permission on the Data Contract asset

If deleteAsset=false

  • Asset > Attribute > Remove on the Data Contract asset.

If deleteAsset=true

  • Asset > Remove on the Data Contract asset.
POST /dataContracts/addFromManifest Product Rights > Data Contract
  • View permission on the Data Contract asset
  • Asset > Attribute > Add on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.
GET /dataContracts/{id}/draftVersion   View permission on the Data Contract asset
POST /dataContracts/{id}/apply Product Rights > Data Contract
  • View permission on the Data Contract asset
  • Asset > Attribute > Add on the Data Contract asset.
  • Asset > Attribute > Remove on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.
POST /dataContracts/{id}/versions Product Rights > Data Contract
  • View permission on the Data Contract asset
  • Asset > Attribute > Add on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.
DELETE /dataContracts/{id}/versions Product Rights > Data Contract Asset > Attribute > Remove on the Data Contract asset.
GET /dataContracts/{id}/versions   View permission on the Data Contract asset
GET /dataContracts/{id}/versions/manifest   View permission on the Data Contract asset
GET /dataContracts/{id}/activeVersion   View permission on the Data Contract asset
PATCH /dataContracts/{id}/activeVersion Product Rights > Data Contract
  • View permission on the Data Contract asset
  • Asset > Attribute > Add on the Data Contract asset.
  • Asset > Attribute > Update on the Data Contract asset.
GET /dataContracts/{id}/activeVersion/manifest   View permission on the Data Contract asset

What's next

Related topics