你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Exports - Get Execution History

用于获取所定义范围和导出名称的导出的运行历史记录的操作。

GET https://management.azure.com/{scope}/providers/Microsoft.CostManagement/exports/{exportName}/runHistory?api-version=2023-11-01

URI 参数

名称 必需 类型 说明
exportName
path True

string

导出名称。

scope
path True

string

与导出操作关联的范围。 这包括订阅范围的“/subscriptions/{subscriptionId}/” “/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}”表示 resourceGroup 范围,“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}”表示计费帐户范围,“/providers/Microsoft.Billing/billingAccounts/{billingAccounts/{billingAccountId}/departments/departmentId}”表示部门范围,“/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}“表示 EnrollmentAccount 范围,”/providers/Microsoft.Management/managementGroups/{managementGroupId}“表示管理组范围, ”/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}“表示 billingProfile 范围,”/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}“表示 invoiceSection 范围,以及”/providers/Microsoft”。特定于合作伙伴的 Billing/billingAccounts/{billingAccountId}/customers/{customerId}。

api-version
query True

string

要用于此操作的 API 版本。

响应

名称 类型 说明
200 OK

ExportExecutionListResult

没问题。 请求已成功。

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ExportRunHistoryGetByBillingAccount
ExportRunHistoryGetByDepartment
ExportRunHistoryGetByEnrollmentAccount
ExportRunHistoryGetByManagementGroup
ExportRunHistoryGetByResourceGroup
ExportRunHistoryGetBySubscription

ExportRunHistoryGetByBillingAccount

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.CostManagement/exports/TestExport/runHistory?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "providers/Microsoft.Billing/billingAccounts/{billingAccount-id}/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100",
      "properties": {
        "executionType": "OnDemand",
        "status": "Completed",
        "submittedBy": "john.doe@gmail.com",
        "submittedTime": "2018-08-03T07:52:15.6016681Z",
        "processingStartTime": "2018-08-03T07:52:16.9123797Z",
        "processingEndTime": "2018-08-03T07:52:28.0373318Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "providers/Microsoft.Billing/billingAccounts/{billingAccount-id}/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef",
      "properties": {
        "executionType": "Scheduled",
        "status": "Completed",
        "submittedBy": "System",
        "submittedTime": "2018-08-03T09:03:58.5710244Z",
        "processingStartTime": "2018-08-03T09:03:58.5710244Z",
        "processingEndTime": "2018-08-03T09:04:19.7223808Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    }
  ]
}

ExportRunHistoryGetByDepartment

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/TestExport/runHistory?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100",
      "properties": {
        "executionType": "OnDemand",
        "status": "Completed",
        "submittedBy": "john.doe@gmail.com",
        "submittedTime": "2018-08-03T07:52:15.6016681Z",
        "processingStartTime": "2018-08-03T07:52:16.9123797Z",
        "processingEndTime": "2018-08-03T07:52:28.0373318Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "providers/Microsoft.Billing/billingAccounts/12/departments/1234/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef",
      "properties": {
        "executionType": "Scheduled",
        "status": "Completed",
        "submittedBy": "System",
        "submittedTime": "2018-08-03T09:03:58.5710244Z",
        "processingStartTime": "2018-08-03T09:03:58.5710244Z",
        "processingEndTime": "2018-08-03T09:04:19.7223808Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    }
  ]
}

ExportRunHistoryGetByEnrollmentAccount

Sample Request

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/TestExport/runHistory?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100",
      "properties": {
        "executionType": "OnDemand",
        "status": "Completed",
        "submittedBy": "john.doe@gmail.com",
        "submittedTime": "2018-08-03T07:52:15.6016681Z",
        "processingStartTime": "2018-08-03T07:52:16.9123797Z",
        "processingEndTime": "2018-08-03T07:52:28.0373318Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "providers/Microsoft.Billing/billingAccounts/100/enrollmentAccounts/456/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef",
      "properties": {
        "executionType": "Scheduled",
        "status": "Completed",
        "submittedBy": "System",
        "submittedTime": "2018-08-03T09:03:58.5710244Z",
        "processingStartTime": "2018-08-03T09:03:58.5710244Z",
        "processingEndTime": "2018-08-03T09:04:19.7223808Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    }
  ]
}

