{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aws-batch/json-schema/aws-batch-submit-service-job-request-schema.json",
  "title": "SubmitServiceJobRequest",
  "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/SubmitServiceJobRequest",
  "type": "object",
  "properties": {
    "jobName": {
      "type": "string",
      "description": "The name of the service job. It can be up to 128 characters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_)."
    },
    "jobQueue": {
      "type": "string",
      "description": "The job queue into which the service job is submitted. You can specify either the name or the ARN of the queue. The job queue must have the type SAGEMAKER_TRAINING."
    },
    "retryStrategy": {
      "$ref": "#/$defs/ServiceJobRetryStrategy"
    },
    "schedulingPriority": {
      "type": "integer",
      "description": "The scheduling priority of the service job. Valid values are integers between 0 and 9999."
    },
    "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, specify SAGEMAKER_TRAINING."
    },
    "shareIdentifier": {
      "type": "string",
      "description": "The share identifier for the service job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified."
    },
    "quotaShareName": {
      "type": "string",
      "description": "The quota share for the service job. Don't specify this parameter if the job queue doesn't have a quota share scheduling policy. If the job queue has a quota share scheduling policy, then this parameter must be specified."
    },
    "preemptionConfiguration": {
      "$ref": "#/$defs/ServiceJobPreemptionConfiguration"
    },
    "timeoutConfig": {
      "$ref": "#/$defs/ServiceJobTimeout"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags that you apply to the service job request. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique identifier for the request. This token is used to ensure idempotency of requests. If this parameter is specified and two submit requests with identical payloads and clientTokens are received, these requests are considered the same request and the second request is rejected."
    }
  },
  "required": [
    "jobName",
    "jobQueue",
    "serviceRequestPayload",
    "serviceJobType"
  ],
  "$defs": {
    "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."
        }
      }
    },
    "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."
        }
      }
    },
    "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."
        }
      }
    }
  }
}