get_sample_file_upload_url_for_dataset

DatasetsApi.get_sample_file_upload_url_for_dataset(role_id, pre_signed, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Generate a presigned URL for sample schema file upload

Generates an S3 presigned URL for uploading a sample schema file to a dataset in pending registration status. This endpoint uses the same Lambda as POST /datasets/file. The behavior switches automatically based on RegistrationStatus: - When RegistrationStatus is pending, the upload targets the temp S3 bucket. - When RegistrationStatus is not pending, the behavior is identical to POST /datasets/file. Validations skipped for pending datasets: - DatasetType does not need to be internal - DatasourceType does not need to be api - RegistrationStatus completed check is skipped Validations still enforced: - Dataset must exist - Caller must have atleast editor access on the dataset - Resource-synced external s3athena datasets are blocked - Empty body field values are rejected (IPV-1001) - Redshift cluster availability is checked if dataset targets Redshift PartitionKeys are not needed for sample schema uploads (the dataset is still pending and has no partition definitions yet). File name handling: - Special characters are replaced with underscores for S3 key compliance (same as POST /datasets/file).

Parameters:
  • role_id (str) – Amorphic role ID. Caller must have editor access on the dataset. (required)

  • pre_signed (PreSigned) – (required)

  • content_type (str)

  • _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:

FileUploadPreSignedResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /datasets/samplefile

Success (HTTP 200)

Successfully generated S3 presigned URL for sample schema file upload

Request / response example

{
  "Message": "https://s3.us-east-1.amazonaws.com/temp-bucket/sample-schema-files/user1_abc123-def456_1691234567_schema.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=...&X-Amz-Signature=..."
}

Errors

Documented error codes: GE-1003, IPV-1001, GE-1034.

HTTP 400

Invalid input - dataset not found, empty body field, missing editor access, or resource-synced external s3athena dataset

Dataset does not exist

{
  "Message": "GE-1003 - abc123-def456-ghi789 does not exist."
}

Empty required field in body

{
  "Message": "IPV-1001 - Parameter FileName is a required value."
}

Resource-synced external s3athena dataset

{
  "Message": "GE-1034 - File uploads are not supported for resource-synced external s3athena datasets"
}

HTTP 500

Unexpected internal error during presigned URL generation