get_data_classification¶
- DatasetsApi.get_data_classification(id, role_id, projection_expression=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Gets data classification item
Returns a single data classification by name, including a list of datasets that reference it. The Resources.Datasets array is only present when at least one dataset uses this classification. Use projectionExpression to limit fields returned from the classification item; the Resources lookup is always appended afterward. {id} is actually the name of the data classification for which the request is to be made Usage examples: GET /datasets/dataclassifications/confidential — returns full item with referenced datasets. GET /datasets/dataclassifications/confidential?projectionExpression=DataClassificationName,DisplayName — returns only projected fields plus referenced datasets.
- Parameters:
id (str) – DataClassificationName of the classification to retrieve. (required)
role_id (str) – The active Amorphic role ID of the caller. (required)
projection_expression (str) – Comma-separated list of field names to include from the classification item. When omitted, all fields are returned. The Resources lookup is always appended regardless of projection.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: GET /datasets/dataclassifications/{id}
Success (HTTP 200)¶
Returns the data classification item. Includes a Resources.Datasets array when at least one dataset uses this classification.
Classification with referenced datasets
{
"DataClassificationName": "confidential",
"DisplayName": "Confidential",
"Description": "Sensitive business data",
"CreatedBy": "user2",
"LastModifiedBy": "user2",
"LastModifiedTime": "2024-01-15T10:30:00Z",
"Resources": {
"Datasets": [
{
"DatasetName": "customer_records",
"DatasetId": "ds-abc-123"
},
{
"DatasetName": "financial_data",
"DatasetId": "ds-def-456"
}
]
}
}
Classification with no datasets referencing it
{
"DataClassificationName": "public",
"DisplayName": "Public",
"Description": "Data that can be freely shared",
"CreatedBy": "user3",
"LastModifiedBy": "user3",
"LastModifiedTime": "2024-01-15T10:30:00Z"
}
Errors¶
Documented error codes: IPV-1002, GE-1008.
HTTP 400
Classification not found (IPV-1002) or invalid input.
Request / response example
{
"Message": "IPV-1002 - Invalid DataClassificationName - confidential, resource not found."
}
HTTP 500
Backend failure.
Request / response example
{
"Message": "GE-1008 - Could not complete the request. Please try again."
}