Check list of S3 data assets for contract violations - Gable Docs

Check list of S3 data assets for contract violations

cURL

curl --request POST \
  --url https://demo-api.gable.ai/v0/data-assets/check-compliance/s3 \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "assets": [
    {
      "schema": {
        "type": "struct",
        "name": "<string>",
        "fields": [
          {
            "type": "struct",
            "name": "<string>",
            "fields": "<array>",
            "alias": "<string>",
            "doc": "<string>",
            "logical": "<string>",
            "optional": true
          }
        ],
        "alias": "<string>",
        "doc": "<string>",
        "logical": "<string>"
      },
      "pattern": "<string>",
      "bucket": "<string>",
      "fieldNameToDataAssetFieldProfileMap": {}
    }
  ],
  "includeUnchangedAssets": false,
  "prLink": "<string>"
}
'

Python

import requests

url = "https://demo-api.gable.ai/v0/data-assets/check-compliance/s3"

payload = {
    "assets": [
        {
            "schema": {
                "type": "struct",
                "name": "<string>",
                "fields": [
                    {
                        "type": "struct",
                        "name": "<string>",
                        "fields": "<array>",
                        "alias": "<string>",
                        "doc": "<string>",
                        "logical": "<string>",
                        "optional": True
                    }
                ],
                "alias": "<string>",
                "doc": "<string>",
                "logical": "<string>"
            },
            "pattern": "<string>",
            "bucket": "<string>",
            "fieldNameToDataAssetFieldProfileMap": {}
        }
    ],
    "includeUnchangedAssets": False,
    "prLink": "<string>"
}
headers = {
    "X-API-KEY": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

JavaScript

const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    assets: [
      {
        schema: {
          type: 'struct',
          name: '<string>',
          fields: [
            {
              type: 'struct',
              name: '<string>',
              fields: '<array>',
              alias: '<string>',
              doc: '<string>',
              logical: '<string>',
              optional: true
            }
          ],
          alias: '<string>',
          doc: '<string>',
          logical: '<string>'
        },
        pattern: '<string>',
        bucket: '<string>',
        fieldNameToDataAssetFieldProfileMap: {}
      }
    ],
    includeUnchangedAssets: false,
    prLink: '<string>'
  })
};

fetch('https://demo-api.gable.ai/v0/data-assets/check-compliance/s3', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Response

[
  {
    "dataAssetNamespace": "<string>",
    "dataAssetResourceName": "<string>",
    "dataAssetPath": "<string>",
    "responseType": "NO_CONTRACT"
  }
]
{
  "message": "<string>",
  "id": 123,
  "title": "<string>"
}

Authorizations

X-API-KEY (string) - required header to authenticate the request.

Body

application/json - List of S3 data assets to check for compliance.

Available attributes: - schema (struct):
- type (string): Type of the structure.
- name (string): Name of the asset.
- fields (array): Array of field definitions.
- alias (string): Alias for the asset.
- doc (string): Documentation for the asset.
- logical (string): Logical representation.