ExportRunHistoryGetByManagementGroup

Sample Request

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport/runHistory?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100",
      "properties": {
        "executionType": "OnDemand",
        "status": "Completed",
        "submittedBy": "john.doe@gmail.com",
        "submittedTime": "2018-08-03T07:52:15.6016681Z",
        "processingStartTime": "2018-08-03T07:52:16.9123797Z",
        "processingEndTime": "2018-08-03T07:52:28.0373318Z",
        "fileName": "ScheduledForTestExport/TestExportSchedule/20180729-20180804/TestExportSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "providers/Microsoft.Management/managementGroups/TestMG/providers/Microsoft.CostManagement/exports/TestExport/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef",
      "properties": {
        "executionType": "Scheduled",
        "status": "Completed",
        "submittedBy": "System",
        "submittedTime": "2018-08-03T09:03:58.5710244Z",
        "processingStartTime": "2018-08-03T09:03:58.5710244Z",
        "processingEndTime": "2018-08-03T09:04:19.7223808Z",
        "fileName": "ScheduledForTestExport/TestExportSchedule/20180729-20180804/TestExportSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    }
  ]
}

ExportRunHistoryGetByResourceGroup

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/TestExport/runHistory?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100",
      "properties": {
        "executionType": "OnDemand",
        "status": "Completed",
        "submittedBy": "john.doe@gmail.com",
        "submittedTime": "2018-08-03T07:52:15.6016681Z",
        "processingStartTime": "2018-08-03T07:52:16.9123797Z",
        "processingEndTime": "2018-08-03T07:52:28.0373318Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef",
      "properties": {
        "executionType": "Scheduled",
        "status": "Completed",
        "submittedBy": "System",
        "submittedTime": "2018-08-03T09:03:58.5710244Z",
        "processingStartTime": "2018-08-03T09:03:58.5710244Z",
        "processingEndTime": "2018-08-03T09:04:19.7223808Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    }
  ]
}

ExportRunHistoryGetBySubscription

Sample Request

GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/TestExport/runHistory?api-version=2023-11-01

Sample Response

