get_job_library_upload_url

EtlJobsApi.get_job_library_upload_url(id, role_id, job_lib_pre_signed, content_type=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get a presigned URL to upload a job library

Generates an S3 presigned PUT URL under the job’s libs/python prefix. Requires editor or owner access. Spaces in FileName are replaced with underscores. Allowed extensions depend on ETLJobType.

Parameters:
  • id (str) – UUID of the ETL job that will own the uploaded library file. (required)

  • role_id (str) – Amorphic role ID sent for authorization. Missing this header returns AUTH-1001. (required)

  • job_lib_pre_signed (JobLibPreSigned) – (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:

PreSignedResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /jobs/{id}/libs

Request

Spark zip library

{
  "FileName": "sales_helpers.zip"
}

Python wheel

{
  "FileName": "utils-1.0.0-py3-none-any.whl"
}

Success (HTTP 200)

Presigned upload URL. Live body includes Message, PresignedUrl, and UploadPath (s3://{etl-bucket}/{jobId}/libs/python/{file}).

Request / response example

{
  "Message": "Generated pre-signed url to upload libs to the job",
  "PresignedUrl": "https://s3.amazonaws.com/example-etl-bucket/3fa85f64-5717-4562-b3fc-2c963f66afa6/libs/python/sales_helpers.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256",
  "UploadPath": "s3://example-etl-bucket/3fa85f64-5717-4562-b3fc-2c963f66afa6/libs/python/sales_helpers.zip"
}

Errors

Documented error codes: GE-1034, IPV-1002, GE-1008.

HTTP 400

Missing FileName, unsupported extension, missing job, or insufficient editor access. Body is {“Message”: “<CODE> - <text>”}.

File extension not allowed for the job type

{
  "Message": "GE-1034 - txt is not a valid supported format."
}

Job does not exist

{
  "Message": "IPV-1002 - Invalid JobId - 3fa85f64-5717-4562-b3fc-2c963f66afa6, resource not found."
}

HTTP 500

Uncaught backend failure. Typical Message is “GE-1008 - Could not complete the request. Please try again.”

Request / response example

{
  "Message": "GE-1008 - Could not complete the request. Please try again."
}