QueryCostCenterResource
Queries the resource instances associated with a financial unit. If CostCenterId is set to 0, the operation queries unassigned parent and child resource instances.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
bss:DescribeCostUnit |
none |
*All Resource
|
None | None |
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| OwnerAccountId |
integer |
No |
The ID of the owner account for the financial unit. |
1234567812345678 |
| CostCenterId |
integer |
No |
The ID of the financial unit. |
123456 |
| NextToken |
string |
No |
The token for the next query. An empty value indicates that no more results are available. |
CAESEgoQCg4KCmd |
| MaxResults |
integer |
No |
The maximum number of records to return in a single query. |
200 |
| EcIdAccountIds |
array<object> |
No |
The list of enterprises and accounts. If this parameter is empty, the current account is queried. |
|
|
object |
No |
The list of enterprises and accounts. |
||
| AccountIds |
array |
No |
The list of accounts to access. If this parameter is empty, all accounts under the current entity ID are selected. |
|
|
integer |
No |
The ID of the member accounts. |
1501603440974415 |
|
| EcId |
string |
Yes |
The ID of the enterprise entity. |
1501603440974415 |
| Nbid |
string |
No |
The ID of the primary marketplace. If this parameter is empty, the marketplace ID of the current user is used by default. |
2684201000001 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
BssApiTokenResult |
||
| CostCenterResourceDtoList |
array<object> |
The data list. |
|
|
object |
The detailed data. |
||
| AddStrategy |
string |
The allocation strategy. |
AUTO_ALLOCATE |
| AddStrategyName |
string |
The added policy name. |
Automatic allocation |
| ApplicablePeriodNum |
integer |
The number of refreshed billing cycles. |
3 |
| ApportionItemCode |
string |
The code of the attached resource. |
test |
| ApportionItemName |
string |
The name of the attached resource. |
test |
| CommodityCode |
string |
The commodity code of the resource. |
otsbag |
| CommodityName |
string |
The commodity name of the resource. |
ApsaraDB |
| CostCenterCode |
string |
The code of the cost center. |
code |
| CostCenterCreateTime |
string |
The creation time of the cost center. The format is YYYY-MM-DD HH:mm:ss. |
2025-05-18 12:12:25 |
| CostCenterId |
integer |
The ID of the cost center. |
123456 |
| CostCenterName |
string |
The name of the cost center. |
test |
| CostCenterUpdateTime |
string |
The last update time of the cost center. The format is YYYY-MM-DD HH:mm:ss. |
2025-05-18 16:12:25 |
| FinanceUnitRuleVersion |
integer |
The version of the rule. |
3 |
| InstanceId |
string |
The ID of the billing granularity. |
cn-hangzhou;standard |
| MasterCommodityCode |
string |
The code of the associated commodity. |
ecs |
| MasterInstanceId |
string |
The associated instance ID. |
i-xxxxx |
| OwnerAccountId |
integer |
The ID of the customer to which the cost center belongs. |
1234567812345678 |
| OwnerAccountName |
string |
The name of the customer to which the cost center belongs. |
Customer A |
| ParentCostCenterId |
integer |
The ID of the parent cost center. |
123456 |
| PipCode |
string |
The product code, which is the same as the product code in the User Center bill. |
rds |
| PipName |
string |
The name of the product. |
ApsaraDB |
| RecentBillingMonth |
integer |
The latest billing cycle. |
202509 |
| RegionName |
string |
The name of the region. |
Shanghai |
| RegionNo |
string |
The region. |
cn-shanghai |
| ResourceGroup |
string |
The resource group to which the resource belongs. |
Default resource group |
| ResourceId |
string |
The ID of the resource. |
OSSBAG-cn-v0h1s4hma018 |
| ResourceNick |
string |
The custom nickname of the resource. |
testResource |
| ResourceSource |
string |
The source of the resource. Valid values:
|
MANUAL_ALLOCATE |
| ResourceTag |
string |
The tag of the resource. |
tag |
| ResourceType |
string |
The type of the resource. |
FPT_ossbag_absolute_Storage_bj |
| ResourceUpdateTime |
string |
The last update time of the cost center. This is a reserved field and is currently unavailable. The format is YYYY-MM-DD HH:mm:ss. |
2025-05-18 16:12:25 |
| ResourceUserId |
integer |
The ID of the user that owns the resource. |
1234567812345678 |
| ResourceUserName |
string |
The name of the user that owns the resource. |
test@test.aliyun.com |
| RootCostCenterId |
integer |
The ID of the root cost center. |
-1 |
| StartBillingMonth |
integer |
The billing cycle when the rule takes effect. |
202509 |
| MaxResults |
integer |
The maximum number of records to return in a single query. |
200 |
| Metadata |
any |
The metadata of the response structure. |
{} |
| NextToken |
string |
The token for the next query. An empty value indicates that no more results are available. |
eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9 |
| RequestId |
string |
The ID of the request. |
79EE7556-0CFD-44EB-9CD6-B3B526E3A85F |
| TotalCount |
integer |
The total number of records. |
2000 |
Examples
Success response
JSON format
{
"CostCenterResourceDtoList": [
{
"AddStrategy": "AUTO_ALLOCATE",
"AddStrategyName": "automatic allocation",
"ApplicablePeriodNum": 3,
"ApportionItemCode": "test",
"ApportionItemName": "test",
"CommodityCode": "otsbag",
"CommodityName": "ApsaraDB",
"CostCenterCode": "code",
"CostCenterCreateTime": "2025-05-18 12:12:25",
"CostCenterId": 123456,
"CostCenterName": "test",
"CostCenterUpdateTime": "2025-05-18 16:12:25",
"FinanceUnitRuleVersion": 3,
"InstanceId": "cn-hangzhou;standard",
"MasterCommodityCode": "ecs",
"MasterInstanceId": "i-xxxxx",
"OwnerAccountId": 1234567812345678,
"OwnerAccountName": "CustomerA",
"ParentCostCenterId": 123456,
"PipCode": "rds",
"PipName": "ApsaraDB",
"RecentBillingMonth": 202509,
"RegionName": "Shanghai",
"RegionNo": "cn-shanghai",
"ResourceGroup": "Default resource group",
"ResourceId": "OSSBAG-cn-v0h1s4hma018\n",
"ResourceNick": "testResource",
"ResourceSource": "MANUAL_ALLOCATE",
"ResourceTag": "tag",
"ResourceType": "FPT_ossbag_absolute_Storage_bj",
"ResourceUpdateTime": "2025-05-18 16:12:25\n",
"ResourceUserId": 1234567812345678,
"ResourceUserName": "test@test.aliyun.com\n",
"RootCostCenterId": -1,
"StartBillingMonth": 202509
}
],
"MaxResults": 200,
"Metadata": "{}",
"NextToken": "eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6MTB9",
"RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F",
"TotalCount": 2000
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | CostCenter.MasterAndSubHasNoRelation | Your account has no valid account relation yet. | |
| 400 | CostCenter.ResourceAuthFailed | The instance does not belong to the current user. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.