swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  description: REST APIs for Azure Advisor
  title: AdvisorManagementClient
  version: 2016-07-12-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/advisor/resource-manager/Microsoft.Advisor/preview/2016-07-12-preview/advisor.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: advisor
  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 version of the API to be used with the client request.
    in: query
    name: api-version
    required: true
    type: string
  subscriptionIdParameter:
    description: The Azure subscription ID.
    in: path
    name: subscriptionId
    required: true
    type: string
paths:
  /providers/Microsoft.Advisor/operations:
    get:
      deprecated: false
      description: Lists all the available Advisor REST API operations.
      operationId: Operations_List
      parameters:
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/OperationEntityListResult"
      tags:
        - Operations
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations":
    post:
      deprecated: false
      description: Initiates the recommendation generation or computation process for a subscription. This operation is asynchronous. The generated recommendations are stored in a cache in the Advisor service.
      operationId: Recommendations_Generate
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "202":
          description: Accepted.
          headers:
            Location:
              description: The URL where the status of the asynchronous operation can be checked.
              type: string
            Retry-After:
              description: The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.
              type: string
      tags:
        - GenerateRecommendations
      x-ms-examples:
        GenerateRecommendations:
          parameters:
            api-version: 2016-07-12-preview
            subscriptionId: subscriptionId
          responses:
            "202":
              headers:
                Location: https://management.azure.com/subscriptions/subscriptionId/providers/Microsoft.Microsoft.Advisor/generateRecommendations/recGUID?api-version=2016-07-12-preview
                Retry-After: "60"
  "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}":
    get:
      deprecated: false
      description: Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response header.
      operationId: Recommendations_GetGenerateRecommendationsStatus
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - description: The operation ID, which can be found from the Location field in the generate recommendation response header.
          format: uuid
          in: path
          name: operationId
          required: true
          type: string
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "202":
          description: Recommendation generation is in progress.
        "204":
          description: Recommendation generation has been completed.
      tags:
        - GenerateRecommendations
      x-ms-examples:
        PollGenerateRecommendationsStatus:
          parameters:
            api-version: 2016-07-12-preview
            operationId: operationGUID
            subscriptionId: subscriptionId
          responses:
            "202": {}
            "204": {}
  "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations":
    get:
      deprecated: false
      description: Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations.
      operationId: Recommendations_List
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
        - description: The filter to apply to the recommendations.
          in: query
          name: $filter
          required: false
          type: string
        - description: The number of recommendations per page if a paged version of this API is being used.
          in: query
          name: $top
          required: false
          type: integer
        - description: The page-continuation token to use with a paged version of this API.
          in: query
          name: $skipToken
          required: false
          type: string
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/ResourceRecommendationBaseListResult"
      tags:
        - GetRecommendations
      x-ms-examples:
        ListRecommendations:
          parameters:
            $top: 10
            api-version: 2016-07-12-preview
            subscriptionId: subscriptionId
          responses:
            "200":
              body:
                nextLink: https://management.azure.com/subscriptions/subscriptionId/providers/Microsoft.Advisor/recommendations?api-version=2016-07-12-preview&$top=10&$skiptoken=skiptoken
                value:
                  - id: /resourceUri/providers/Microsoft.Advisor/recommendations/recGUID
                    name: recGUID
                    properties:
                      category: HighAvailability
                      impact: Medium
                      impactedField: Microsoft.Compute/availabilitySets
                      impactedValue: armavset
                      lastUpdated: 2017-02-24T22:24:43.3216408Z
                      risk: Warning
                      shortDescription:
                        problem: This availability set is not configured for fault tolerance
                        solution: To ensure high availability add one or more virtual machines to this availability set
                    type: Microsoft.Advisor/recommendations
      x-ms-pageable:
        nextLinkName: nextLink
  "/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions":
    get:
      deprecated: false
      description: Retrieves the list of snoozed or dismissed suppressions for a subscription. The snoozed or dismissed attribute of a recommendation is referred to as a suppression.
      operationId: Suppressions_List
      parameters:
        - $ref: "#/parameters/subscriptionIdParameter"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            items:
              $ref: "#/definitions/SuppressionContract"
            type: array
      tags:
        - Suppressions
      x-ms-examples:
        ListSuppressions:
          parameters:
            api-version: 2016-07-12-preview
            subscriptionId: subscriptionId1
          responses:
            "200":
              body:
                - id: /resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1
                  name: suppressionName1
                  suppressionId: suppressionId1
                  ttl: 7.00:00:00
                  type: Microsoft.Advisor/suppressions
                - id: /resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName2
                  name: suppressionName2
                  suppressionId: suppressionId2
                  ttl: 7.00:00:00
                  type: Microsoft.Advisor/suppressions
  "/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}":
    get:
      deprecated: false
      description: Obtains details of a cached recommendation.
      operationId: Recommendations_Get
      parameters:
        - description: The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.
          in: path
          name: resourceUri
          required: true
          type: string
        - description: The recommendation ID.
          in: path
          name: recommendationId
          required: true
          type: string
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK
          schema:
            $ref: "#/definitions/ResourceRecommendationBase"
      tags:
        - GetRecommendations
      x-ms-examples:
        GetRecommendationDetail:
          parameters:
            api-version: 2016-07-12-preview
            recommendationId: recommendationId
            resourceUri: resourceUri
          responses:
            "200":
              body:
                id: /resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId
                name: recommendationId
                properties:
                  category: HighAvailability
                  impact: Medium
                  impactedField: Microsoft.Compute/availabilitySets
                  impactedValue: armavset
                  lastUpdated: 2017-02-24T22:24:43.3216408Z
                  risk: Warning
                  shortDescription:
                    problem: This availability set is not configured for fault tolerance
                    solution: To ensure high availability add one or more virtual machines to this availability set
                type: Microsoft.Advisor/recommendations
  "/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}":
    delete:
      deprecated: false
      description: Enables the activation of a snoozed or dismissed recommendation. The snoozed or dismissed attribute of a recommendation is referred to as a suppression.
      operationId: Suppressions_Delete
      parameters:
        - description: The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.
          in: path
          name: resourceUri
          required: true
          type: string
        - description: The recommendation ID.
          in: path
          name: recommendationId
          required: true
          type: string
        - description: The name of the suppression.
          in: path
          name: name
          required: true
          type: string
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "204":
          description: The recommendation has been activated.
      tags:
        - Suppressions
      x-ms-examples:
        DeleteSuppression:
          parameters:
            api-version: 2016-07-12-preview
            name: suppressionName1
            recommendationId: recommendationId
            resourceUri: resourceUri
          responses:
            "204": {}
    get:
      deprecated: false
      description: Obtains the details of a suppression.
      operationId: Suppressions_Get
      parameters:
        - description: The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.
          in: path
          name: resourceUri
          required: true
          type: string
        - description: The recommendation ID.
          in: path
          name: recommendationId
          required: true
          type: string
        - description: The name of the suppression.
          in: path
          name: name
          required: true
          type: string
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/SuppressionContract"
      tags:
        - Suppressions
      x-ms-examples:
        GetSuppressionDetail:
          parameters:
            api-version: 2016-07-12-preview
            name: suppressionName1
            recommendationId: recommendationId
            resourceUri: resourceUri
          responses:
            "200":
              body:
                id: /resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1
                name: suppressionName1
                suppressionId: suppressionId1
                ttl: 7.00:00:00
                type: Microsoft.Advisor/suppressions
    put:
      deprecated: false
      description: Enables the snoozed or dismissed attribute of a recommendation. The snoozed or dismissed attribute is referred to as a suppression. Use this API to create or update the snoozed or dismissed status of a recommendation.
      operationId: Suppressions_Create
      parameters:
        - description: The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies.
          in: path
          name: resourceUri
          required: true
          type: string
        - description: The recommendation ID.
          in: path
          name: recommendationId
          required: true
          type: string
        - description: The name of the suppression.
          in: path
          name: name
          required: true
          type: string
        - description: The snoozed or dismissed attribute; for example, the snooze duration.
          in: body
          name: suppressionContract
          required: true
          schema:
            $ref: "#/definitions/SuppressionContract"
        - $ref: "#/parameters/apiVersionParameter"
      responses:
        "200":
          description: OK.
          schema:
            $ref: "#/definitions/SuppressionContract"
      tags:
        - Suppressions
      x-ms-examples:
        CreateSuppression:
          parameters:
            api-version: 2016-07-12-preview
            name: suppressionName1
            recommendationId: recommendationId
            resourceUri: resourceUri
            suppressionContract:
              id: /resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1
              name: suppressionName1
              ttl: 07:00:00:00
              type: Microsoft.Advisor/suppressions
          responses:
            "200":
              body:
                id: /resourceUri/providers/Microsoft.Advisor/recommendations/recommendationId/suppressions/suppressionName1
                name: suppressionName1
                suppressionId: suppresionId
                ttl: 07:00:00:00
                type: Microsoft.Advisor/suppressions
