{
  "swagger": "2.0",
  "schemes": [
    "https"
  ],
  "host": "management.azure.com",
  "info": {
    "title": "MonitorManagementClient",
    "version": "2017-11-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-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/2017-11-01-preview/baseline_API.json",
        "version": "2.0"
      }
    ],
    "x-preferred": false,
    "x-providerName": "azure.com",
    "x-serviceName": "monitor-baseline_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": {
    "AggregationParameter": {
      "description": "The aggregation type of the metric to retrieve the baseline for.",
      "in": "query",
      "name": "aggregation",
      "required": false,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "ApiVersionParameter": {
      "description": "Client Api Version.",
      "in": "query",
      "name": "api-version",
      "required": true,
      "type": "string"
    },
    "BaselineResultTypeParameter": {
      "description": "Allows retrieving only metadata of the baseline. On data request all information is retrieved.",
      "enum": [
        "Data",
        "Metadata"
      ],
      "in": "query",
      "name": "resultType",
      "required": false,
      "type": "string",
      "x-ms-enum": {
        "modelAsString": false,
        "name": "ResultType"
      },
      "x-ms-parameter-location": "method"
    },
    "ExtendedResourceUriParameter": {
      "description": "The identifier of the resource. It has the following structure: subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. For example: subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1",
      "in": "path",
      "name": "resourceUri",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method",
      "x-ms-skip-url-encoding": true
    },
    "IntervalParameter": {
      "description": "The interval (i.e. timegrain) of the query.",
      "format": "duration",
      "in": "query",
      "name": "interval",
      "required": false,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "MetricNameParameter": {
      "description": "The name of the metric to retrieve the baseline for.",
      "in": "path",
      "name": "metricName",
      "required": true,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "SensitivitiesParameter": {
      "description": "The list of sensitivities (comma separated) to retrieve.",
      "in": "query",
      "name": "sensitivities",
      "required": false,
      "type": "string",
      "x-ms-parameter-location": "method"
    },
    "TimespanParameter": {
      "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.",
      "in": "query",
      "name": "timespan",
      "required": false,
      "type": "string",
      "x-ms-parameter-location": "method"
    }
  },
  "paths": {
    "/{resourceUri}/providers/microsoft.insights/baseline/{metricName}": {
      "get": {
        "description": "**Gets the baseline values for a specific metric**.",
        "operationId": "MetricBaseline_Get",
        "parameters": [
          {
            "$ref": "#/parameters/ExtendedResourceUriParameter"
          },
          {
            "$ref": "#/parameters/MetricNameParameter"
          },
          {
            "$ref": "#/parameters/TimespanParameter"
          },
          {
            "$ref": "#/parameters/IntervalParameter"
          },
          {
            "$ref": "#/parameters/AggregationParameter"
          },
          {
            "$ref": "#/parameters/SensitivitiesParameter"
          },
          {
            "$ref": "#/parameters/BaselineResultTypeParameter"
          },
          {
            "$ref": "#/parameters/ApiVersionParameter"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful request to get the list of metric values.",
            "schema": {
              "$ref": "#/definitions/BaselineResponse"
            }
          },
          "default": {
            "description": "Error response describing why the operation failed.",
            "schema": {
              "$ref": "#/definitions/ErrorResponse"
            }
          }
        },
        "tags": [
          "Baseline"
        ],
        "x-ms-examples": {
          "Get Metric for data": {
            "parameters": {
              "aggregation": "Average",
              "api-version": "2017-11-01-preview",
              "interval": "PT1H",
              "metricName": "PercentageCpu",
              "resourceUri": "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1",
              "sensitivities": "Low,Medium",
              "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/baseline/PercentageCpu",
                  "name": {
                    "value": "PercentageCpu"
                  },
                  "properties": {
                    "aggregation": "Average",
                    "baseline": [
                      {
                        "highThresholds": [
                          90.3453,
                          91.3453
                        ],
                        "lowThresholds": [
                          30,
                          31.1
                        ],
                        "sensitivity": "Low"
                      },
                      {
                        "highThresholds": [
                          70.3453,
                          71.3453
                        ],
                        "lowThresholds": [
                          50,
                          51.1
                        ],
                        "sensitivity": "Medium"
                      }
                    ],
                    "interval": "PT1H",
                    "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z",
                    "timestamps": [
                      "2017-04-14T02:20:00Z",
                      "2017-04-14T03:20:00Z"
                    ]
                  },
                  "type": "Microsoft.Insights/baseline"
                }
              }
            }
          },
          "Get Metric for metadata": {
            "parameters": {
              "aggregation": "Average",
              "api-version": "2017-11-01-preview",
              "interval": "PT1H",
              "metricName": "PercentageCpu",
              "resourceUri": "subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1",
              "resulttype": "metadata",
              "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"
            },
            "responses": {
              "200": {
                "body": {
                  "id": "/subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Insights/baseline/PercentageCpu",
                  "name": {
                    "value": "PercentageCpu"
                  },
                  "properties": {
                    "aggregation": "Average",
                    "interval": "PT1H",
                    "metadata": [
                      {
                        "name": "CurrentTrainingState",
                        "value": "Trained"
                      },
                      {
                        "name": "SelectedModel",
                        "value": "AdjustedBoxplot"
                      }
                    ],
                    "timespan": "2017-04-14T02:20:00Z/2017-04-14T04:20:00Z"
                  },
                  "type": "Microsoft.Insights/baseline"
                }
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Baseline": {
      "description": "The baseline values for a single sensitivity value.",
      "properties": {
        "highThresholds": {
          "description": "The high thresholds of the baseline.",
          "items": {
            "description": "A single high threshold value.",
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "lowThresholds": {
          "description": "The low thresholds of the baseline.",
          "items": {
            "description": "A single low threshold value.",
            "format": "double",
            "type": "number"
          },
          "type": "array"
        },
        "sensitivity": {
          "description": "the sensitivity of the baseline.",
          "enum": [
            "Low",
            "Medium",
            "High"
          ],
          "type": "string",
          "x-ms-enum": {
            "modelAsString": false,
            "name": "Sensitivity"
          }
        }
      },
      "required": [
        "sensitivity",
        "lowThresholds",
        "highThresholds"
      ],
      "type": "object"
    },
    "BaselineMetadataValue": {
      "description": "Represents a baseline metadata value.",
      "properties": {
        "name": {
          "$ref": "#/definitions/LocalizableString",
          "description": "the name of the metadata."
        },
        "value": {
          "description": "the value of the metadata.",
          "type": "string"
        }
      }
    },
    "BaselineProperties": {
      "description": "The baseline properties class.",
      "properties": {
        "aggregation": {
          "description": "The aggregation type of the metric.",
          "type": "string"
        },
        "baseline": {
          "description": "the baseline values for each sensitivity.",
          "items": {
            "$ref": "#/definitions/Baseline"
          },
          "type": "array"
        },
        "interval": {
          "description": "The interval (window size) for which the metric data was returned in.  This may be adjusted in the future and returned back from what was originally requested.  This is not present if a metadata request was made.",
          "format": "duration",
          "type": "string"
        },
        "metadata": {
          "description": "the baseline metadata values.",
          "items": {
            "$ref": "#/definitions/BaselineMetadataValue"
          },
          "type": "array"
        },
        "timespan": {
          "description": "The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'.  This may be adjusted in the future and returned back from what was originally requested.",
          "type": "string"
        },
        "timestamps": {
          "description": "the array of timestamps of the baselines.",
          "items": {
            "description": "the timestamp for the baseline value in ISO 8601 format.",
            "format": "date-time",
            "type": "string"
          },
          "type": "array"
        }
      }
    },
    "BaselineResponse": {
      "description": "The response to a baseline query.",
      "properties": {
        "id": {
          "description": "the metric baseline Id.",
          "readOnly": true,
          "type": "string"
        },
        "name": {
          "$ref": "#/definitions/LocalizableString",
          "description": "the name and the display name of the metric, i.e. it is localizable string.",
          "readOnly": true
        },
        "properties": {
          "$ref": "#/definitions/BaselineProperties",
          "description": "the properties of the baseline.",
          "x-ms-client-flatten": true
        },
        "type": {
          "description": "the resource type of the baseline resource.",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "ErrorResponse": {
      "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"
    },
    "LocalizableString": {
      "description": "The localizable string class.",
      "properties": {
        "localizedValue": {
          "description": "the locale specific value.",
          "type": "string"
        },
        "value": {
          "description": "the invariant value.",
          "type": "string"
        }
      },
      "required": [
        "value"
      ]
    }
  }
}