AWS Glue
Developer Guide

Jobs

The Jobs API describes the data types and API related to creating, updating, deleting, or viewing jobs in AWS Glue.

Data Types

Job Structure

Specifies a job definition.

Fields

  • Name – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name you assign to this job definition.

  • Description – Description string, not more than 2048 bytes long, matching the URI address multi-line string pattern.

    Description of the job being defined.

  • LogUri – UTF-8 string.

    This field is reserved for future use.

  • Role – UTF-8 string.

    The name or ARN of the IAM role associated with this job.

  • CreatedOn – Timestamp.

    The time and date that this job definition was created.

  • LastModifiedOn – Timestamp.

    The last point in time when this job definition was modified.

  • ExecutionProperty – An ExecutionProperty object.

    An ExecutionProperty specifying the maximum number of concurrent runs allowed for this job.

  • Command – A JobCommand object.

    The JobCommand that executes this job.

  • DefaultArguments – A map array of key-value pairs.

    Each key is a UTF-8 string.

    Each value is a UTF-8 string.

    The default arguments for this job, specified as name-value pairs.

    You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue itself consumes.

    For information about how to specify and consume your own Job arguments, see the Calling AWS Glue APIs in Python topic in the developer guide.

    For information about the key-value pairs that AWS Glue consumes to set up your job, see the Special Parameters Used by AWS Glue topic in the developer guide.

  • Connections – A ConnectionsList object.

    The connections used for this job.

  • MaxRetries – Number (integer).

    The maximum number of times to retry this job after a JobRun fails.

  • AllocatedCapacity – Number (integer).

    This field is deprecated, use MaxCapacity instead.

    The number of AWS Glue data processing units (DPUs) allocated to runs of this job. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.

  • Timeout – Number (integer), at least 1.

    The job timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours).

  • MaxCapacity – Number (double).

    The number of AWS Glue data processing units (DPUs) that can be allocated when this job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.

    The value that can be allocated for MaxCapacity depends on whether you are running a python shell job, or an Apache Spark ETL job:

    • When you specify a python shell job (JobCommand.Name="pythonshell"), you can allocate either 0.0625 or 1 DPU. The default is 0.0625 DPU.

    • When you specify an Apache Spark ETL job (JobCommand.Name="glueetl"), you can allocate from 2 to 100 DPUs. The default is 10 DPUs. This job type cannot have a fractional DPU allocation.

  • NotificationProperty – A NotificationProperty object.

    Specifies configuration properties of a job notification.

  • SecurityConfiguration – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the SecurityConfiguration structure to be used with this job.

ExecutionProperty Structure

An execution property of a job.

Fields

  • MaxConcurrentRuns – Number (integer).

    The maximum number of concurrent runs allowed for the job. The default is 1. An error is returned when this threshold is reached. The maximum value you can specify is controlled by a service limit.

NotificationProperty Structure

Specifies configuration properties of a notification.

Fields

  • NotifyDelayAfter – Number (integer), at least 1.

    After a job run starts, the number of minutes to wait before sending a job run delay notification.

JobCommand Structure

Specifies code executed when a job is run.

Fields

  • Name – UTF-8 string.

    The name of the job command: this must be glueetl, for an Apache Spark ETL job, or pythonshell, for a Python shell job.

  • ScriptLocation – UTF-8 string.

    Specifies the S3 path to a script that executes a job (required).

ConnectionsList Structure

Specifies the connections used by a job.

Fields

  • Connections – An array of UTF-8 strings.

    A list of connections used by the job.

JobUpdate Structure

Specifies information used to update an existing job definition. Note that the previous job definition will be completely overwritten by this information.

