swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: The Azure Serial Console allows you to access the serial console of a Virtual Machine or VM scale set instance
  title: MicrosoftSerialConsoleClient
  version: 2018-05-01
  x-apisguru-categories:
    - cloud
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_assets.onestore.ms_cdnfiles_onestorerolling-1606-01000_shell_v3_images_logo_microsoft.png
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/serialconsole/resource-manager/Microsoft.SerialConsole/stable/2018-05-01/serialconsole.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: serialconsole
  x-tags:
    - Azure
    - Microsoft
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  azure_auth:
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    description: Azure Active Directory OAuth2 Flow
    flow: implicit
    scopes:
      user_impersonation: impersonate your user account
    type: oauth2
security:
  - azure_auth:
      - user_impersonation
parameters:
  ApiVersionParameter:
    description: The API version to use for this operation.
    in: query
    name: api-version
    required: true
    type: string
  SubscriptionIdParameter:
    description: Subscription ID which uniquely identifies the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call requiring it.
    in: path
    name: subscriptionId
    required: true
    type: string
  defaultParameter:
    description: Default parameter. Leave the value as "default".
    in: path
    name: default
    required: true
    type: string
    x-ms-parameter-location: method
paths:
  /providers/Microsoft.SerialConsole/operations:
    get:
      description: Gets a list of Serial Console API operations.
      operationId: ListOperations
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK - returns a JSON object
          schema:
            $ref: "#/definitions/SerialConsoleOperations"
      tags:
        - SerialConsole
      x-ms-examples:
        List all Serial Console management operations supported by Serial Console RP:
          parameters:
            api-version: 2018-05-01
          responses:
            "200":
              body:
                value:
                  - display:
                      description: Retrieves the current subscription state
                      operation: Default
                      provider: Microsoft.SerialConsole
                      resource: Serial Console instance
                    isDataAction: "false"
                    name: Microsoft.SerialConsole/consoleServices/read
                  - display:
                      description: Disable Serial Console for a subscription
                      operation: Disable Console
                      provider: Microsoft.SerialConsole
                      resource: Serial Console instance
                    isDataAction: "false"
                    name: Microsoft.SerialConsole/consoleServices/disableConsole/action
                  - display:
                      description: Enable Serial Console for a subscription
                      operation: Enable Console
                      provider: Microsoft.SerialConsole
                      resource: Serial Console instance
                    isDataAction: "false"
                    name: Microsoft.SerialConsole/consoleServices/enableConsole/action
  "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}":
    get:
      description: Gets whether or not Serial Console is disabled for a given subscription
      operationId: GetConsoleStatus
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/defaultParameter"
      responses:
        "200":
          description: OK - Returns a JSON object
          schema:
            $ref: "#/definitions/SerialConsoleStatus"
        "404":
          description: Subscription not found - returns a JSON object with error details
          schema:
            $ref: "#/definitions/GetSerialConsoleSubscriptionNotFound"
      summary: Get the disabled status for a subscription
      tags:
        - SerialConsole
      x-ms-examples:
        Get the Serial Console disabled status for a subscription:
          parameters:
            api-version: 2018-05-01
            default: default
            subscriptionId: 00000000-00000-0000-0000-000000000000
          responses:
            "200":
              body:
                disabled: true
            "404":
              body:
                code: SubscriptionNotFound
                message: The subscription '00000000-00000-0000-0000-000000000000' could not be found.
  "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole":
    post:
      description: Disables the Serial Console service for all VMs and VM scale sets in the provided subscription
      operationId: DisableConsole
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/defaultParameter"
      responses:
        "200":
          description: OK - Returns a JSON object
          schema:
            $ref: "#/definitions/DisableSerialConsoleResult"
        "404":
          description: Subscription not found - returns a JSON object with error details
          schema:
            $ref: "#/definitions/GetSerialConsoleSubscriptionNotFound"
      summary: Disable Serial Console for a subscription
      tags:
        - SerialConsole
      x-ms-examples:
        Disable Serial Console for a subscription:
          parameters:
            api-version: 2018-05-01
            default: default
            subscriptionId: 00000000-00000-0000-0000-000000000000
          responses:
            "200":
              body:
                disabled: true
            "404":
              body:
                code: SubscriptionNotFound
                message: The subscription '00000000-00000-0000-0000-000000000000' could not be found.
  "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole":
    post:
      description: Enables the Serial Console service for all VMs and VM scale sets in the provided subscription
      operationId: EnableConsole
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/defaultParameter"
      responses:
        "200":
          description: OK - Serial Console disabled
          schema:
            $ref: "#/definitions/EnableSerialConsoleResult"
        "404":
          description: Subscription not found - returns a JSON object with error details
          schema:
            $ref: "#/definitions/GetSerialConsoleSubscriptionNotFound"
      summary: Enable Serial Console for a subscription
      tags:
        - SerialConsole
      x-ms-examples:
        Enable Serial Console for a subscription:
          parameters:
            api-version: 2018-05-01
            default: default
            subscriptionId: 00000000-00000-0000-0000-000000000000
          responses:
            "200":
              body:
                disabled: false
            "404":
              body:
                code: SubscriptionNotFound
                message: The subscription '00000000-00000-0000-0000-000000000000' could not be found.
definitions:
  DisableSerialConsoleResult:
    description: Returns whether or not Serial Console is disabled.
    properties:
      disabled:
        description: Whether or not Serial Console is disabled.
        type: boolean
    title: Serial Console Disable Result
    type: object
  EnableSerialConsoleResult:
    description: Returns whether or not Serial Console is disabled (enabled).
    properties:
      disabled:
        description: Whether or not Serial Console is disabled (enabled).
        type: boolean
    title: Serial Console Enable Result
    type: object
  GetSerialConsoleSubscriptionNotFound:
    description: Error saying that the provided subscription could not be found
    properties:
      code:
        description: Error code
        type: string
      message:
        description: Subscription not found message
        type: string
    title: Serial Console subscription not found
    type: object
  SerialConsoleOperations:
    description: Serial Console operations
    properties:
      value:
        description: A list of Serial Console operations
        items:
          properties:
            display:
              properties:
                description:
                  type: string
                operation:
                  type: string
                provider:
                  type: string
                resource:
                  type: string
              type: object
            isDataAction:
              type: string
            name:
              type: string
          type: object
        type: array
    title: Serial Console operations
    type: object
  SerialConsoleStatus:
    description: Returns whether or not Serial Console is disabled.
    properties:
      disabled:
        description: Whether or not Serial Console is disabled.
        type: boolean
    title: Serial Console GET Result
    type: object
