mgn / Client / describe_jobs

describe_jobs#

mgn.Client.describe_jobs(**kwargs)#

Returns a list of Jobs. Use the JobsID and fromDate and toData filters to limit which jobs are returned. The response is sorted by creationDataTime - latest date first. Jobs are normally created by the StartTest, StartCutover, and TerminateTargetInstances APIs. Jobs are also created by DiagnosticLaunch and TerminateDiagnosticInstances, which are APIs available only to Support and only used in response to relevant support tickets.

See also: AWS API Documentation

Request Syntax

response = client.describe_jobs(
    accountID='string',
    filters={
        'fromDate': 'string',
        'jobIDs': [
            'string',
        ],
        'toDate': 'string'
    },
    maxResults=123,
    nextToken='string'
)
Parameters:
  • accountID (string) – Request to describe job log items by Account ID.

  • filters (dict) –

    Request to describe Job log filters.

    • fromDate (string) –

      Request to describe Job log filters by date.

    • jobIDs (list) –

      Request to describe Job log filters by job ID.

      • (string) –

    • toDate (string) –

      Request to describe job log items by last date.

  • maxResults (integer) – Request to describe job log items by max results.

  • nextToken (string) – Request to describe job log items by next token.

Return type:

dict

Returns:

Response Syntax

{
    'items': [
        {
            'arn': 'string',
            'creationDateTime': 'string',
            'endDateTime': 'string',
            'initiatedBy': 'START_TEST'|'START_CUTOVER'|'DIAGNOSTIC'|'TERMINATE',
            'jobID': 'string',
            'participatingServers': [
                {
                    'launchStatus': 'PENDING'|'IN_PROGRESS'|'LAUNCHED'|'FAILED'|'TERMINATED',
                    'launchedEc2InstanceID': 'string',
                    'postLaunchActionsStatus': {
                        'postLaunchActionsLaunchStatusList': [
                            {
                                'executionID': 'string',
                                'executionStatus': 'IN_PROGRESS'|'SUCCESS'|'FAILED',
                                'failureReason': 'string',
                                'ssmDocument': {
                                    'actionName': 'string',
                                    'externalParameters': {
                                        'string': {
                                            'dynamicPath': 'string'
                                        }
                                    },
                                    'mustSucceedForCutover': True|False,
                                    'parameters': {
                                        'string': [
                                            {
                                                'parameterName': 'string',
                                                'parameterType': 'STRING'
                                            },
                                        ]
                                    },
                                    'ssmDocumentName': 'string',
                                    'timeoutSeconds': 123
                                },
                                'ssmDocumentType': 'AUTOMATION'|'COMMAND'
                            },
                        ],
                        'ssmAgentDiscoveryDatetime': 'string'
                    },
                    'sourceServerID': 'string'
                },
            ],
            'status': 'PENDING'|'STARTED'|'COMPLETED',
            'tags': {
                'string': 'string'
            },
            'type': 'LAUNCH'|'TERMINATE'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • items (list) –

      Request to describe Job log items.

      • (dict) –

        Job.

        • arn (string) –

          the ARN of the specific Job.

        • creationDateTime (string) –

          Job creation time.

        • endDateTime (string) –

          Job end time.

        • initiatedBy (string) –

          Job initiated by field.

        • jobID (string) –

          Job ID.

        • participatingServers (list) –

          Servers participating in a specific Job.

          • (dict) –

            Server participating in Job.

            • launchStatus (string) –

              Participating server launch status.

            • launchedEc2InstanceID (string) –

              Participating server’s launched ec2 instance ID.

            • postLaunchActionsStatus (dict) –

              Participating server’s Post Launch Actions Status.

              • postLaunchActionsLaunchStatusList (list) –

                List of Post Launch Action status.

                • (dict) –

                  Launch Status of the Job Post Launch Actions.

                  • executionID (string) –

                    AWS Systems Manager Document’s execution ID of the of the Job Post Launch Actions.

                  • executionStatus (string) –

                    AWS Systems Manager Document’s execution status.

                  • failureReason (string) –

                    AWS Systems Manager Document’s failure reason.

                  • ssmDocument (dict) –

                    AWS Systems Manager’s Document of the of the Job Post Launch Actions.

                    • actionName (string) –

                      User-friendly name for the AWS Systems Manager Document.

                    • externalParameters (dict) –

                      AWS Systems Manager Document external parameters.

                      • (string) –

                        • (dict) –

                          AWS Systems Manager Document external parameter.

                          Note

                          This is a Tagged Union structure. Only one of the following top level keys will be set: dynamicPath. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

                          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
                          
                          • dynamicPath (string) –

                            AWS Systems Manager Document external parameters dynamic path.

                    • mustSucceedForCutover (boolean) –

                      If true, Cutover will not be enabled if the document has failed.

                    • parameters (dict) –

                      AWS Systems Manager Document parameters.

                      • (string) –

                        • (list) –

                          • (dict) –

                            AWS Systems Manager Parameter Store parameter.

                            • parameterName (string) –

                              AWS Systems Manager Parameter Store parameter name.

                            • parameterType (string) –

                              AWS Systems Manager Parameter Store parameter type.

                    • ssmDocumentName (string) –

                      AWS Systems Manager Document name or full ARN.

                    • timeoutSeconds (integer) –

                      AWS Systems Manager Document timeout seconds.

                  • ssmDocumentType (string) –

                    AWS Systems Manager Document type.

              • ssmAgentDiscoveryDatetime (string) –

                Time where the AWS Systems Manager was detected as running on the Test or Cutover instance.

            • sourceServerID (string) –

              Participating server Source Server ID.

        • status (string) –

          Job status.

        • tags (dict) –

          Tags associated with specific Job.

          • (string) –

            • (string) –

        • type (string) –

          Job type.

    • nextToken (string) –

      Request to describe Job response by next token.

Exceptions

  • mgn.Client.exceptions.UninitializedAccountException

  • mgn.Client.exceptions.ValidationException