Fields

  • Description – Description string, not more than 2048 bytes long, matching the URI address multi-line string pattern.

    Description of the job being defined.

  • LogUri – UTF-8 string.

    This field is reserved for future use.

  • Role – UTF-8 string.

    The name or ARN of the IAM role associated with this job (required).

  • ExecutionProperty – An ExecutionProperty object.

    An ExecutionProperty specifying the maximum number of concurrent runs allowed for this job.

  • Command – A JobCommand object.

    The JobCommand that executes this job (required).

  • DefaultArguments – A map array of key-value pairs.

    Each key is a UTF-8 string.

    Each value is a UTF-8 string.

    The default arguments for this job.

    You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue itself consumes.

    For information about how to specify and consume your own Job arguments, see the Calling AWS Glue APIs in Python topic in the developer guide.

    For information about the key-value pairs that AWS Glue consumes to set up your job, see the Special Parameters Used by AWS Glue topic in the developer guide.

  • Connections – A ConnectionsList object.

    The connections used for this job.

  • MaxRetries – Number (integer).

    The maximum number of times to retry this job if it fails.

  • AllocatedCapacity – Number (integer).

    This field is deprecated. Use MaxCapacity instead.

    The number of AWS Glue data processing units (DPUs) to allocate to this Job. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.

  • Timeout – Number (integer), at least 1.

    The job timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours).

  • MaxCapacity – Number (double).

    The number of AWS Glue data processing units (DPUs) that can be allocated when this job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.

    The value that can be allocated for MaxCapacity depends on whether you are running a python shell job, or an Apache Spark ETL job:

    • When you specify a python shell job (JobCommand.Name="pythonshell"), you can allocate either 0.0625 or 1 DPU. The default is 0.0625 DPU.

    • When you specify an Apache Spark ETL job (JobCommand.Name="glueetl"), you can allocate from 2 to 100 DPUs. The default is 10 DPUs. This job type cannot have a fractional DPU allocation.

  • NotificationProperty – A NotificationProperty object.

    Specifies configuration properties of a job notification.

  • SecurityConfiguration – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the SecurityConfiguration structure to be used with this job.

Operations

CreateJob Action (Python: create_job)

Creates a new job definition.

Request

  • NameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name you assign to this job definition. It must be unique in your account.

  • Description – Description string, not more than 2048 bytes long, matching the URI address multi-line string pattern.

    Description of the job being defined.

  • LogUri – UTF-8 string.

    This field is reserved for future use.

  • RoleRequired: UTF-8 string.

    The name or ARN of the IAM role associated with this job.

  • ExecutionProperty – An ExecutionProperty object.

    An ExecutionProperty specifying the maximum number of concurrent runs allowed for this job.

  • CommandRequired: A JobCommand object.

    The JobCommand that executes this job.

  • DefaultArguments – A map array of key-value pairs.

    Each key is a UTF-8 string.

    Each value is a UTF-8 string.

    The default arguments for this job.

    You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue itself consumes.

    For information about how to specify and consume your own Job arguments, see the Calling AWS Glue APIs in Python topic in the developer guide.

    For information about the key-value pairs that AWS Glue consumes to set up your job, see the Special Parameters Used by AWS Glue topic in the developer guide.

  • Connections – A ConnectionsList object.

    The connections used for this job.

  • MaxRetries – Number (integer).

    The maximum number of times to retry this job if it fails.

  • AllocatedCapacity – Number (integer).

    This parameter is deprecated. Use MaxCapacity instead.

    The number of AWS Glue data processing units (DPUs) to allocate to this Job. From 2 to 100 DPUs can be allocated; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.

  • Timeout – Number (integer), at least 1.

    The job timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours).

  • MaxCapacity – Number (double).

    The number of AWS Glue data processing units (DPUs) that can be allocated when this job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.

    The value that can be allocated for MaxCapacity depends on whether you are running a python shell job, or an Apache Spark ETL job:

    • When you specify a python shell job (JobCommand.Name="pythonshell"), you can allocate either 0.0625 or 1 DPU. The default is 0.0625 DPU.

    • When you specify an Apache Spark ETL job (JobCommand.Name="glueetl"), you can allocate from 2 to 100 DPUs. The default is 10 DPUs. This job type cannot have a fractional DPU allocation.

  • NotificationProperty – A NotificationProperty object.

    Specifies configuration properties of a job notification.

  • SecurityConfiguration – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the SecurityConfiguration structure to be used with this job.

  • Tags – A map array of key-value pairs, not more than 50 pairs.

    Each key is a UTF-8 string, not less than 1 or more than 128 bytes long.

    Each value is a UTF-8 string, not more than 256 bytes long.

    The tags to use with this job. You may use tags to limit access to the job. For more information about tags in AWS Glue, see AWS Tags in AWS Glue in the developer guide.

