Batch / Client / describe_jobs

describe_jobs#

Batch.Client.describe_jobs(**kwargs)#

Describes a list of Batch jobs.

See also: AWS API Documentation

Request Syntax

response = client.describe_jobs(
    jobs=[
        'string',
    ]
)
Parameters:

jobs (list) –

[REQUIRED]

A list of up to 100 job IDs.

  • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'jobs': [
        {
            'jobArn': 'string',
            'jobName': 'string',
            'jobId': 'string',
            'jobQueue': 'string',
            'status': 'SUBMITTED'|'PENDING'|'RUNNABLE'|'STARTING'|'RUNNING'|'SUCCEEDED'|'FAILED',
            'shareIdentifier': 'string',
            'schedulingPriority': 123,
            'attempts': [
                {
                    'container': {
                        'containerInstanceArn': 'string',
                        'taskArn': 'string',
                        'exitCode': 123,
                        'reason': 'string',
                        'logStreamName': 'string',
                        'networkInterfaces': [
                            {
                                'attachmentId': 'string',
                                'ipv6Address': 'string',
                                'privateIpv4Address': 'string'
                            },
                        ]
                    },
                    'startedAt': 123,
                    'stoppedAt': 123,
                    'statusReason': 'string',
                    'taskProperties': [
                        {
                            'containerInstanceArn': 'string',
                            'taskArn': 'string',
                            'containers': [
                                {
                                    'exitCode': 123,
                                    'name': 'string',
                                    'reason': 'string',
                                    'logStreamName': 'string',
                                    'networkInterfaces': [
                                        {
                                            'attachmentId': 'string',
                                            'ipv6Address': 'string',
                                            'privateIpv4Address': 'string'
                                        },
                                    ]
                                },
                            ]
                        },
                    ]
                },
            ],
            'statusReason': 'string',
            'createdAt': 123,
            'retryStrategy': {
                'attempts': 123,
                'evaluateOnExit': [
                    {
                        'onStatusReason': 'string',
                        'onReason': 'string',
                        'onExitCode': 'string',
                        'action': 'RETRY'|'EXIT'
                    },
                ]
            },
            'startedAt': 123,
            'stoppedAt': 123,
            'dependsOn': [
                {
                    'jobId': 'string',
                    'type': 'N_TO_N'|'SEQUENTIAL'
                },
            ],
            'jobDefinition': 'string',
            'parameters': {
                'string': 'string'
            },
            'container': {
                'image': 'string',
                'vcpus': 123,
                'memory': 123,
                'command': [
                    'string',
                ],
                'jobRoleArn': 'string',
                'executionRoleArn': 'string',
                'volumes': [
                    {
                        'host': {
                            'sourcePath': 'string'
                        },
                        'name': 'string',
                        'efsVolumeConfiguration': {
                            'fileSystemId': 'string',
                            'rootDirectory': 'string',
                            'transitEncryption': 'ENABLED'|'DISABLED',
                            'transitEncryptionPort': 123,
                            'authorizationConfig': {
                                'accessPointId': 'string',
                                'iam': 'ENABLED'|'DISABLED'
                            }
                        }
                    },
                ],
                'environment': [
                    {
                        'name': 'string',
                        'value': 'string'
                    },
                ],
                'mountPoints': [
                    {
                        'containerPath': 'string',
                        'readOnly': True|False,
                        'sourceVolume': 'string'
                    },
                ],
                'readonlyRootFilesystem': True|False,
                'ulimits': [
                    {
                        'hardLimit': 123,
                        'name': 'string',
                        'softLimit': 123
                    },
                ],
                'privileged': True|False,
                'user': 'string',
                'exitCode': 123,
                'reason': 'string',
                'containerInstanceArn': 'string',
                'taskArn': 'string',
                'logStreamName': 'string',
                'instanceType': 'string',
                'networkInterfaces': [
                    {
                        'attachmentId': 'string',
                        'ipv6Address': 'string',
                        'privateIpv4Address': 'string'
                    },
                ],
                'resourceRequirements': [
                    {
                        'value': 'string',
                        'type': 'GPU'|'VCPU'|'MEMORY'
                    },
                ],
                'linuxParameters': {
                    'devices': [
                        {
                            'hostPath': 'string',
                            'containerPath': 'string',
                            'permissions': [
                                'READ'|'WRITE'|'MKNOD',
                            ]
                        },
                    ],
                    'initProcessEnabled': True|False,
                    'sharedMemorySize': 123,
                    'tmpfs': [
                        {
                            'containerPath': 'string',
                            'size': 123,
                            'mountOptions': [
                                'string',
                            ]
                        },
                    ],
                    'maxSwap': 123,
                    'swappiness': 123
                },
                'logConfiguration': {
                    'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk',
                    'options': {
                        'string': 'string'
                    },
                    'secretOptions': [
                        {
                            'name': 'string',
                            'valueFrom': 'string'
                        },
                    ]
                },
                'secrets': [
                    {
                        'name': 'string',
                        'valueFrom': 'string'
                    },
                ],
                'networkConfiguration': {
                    'assignPublicIp': 'ENABLED'|'DISABLED'
                },
                'fargatePlatformConfiguration': {
                    'platformVersion': 'string'
                },
                'ephemeralStorage': {
                    'sizeInGiB': 123
                },
                'runtimePlatform': {
                    'operatingSystemFamily': 'string',
                    'cpuArchitecture': 'string'
                },
                'repositoryCredentials': {
                    'credentialsParameter': 'string'
                }
            },
            'nodeDetails': {
                'nodeIndex': 123,
                'isMainNode': True|False
            },
            'nodeProperties': {
                'numNodes': 123,
                'mainNode': 123,
                'nodeRangeProperties': [
                    {
                        'targetNodes': 'string',
                        'container': {
                            'image': 'string',
                            'vcpus': 123,
                            'memory': 123,
                            'command': [
                                'string',
                            ],
                            'jobRoleArn': 'string',
                            'executionRoleArn': 'string',
                            'volumes': [
                                {
                                    'host': {
                                        'sourcePath': 'string'
                                    },
                                    'name': 'string',
                                    'efsVolumeConfiguration': {
                                        'fileSystemId': 'string',
                                        'rootDirectory': 'string',
                                        'transitEncryption': 'ENABLED'|'DISABLED',
                                        'transitEncryptionPort': 123,
                                        'authorizationConfig': {
                                            'accessPointId': 'string',
                                            'iam': 'ENABLED'|'DISABLED'
                                        }
                                    }
                                },
                            ],
                            'environment': [
                                {
                                    'name': 'string',
                                    'value': 'string'
                                },
                            ],
                            'mountPoints': [
                                {
                                    'containerPath': 'string',
                                    'readOnly': True|False,
                                    'sourceVolume': 'string'
                                },
                            ],
                            'readonlyRootFilesystem': True|False,
                            'privileged': True|False,
                            'ulimits': [
                                {
                                    'hardLimit': 123,
                                    'name': 'string',
                                    'softLimit': 123
                                },
                            ],
                            'user': 'string',
                            'instanceType': 'string',
                            'resourceRequirements': [
                                {
                                    'value': 'string',
                                    'type': 'GPU'|'VCPU'|'MEMORY'
                                },
                            ],
                            'linuxParameters': {
                                'devices': [
                                    {
                                        'hostPath': 'string',
                                        'containerPath': 'string',
                                        'permissions': [
                                            'READ'|'WRITE'|'MKNOD',
                                        ]
                                    },
                                ],
                                'initProcessEnabled': True|False,
                                'sharedMemorySize': 123,
                                'tmpfs': [
                                    {
                                        'containerPath': 'string',
                                        'size': 123,
                                        'mountOptions': [
                                            'string',
                                        ]
                                    },
                                ],
                                'maxSwap': 123,
                                'swappiness': 123
                            },
                            'logConfiguration': {
                                'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk',
                                'options': {
                                    'string': 'string'
                                },
                                'secretOptions': [
                                    {
                                        'name': 'string',
                                        'valueFrom': 'string'
                                    },
                                ]
                            },
                            'secrets': [
                                {
                                    'name': 'string',
                                    'valueFrom': 'string'
                                },
                            ],
                            'networkConfiguration': {
                                'assignPublicIp': 'ENABLED'|'DISABLED'
                            },
                            'fargatePlatformConfiguration': {
                                'platformVersion': 'string'
                            },
                            'ephemeralStorage': {
                                'sizeInGiB': 123
                            },
                            'runtimePlatform': {
                                'operatingSystemFamily': 'string',
                                'cpuArchitecture': 'string'
                            },
                            'repositoryCredentials': {
                                'credentialsParameter': 'string'
                            }
                        },
                        'instanceTypes': [
                            'string',
                        ],
                        'ecsProperties': {
                            'taskProperties': [
                                {
                                    'containers': [
                                        {
                                            'command': [
                                                'string',
                                            ],
                                            'dependsOn': [
                                                {
                                                    'containerName': 'string',
                                                    'condition': 'string'
                                                },
                                            ],
                                            'environment': [
                                                {
                                                    'name': 'string',
                                                    'value': 'string'
                                                },
                                            ],
                                            'essential': True|False,
                                            'image': 'string',
                                            'linuxParameters': {
                                                'devices': [
                                                    {
                                                        'hostPath': 'string',
                                                        'containerPath': 'string',
                                                        'permissions': [
                                                            'READ'|'WRITE'|'MKNOD',
                                                        ]
                                                    },
                                                ],
                                                'initProcessEnabled': True|False,
                                                'sharedMemorySize': 123,
                                                'tmpfs': [
                                                    {
                                                        'containerPath': 'string',
                                                        'size': 123,
                                                        'mountOptions': [
                                                            'string',
                                                        ]
                                                    },
                                                ],
                                                'maxSwap': 123,
                                                'swappiness': 123
                                            },
                                            'logConfiguration': {
                                                'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk',
                                                'options': {
                                                    'string': 'string'
                                                },
                                                'secretOptions': [
                                                    {
                                                        'name': 'string',
                                                        'valueFrom': 'string'
                                                    },
                                                ]
                                            },
                                            'mountPoints': [
                                                {
                                                    'containerPath': 'string',
                                                    'readOnly': True|False,
                                                    'sourceVolume': 'string'
                                                },
                                            ],
                                            'name': 'string',
                                            'privileged': True|False,
                                            'readonlyRootFilesystem': True|False,
                                            'repositoryCredentials': {
                                                'credentialsParameter': 'string'
                                            },
                                            'resourceRequirements': [
                                                {
                                                    'value': 'string',
                                                    'type': 'GPU'|'VCPU'|'MEMORY'
                                                },
                                            ],
                                            'secrets': [
                                                {
                                                    'name': 'string',
                                                    'valueFrom': 'string'
                                                },
                                            ],
                                            'ulimits': [
                                                {
                                                    'hardLimit': 123,
                                                    'name': 'string',
                                                    'softLimit': 123
                                                },
                                            ],
                                            'user': 'string'
                                        },
                                    ],
                                    'ephemeralStorage': {
                                        'sizeInGiB': 123
                                    },
                                    'executionRoleArn': 'string',
                                    'platformVersion': 'string',
                                    'ipcMode': 'string',
                                    'taskRoleArn': 'string',
                                    'pidMode': 'string',
                                    'networkConfiguration': {
                                        'assignPublicIp': 'ENABLED'|'DISABLED'
                                    },
                                    'runtimePlatform': {
                                        'operatingSystemFamily': 'string',
                                        'cpuArchitecture': 'string'
                                    },
                                    'volumes': [
                                        {
                                            'host': {
                                                'sourcePath': 'string'
                                            },
                                            'name': 'string',
                                            'efsVolumeConfiguration': {
                                                'fileSystemId': 'string',
                                                'rootDirectory': 'string',
                                                'transitEncryption': 'ENABLED'|'DISABLED',
                                                'transitEncryptionPort': 123,
                                                'authorizationConfig': {
                                                    'accessPointId': 'string',
                                                    'iam': 'ENABLED'|'DISABLED'
                                                }
                                            }
                                        },
                                    ]
                                },
                            ]
                        }
                    },
                ]
            },
            'arrayProperties': {
                'statusSummary': {
                    'string': 123
                },
                'size': 123,
                'index': 123
            },
            'timeout': {
                'attemptDurationSeconds': 123
            },
            'tags': {
                'string': 'string'
            },
            'propagateTags': True|False,
            'platformCapabilities': [
                'EC2'|'FARGATE',
            ],
            'eksProperties': {
                'podProperties': {
                    'serviceAccountName': 'string',
                    'hostNetwork': True|False,
                    'dnsPolicy': 'string',
                    'imagePullSecrets': [
                        {
                            'name': 'string'
                        },
                    ],
                    'containers': [
                        {
                            'name': 'string',
                            'image': 'string',
                            'imagePullPolicy': 'string',
                            'command': [
                                'string',
                            ],
                            'args': [
                                'string',
                            ],
                            'env': [
                                {
                                    'name': 'string',
                                    'value': 'string'
                                },
                            ],
                            'resources': {
                                'limits': {
                                    'string': 'string'
                                },
                                'requests': {
                                    'string': 'string'
                                }
                            },
                            'exitCode': 123,
                            'reason': 'string',
                            'volumeMounts': [
                                {
                                    'name': 'string',
                                    'mountPath': 'string',
                                    'readOnly': True|False
                                },
                            ],
                            'securityContext': {
                                'runAsUser': 123,
                                'runAsGroup': 123,
                                'privileged': True|False,
                                'allowPrivilegeEscalation': True|False,
                                'readOnlyRootFilesystem': True|False,
                                'runAsNonRoot': True|False
                            }
                        },
                    ],
                    'initContainers': [
                        {
                            'name': 'string',
                            'image': 'string',
                            'imagePullPolicy': 'string',
                            'command': [
                                'string',
                            ],
                            'args': [
                                'string',
                            ],
                            'env': [
                                {
                                    'name': 'string',
                                    'value': 'string'
                                },
                            ],
                            'resources': {
                                'limits': {
                                    'string': 'string'
                                },
                                'requests': {
                                    'string': 'string'
                                }
                            },
                            'exitCode': 123,
                            'reason': 'string',
                            'volumeMounts': [
                                {
                                    'name': 'string',
                                    'mountPath': 'string',
                                    'readOnly': True|False
                                },
                            ],
                            'securityContext': {
                                'runAsUser': 123,
                                'runAsGroup': 123,
                                'privileged': True|False,
                                'allowPrivilegeEscalation': True|False,
                                'readOnlyRootFilesystem': True|False,
                                'runAsNonRoot': True|False
                            }
                        },
                    ],
                    'volumes': [
                        {
                            'name': 'string',
                            'hostPath': {
                                'path': 'string'
                            },
                            'emptyDir': {
                                'medium': 'string',
                                'sizeLimit': 'string'
                            },
                            'secret': {
                                'secretName': 'string',
                                'optional': True|False
                            }
                        },
                    ],
                    'podName': 'string',
                    'nodeName': 'string',
                    'metadata': {
                        'labels': {
                            'string': 'string'
                        }
                    },
                    'shareProcessNamespace': True|False
                }
            },
            'eksAttempts': [
                {
                    'containers': [
                        {
                            'name': 'string',
                            'exitCode': 123,
                            'reason': 'string'
                        },
                    ],
                    'initContainers': [
                        {
                            'name': 'string',
                            'exitCode': 123,
                            'reason': 'string'
                        },
                    ],
                    'podName': 'string',
                    'nodeName': 'string',
                    'startedAt': 123,
                    'stoppedAt': 123,
                    'statusReason': 'string'
                },
            ],
            'ecsProperties': {
                'taskProperties': [
                    {
                        'containers': [
                            {
                                'command': [
                                    'string',
                                ],
                                'dependsOn': [
                                    {
                                        'containerName': 'string',
                                        'condition': 'string'
                                    },
                                ],
                                'environment': [
                                    {
                                        'name': 'string',
                                        'value': 'string'
                                    },
                                ],
                                'essential': True|False,
                                'image': 'string',
                                'linuxParameters': {
                                    'devices': [
                                        {
                                            'hostPath': 'string',
                                            'containerPath': 'string',
                                            'permissions': [
                                                'READ'|'WRITE'|'MKNOD',
                                            ]
                                        },
                                    ],
                                    'initProcessEnabled': True|False,
                                    'sharedMemorySize': 123,
                                    'tmpfs': [
                                        {
                                            'containerPath': 'string',
                                            'size': 123,
                                            'mountOptions': [
                                                'string',
                                            ]
                                        },
                                    ],
                                    'maxSwap': 123,
                                    'swappiness': 123
                                },
                                'logConfiguration': {
                                    'logDriver': 'json-file'|'syslog'|'journald'|'gelf'|'fluentd'|'awslogs'|'splunk',
                                    'options': {
                                        'string': 'string'
                                    },
                                    'secretOptions': [
                                        {
                                            'name': 'string',
                                            'valueFrom': 'string'
                                        },
                                    ]
                                },
                                'mountPoints': [
                                    {
                                        'containerPath': 'string',
                                        'readOnly': True|False,
                                        'sourceVolume': 'string'
                                    },
                                ],
                                'name': 'string',
                                'privileged': True|False,
                                'readonlyRootFilesystem': True|False,
                                'repositoryCredentials': {
                                    'credentialsParameter': 'string'
                                },
                                'resourceRequirements': [
                                    {
                                        'value': 'string',
                                        'type': 'GPU'|'VCPU'|'MEMORY'
                                    },
                                ],
                                'secrets': [
                                    {
                                        'name': 'string',
                                        'valueFrom': 'string'
                                    },
                                ],
                                'ulimits': [
                                    {
                                        'hardLimit': 123,
                                        'name': 'string',
                                        'softLimit': 123
                                    },
                                ],
                                'user': 'string',
                                'exitCode': 123,
                                'reason': 'string',
                                'logStreamName': 'string',
                                'networkInterfaces': [
                                    {
                                        'attachmentId': 'string',
                                        'ipv6Address': 'string',
                                        'privateIpv4Address': 'string'
                                    },
                                ]
                            },
                        ],
                        'containerInstanceArn': 'string',
                        'taskArn': 'string',
                        'ephemeralStorage': {
                            'sizeInGiB': 123
                        },
                        'executionRoleArn': 'string',
                        'platformVersion': 'string',
                        'ipcMode': 'string',
                        'taskRoleArn': 'string',
                        'pidMode': 'string',
                        'networkConfiguration': {
                            'assignPublicIp': 'ENABLED'|'DISABLED'
                        },
                        'runtimePlatform': {
                            'operatingSystemFamily': 'string',
                            'cpuArchitecture': 'string'
                        },
                        'volumes': [
                            {
                                'host': {
                                    'sourcePath': 'string'
                                },
                                'name': 'string',
                                'efsVolumeConfiguration': {
                                    'fileSystemId': 'string',
                                    'rootDirectory': 'string',
                                    'transitEncryption': 'ENABLED'|'DISABLED',
                                    'transitEncryptionPort': 123,
                                    'authorizationConfig': {
                                        'accessPointId': 'string',
                                        'iam': 'ENABLED'|'DISABLED'
                                    }
                                }
                            },
                        ]
                    },
                ]
            },
            'isCancelled': True|False,
            'isTerminated': True|False
        },
    ]
}

