Queries the resource instances that are allocated to a cost center. If the unitId parameter is set to 0, the unallocated primary resource instances and sub-resource instances are queried.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
bss:QueryCostUnitResource |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| OwnerUid |
integer |
Yes |
The user ID of the cost center owner. |
23453245 |
| UnitId |
integer |
Yes |
The ID of the cost center. |
235325 |
| PageNum |
integer |
No |
The number of the page to return. |
1 |
| PageSize |
integer |
No |
The number of entries to return on each page. |
20 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. |
Success |
| Message |
string |
The error message. |
Successful! |
| RequestId |
string |
The ID of the request. |
04332CB7-9A57-4461-97E0-02821D044414 |
| Success |
boolean |
Indicates whether the request was successful. |
true |
| Data |
object |
The data returned. |
|
| PageNum |
integer |
The page number of the returned page. |
1 |
| PageSize |
integer |
The number of entries returned per page. |
20 |
| TotalCount |
integer |
The total number of returned entries. |
12 |
| ResourceInstanceDtoList |
array<object> |
The resource instances. |
|
|
object |
|||
| CommodityCode |
string |
The product code of the resource. |
rds |
| ResourceUserName |
string |
The username of the resource owner. |
test@test.aliyun.com |
| CommodityName |
string |
The commodity name of the resource. |
ApsaraDB |
| ResourceUserId |
integer |
The user ID of the resource owner. |
2424242134 |
| ApportionName |
string |
The split name of the resource. |
test |
| ApportionCode |
string |
The split code of the resource. |
test |
| ResourceType |
string |
The type of the resource. |
FPT_ossbag_absolute_Storage_bj |
| ResourceNick |
string |
The custom name of the resource. |
testResource |
| ResourceTag |
string |
The tags of the resource. |
testResource |
| ResourceId |
string |
The instance ID of the resource. |
OSSBAG-cn-v0h1s4hma018 |
| ResourceGroup |
string |
The resource group to which the resource belongs. |
Default Resource Group |
| RelatedResources |
string |
The resources related to the resource instance. |
oss |
| ResourceStatus |
string |
The status of the resource. |
Available |
| PipCode |
string |
The code of the service. The code is the same as that in Cost Center. |
rds |
| ResourceSource |
string |
The source of the resource. Value:
|
MANUAL_ALLOCATE |
| CostUnit |
object |
The information about the cost center. |
|
| ParentUnitId |
integer |
The ID of the parent cost center. A value of -1 indicates the root cost center. |
23421 |
| UnitName |
string |
The name of the cost center. |
test |
| UnitId |
integer |
The ID of the cost center. |
123412 |
| OwnerUid |
integer |
The user ID of the cost center owner. |
321432 |
| CostUnitStatisInfo |
object |
The statistical information about the cost center. |
|
| TotalResourceCount |
integer |
The total number of resource instances, including resource instances of sub-cost centers, in the cost center. |
3 |
| ResourceCount |
integer |
The number of resource instances in the cost center. |
1 |
| TotalUserCount |
integer |
The total number of the associated accounts, including associated accounts of sub-cost centers, in the cost center. |
2 |
| SubUnitCount |
integer |
The number of sub-cost centers in the cost center. |
2 |
| ResourceGroupCount |
integer |
The number of resource groups in the cost center. |
1 |
| TotalResourceGroupCount |
integer |
The total number of resource groups, including resource groups of sub-cost centers, in the cost center. |
2 |
| UserCount |
integer |
The number of sub-cost centers in the cost center. |
0 |
Examples
Success response
JSON format
{
"Code": "Success",
"Message": "Successful!",
"RequestId": "04332CB7-9A57-4461-97E0-02821D044414",
"Success": true,
"Data": {
"PageNum": 1,
"PageSize": 20,
"TotalCount": 12,
"ResourceInstanceDtoList": [
{
"CommodityCode": "rds",
"ResourceUserName": "test@test.aliyun.com",
"CommodityName": "ApsaraDB\n",
"ResourceUserId": 2424242134,
"ApportionName": "test",
"ApportionCode": "test",
"ResourceType": "FPT_ossbag_absolute_Storage_bj",
"ResourceNick": "testResource",
"ResourceTag": "testResource",
"ResourceId": "OSSBAG-cn-v0h1s4hma018",
"ResourceGroup": "Default Resource Group\n",
"RelatedResources": "oss",
"ResourceStatus": "Available",
"PipCode": "rds",
"ResourceSource": "MANUAL_ALLOCATE"
}
],
"CostUnit": {
"ParentUnitId": 23421,
"UnitName": "test",
"UnitId": 123412,
"OwnerUid": 321432
},
"CostUnitStatisInfo": {
"TotalResourceCount": 3,
"ResourceCount": 1,
"TotalUserCount": 2,
"SubUnitCount": 2,
"ResourceGroupCount": 1,
"TotalResourceGroupCount": 2,
"UserCount": 0
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.