{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ecs/json-schema/amazon-ecs-submit-task-state-change-request-schema.json",
  "title": "SubmitTaskStateChangeRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ecs-operations-api-openapi.yml#/components/schemas/SubmitTaskStateChangeRequest",
  "type": "object",
  "properties": {
    "cluster": {
      "type": "string",
      "description": "The short name or full Amazon Resource Name (ARN) of the cluster that hosts the task."
    },
    "task": {
      "type": "string",
      "description": "The task ID or full ARN of the task in the state change request."
    },
    "status": {
      "type": "string",
      "description": "The status of the state change request."
    },
    "reason": {
      "type": "string",
      "description": "The reason for the state change request."
    },
    "containers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContainerStateChange"
      },
      "description": "Any containers that's associated with the state change request."
    },
    "attachments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AttachmentStateChange"
      },
      "description": "Any attachments associated with the state change request."
    },
    "managedAgents": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ManagedAgentStateChange"
      },
      "description": "The details for the managed agent that's associated with the task."
    },
    "pullStartedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The Unix timestamp for the time when the container image pull started."
    },
    "pullStoppedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The Unix timestamp for the time when the container image pull completed."
    },
    "executionStoppedAt": {
      "type": "string",
      "format": "date-time",
      "description": "The Unix timestamp for the time when the task execution stopped."
    }
  },
  "$defs": {
    "AttachmentStateChange": {
      "type": "object",
      "properties": {
        "attachmentArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the attachment."
        },
        "status": {
          "type": "string",
          "description": "The status of the attachment."
        }
      },
      "required": [
        "attachmentArn",
        "status"
      ]
    },
    "ContainerStateChange": {
      "type": "object",
      "properties": {
        "containerName": {
          "type": "string",
          "description": "The name of the container."
        },
        "imageDigest": {
          "type": "string",
          "description": "The container image SHA 256 digest."
        },
        "runtimeId": {
          "type": "string",
          "description": "The ID of the Docker container."
        },
        "exitCode": {
          "type": "integer",
          "description": "The exit code for the container, if the state change is a result of the container exiting."
        },
        "networkBindings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NetworkBinding"
          },
          "description": "Any network bindings that are associated with the container."
        },
        "reason": {
          "type": "string",
          "description": "The reason for the state change."
        },
        "status": {
          "type": "string",
          "description": "The status of the container."
        }
      }
    },
    "ManagedAgentStateChange": {
      "type": "object",
      "properties": {
        "containerName": {
          "type": "string",
          "description": "The name of the container that's associated with the managed agent."
        },
        "managedAgentName": {
          "type": "string",
          "enum": [
            "ExecuteCommandAgent"
          ],
          "description": "The name of the managed agent."
        },
        "status": {
          "type": "string",
          "description": "The status of the managed agent."
        },
        "reason": {
          "type": "string",
          "description": "The reason for the status of the managed agent."
        }
      },
      "required": [
        "containerName",
        "managedAgentName",
        "status"
      ]
    },
    "NetworkBinding": {
      "type": "object",
      "properties": {
        "bindIP": {
          "type": "string",
          "description": "The IP address that the container is bound to on the container instance."
        },
        "containerPort": {
          "type": "integer",
          "description": "The port number on the container that's used with the network binding."
        },
        "hostPort": {
          "type": "integer",
          "description": "The port number on the host that's used with the network binding."
        },
        "protocol": {
          "type": "string",
          "enum": [
            "tcp",
            "udp"
          ],
          "description": "The protocol used for the network binding."
        },
        "containerPortRange": {
          "type": "string",
          "description": "The port number range on the container that's bound to the dynamically mapped host port range. The following rules apply when you specify a containerPortRange: You must use either the bridge network mode or the awsvpc network mode. This parameter is available for both the EC2 and Fargate launch types. This parameter is available for both the Linux and Windows operating systems. The container instance must have at least version 1.67.0 of the container agent and at least version 1.67.0-1 of the ecs-init package You can specify a maximum of 100 port ranges per container. You do not specify a host"
        },
        "hostPortRange": {
          "type": "string",
          "description": "The port number range on the host that's used with the network binding. This is assigned is assigned by Docker and delivered by the Amazon ECS agent."
        }
      }
    }
  }
}