Response

  • Name – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The unique name that was provided for this job definition.

Errors

  • InvalidInputException

  • IdempotentParameterMismatchException

  • AlreadyExistsException

  • InternalServiceException

  • OperationTimeoutException

  • ResourceNumberLimitExceededException

  • ConcurrentModificationException

UpdateJob Action (Python: update_job)

Updates an existing job definition.

Request

  • JobNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    Name of the job definition to update.

  • JobUpdateRequired: A JobUpdate object.

    Specifies the values with which to update the job definition.

Response

  • JobName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    Returns the name of the updated job definition.

Errors

  • InvalidInputException

  • EntityNotFoundException

  • InternalServiceException

  • OperationTimeoutException

  • ConcurrentModificationException

GetJob Action (Python: get_job)

Retrieves an existing job definition.

Request

  • JobNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the job definition to retrieve.

Response

  • Job – A Job object.

    The requested job definition.

Errors

  • InvalidInputException

  • EntityNotFoundException

  • InternalServiceException

  • OperationTimeoutException

GetJobs Action (Python: get_jobs)

Retrieves all current job definitions.

Request

  • NextToken – UTF-8 string.

    A continuation token, if this is a continuation call.

  • MaxResults – Number (integer), not less than 1 or more than 1000.

    The maximum size of the response.

Response

  • Jobs – An array of Job objects.

    A list of job definitions.

  • NextToken – UTF-8 string.

    A continuation token, if not all job definitions have yet been returned.

Errors

  • InvalidInputException

  • EntityNotFoundException

  • InternalServiceException

  • OperationTimeoutException

DeleteJob Action (Python: delete_job)

Deletes a specified job definition. If the job definition is not found, no exception is thrown.

Request

  • JobNameRequired: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the job definition to delete.

Response

  • JobName – UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.

    The name of the job definition that was deleted.

Errors

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

ListJobs Action (Python: list_jobs)

Retrieves the names of all job resources in this AWS account, or the resources with the specified tag. This operation allows you to see which resources are available in your account, and their names.

This operation takes the optional Tags field which you can use as a filter on the response so that tagged resources can be retrieved as a group. If you choose to use tags filtering, only resources with the tag will be retrieved.

Request

  • NextToken – UTF-8 string.

    A continuation token, if this is a continuation request.

  • MaxResults – Number (integer), not less than 1 or more than 1000.

    The maximum size of a list to return.

  • Tags – A map array of key-value pairs, not more than 50 pairs.

    Each key is a UTF-8 string, not less than 1 or more than 128 bytes long.

    Each value is a UTF-8 string, not more than 256 bytes long.

    Specifies to return only these tagged resources.

Response

  • JobNames – An array of UTF-8 strings.

    The names of all jobs in the account, or the jobs with the specified tags.

  • NextToken – UTF-8 string.

    A continuation token, if the returned list does not contain the last metric available.

Errors

  • InvalidInputException

  • EntityNotFoundException

  • InternalServiceException

  • OperationTimeoutException

BatchGetJobs Action (Python: batch_get_jobs)

Returns a list of resource metadata for a given list of job names. After calling the ListJobs operation, you can call this operation to access the data to which you have been granted permissions. This operation supports all IAM permissions, including permission conditions that uses tags.

Request

  • JobNamesRequired: An array of UTF-8 strings.

    A list of job names, which may be the names returned from the ListJobs operation.

Response

  • Jobs – An array of Job objects.

    A list of job definitions.

  • JobsNotFound – An array of UTF-8 strings.

    A list of names of jobs not found.

Errors

  • InternalServiceException

  • OperationTimeoutException

  • InvalidInputException