create_datasource_entity¶
- DatasourcesApi.create_datasource_entity(datasource_id, role_id, create_datasource_entity_request, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Create a datasource entity
Creates an entity for a datasource. The caller (identified by role_id) must have at least edit permission (else AUTH-1012). Supports JDBC Bulkload (shared DMS instance), JDBC Advanced Load (shared Kafka cluster; blocked in GovCloud with GE-1034), and Streams (data transformation function after get_presigned_url upload). Other types fail at runtime. Not idempotent.
- Parameters:
datasource_id (str) – UUID of the datasource. Rejected with IPV-1045 if missing. (required)
role_id (str) – Amorphic role ID. Must grant at least edit access on the datasource. (required)
create_datasource_entity_request (CreateDatasourceEntityRequest) – (required)
content_type (str) – Must be application/json.
_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: POST /datasources/{datasource_id}/entities
Request¶
JDBC Bulkload shared instance (sample)
{
"EntityName": "shared-dms-1",
"Description": "Shared DMS instance",
"EntityConfig": {
"InstanceClass": "dms.t3.medium",
"AllocatedStorage": 50,
"InstanceAZ": "us-east-1a",
"ScheduleConfig": {
"ScheduleEnabled": "no"
}
}
}
Streams transformation (EntityId from get_presigned_url)
{
"EntityId": "c3d8e4f2-9a6b-5c7d-0e1f-3a4b5c6d7e8f",
"EntityName": "transform_fn",
"EntityConfig": {
"LambdaHandler": "index.handler",
"MemorySize": 128
}
}
Success (HTTP 200)¶
Create accepted. Always returns Message and EntityId. Typical messages: “Successfully triggered entity creation and is running in background” (Bulk/Streams immediate; Advanced uses “it is running”), “Entity creation has been successfully scheduled” (Bulk scheduled), “Schedule has been created and the entity configuration is added to metadata” (Advanced scheduled).
Immediate create triggered
{
"Message": "Successfully triggered entity creation and is running in background",
"EntityId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"
}
JDBC Bulkload scheduled create
{
"Message": "Entity creation has been successfully scheduled",
"EntityId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"
}
Errors¶
Documented error codes: AUTH-1012, IPV-1045, IPV-1008, IPV-1010, IPV-1018, SCH-1015, GE-1034, DTSC-1006, DTSC-1007, GE-1020, DB-1002.
HTTP 400
Validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Common codes: AUTH-1012 (no edit access), IPV-1045 (missing EntityName/EntityConfig or invalid config), IPV-1008 / IPV-1010 / IPV-1018 (name validation), SCH-1015 (invalid schedule), GE-1034 (streams zip / config issues when raised as InvalidInput).
Caller lacks edit access
{
"Message": "AUTH-1012 - User: user1 requires at least edit access on the resource to perform this action."
}
Missing required create fields
{
"Message": "IPV-1045 - Invalid parameter - EntityConfig, value either missing or is invalid."
}
HTTP 500
Backend failure. Body is {“Message”: “<CODE> - <text>”} or a plain Message. Common codes: GE-1034 (Advanced create in GovCloud), DTSC-1006 / DTSC-1007 (DMS/schedule failures), GE-1020 / DB-1002 (persist failures). Unsupported datasource types fail here.
Advanced entity create in GovCloud
{
"Message": "GE-1034 - JDBC Advanced dataload entity creation is not supported in AWS GovCloud region (us-gov-west-1)."
}