swagger: "2.0"
schemes:
  - https
host: management.azure.com
info:
  title: MonitorClient
  version: 2016-03-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/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/metricDefinitions_API.json
      version: "2.0"
  x-preferred: false
  x-providerName: azure.com
  x-serviceName: monitor-metricDefinitions_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: Client Api Version.
    in: query
    name: api-version
    required: true
    type: string
  ResourceUriParameter:
    description: The identifier of the resource.
    in: path
    name: resourceUri
    required: true
    type: string
    x-ms-parameter-location: method
    x-ms-skip-url-encoding: true
paths:
  "/{resourceUri}/providers/microsoft.insights/metricDefinitions":
    get:
      description: Lists the metric definitions for the resource.
      operationId: MetricDefinitions_List
      parameters:
        - $ref: "#/parameters/ResourceUriParameter"
        - $ref: "#/parameters/ApiVersionParameter"
        - description: "Reduces the set of data collected by retrieving particular metric definitions from all the definitions available for the resource.<br>For example, to get just the definition for the 'CPU percentage' counter: $filter=name.value eq '\\Processor(_Total)\\% Processor Time'.<br>Multiple metrics can be retrieved by joining together *'name eq <value>'* clauses separated by *or* logical operators.<br>**NOTE**: No other syntax is allowed."
          in: query
          name: $filter
          required: false
          type: string
      responses:
        "200":
          description: Successful request to get the list of metric definitions
          examples:
            application/json:
              value:
                - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsStarted
                  metricAvailabilities:
                    - retention: P30D
                      timeGrain: PT1M
                    - retention: P30D
                      timeGrain: PT1H
                  name:
                    localizedValue: Runs Started
                    value: RunsStarted
                  primaryAggregationType: Total
                  resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                  unit: Count
                - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsCompleted
                  metricAvailabilities:
                    - retention: P30D
                      timeGrain: PT1M
                    - retention: P30D
                      timeGrain: PT1H
                  name:
                    localizedValue: Runs Completed
                    value: RunsCompleted
                  primaryAggregationType: Total
                  resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                  unit: Count
                - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsSucceeded
                  metricAvailabilities:
                    - retention: P30D
                      timeGrain: PT1M
                    - retention: P30D
                      timeGrain: PT1H
                  name:
                    localizedValue: Runs Succeeded
                    value: RunsSucceeded
                  primaryAggregationType: Total
                  resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                  unit: Count
          schema:
            $ref: "#/definitions/MetricDefinitionCollection"
        default:
          description: Error response describing why the operation failed.
          schema:
            $ref: "#/definitions/ErrorResponse"
      tags:
        - MetricDefinitions
      x-ms-examples:
        Get Metric Definitions with filter:
          parameters:
            $filter: name.value eq 'RunsStarted' or name.value eq 'RunsSucceeded'
            api-version: 2016-03-01
            resourceUri: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
            subscriptionId: df602c9c-7aa0-407d-a6fb-eb20c8bd1192
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsStarted
                    metricAvailabilities:
                      - retention: P30D
                        timeGrain: PT1M
                      - retention: P30D
                        timeGrain: PT1H
                    name:
                      localizedValue: Runs Started
                      value: RunsStarted
                    primaryAggregationType: Total
                    resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                    unit: Count
                  - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsSucceeded
                    metricAvailabilities:
                      - retention: P30D
                        timeGrain: PT1M
                      - retention: P30D
                        timeGrain: PT1H
                    name:
                      localizedValue: Runs Succeeded
                      value: RunsSucceeded
                    primaryAggregationType: Total
                    resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                    unit: Count
        Get Metric Definitions without filter:
          parameters:
            api-version: 2016-03-01
            resourceUri: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
            subscriptionId: df602c9c-7aa0-407d-a6fb-eb20c8bd1192
          responses:
            "200":
              body:
                value:
                  - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsStarted
                    metricAvailabilities:
                      - retention: P30D
                        timeGrain: PT1M
                      - retention: P30D
                        timeGrain: PT1H
                    name:
                      localizedValue: Runs Started
                      value: RunsStarted
                    primaryAggregationType: Total
                    resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                    unit: Count
                  - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsCompleted
                    metricAvailabilities:
                      - retention: P30D
                        timeGrain: PT1M
                      - retention: P30D
                        timeGrain: PT1H
                    name:
                      localizedValue: Runs Completed
                      value: RunsCompleted
                    primaryAggregationType: Total
                    resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                    unit: Count
                  - id: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia/providers/microsoft.insights/metricdefinitions/RunsSucceeded
                    metricAvailabilities:
                      - retention: P30D
                        timeGrain: PT1M
                      - retention: P30D
                        timeGrain: PT1H
                    name:
                      localizedValue: Runs Succeeded
                      value: RunsSucceeded
                    primaryAggregationType: Total
                    resourceId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/andy0802australia/providers/Microsoft.Logic/workflows/andy0803australia
                    unit: Count
      x-ms-odata: "#/definitions/MetricDefinition"
      x-ms-pageable:
        nextLinkName: null
definitions:
  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
  MetricAvailability:
    description: Metric availability specifies the time grain (aggregation interval or frequency) and the retention period for that time grain.
    properties:
      retention:
        description: the retention period for the metric at the specified timegrain.  Expressed as a duration 'PT1M', 'P1D', etc.
        format: duration
        type: string
      timeGrain:
        description: the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
        format: duration
        type: string
  MetricDefinition:
    description: Metric definition class specifies the metadata for a metric.
    properties:
      id:
        description: the resource identifier of the metric definition.
        type: string
      metricAvailabilities:
        description: the collection of what aggregation intervals are available to be queried.
        items:
          $ref: "#/definitions/MetricAvailability"
        type: array
      name:
        $ref: "#/definitions/LocalizableString"
        description: the name and the display name of the metric, i.e. it is a localizable string.
      primaryAggregationType:
        description: the primary aggregation type value defining how to use the values for display.
        enum:
          - None
          - Average
          - Count
          - Minimum
          - Maximum
          - Total
        type: string
        x-ms-enum:
          modelAsString: false
          name: AggregationType
      resourceId:
        description: the resource identifier of the resource that emitted the metric.
        type: string
      unit:
        $ref: "#/definitions/Unit"
        description: the unit of the metric.
  MetricDefinitionCollection:
    description: Represents collection of metric definitions.
    properties:
      value:
        description: the values for the metric definitions.
        items:
          $ref: "#/definitions/MetricDefinition"
        type: array
    required:
      - value
  Unit:
    description: the unit of the metric.
    enum:
      - Count
      - Bytes
      - Seconds
      - CountPerSecond
      - BytesPerSecond
      - Percent
      - MilliSeconds
    type: string
    x-ms-enum:
      modelAsString: false
      name: Unit
