swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: API to manage VM Insights Onboarding
  title: VM Insights Onboarding
  version: 2018-11-27-preview
  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-ms-code-generation-settings:
    name: MonitorManagementClient
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/monitor/resource-manager/Microsoft.Insights/preview/2018-11-27-preview/vmInsightsOnboarding_API.json
      version: "2.0"
  x-providerName: azure.com
  x-serviceName: monitor-vmInsightsOnboarding_API
  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: API version.
    in: query
    name: api-version
    required: true
    type: string
paths:
  "/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default":
    get:
      description: Retrieves the VM Insights onboarding status for the specified resource or resource scope.
      operationId: VMInsights_GetOnboardingStatus
      parameters:
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The fully qualified Azure Resource manager identifier of the resource, or scope, whose status to retrieve.
          in: path
          name: resourceUri
          required: true
          type: string
          x-ms-skip-url-encoding: true
      responses:
        "200":
          description: The operation completed successfully.
          schema:
            $ref: "#/definitions/VMInsightsOnboardingStatus"
        default:
          description: An error occurred while processing the request. See the error.code parameter to identify the specific error.
          schema:
            $ref: "#/definitions/ResponseWithError"
      tags:
        - VM Insights Onboarding
      x-ms-examples:
        Get status for a VM scale set that is actively reporting data:
          parameters:
            api-version: 2018-11-27-preview
            resourceUri: subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01
          responses:
            "200":
              body:
                id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default
                name: default
                properties:
                  data:
                    - workspace:
                        id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring
                        location: eastus
                        properties:
                          customerId: c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a
                  dataStatus: present
                  onboardingStatus: onboarded
                  resourceId: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/my-service-cluster/providers/Microsoft.Compute/virtualMachineScaleSets/scale-set-01
                type: Microsoft.Insights/vmInsightsOnboardingStatuses
              headers: {}
        Get status for a VM that has not yet reported data:
          parameters:
            api-version: 2018-11-27-preview
            resourceUri: subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm
          responses:
            "200":
              body:
                id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default
                name: default
                properties:
                  data: []
                  dataStatus: notPresent
                  onboardingStatus: unknown
                  resourceId: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm
                type: Microsoft.Insights/vmInsightsOnboardingStatuses
              headers: {}
        Get status for a VM that is actively reporting data:
          parameters:
            api-version: 2018-11-27-preview
            resourceUri: subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm
          responses:
            "200":
              body:
                id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default
                name: default
                properties:
                  data:
                    - workspace:
                        id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring
                        location: eastus
                        properties:
                          customerId: c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a
                  dataStatus: present
                  onboardingStatus: onboarded
                  resourceId: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/vm-resource-group/providers/Microsoft.Compute/virtualMachines/ubuntu-vm
                type: Microsoft.Insights/vmInsightsOnboardingStatuses
              headers: {}
        Get status for a resource group that has at least one VM that is actively reporting data:
          parameters:
            api-version: 2018-11-27-preview
            resourceUri: subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms
          responses:
            "200":
              body:
                id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default
                name: default
                properties:
                  data:
                    - workspace:
                        id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring
                        location: eastus
                        properties:
                          customerId: c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a
                  dataStatus: present
                  onboardingStatus: onboarded
                  resourceId: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourceGroups/resource-group-with-vms
                type: Microsoft.Insights/vmInsightsOnboardingStatuses
              headers: {}
        Get status for a subscription that has at least one VM that is actively reporting data:
          parameters:
            api-version: 2018-11-27-preview
            resourceUri: subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87
          responses:
            "200":
              body:
                id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default
                name: default
                properties:
                  data:
                    - workspace:
                        id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring-secondary
                        location: eastus
                        properties:
                          customerId: f096d163-206e-4abf-9db3-2c62af003d68
                    - workspace:
                        id: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87/resourcegroups/monitoring/providers/microsoft.operationalinsights/workspaces/vm-monitoring
                        location: eastus
                        properties:
                          customerId: c7f8f44d-d8ee-4b79-9d9a-4d8a1f2a112a
                  dataStatus: present
                  onboardingStatus: onboarded
                  resourceId: /subscriptions/3d51de47-8d1c-4d24-b42f-bcae075dfa87
                type: Microsoft.Insights/vmInsightsOnboardingStatuses
definitions:
  DataContainer:
    description: Information about a container with data for a given resource.
    properties:
      workspace:
        $ref: "#/definitions/WorkspaceInfo"
        description: Log Analytics workspace information.
    required:
      - workspace
    type: object
  Error:
    description: Error details.
    properties:
      code:
        description: Error code identifying the specific error.
        type: string
      message:
        description: Error message in the caller's locale.
        type: string
    required:
      - code
    type: object
  ProxyResource:
    description: An azure resource object
    properties:
      id:
        description: Azure resource Id
        readOnly: true
        type: string
      name:
        description: Azure resource name
        readOnly: true
        type: string
      type:
        description: Azure resource type
        readOnly: true
        type: string
    x-ms-azure-resource: true
  ResponseWithError:
    description: An error response from the API.
    properties:
      error:
        $ref: "#/definitions/Error"
        description: Error information.
    required:
      - error
    type: object
  VMInsightsOnboardingStatus:
    allOf:
      - $ref: "#/definitions/ProxyResource"
    description: VM Insights onboarding status for a resource.
    properties:
      properties:
        description: Resource properties.
        properties:
          data:
            description: Containers that currently store VM Insights data for the specified resource.
            items:
              $ref: "#/definitions/DataContainer"
            type: array
          dataStatus:
            description: The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed.
            enum:
              - present
              - notPresent
            type: string
            x-ms-enum:
              modelAsString: true
              name: DataStatus
          onboardingStatus:
            description: The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded.
            enum:
              - onboarded
              - notOnboarded
              - unknown
            type: string
            x-ms-enum:
              modelAsString: true
              name: OnboardingStatus
          resourceId:
            description: Azure Resource Manager identifier of the resource whose onboarding status is being represented.
            type: string
        required:
          - resourceId
          - onboardingStatus
          - dataStatus
        type: object
        x-ms-client-flatten: true
  WorkspaceInfo:
    description: Information about a Log Analytics Workspace.
    properties:
      id:
        description: Azure Resource Manager identifier of the Log Analytics Workspace.
        type: string
      location:
        description: Location of the Log Analytics workspace.
        type: string
      properties:
        description: Resource properties.
        properties:
          customerId:
            description: Log Analytics workspace identifier.
            type: string
        required:
          - customerId
        type: object
        x-ms-client-flatten: true
    required:
      - id
      - location
      - properties
    type: object
