get_url_to_upload_libraries

EtlJobsApi.get_url_to_upload_libraries(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 presigned URL to upload a shared library package

Returns a presigned PUT URL for common-libs/{id}/libs/python/{FileName} (spaces in FileName become underscores). Extension must be py, egg, whl, zip, or jar. Caller must be able to view the library. Extra body fields are ignored.

Parameters:
  • id (str) – Shared library identifier. (required)

  • role_id (str) – Amorphic role ID of the requesting user. Must be a role the authenticated user belongs to. (required)

  • job_lib_pre_signed (JobLibPreSigned) – (required)

  • content_type (str) – Request body media type.

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

SharedLibraryPackageUploadResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: POST /jobs/libs/{id}

Parameter examples

Name

In

Example

Content-Type

header

"application/json"

id

path

"123e4567-e89b-12d3-a456-426614174000"

role_id

header

"custom-role-123e4567-e89b-12d3-a456-426614174000"

Success (HTTP 200)

Presigned upload URL and S3 path.

Request / response example

{
  "Message": "Generated pre-signed url to upload libs to the shared library",
  "PresignedUrl": "https://example-etl-bucket.s3.amazonaws.com/...",
  "UploadPath": "s3://example-etl-bucket/common-libs/123e4567-e89b-12d3-a456-426614174000/libs/python/helpers.zip"
}

Errors

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

HTTP 400

Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1008 (missing FileName), AUTH-1001 (missing role_id), AUTH-1011 (caller not authorized).

Missing role_id header

{
  "Message": "AUTH-1001 - Missing role information in event header"
}

Caller not authorized

{
  "Message": "AUTH-1011 - User does not have sufficient permission to perform this action"
}

Missing FileName

{
  "Message": "IPV-1008 - Invalid input parameter(s) - FileName"
}

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”}. Codes: IPV-1002 (library not found), GE-1034 (unsupported file extension).

Library not found

{
  "Message": "IPV-1002 - Invalid LibraryId - 123e4567-e89b-12d3-a456-426614174000, resource not found."
}

Unexpected backend failure

{
  "Message": "GE-1034 - Unable to process the request"
}