{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-batch/json-schema/aws-batch-describe-service-job-response-schema.json",
  "title": "DescribeServiceJobResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aws-batch-operations-api-openapi.yml#/components/schemas/DescribeServiceJobResponse",
  "type": "object",
  "properties": {
    "attempts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceJobAttemptDetail"
      },
      "description": "A list of job attempts associated with the service job."
    },
    "capacityUsage": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceJobCapacityUsageDetail"
      },
      "description": "The configured capacity for the service job, such as the number of instances. The number of instances should be the same value as the serviceRequestPayload.InstanceCount field."
    },
    "createdAt": {
      "type": "integer",
      "description": "The Unix timestamp (in milliseconds) for when the service job was created."
    },
    "isTerminated": {
      "type": "boolean",
      "description": "Indicates whether the service job has been terminated."
    },
    "jobArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the service job."
    },
    "jobId": {
      "type": "string",
      "description": "The job ID for the service job."
    },
    "jobName": {
      "type": "string",
      "description": "The name of the service job."
    },
    "jobQueue": {
      "type": "string",
      "description": "The ARN of the job queue that the service job is associated with."
    },
    "latestAttempt": {
      "$ref": "#/$defs/LatestServiceJobAttempt"
    },
    "retryStrategy": {
      "$ref": "#/$defs/ServiceJobRetryStrategy"
    },
    "scheduledAt": {
      "type": "integer",
      "description": "The Unix timestamp (in milliseconds) for when the service job was scheduled. This represents when the service job was dispatched to SageMaker and the service job transitioned to the SCHEDULED state."
    },
    "schedulingPriority": {
      "type": "integer",
      "description": "The scheduling priority of the service job."
    },
    "serviceRequestPayload": {
      "type": "string",
      "description": "The request, in JSON, for the service that the SubmitServiceJob operation is queueing."
    },
    "serviceJobType": {
      "type": "string",
      "enum": [
        "SAGEMAKER_TRAINING"
      ],
      "description": "The type of service job. For SageMaker Training jobs, this value is SAGEMAKER_TRAINING."
    },
    "shareIdentifier": {
      "type": "string",
      "description": "The share identifier for the service job. This is used for fair-share scheduling."
    },
    "quotaShareName": {
      "type": "string",
      "description": "The name of the quota share that the service job is associated with."
    },
    "preemptionConfiguration": {
      "$ref": "#/$defs/ServiceJobPreemptionConfiguration"
    },
    "preemptionSummary": {
      "$ref": "#/$defs/ServiceJobPreemptionSummary"
    },
    "startedAt": {
      "type": "integer",
      "description": "The Unix timestamp (in milliseconds) for when the service job was started."
    },
    "status": {
      "type": "string",
      "enum": [
        "SUBMITTED",
        "PENDING",
        "RUNNABLE",
        "SCHEDULED",
        "STARTING",
        "RUNNING",
        "SUCCEEDED",
        "FAILED"
      ],
      "description": "The current status of the service job."
    },
    "statusReason": {
      "type": "string",
      "description": "A short, human-readable string to provide more details for the current status of the service job."
    },
    "stoppedAt": {
      "type": "integer",
      "description": "The Unix timestamp (in milliseconds) for when the service job stopped running."
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags that are associated with the service job. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources."
    },
    "timeoutConfig": {
      "$ref": "#/$defs/ServiceJobTimeout"
    }
  },
  "required": [
    "jobId",
    "jobName",
    "jobQueue",
    "serviceJobType",
    "startedAt",
    "status"
  ],
  "$defs": {
    "LatestServiceJobAttempt": {
      "type": "object",
      "properties": {
        "serviceResourceId": {
          "$ref": "#/$defs/ServiceResourceId"
        }
      }
    },
    "ServiceJobAttemptDetail": {
      "type": "object",
      "properties": {
        "serviceResourceId": {
          "$ref": "#/$defs/ServiceResourceId"
        },
        "startedAt": {
          "type": "integer",
          "description": "The Unix timestamp (in milliseconds) for when the service job attempt was started."
        },
        "stoppedAt": {
          "type": "integer",
          "description": "The Unix timestamp (in milliseconds) for when the service job attempt stopped running."
        },
        "statusReason": {
          "type": "string",
          "description": "A string that provides additional details for the current status of the service job attempt."
        }
      }
    },
    "ServiceJobCapacityUsageDetail": {
      "type": "object",
      "properties": {
        "capacityUnit": {
          "type": "string",
          "description": "The unit of measure for the service job capacity usage. For service jobs, this is the instance type."
        },
        "quantity": {
          "type": "number",
          "description": "The quantity of capacity being used by the service job, measured in the units specified by capacityUnit."
        }
      }
    },
    "ServiceJobEvaluateOnExit": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "enum": [
            "RETRY",
            "EXIT"
          ],
          "description": "The action to take if the service job exits with the specified condition. Valid values are RETRY and EXIT."
        },
        "onStatusReason": {
          "type": "string",
          "description": "Contains a glob pattern to match against the StatusReason returned for a job. The pattern can contain up to 512 characters and can contain all printable characters. It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match."
        }
      }
    },
    "ServiceJobPreemptedAttempt": {
      "type": "object",
      "properties": {
        "serviceResourceId": {
          "$ref": "#/$defs/ServiceResourceId"
        },
        "startedAt": {
          "type": "integer",
          "description": "The Unix timestamp (in milliseconds) for when the service job attempt was started."
        },
        "stoppedAt": {
          "type": "integer",
          "description": "The Unix timestamp (in milliseconds) for when the service job attempt stopped running."
        },
        "statusReason": {
          "type": "string",
          "description": "A string that provides additional details for the current status of the service job attempt."
        }
      }
    },
    "ServiceJobPreemptionConfiguration": {
      "type": "object",
      "properties": {
        "preemptionRetriesBeforeTermination": {
          "type": "integer",
          "description": "The number of times a service job can be retried after it is preempted. A job will be terminated when preemption retries have been exhausted. If this field is unset, preempted jobs will be requeued an unlimited number of times."
        }
      }
    },
    "ServiceJobPreemptionSummary": {
      "type": "object",
      "properties": {
        "preemptedAttemptCount": {
          "type": "integer",
          "description": "The total number of times the service job has been preempted."
        },
        "recentPreemptedAttempts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ServiceJobPreemptedAttempt"
          },
          "description": "A list of the most recent preemption attempts for the service job."
        }
      }
    },
    "ServiceJobRetryStrategy": {
      "type": "object",
      "properties": {
        "attempts": {
          "type": "integer",
          "description": "The number of times to move a service job to RUNNABLE status. You can specify between 1 and 10 attempts."
        },
        "evaluateOnExit": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ServiceJobEvaluateOnExit"
          },
          "description": "Array of ServiceJobEvaluateOnExit objects that specify conditions under which the service job should be retried or failed."
        }
      },
      "required": [
        "attempts"
      ]
    },
    "ServiceJobTimeout": {
      "type": "object",
      "properties": {
        "attemptDurationSeconds": {
          "type": "integer",
          "description": "The maximum duration in seconds that a service job attempt can run. After this time is reached, Batch terminates the service job attempt."
        }
      }
    },
    "ServiceResourceId": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "TrainingJobArn"
          ],
          "description": "The name of the resource identifier."
        },
        "value": {
          "type": "string",
          "description": "The value of the resource identifier."
        }
      },
      "required": [
        "name",
        "value"
      ]
    }
  }
}