---
title: "POST /v1/{+parent}/state:report"
method: POST
path: "/v1/{+parent}/state:report"
tags: ["projects"]
---

# POST /v1/{+parent}/state:report

`POST /v1/{+parent}/state:report`

Report agent's state, e.g. agent status and tasks information

## Path parameters

- `parent` string, required

## Request body

- ReportAgentStateRequest — Request to report agent's state. The Request itself implies the agent is healthy.
  - `metadata` AgentMetadata — VM Agent Metadata.
    - `zone` string — Agent zone.
    - `osRelease` object — parsed contents of /etc/os-release
    - `imageVersion` string — image version for the VM that this agent is installed on.
    - `creator` string — Full name of the entity that created this vm. For MIG, this path is: projects/{project}/regions/{region}/InstanceGroupManagers/{igm} The value is retrieved from the vm metadata key of "created-by".
    - `creationTime` string, google-datetime — When the VM agent started. Use agent_startup_time instead.
    - `instancePreemptionNoticeReceived` boolean — If the GCP instance has received preemption notice.
    - `machineType` string — Optional. machine type of the VM
    - `instance` string — GCP instance name (go/instance-name).
    - `version` string — agent binary version running on VM
    - `instanceId` string, uint64 — GCP instance ID (go/instance-id).
  - `agentInfo` AgentInfo — VM Agent Info.
    - `tasks` AgentTaskInfo[] — Task Info.
      - `taskId` string — ID of the Task
      - `taskStatus` TaskStatus — Status of a task.
        - `state` 'STATE_UNSPECIFIED' | 'PENDING' | 'ASSIGNED' | 'RUNNING' | 'FAILED' | 'SUCCEEDED' | 'UNEXECUTED' — Task state.
        - `statusEvents` StatusEvent[] — Detailed info about why the state is reached.
          - `taskState` 'STATE_UNSPECIFIED' | 'PENDING' | 'ASSIGNED' | 'RUNNING' | 'FAILED' | 'SUCCEEDED' | 'UNEXECUTED' — Task State. This field is only defined for task-level status events.
          - `description` string — Description of the event.
          - `eventTime` string, google-datetime — The time this event occurred.
          - `type` string — Type of the event.
          - `taskExecution` TaskExecution — This Task Execution field includes detail information for task execution procedures, based on StatusEvent types.
            - `exitCode` integer — The exit code of a finished task. If the task succeeded, the exit code will be 0. If the task failed but not due to the following reasons, the exit code will be 50000. Otherwise, it can be from different sources: * Batch known failures: https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. * Batch runnable execution failures; you can rely on Batch logs to further diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If there are multiple runnables failures, Batch only exposes the first error.
      - `runnable` string, int64 — The highest index of a runnable started by the agent for this task. The runnables are indexed from 1. Value 0 is undefined.
    - `taskGroupId` string — The assigned task group ID.
    - `jobId` string — Optional. The assigned Job ID
    - `state` 'AGENT_STATE_UNSPECIFIED' | 'AGENT_STARTING' | 'AGENT_RUNNING' | 'AGENT_STOPPED' — Agent state.
    - `reportTime` string, google-datetime — When the AgentInfo is generated.
  - `agentTimingInfo` AgentTimingInfo — VM timing information
    - `bootTime` string, google-datetime — Boot timestamp of the VM OS
    - `agentStartupTime` string, google-datetime — Agent startup time
    - `scriptStartupTime` string, google-datetime — Startup time of the Batch VM script.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/batch.md) · [All operations](https://skmtc.dev/google/apis/batch/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/batch/revisions/c0efedff871c/schema)
