> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phala.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Handle Batch Cvm Status

> Batch query CVM real-time status.

Groups by teepod and queries VMM status in parallel. Resource usage comes
from VictoriaMetrics, not a per-node teescope fan-out.



## OpenAPI

````yaml /openapi.json post /api/v1/status/batch
openapi: 3.1.0
info:
  title: Phala Cloud API
  version: 0.1.0
servers:
  - url: https://cloud-api.phala.com
security: []
tags:
  - name: CVMs
    description: Confidential Virtual Machine (CVM) lifecycle management on Phala Network
    x-mint:
      href: https://cloud.phala.network/api-reference/cvms
  - name: Apps
    description: App template management and CVM deployment from app blueprints
    x-mint:
      href: https://cloud.phala.network/api-reference/apps
  - name: Webhooks
    description: Manage webhook endpoints and monitor delivery history
    x-mint:
      href: https://cloud.phala.network/api-reference/webhooks
  - name: SSH Keys
    description: SSH public key management for CVM access
    x-mint:
      href: https://cloud.phala.network/api-reference/ssh-keys
  - name: KMS
    description: >-
      Key Management Service — key derivation, on-chain anchoring, and
      inspection
    x-mint:
      href: https://cloud.phala.network/api-reference/kms
  - name: Instance Types
    description: Available hardware configurations for CVM deployment
    x-mint:
      href: https://cloud.phala.network/api-reference/instance-types
  - name: Attestations
    description: Remote attestation and TEE verification endpoints
    x-mint:
      href: https://cloud.phala.network/api-reference/attestations
paths:
  /api/v1/status/batch:
    post:
      tags:
        - user
        - CVMs
      summary: Handle Batch Cvm Status
      description: >-
        Batch query CVM real-time status.


        Groups by teepod and queries VMM status in parallel. Resource usage
        comes

        from VictoriaMetrics, not a per-node teescope fan-out.
      operationId: handle_batch_cvm_status_api_v1_status_batch_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchStatusRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties:
                  $ref: '#/components/schemas/CvmStatus'
                type: object
                title: Response Handle Batch Cvm Status Api V1 Status Batch Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
components:
  schemas:
    BatchStatusRequest:
      properties:
        vm_uuids:
          items:
            type: string
          type: array
          title: Vm Uuids
      type: object
      required:
        - vm_uuids
      title: BatchStatusRequest
    CvmStatus:
      properties:
        vm_uuid:
          type: string
          title: Vm Uuid
        status:
          type: string
          title: Status
        uptime:
          anyOf:
            - type: string
            - type: 'null'
          title: Uptime
        in_progress:
          type: boolean
          title: In Progress
          default: false
        boot_progress:
          anyOf:
            - type: string
            - type: 'null'
          title: Boot Progress
        boot_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Boot Error
        reachability:
          anyOf:
            - $ref: '#/components/schemas/CvmReachability'
            - type: 'null'
        boot_phase:
          anyOf:
            - type: string
            - type: 'null'
          title: Boot Phase
        boot_phase_started_at:
          anyOf:
            - type: string
              format: date-time
              examples:
                - '2024-01-01T00:00:00Z'
            - type: 'null'
          title: Boot Phase Started At
        boot_stalled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Boot Stalled
        shutdown_progress:
          anyOf:
            - type: string
            - type: 'null'
          title: Shutdown Progress
        events:
          items:
            $ref: '#/components/schemas/GuestEvent'
          type: array
          title: Events
        operation:
          anyOf:
            - $ref: '#/components/schemas/CvmOperationStatus'
            - type: 'null'
        resource_usage:
          anyOf:
            - $ref: '#/components/schemas/CvmResourceUsage'
            - type: 'null'
      type: object
      required:
        - vm_uuid
        - status
      title: CvmStatus
      description: >-
        CVM status information for API response.


        This schema is used for both internal status determination and API
        responses.

        Contains current state, progress information, and async operation
        tracking.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CvmReachability:
      properties:
        reachable:
          type: boolean
          title: Reachable
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
      type: object
      required:
        - reachable
      title: CvmReachability
    GuestEvent:
      properties:
        event:
          type: string
          title: Event
        body:
          type: string
          title: Body
        timestamp:
          type: integer
          title: Timestamp
          default: 0
      type: object
      required:
        - event
        - body
      title: GuestEvent
      description: >-
        Structured lifecycle event emitted by the guest or runtime. Since VMM
        v0.5.7.
    CvmOperationStatus:
      properties:
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        phase:
          anyOf:
            - $ref: '#/components/schemas/CvmOperationPhase'
            - type: 'null'
        started_at:
          anyOf:
            - type: string
              format: date-time
              examples:
                - '2024-01-01T00:00:00Z'
            - type: 'null'
          title: Started At
        correlation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Correlation Id
      type: object
      title: CvmOperationStatus
    CvmResourceUsage:
      properties:
        cpu_percent:
          anyOf:
            - type: number
            - type: 'null'
          title: Cpu Percent
          description: >-
            CPU used relative to the CVM's allocated vCPUs, 0-100. 100 means
            every allocated vCPU is busy; may exceed 100.
        memory_used_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Memory Used Bytes
        memory_total_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Memory Total Bytes
        disk_used_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Disk Used Bytes
        disk_total_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Disk Total Bytes
        egress_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Egress Bytes
      type: object
      title: CvmResourceUsage
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CvmOperationPhase:
      type: string
      enum:
        - queued
        - init
        - wait_stopped
        - wait_stopped_graceful
        - wait_stopped_force
        - apply_update
        - updating_compose
        - upgrade_compose
        - resize
        - destroy
        - wait_running
      title: CvmOperationPhase
      description: |-
        Persisted phase of an in-progress CVM operation.

        Common shutdown flow and operation-specific continuations::

            QUEUED -> INIT
                        |
                        +-- already stopped -------------------------------> CONTINUE
                        |
                        +-- explicit force / unhealthy precheck
                        |       |
                        |       +-> WAIT_STOPPED_FORCE -- stopped ---------> CONTINUE
                        |
                        +-- healthy precheck
                                |
                                +-> WAIT_STOPPED_GRACEFUL
                                        |
                                        +-- stopped ------------------------> CONTINUE
                                        |
                                        +-- unhealthy / timeout
                                                |
                                                +-> WAIT_STOPPED_FORCE
                                                        |
                                                        +-- stopped --------> CONTINUE

            CONTINUE
                +-- UPDATE -----> APPLY_UPDATE -----------+
                +-- COMPOSE ----> UPDATING_COMPOSE -------+-> WAIT_RUNNING -> complete
                +-- VISIBILITY -> UPGRADE_COMPOSE --------+
                +-- RESIZE -----> RESIZE -----------------+
                +-- RESTART -----------------------------------------------> WAIT_RUNNING -> complete
                +-- SHUTDOWN -------------------------------------------------------------> complete
                +-- REMOVE -----> DESTROY ------------------------------------------------> complete
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: ''
          tokenUrl: token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.