{
  "value": [
    {
      "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/1e25d58a-a3b0-4916-9542-6e04a89bc100",
      "properties": {
        "executionType": "OnDemand",
        "status": "Completed",
        "submittedBy": "john.doe@gmail.com",
        "submittedTime": "2018-08-03T07:52:15.6016681Z",
        "processingStartTime": "2018-08-03T07:52:16.9123797Z",
        "processingEndTime": "2018-08-03T07:52:28.0373318Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_1e25d58a-a3b0-4916-9542-6e04a89bc100.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    },
    {
      "id": "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/exports/JohnDoeSchedule/Run/11ac6811-dca3-46ad-b326-4704cf0c58ef",
      "properties": {
        "executionType": "Scheduled",
        "status": "Completed",
        "submittedBy": "System",
        "submittedTime": "2018-08-03T09:03:58.5710244Z",
        "processingStartTime": "2018-08-03T09:03:58.5710244Z",
        "processingEndTime": "2018-08-03T09:04:19.7223808Z",
        "fileName": "ScheduledTestsForJohnDoe/JohnDoeSchedule/20180729-20180804/JohnDoeSchedule_11ac6811-dca3-46ad-b326-4704cf0c58ef.csv",
        "runSettings": {
          "format": "Csv",
          "deliveryInfo": {
            "destination": {
              "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182",
              "container": "exports",
              "rootFolderPath": "ScheduledTestsForJohnDoe"
            }
          },
          "definition": {
            "type": "ActualCost",
            "timeframe": "Custom",
            "timePeriod": {
              "from": "2020-06-01T00:00:00Z",
              "to": "2020-10-31T00:00:00Z"
            },
            "dataSet": {
              "granularity": "Daily",
              "configuration": {
                "columns": [
                  "Date",
                  "MeterId",
                  "ResourceId",
                  "ResourceLocation",
                  "Quantity"
                ]
              }
            }
          }
        }
      }
    }
  ]
}

定义

名称 说明
CommonExportProperties

导出的通用属性。

ErrorDetails

错误的详细信息。

ErrorResponse

错误响应指示服务无法处理传入请求。 错误消息中提供了原因。

某些错误响应:

  • 429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。

  • 503 ServiceUnavailable - 服务暂时不可用。 等待“Retry-After”标头中指定的时间后重试。

ExecutionStatus

导出运行的最后一个已知状态。

ExecutionType

导出运行的类型。

ExportDataset

导出中数据的定义。

ExportDatasetConfiguration

导出数据集配置。 允许为导出选择列。 如果未提供,则导出将包括所有可用列。

ExportDefinition

导出的定义。

ExportDeliveryDestination

这表示将交付成本导出的 Blob 存储帐户位置。 有两种方法可以配置目标。 大多数客户建议的方法是指定存储帐户的 resourceId。 这需要向 Microsoft.CostManagementExports 资源提供程序一次性注册帐户的订阅,以便为成本管理服务提供对存储的访问权限。 在 Azure 门户创建导出时,会自动执行此注册,但 API 用户可能需要显式注册订阅, (有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ) 。 配置目标的另一种方法仅适用于具有Microsoft 合作伙伴协议计划的合作伙伴,这些合作伙伴是其计费帐户的全局管理员。 这些合作伙伴可以指定存储帐户名称以及帐户的 SAS 令牌,而不是指定存储帐户的 resourceId。 这允许将成本导出到任何租户中的存储帐户。 应为具有服务/容器/对象资源类型和读/写/删除/列表/添加/创建权限的 Blob 服务创建 SAS 令牌, (有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ) 。

ExportDeliveryInfo

与导出关联的传递信息。

ExportExecutionListResult

列出导出的运行历史记录的结果。

ExportRun

导出运行。

ExportTimePeriod

导出中数据的日期范围。 仅当 timeFrame 设置为“Custom”时,才应指定此值。 最大日期范围为 3 个月。

ExportType

导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。

FormatType

正在传递的导出的格式。 目前仅支持“Csv”。

GranularityType

导出中行的粒度。 目前仅支持“每日”。

TimeframeType

为导出拉取数据的时间范围。 如果是自定义的,则必须提供特定的时间段。

CommonExportProperties

导出的通用属性。

名称 类型 说明
definition

ExportDefinition

具有导出的定义。

deliveryInfo

ExportDeliveryInfo

具有导出的传递信息。

format

FormatType

正在传递的导出的格式。 目前仅支持“Csv”。

nextRunTimeEstimate

string

如果导出具有活动计划,则 提供下一次运行时的估计值。

partitionData

boolean

如果设置为 true,则导出的数据将按大小进行分区,并与清单文件一起放置在 Blob 目录中。 注意:此选项目前仅适用于Microsoft 客户协议商业范围。

runHistory

ExportExecutionListResult

如果请求, 具有导出的最新运行历史记录。

ErrorDetails

错误的详细信息。

名称 类型 说明
code

string

错误代码。

message

string

指示操作失败原因的错误消息。

ErrorResponse

错误响应指示服务无法处理传入请求。 错误消息中提供了原因。

某些错误响应:

  • 429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。

  • 503 ServiceUnavailable - 服务暂时不可用。 等待“Retry-After”标头中指定的时间后重试。

名称 类型 说明
error

ErrorDetails

错误的详细信息。

ExecutionStatus

导出运行的最后一个已知状态。

名称 类型 说明
Completed

string

DataNotAvailable

string

Failed

string

InProgress

string

NewDataNotAvailable

string

Queued

string

Timeout

string

ExecutionType

导出运行的类型。

名称 类型 说明
OnDemand

string

Scheduled

string

ExportDataset

导出中数据的定义。

名称 类型 说明
configuration

ExportDatasetConfiguration

导出数据集配置。

granularity

GranularityType

导出中行的粒度。 目前仅支持“每日”。

ExportDatasetConfiguration

导出数据集配置。 允许为导出选择列。 如果未提供,则导出将包括所有可用列。

名称 类型 说明
columns

string[]

要包含在导出中的列名的数组。 如果未提供,则导出将包括所有可用列。 可用列可能因客户渠道而异 (请参阅示例) 。

ExportDefinition

导出的定义。

名称 类型 说明
dataSet

ExportDataset

导出中数据的定义。

timePeriod

ExportTimePeriod

具有为导出拉取数据的时间段。

timeframe

TimeframeType

为导出拉取数据的时间范围。 如果是自定义的,则必须提供特定的时间段。

type

ExportType

导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。

ExportDeliveryDestination

这表示将交付成本导出的 Blob 存储帐户位置。 有两种方法可以配置目标。 大多数客户建议的方法是指定存储帐户的 resourceId。 这需要向 Microsoft.CostManagementExports 资源提供程序一次性注册帐户的订阅,以便为成本管理服务提供对存储的访问权限。 在 Azure 门户创建导出时,会自动执行此注册,但 API 用户可能需要显式注册订阅, (有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services ) 。 配置目标的另一种方法仅适用于具有Microsoft 合作伙伴协议计划的合作伙伴,这些合作伙伴是其计费帐户的全局管理员。 这些合作伙伴可以指定存储帐户名称以及帐户的 SAS 令牌,而不是指定存储帐户的 resourceId。 这允许将成本导出到任何租户中的存储帐户。 应为具有服务/容器/对象资源类型和读/写/删除/列表/添加/创建权限的 Blob 服务创建 SAS 令牌, (有关详细信息,请参阅 https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/export-cost-data-storage-account-sas-key ) 。

名称 类型 说明
container

string

要在其中上传导出的容器的名称。 如果该容器不存在,则会创建该容器。

resourceId

string

将在其中传递导出的存储帐户的资源 ID。 如果指定了 sasToken 和 storageAccount,则不需要这样做。

rootFolderPath

string

要在其中上传导出的目录的名称。

sasToken

string

存储帐户的 SAS 令牌。 对于一组受限的 Azure 客户,可以指定此与 storageAccount 一起指定,而不是 resourceId。 注意:API 为此属性返回的值将始终被模糊处理。 返回此相同的模糊值不会导致更新 SAS 令牌。 若要更新此值,必须指定新的 SAS 令牌。

storageAccount

string

要在其中上传导出的存储帐户。 对于一组受限的 Azure 客户,可以指定此与 sasToken 一起指定,而不是 resourceId。

ExportDeliveryInfo

与导出关联的传递信息。

名称 类型 说明
destination

ExportDeliveryDestination

具有要传递的导出的目标。

ExportExecutionListResult

列出导出的运行历史记录的结果。

名称 类型 说明
value

ExportRun[]

导出运行的列表。

ExportRun

导出运行。

名称 类型 说明
eTag

string

资源的 eTag。 为了处理并发更新方案,此字段将用于确定用户是否正在更新最新版本。

id

string

资源 ID。

name

string

资源名称。

properties.error

ErrorDetails

任何错误的详细信息。

properties.executionType

ExecutionType

导出运行的类型。

properties.fileName

string

导出文件的文件名。

properties.processingEndTime

string

导出运行完成的时间。

properties.processingStartTime

string

选择导出以运行的时间。

properties.runSettings

CommonExportProperties

对此运行生效的导出设置。

properties.status

ExecutionStatus

导出运行的最后一个已知状态。

properties.submittedBy

string

触发导出的实体的标识符。 对于按需运行,它是用户电子邮件。 对于计划的运行,它为“System”。

properties.submittedTime

string

排队运行导出的时间。

type

string

资源类型。

ExportTimePeriod

导出中数据的日期范围。 仅当 timeFrame 设置为“Custom”时,才应指定此值。 最大日期范围为 3 个月。

名称 类型 说明
from

string

导出数据的开始日期。

to

string

导出数据的结束日期。

ExportType

导出的类型。 请注意,“使用情况”等效于“ActualCost”,适用于尚未提供服务预留费用或摊销数据的导出。

名称 类型 说明
ActualCost

string

AmortizedCost

string

Usage

string

FormatType

正在传递的导出的格式。 目前仅支持“Csv”。

名称 类型 说明
Csv

string

GranularityType

导出中行的粒度。 目前仅支持“每日”。

名称 类型 说明
Daily

string

TimeframeType

为导出拉取数据的时间范围。 如果是自定义的,则必须提供特定的时间段。

名称 类型 说明
BillingMonthToDate

string

Custom

string

MonthToDate

string

TheLastBillingMonth

string

TheLastMonth

string

WeekToDate

string