UiPath Documentation
test-cloud
latest
false
Test Cloud API 指南
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。

获取租户消耗情况摘要

POST 端点,用于检索组织中所有租户的消耗摘要,按租户分组,提供租户池和组织池明细。

作为组织管理员,可以使用此端点检索组织中所有租户的消耗摘要。

API 端点​

POST {accessURL}/lease_/api/usage/{organizationId}/tenants/consumption-summary

将所有端点路径中的{accessURL}替换为您的云平台的基本 URL:

Cloud Platform访问 URL
Test Cloudhttps://cloud.uipath.com/
Test Cloud 公共部门版https://govcloud.uipath.us/
Test Cloud 专用版https://{customURL}.dedicated.uipath.com/
备注:

当您登录到产品时,您的组织名称将显示在访问 URL 后面的 URL 中,例如 {accessURL}/{organizationName}/...。

请求标头​

--header 'Authorization: Bearer {access_token}'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {access_token}'
--header 'Content-Type: application/json'
备注:

要获取{access_token} ,请确保通过此处描述的 ROPC 方法进行身份验证。

路径参数​

路径参数数据类型描述
organizationId (必填)字符串 (GUID)要检索其消耗摘要的组织 ID。

请求正文​

请求正文指定要检索摘要的日期范围和消耗性代码。有关消耗品代码的详细列表,请参阅消耗品。

{
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "tenantId": "string",
  "includeTopUpBreakdown": false,
  "includeAllocation": false
}
{
  "startDate": 0,
  "endDate": 0,
  "consumableCode": "string",
  "tenantId": "string",
  "includeTopUpBreakdown": false,
  "includeAllocation": false
}
备注:
  • startDate 和 endDate 是以秒为单位的 Unix 时间戳。两个边界都包含在内。系统会拒绝所提供的以毫秒为单位的值,并显示 400 Bad Request 错误,表明应为秒数。
  • tenantId 是可选项。如有提供,请将摘要限制为该租户。
  • includeTopUpBreakdown 是可选的(默认值:false)。当设置为 true 时,响应包括从充值单元中提取的消耗量(consumedByTopUp 字段)。
  • includeAllocation is optional (default: false). When set to true together with tenantId, the response includes that tenant's allocated quantity for the queried consumable (allocated field). Without tenantId, allocated is null, because a request across all tenants has no single allocation to report.

响应​

200 OK​

返回组织中所有租户的消耗情况摘要。

请求示例​

调用应类似于以下示例 (cURL):

curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/consumption-summary' \
--header 'Authorization: Bearer <your-access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code"
}'
curl --location --request POST 'https://cloud.uipath.com/lease_/api/usage/11111111-1111-1111-1111-111111111111/tenants/consumption-summary' \
--header 'Authorization: Bearer <your-access-token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "startDate": 1704067200,
  "endDate": 1706745600,
  "consumableCode": "consumption_unit_code"
}'

以下是成功获取摘要检索的响应正文:

备注:
  • 仅当 consumedByTopUp 为 tenantConsumptionItems 时,顶层和每个 includeTopUpBreakdown 条目中才会包含 true。
  • allocated is included at the top level only when includeAllocation is true, and is null unless tenantId is also provided. Handle null as unknown, not as zero, because it means the allocation can't be determined.
{
  "consumedFromOrgWithoutTenant": 0,
  "consumedByTopUp": 0,
  "allocated": null,
  "tenantConsumptionItems": [
    {
      "tenantId": "string",
      "consumedFromTenantPool": 0,
      "consumedFromOrgPool": 0,
      "consumedByTopUp": 0
    },
    {
      "tenantId": "string",
      "consumedFromTenantPool": 0,
      "consumedFromOrgPool": 0,
      "consumedByTopUp": 0
    }
  ]
}
{
  "consumedFromOrgWithoutTenant": 0,
  "consumedByTopUp": 0,
  "allocated": null,
  "tenantConsumptionItems": [
    {
      "tenantId": "string",
      "consumedFromTenantPool": 0,
      "consumedFromOrgPool": 0,
      "consumedByTopUp": 0
    },
    {
      "tenantId": "string",
      "consumedFromTenantPool": 0,
      "consumedFromOrgPool": 0,
      "consumedByTopUp": 0
    }
  ]
}
  • API 端点​
  • 请求标头​
  • 路径参数​
  • 请求正文​
  • 响应​
  • 200 OK​
  • 请求示例​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新