swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: The HDInsight Management Client.
  title: HDInsightManagementClient
  version: 2018-06-01-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-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2018-06-01-preview/extensions.json
      version: "2.0"
  x-preferred: true
  x-providerName: azure.com
  x-serviceName: hdinsight-extensions
  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 HDInsight client API Version.
    in: query
    name: api-version
    required: true
    type: string
  ClusterNameParameter:
    description: The name of the cluster.
    in: path
    name: clusterName
    required: true
    type: string
    x-ms-parameter-location: method
  ExtensionNameParameter:
    description: The name of the cluster extension.
    in: path
    name: extensionName
    required: true
    type: string
    x-ms-parameter-location: method
  ResourceGroupNameParameter:
    description: The name of the resource group.
    in: path
    name: resourceGroupName
    required: true
    type: string
    x-ms-parameter-location: method
  SubscriptionIdParameter:
    description: The subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/clustermonitoring":
    delete:
      description: Disables the Operations Management Suite (OMS) on the HDInsight cluster.
      operationId: Extensions_DisableMonitoring
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ClusterNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Ok response definition.
        "202":
          description: OK response definition.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Describes the format of Error response.
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Extensions
      x-ms-examples:
        Enable cluster monitoring:
          parameters:
            api-version: 2018-06-01-preview
            clusterName: cluster1
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200": {}
            "202": {}
      x-ms-long-running-operation: true
    get:
      description: Gets the status of Operations Management Suite (OMS) on the HDInsight cluster.
      operationId: Extensions_GetMonitoringStatus
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ClusterNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK. The request has succeeded.
          schema:
            $ref: "#/definitions/ClusterMonitoringResponse"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Describes the format of Error response.
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Extensions
      x-ms-examples:
        Enable cluster monitoring:
          parameters:
            api-version: 2018-06-01-preview
            clusterName: cluster1
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                clusterMonitoringEnabled: true
                workspaceId: id
    put:
      description: Enables the Operations Management Suite (OMS) on the HDInsight cluster.
      operationId: Extensions_EnableMonitoring
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ClusterNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The Operations Management Suite (OMS) workspace parameters.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/ClusterMonitoringRequest"
      responses:
        "200":
          description: Ok response definition.
        "202":
          description: Accepted response definition.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Describes the format of Error response.
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Extensions
      x-ms-examples:
        Enable cluster monitoring:
          parameters:
            api-version: 2018-06-01-preview
            clusterName: cluster1
            parameters:
              primaryKey: "**********"
              workspaceId: a2090ead-8c9f-4fba-b70e-533e3e003163
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200": {}
            "202": {}
      x-ms-long-running-operation: true
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HDInsight/clusters/{clusterName}/extensions/{extensionName}":
    delete:
      description: Deletes the specified extension for HDInsight cluster.
      operationId: Extensions_Delete
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ClusterNameParameter"
        - $ref: "#/parameters/ExtensionNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: Ok response definition.
        "202":
          description: Accepted response definition.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Describes the format of Error response.
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Extensions
      x-ms-examples:
        Delete an extension:
          parameters:
            api-version: 2018-06-01-preview
            clusterName: cluster1
            extensionName: clustermonitoring
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200": {}
            "202": {}
      x-ms-long-running-operation: true
    get:
      description: Gets the extension properties for the specified HDInsight cluster extension.
      operationId: Extensions_Get
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ClusterNameParameter"
        - $ref: "#/parameters/ExtensionNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
      responses:
        "200":
          description: OK. The request has succeeded.
          schema:
            $ref: "#/definitions/Extension"
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Describes the format of Error response.
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Extensions
      x-ms-examples:
        Get an extension:
          parameters:
            api-version: 2018-06-01-preview
            clusterName: cluster1
            extensionName: clustermonitoring
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200":
              body:
                primaryKey: key
                workspaceId: id
    put:
      description: Creates an HDInsight cluster extension.
      operationId: Extensions_Create
      parameters:
        - $ref: "#/parameters/SubscriptionIdParameter"
        - $ref: "#/parameters/ResourceGroupNameParameter"
        - $ref: "#/parameters/ClusterNameParameter"
        - $ref: "#/parameters/ExtensionNameParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - description: The cluster extensions create request.
          in: body
          name: parameters
          required: true
          schema:
            $ref: "#/definitions/Extension"
      responses:
        "200":
          description: Ok response definition.
        "202":
          description: Accepted response definition.
        default:
          description: Error response describing why the operation failed.
          schema:
            description: Describes the format of Error response.
            properties:
              code:
                description: Error code
                type: string
              message:
                description: Error message indicating why the operation failed.
                type: string
            type: object
      tags:
        - Extensions
      x-ms-examples:
        Create a monitoring extension on Hadoop Linux cluster:
          parameters:
            api-version: 2018-06-01-preview
            clusterName: cluster1
            extensionName: clustermonitoring
            parameters:
              primaryKey: "**********"
              workspaceId: a2090ead-8c9f-4fba-b70e-533e3e003163
            resourceGroupName: rg1
            subscriptionId: subid
          responses:
            "200": {}
            "202": {}
      x-ms-long-running-operation: true
definitions:
  ClusterMonitoringRequest:
    description: The Operations Management Suite (OMS) parameters.
    properties:
      primaryKey:
        description: The Operations Management Suite (OMS) workspace key.
        type: string
      workspaceId:
        description: The Operations Management Suite (OMS) workspace ID.
        type: string
  ClusterMonitoringResponse:
    description: The Operations Management Suite (OMS) status response
    properties:
      clusterMonitoringEnabled:
        description: The status of the Operations Management Suite (OMS) on the HDInsight cluster.
        type: boolean
      workspaceId:
        description: The workspace ID of the Operations Management Suite (OMS) on the HDInsight cluster.
        type: string
  Extension:
    description: Cluster monitoring extensions
    properties:
      primaryKey:
        description: The certificate for the cluster monitoring extensions.
        type: string
      workspaceId:
        description: The workspace ID for the cluster monitoring extension.
        type: string
