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

# Update virtual machine metadata and run permission policy



## OpenAPI

````yaml /openapi/control-plane-public.json patch /api/v1/workspaces/{workspaceId}/virtual-machines/{vmId}
openapi: 3.1.0
info:
  title: AcornOps Control Plane API
  version: 0.0.1-experimental.1
  description: >-
    Control plane API for workspaces, targets, Kubernetes clusters, virtual
    machines, sessions, runs, auth, and internal execution wiring.
servers:
  - url: https://api.acornops.dev
security: []
tags:
  - name: health
    description: Health and readiness endpoints.
  - name: auth
    description: >-
      OIDC, password, browser session, and external integration account link
      endpoints.
  - name: workspaces
    description: Workspace, target, Kubernetes cluster, and VM management endpoints.
  - name: webhooks
    description: >-
      Durable webhook subscriptions, lifecycle-aware delivery, and attempt
      history.
  - name: sessions
    description: Session and message endpoints.
  - name: runs
    description: Run query, cancel, and stream endpoints.
  - name: workflows
    description: >-
      Workspace workflow definitions, schedules, sessions, and approval inbox
      endpoints.
  - name: catalog
    description: >-
      MCP registries, destination-bound browsing, scoped MCP imports, and
      credential connections.
  - name: agents
    description: >-
      Workspace-scoped Agent definitions, direct conversations, tests, and
      activity.
  - name: admin
    description: Operator-only admin API protected exclusively by admin bearer tokens.
  - name: internal
    description: Internal execution endpoints for execution-engine.
paths:
  /api/v1/workspaces/{workspaceId}/virtual-machines/{vmId}:
    patch:
      tags:
        - workspaces
      summary: Update virtual machine metadata and run permission policy
      parameters:
        - $ref: '#/components/parameters/PathWorkspaceId'
        - $ref: '#/components/parameters/PathVmId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: payments-vm-01
                hostname:
                  type: string
                  example: payments-vm-01.internal
                allowedLogSources:
                  type: array
                  items:
                    type: string
                  example:
                    - system
                    - app
                permissionModeOverride:
                  type:
                    - string
                    - 'null'
                  enum:
                    - read_only
                    - ask_before_changes
                    - auto_allowed_changes
                    - null
                  description: >-
                    VM-specific assistant run policy. Null restores the
                    deployment default.
      responses:
        '200':
          description: VM metadata and effective permission policy updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualMachine'
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '409':
          $ref: '#/components/responses/Error409'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
      security:
        - userSession: []
components:
  parameters:
    PathWorkspaceId:
      in: path
      name: workspaceId
      required: true
      schema:
        type: string
        format: uuid
        example: 4b930d98-add9-4924-ab26-3c16d96ec373
    PathVmId:
      in: path
      name: vmId
      required: true
      schema:
        type: string
        format: uuid
        example: 9254df42-4d9b-4e63-8bb6-93442e7d9a45
  schemas:
    VirtualMachine:
      allOf:
        - type: object
          required:
            - id
            - workspaceId
            - targetType
            - name
          properties:
            id:
              type: string
              format: uuid
            workspaceId:
              type: string
              format: uuid
            targetType:
              type: string
              enum:
                - kubernetes
                - virtual_machine
            name:
              type: string
            status:
              type: string
            connectionStatus:
              type: string
            latestSnapshot:
              $ref: '#/components/schemas/SnapshotReference'
            summary:
              type: object
              additionalProperties: true
            permissions:
              type: object
              additionalProperties:
                type: boolean
          additionalProperties: true
      required:
        - agentAccessMode
        - restartServices
        - pendingAgentAccessPolicy
        - permissionMode
        - permissionModeOverride
        - permissionModeSource
      properties:
        hostname:
          type: string
        osFamily:
          type: string
          enum:
            - linux
        serviceManager:
          type: string
          enum:
            - systemd
        allowedLogSources:
          type: array
          items:
            type: string
        agentAccessMode:
          type: string
          enum:
            - read_only
            - read_write
        restartServices:
          type: array
          items:
            type: string
        pendingAgentAccessPolicy:
          oneOf:
            - $ref: '#/components/schemas/AgentVAccessPolicy'
            - type: 'null'
        permissionMode:
          type: string
          enum:
            - read_only
            - ask_before_changes
            - auto_allowed_changes
        permissionModeOverride:
          type:
            - string
            - 'null'
          enum:
            - read_only
            - ask_before_changes
            - auto_allowed_changes
            - null
        permissionModeSource:
          type: string
          enum:
            - virtual_machine_override
            - deployment_default
    SnapshotReference:
      type: object
      properties:
        workspaceId:
          type: string
          format: uuid
        clusterId:
          type: string
          format: uuid
        targetId:
          type: string
          format: uuid
        timestamp:
          type: string
          format: date-time
      additionalProperties: true
    AgentVAccessPolicy:
      type: object
      required:
        - accessMode
        - restartServices
      properties:
        accessMode:
          type: string
          enum:
            - read_only
            - read_write
        restartServices:
          type: array
          maxItems: 32
          uniqueItems: true
          items:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9_.@:-]{0,254}\.service$
      additionalProperties: false
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            retryable:
              type: boolean
            details:
              type: object
              additionalProperties: true
              description: Optional structured error details.
  responses:
    Error400:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error401:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error403:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error404:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error409:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error429:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Error500:
      description: Error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    userSession:
      type: apiKey
      in: cookie
      name: acornops_cp_session

````