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
- 200: Successful request.
- 400: Bad request, check the provided data.
- 404: Not found, resource could not be located.
- 500: Server error, please try again later.
[
{
"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.
- assets (object[]) - Required. Array of 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.
pattern (string): Pattern of the asset.
bucket (string): S3 bucket name.
fieldNameToDataAssetFieldProfileMap (object): Mapping from field names to metadata.
includeUnchangedAssets (boolean): Default is false. If true, unchanged assets will be checked.
prLink (string): Link to the pull request associated with changes to the asset.