Microsoft Azure Carbon

Microsoft Azure Carbon is a cloud computing service that focuses on helping businesses reduce their carbon footprint. By utilizing renewable energy sources and energy-efficient data centers, Azure Carbon provides an environmentally friendly solution for companies looking to transition to a more sustainable IT infrastructure.

OpenAPI Specification

carbon-openapi-original.yml Raw ↑
swagger: '2.0'
info:
  title: Microsoft Azure Carbon
  version: 2024-02-01-preview
  description: Carbon Report Resource Provider query API.
  x-typespec-generated:
    - emitter: '@azure-tools/typespec-autorest'
schemes:
  - https
host: management.azure.com
produces:
  - application/json
consumes:
  - application/json
security:
  - azure_auth:
      - user_impersonation
securityDefinitions:
  azure_auth:
    type: oauth2
    description: Azure Active Directory OAuth2 Flow.
    flow: implicit
    authorizationUrl: https://login.microsoftonline.com/common/oauth2/authorize
    scopes:
      user_impersonation: impersonate your user account
tags:
  - name: Operations
  - name: Providers
paths:
  /providers/Microsoft.Carbon/carbonEmissionReports:
    post:
      operationId: microsoftAzureCarbonserviceListcarbonemissionreports
      description: API for Carbon Emissions Reports
      parameters:
        - $ref: >-
            ../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter
        - name: queryParameters
          in: body
          description: Query parameters
          required: true
          schema:
            $ref: '#/definitions/QueryFilter'
      responses:
        '200':
          description: The request has succeeded.
          schema:
            $ref: '#/definitions/CarbonEmissionDataListResult'
        default:
          description: An unexpected error response.
          schema:
            $ref: >-
              ../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse
      x-ms-examples:
        CarbonService_ListCarbonEmissionReports:
          $ref: ./examples/carbonEmissionsReport.json
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Microsoft Azure Post Providers Microsoft Carbon Carbonemissionreports
      tags:
        - Providers
  /providers/Microsoft.Carbon/operations:
    get:
      operationId: microsoftAzureOperationsList
      tags:
        - Operations
      description: List the operations for the provider
      parameters:
        - $ref: >-
            ../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter
      responses:
        '200':
          description: Azure operation completed successfully.
          schema:
            $ref: >-
              ../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult
        default:
          description: An unexpected error response.
          schema:
            $ref: >-
              ../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse
      x-ms-examples:
        Operations_List:
          $ref: ./examples/listOperations.json
      x-ms-pageable:
        nextLinkName: nextLink
      summary: Microsoft Azure Get Providers Microsoft Carbon Operations
  /providers/Microsoft.Carbon/queryCarbonEmissionDataAvailableDateRange:
    post:
      operationId: microsoftAzureCarbonserviceQuerycarbonemissiondataavailabledaterange
      description: API for query carbon emission data available date range
      parameters:
        - $ref: >-
            ../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter
      responses:
        '200':
          description: Azure operation completed successfully.
          schema:
            $ref: '#/definitions/CarbonEmissionDataAvailableDateRange'
        default:
          description: An unexpected error response.
          schema:
            $ref: >-
              ../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse
      x-ms-examples:
        CarbonService_QueryCarbonEmissionDataAvailableDateRange:
          $ref: ./examples/carbonEmissionsDataAvailableDateRange.json
      summary: >-
        Microsoft Azure Post Providers Microsoft Carbon Querycarbonemissiondataavailabledaterange
      tags:
        - Providers
