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

# Diagnose bastion

> Bearer PAT authentication; RBAC permission `clusters.operate`. Dispatches the read-only `<provider>_bastion_diagnose` job over SSH and waits for its report within a bounded budget; a slower job answers the operation ids to poll. Browser mutations require CSRF.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /api/v1/clusters/scaleway/{cluster_id}/bastion/diagnose
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /api/v1/clusters/scaleway/{cluster_id}/bastion/diagnose:
    post:
      tags:
        - Scaleway / Kapsule
      summary: Diagnose bastion
      description: >-
        Bearer PAT authentication; RBAC permission `clusters.operate`.
        Dispatches the read-only `<provider>_bastion_diagnose` job over SSH and
        waits for its report within a bounded budget; a slower job answers the
        operation ids to poll. Browser mutations require CSRF.
      operationId: diagnose_bastion_scaleway_pat
      parameters:
        - in: path
          name: cluster_id
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BastionDiagnoseResponse'
          description: Successful response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Unauthenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Permission or CSRF check failed
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Cluster not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: >-
            No bastion resource, a provider with no bastion job lane, or a
            diagnosis already running
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Request validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDetailError'
          description: Provider or internal failure
      security:
        - BearerAuth: []
components:
  schemas:
    BastionDiagnoseResponse:
      properties:
        completed:
          description: >-
            False when the wait budget elapsed first; poll operation_id for the
            report.
          type: boolean
        error_excerpt:
          type: string
        health:
          additionalProperties: true
          description: >-
            The platform's own bastion health view (state, hop, detail) at
            dispatch time.
          properties: {}
          type: object
        job_name:
          type: string
        operation_id:
          format: uuid
          type: string
        report:
          additionalProperties: true
          description: >-
            The diagnose job's structured snapshot and findings, present once it
            completed.
          properties: {}
          type: object
        resource_id:
          format: uuid
          type: string
        status:
          type: string
        step_id:
          format: uuid
          type: string
      required:
        - operation_id
        - step_id
        - resource_id
        - job_name
        - status
        - completed
        - health
      type: object
    ContractDetailError:
      example:
        detail: Cluster not found
      properties:
        detail:
          oneOf:
            - type: string
            - additionalProperties: true
              properties: {}
              type: object
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: PAT
      scheme: bearer
      type: http

````