All Products
Search
Document Center

QueryCostUnitResource

Last Updated: Jun 18, 2020

API Name

QueryCostUnitResource

Overview

Query the list of resource instances to which the user’s cost unit belongs. When the cost unit unitId is 0, it means that the unallocated primary child resource instance is queried.

Request parameters

Name Type Required Description
userId Long Yes Owner user ID of the cost unit
unitId Long Yes Cost unit ID, -1 indicates the cost unit root,and 0 indicates that the query is not assigned
pageNum int No Page number, default 1
pageSize int No Page size, default 20

Response parameters

Name Type Description
success boolean Is success or not
code String Error code
message String Detail information
data List<(CostUnitOperateResponse)> Message body

CostUnitResourceListResponse:

Name Type Description
costUnit CostUnitDto Cost unit information
costUnitStatisInfo CostUnitStatisInfo Cost unit statistics
resourceInstanceDtoList List Resource instance list
pageNum int Page number
pageSize int Number of lines per page
totalCount int Total Count

CostUnitDto:

Name Type Description
parentUnitId Long Parent cost unit ID, -1 indicates the cost unit root
ownerUid Long Owner user ID of the cost unit
unitId Long Cost unit ID
unitName String Cost unit name

CostUnitStatisInfo:

Name Type Description
resourceCount Long Number of resource instances under the current cost unit
resourceGroupCount Long Number of resource groups under current cost unit
subUnitCount Long Number of subunits under the current cost unit
userCount Long Number of associated accounts under the current cost unit
totalResourceCount Long The total number of resource instances under the current cost unit (including sub-cost units)
totalUserCount Long The number of all associated accounts under the current cost unit (including sub-cost units)
totalResourceGroupCount Long The total number of resource groups under the current cost unit (including sub-cost units)

ResourceInstanceDto:

Name Type Description
resourceUserId Long Owner ID of the resource
resourceId String Resource instance ID
resourceUserName String Resource owner’s username
commodityCode String Resource product code
commodityName String Product name of the resource
resourceGroup String Resource group to which the resource belongs
resourceTag String Resource tag
resourceNick String Custom nickname for resources
resourceType String Resource type
resourceStatus String Resource status
relatedResources String Resource instance related resources
apportionCode String Resource split code
apportionName String Resource split name

Error codes

Error code MessageDescription
MissingParameter The specified parameter is mandatory for this request. Missing Parameter
UnitNotBelongToUser Financial unit is not belong to this user. Cost unit is not belong to this user.
MasterAndSubHasNoRelation Your accounts has no valid account relation yet. The master has no relationship.
InternalError The request processing has failed due to some unknown error, exception or failure. Internal Error.

Request sample

  1. https://business.ap-southeast-1.aliyuncs.com/?Action=QueryCostUnitResource
  2. &userId=168***********77
  3. &unitId=*******
  4. &RegionId=cn-hangzhou
  5. &Public parameters

Response sample