definitions:
  OperationDisplayInfo:
    description: The operation supported by Advisor.
    properties:
      description:
        description: The description of the operation.
        type: string
      operation:
        description: The action that users can perform, based on their permission level.
        type: string
      provider:
        description: "Service provider: Microsoft Advisor."
        type: string
      resource:
        description: Resource on which the operation is performed.
        type: string
    type: object
  OperationEntity:
    description: The operation supported by Advisor.
    properties:
      display:
        $ref: "#/definitions/OperationDisplayInfo"
        description: The operation supported by Advisor.
      name:
        description: "Operation name: {provider}/{resource}/{operation}."
        type: string
    type: object
  OperationEntityListResult:
    description: The list of Advisor operations.
    properties:
      nextLink:
        description: The link used to get the next page of operations.
        type: string
      value:
        description: The list of operations.
        items:
          $ref: "#/definitions/OperationEntity"
        type: array
    type: object
  RecommendationProperties:
    description: The properties of the recommendation.
    properties:
      category:
        description: The category of the recommendation.
        enum:
          - HighAvailability
          - Security
          - Performance
          - Cost
        type: string
        x-ms-enum:
          modelAsString: true
          name: category
      impact:
        description: The business impact of the recommendation.
        enum:
          - High
          - Medium
          - Low
        type: string
        x-ms-enum:
          modelAsString: true
          name: impact
      impactedField:
        description: The resource type identified by Advisor.
        type: string
      impactedValue:
        description: The resource identified by Advisor.
        type: string
      lastUpdated:
        description: The most recent time that Advisor checked the validity of the recommendation.
        format: date-time
        type: string
      metadata:
        additionalProperties:
          type: object
        description: The recommendation metadata.
        type: object
      recommendationTypeId:
        description: The recommendation-type GUID.
        type: string
      risk:
        description: The potential risk of not implementing the recommendation.
        enum:
          - Error
          - Warning
          - None
        type: string
        x-ms-enum:
          modelAsString: true
          name: risk
      shortDescription:
        $ref: "#/definitions/ShortDescription"
        description: A summary of the recommendation.
    type: object
  Resource:
    description: An Azure resource.
    properties:
      id:
        description: The resource ID.
        readOnly: true
        type: string
      location:
        description: The location of the resource. This cannot be changed after the resource is created.
        type: string
      name:
        description: The name of the resource.
        readOnly: true
        type: string
      tags:
        additionalProperties:
          type: string
        description: The tags of the resource.
        type: object
      type:
        description: The type of the resource.
        readOnly: true
        type: string
    x-ms-azure-resource: true
  ResourceRecommendationBase:
    description: Advisor Recommendation.
    properties:
      id:
        description: The fully qualified recommendation ID, for example /subscriptions/subscriptionId/resourceGroups/resourceGroup1/providers/Microsoft.ClassicCompute/virtualMachines/vm1/providers/Microsoft.Advisor/recommendations/recommendationGUID.
        type: string
      name:
        description: The name of recommendation.
        type: string
      properties:
        $ref: "#/definitions/RecommendationProperties"
        description: The properties of the recommendation.
        x-ms-client-flatten: true
      suppressionIds:
        description: The list of snoozed and dismissed rules for the recommendation.
        items:
          format: uuid
          type: string
        type: array
      type:
        description: "The recommendation type: Microsoft.Advisor/recommendations."
        type: string
    type: object
  ResourceRecommendationBaseListResult:
    description: The list of Advisor recommendations.
    properties:
      nextLink:
        description: The link used to get the next page of recommendations.
        type: string
      value:
        description: The list of recommendations.
        items:
          $ref: "#/definitions/ResourceRecommendationBase"
        type: array
    type: object
  ShortDescription:
    description: A summary of the recommendation.
    properties:
      problem:
        description: The issue or opportunity identified by the recommendation.
        type: string
      solution:
        description: The remediation action suggested by the recommendation.
        type: string
    type: object
  SuppressionContract:
    allOf:
      - $ref: "#/definitions/Resource"
    description: The details of the snoozed or dismissed rule; for example, the duration, name, and GUID associated with the rule.
    properties:
      suppressionId:
        description: The GUID of the suppression.
        type: string
      ttl:
        description: The duration for which the suppression is valid.
        type: string
    type: object