definitions:
  AccessDecisionEnum:
    type: string
    description: Enum for Access Decision
    enum:
      - Allowed
      - Denied
    x-ms-enum:
      name: AccessDecisionEnum
      modelAsString: true
      values:
        - name: Allowed
          value: Allowed
          description: Access allowed
        - name: Denied
          value: Denied
          description: Access denied
  CarbonEmissionData:
    type: object
    description: Response for given query parameters
    properties:
      dataType:
        type: string
        description: Query result data type name
      totalCarbonEmission:
        type: number
        format: double
        description: Total carbon emissions for given query parameters
      totalCarbonEmissionLastMonth:
        type: number
        format: double
        description: Total carbon emission for last month for given query parameters
      changeRatioForLastMonth:
        type: number
        format: double
        description: >-
          Change ratio between totalCarbonEmission and
          totalCarbonEmissionLastMonth
      totalCarbonEmission12MonthsAgo:
        type: number
        format: double
        description: Total carbon emissions for 12 months ago for given query parameters
      changeRatioFor12Months:
        type: number
        format: double
        description: >-
          Change ratio between totalCarbonEmission and
          totalCarbonEmission12MonthsAgo
      changeValueMonthOverMonth:
        type: number
        format: double
        description: >-
          Change Value between totalCarbonEmission and
          totalCarbonEmissionLastMonth
    discriminator: dataType
    required:
      - dataType
      - totalCarbonEmission
      - totalCarbonEmissionLastMonth
      - changeRatioForLastMonth
      - totalCarbonEmission12MonthsAgo
      - changeRatioFor12Months
  CarbonEmissionDataAvailableDateRange:
    type: object
    description: Response for available date range of carbon emission data
    properties:
      startDate:
        type: string
        description: Start date parameter, format is yyyy-MM-dd
      endDate:
        type: string
        description: End date parameter, format is yyyy-MM-dd
    required:
      - startDate
      - endDate
  CarbonEmissionDataListResult:
    type: object
    description: List of carbon emission results
    properties:
      value:
        type: array
        description: The CarbonEmissionData items on this page
        items:
          $ref: '#/definitions/CarbonEmissionData'
        x-ms-identifiers: []
      skipToken:
        type: string
        description: The number of result items to skip for next page
      nextLink:
        type: string
        description: The link to the next page of items
      subscriptionAccessDecisionList:
        type: array
        description: 'The access decision list for each input subscription '
        items:
          $ref: '#/definitions/SubscriptionAccessDecision'
        x-ms-identifiers: []
    required:
      - value
  CarbonEmissionItemDetailData:
    type: object
    description: Response for detailed carbon emissions
    properties:
      itemName:
        type: string
        description: Item name
      groupName:
        type: string
        description: Item group name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
    required:
      - itemName
      - groupName
      - categoryType
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ItemDetailsData
  CarbonEmissionMonthlySummaryData:
    type: object
    description: Response for Monthly Carbon Emissions Summary
    properties:
      date:
        type: string
        description: Monthly date string
      carbonIntensity:
        type: number
        format: double
        description: Carbon Intensity
    required:
      - date
      - carbonIntensity
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: MonthlySummaryData
  CarbonEmissionOverallSummaryData:
    type: object
    description: Response for Overall Carbon Emissions Summary
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: OverallSummaryData
  CarbonEmissionTopItemMonthlySummaryData:
    type: object
    description: Response for Top Items Carbon Emissions by Month
    properties:
      itemName:
        type: string
        description: Item name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      date:
        type: string
        description: Month date
    required:
      - itemName
      - categoryType
      - date
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: TopItemsMonthlySummaryData
  CarbonEmissionTopItemsSummaryData:
    type: object
    description: Response for Top Items by Category Type
    properties:
      itemName:
        type: string
        description: Item name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
    required:
      - itemName
      - categoryType
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: TopItemsSummaryData
  CategoryTypeEnum:
    type: string
    description: Supported category types to be used with QueryParameter
    enum:
      - Subscription
      - ResourceGroup
      - Location
      - ServiceType
      - Resource
      - ResourceType
    x-ms-enum:
      name: CategoryTypeEnum
      modelAsString: true
      values:
        - name: Subscription
          value: Subscription
          description: Subscription level aggregation granularity
        - name: ResourceGroup
          value: ResourceGroup
          description: ResourceGroup level aggregation granularity
        - name: Location
          value: Location
          description: Location level aggregation granularity
        - name: ServiceType
          value: ServiceType
          description: ServiceType level aggregation granularity
        - name: Resource
          value: Resource
          description: Resource level aggregation granularity
        - name: ResourceType
          value: ResourceType
          description: ResourceType level aggregation granularity
  DateRange:
    type: object
    description: Date range to be used with QueryParameter
    properties:
      start:
        type: string
        format: date
        description: Start date parameter, format is yyyy-MM-dd
      end:
        type: string
        format: date
        description: End date parameter, format is yyyy-MM-dd
    required:
      - start
      - end
  EmissionScopeEnum:
    type: string
    description: Supported emission scopes to be used with QueryParameter
    enum:
      - Scope1
      - Scope2
      - Scope3
    x-ms-enum:
      name: EmissionScopeEnum
      modelAsString: true
      values:
        - name: Scope1
          value: Scope1
          description: Scope1 carbon emission
        - name: Scope2
          value: Scope2
          description: Scope2 carbon emission
        - name: Scope3
          value: Scope3
          description: Scope3 carbon emission
  ItemDetailsQueryFilter:
    type: object
    description: Query Parameters for Detailed carbon emissions by pageSize
    properties:
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item Category type
      orderBy:
        type: string
        description: Order by column name
      sortDirection:
        type: string
        description: Direction for sorting
      groupCategory:
        type: string
        description: Group category name
      pageSize:
        type: integer
        format: int32
        description: Number of items to return
      skipToken:
        type: string
        description: The number of result items to skip
    required:
      - categoryType
      - orderBy
      - sortDirection
      - groupCategory
      - pageSize
    allOf:
      - $ref: '#/definitions/QueryFilter'
    x-ms-discriminator-value: ItemDetailsReport
  MonthlySummaryReportQueryFilter:
    type: object
    description: Query Parameters for Monthly Carbon Emissions Summary
    allOf:
      - $ref: '#/definitions/QueryFilter'
    x-ms-discriminator-value: MonthlySummaryReport
  OverallSummaryReportQueryFilter:
    type: object
    description: Query Parameters for Overall Carbon Emissions Summary
    allOf:
      - $ref: '#/definitions/QueryFilter'
    x-ms-discriminator-value: OverallSummaryReport
  QueryFilter:
    type: object
    description: Query filter parameter specified by users
    properties:
      reportType:
        type: string
        description: Report type
      dateRange:
        $ref: '#/definitions/DateRange'
        description: The start date and end date for carbon emissions data
      subscriptionList:
        type: array
        description: SubscriptionId list for carbon emissions data
        items:
          type: string
        x-ms-identifiers: []
      resourceGroupUrlList:
        type: array
        description: resourceGroupUrl list for carbon emissions data
        items:
          type: string
        x-ms-identifiers: []
      resourceTypeList:
        type: array
        description: resource type list for carbon emissions data
        items:
          type: string
        x-ms-identifiers: []
      locationList:
        type: array
        description: Location list for carbon emissions data
        items:
          type: string
        x-ms-identifiers: []
      carbonScopeList:
        type: array
        description: Carbon emission scope for carbon emissions data
        items:
          $ref: '#/definitions/EmissionScopeEnum'
        x-ms-identifiers: []
    discriminator: reportType
    required:
      - reportType
      - dateRange
      - subscriptionList
      - carbonScopeList
  ResourceCarbonEmissionItemDetailData:
    type: object
    description: Response for Resource detailed carbon emissions
    properties:
      itemName:
        type: string
        description: Item name
      groupName:
        type: string
        description: Item group name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      subscriptionId:
        type: string
        description: Subscription Id
      resourceGroup:
        type: string
        description: Resource Group
      resourceId:
        type: string
        description: Resource Id Url
      location:
        type: string
        description: Resource Location
      resourceType:
        type: string
        description: Resource Type
      resourceTypeFriendlyName:
        type: string
        description: Friendly name of Resource Type
      resourceProvider:
        type: string
        description: Resource Provider
    required:
      - itemName
      - groupName
      - categoryType
      - subscriptionId
      - resourceGroup
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceItemDetailsData
  ResourceCarbonEmissionTopItemMonthlySummaryData:
    type: object
    description: Response for Top Items Carbon Emissions by Month for ResourceType
    properties:
      itemName:
        type: string
        description: Item name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      date:
        type: string
        description: Month date
      subscriptionId:
        type: string
        description: Subscription Id
      resourceGroup:
        type: string
        description: Resource Group
    required:
      - itemName
      - categoryType
      - date
      - subscriptionId
      - resourceGroup
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceTopItemsMonthlySummaryData
  ResourceCarbonEmissionTopItemsSummaryData:
    type: object
    description: Response for Top Items For Resource
    properties:
      itemName:
        type: string
        description: Item name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      subscriptionId:
        type: string
        description: Subscription Id
      resourceGroup:
        type: string
        description: Resource Group
    required:
      - itemName
      - categoryType
      - subscriptionId
      - resourceGroup
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceTopItemsSummaryData
  ResourceGroupCarbonEmissionItemDetailData:
    type: object
    description: Response for Resource Group detailed carbon emissions
    properties:
      itemName:
        type: string
        description: Item name
      groupName:
        type: string
        description: Item group name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      subscriptionId:
        type: string
        description: Subscription Id
    required:
      - itemName
      - groupName
      - categoryType
      - subscriptionId
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceGroupItemDetailsData
  ResourceGroupCarbonEmissionTopItemMonthlySummaryData:
    type: object
    description: Response for Top Items Carbon Emissions by Month for ResourceGroupType
    properties:
      itemName:
        type: string
        description: Item name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      date:
        type: string
        description: Month date
      subscriptionId:
        type: string
        description: Subscription Id
    required:
      - itemName
      - categoryType
      - date
      - subscriptionId
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceGroupTopItemsMonthlySummaryData
  ResourceGroupCarbonEmissionTopItemsSummaryData:
    type: object
    description: Response for Top Items For ResourceGroup
    properties:
      itemName:
        type: string
        description: Item name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category
      subscriptionId:
        type: string
        description: Subscription Id
    required:
      - itemName
      - categoryType
      - subscriptionId
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceGroupTopItemsSummaryData
  ResourceTypeCarbonEmissionItemDetailData:
    type: object
    description: Response for detailed carbon emissions
    properties:
      itemName:
        type: string
        description: Item name, resource type name
      resourceTypeFriendlyName:
        type: string
        description: Item group name
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item category, which is ResourceType
    required:
      - itemName
      - resourceTypeFriendlyName
      - categoryType
    allOf:
      - $ref: '#/definitions/CarbonEmissionData'
    x-ms-discriminator-value: ResourceTypeItemDetailsData
  SubscriptionAccessDecision:
    type: object
    description: Access Decision for each Subscription
    properties:
      subscriptionId:
        type: string
        description: Id of Subscription
      decision:
        $ref: '#/definitions/AccessDecisionEnum'
        description: Access decision to subscription
    required:
      - subscriptionId
      - decision
  TopItemsMonthlySummaryReportQueryFilter:
    type: object
    description: Query Parameters for Top Items Carbon Emissions by Month
    properties:
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item Category type
      topItems:
        type: integer
        format: int32
        description: Number of top items to return. The value should be between 5 and 100
        minimum: 5
        maximum: 100
    required:
      - categoryType
      - topItems
    allOf:
      - $ref: '#/definitions/QueryFilter'
    x-ms-discriminator-value: TopItemsMonthlySummaryReport
  TopItemsSummaryReportQueryFilter:
    type: object
    description: Query Parameters for Top Items Carbon Emission by Category Type
    properties:
      categoryType:
        $ref: '#/definitions/CategoryTypeEnum'
        description: Item Category type
      topItems:
        type: integer
        format: int32
        description: Number of top items to return. The value should be between 5 and 100
        minimum: 5
        maximum: 100
    required:
      - categoryType
      - topItems
    allOf:
      - $ref: '#/definitions/QueryFilter'
    x-ms-discriminator-value: TopItemsSummaryReport
  Versions:
    type: string
    description: Api versions
    enum:
      - 2024-02-01-preview
    x-ms-enum:
      name: Versions
      modelAsString: true
      values:
        - name: 2024-02-01-preview
          value: 2024-02-01-preview
          description: 2024-02-01-preview preview version
parameters: {}