Response Structure

# This section is too large to render.
# Please see the AWS API Documentation linked below.

AWS API Documentation

Exceptions

  • Batch.Client.exceptions.ClientException

  • Batch.Client.exceptions.ServerException

Examples

This example describes a job with the specified job ID.

response = client.describe_jobs(
    jobs=[
        '24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9',
    ],
)

print(response)

Expected Output:

{
    'jobs': [
        {
            'container': {
                'command': [
                    'sleep',
                    '60',
                ],
                'containerInstanceArn': 'arn:aws:ecs:us-east-1:012345678910:container-instance/5406d7cd-58bd-4b8f-9936-48d7c6b1526c',
                'environment': [
                ],
                'exitCode': 0,
                'image': 'busybox',
                'memory': 128,
                'mountPoints': [
                ],
                'ulimits': [
                ],
                'vcpus': 1,
                'volumes': [
                ],
            },
            'createdAt': 1480460782010,
            'dependsOn': [
            ],
            'jobDefinition': 'sleep60',
            'jobId': '24fa2d7a-64c4-49d2-8b47-f8da4fbde8e9',
            'jobName': 'example',
            'jobQueue': 'arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority',
            'parameters': {
            },
            'startedAt': 1480460816500,
            'status': 'SUCCEEDED',
            'stoppedAt': 1480460880699,
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}