API Name
AllocateCostUnitResource
Overview
Resource instances are assigned from the source cost unit to the target cost unit.
Request parameters
| Name |
Type |
Required |
Description |
| fromUnitUserId |
Long |
Yes |
Owner user ID of the source cost unit |
| fromUnitId |
Long |
Yes |
Source cost unit ID, 0 means unallocated resource first allocation, greater than 0 means allocated resource transfer or removal |
| toUnitUserId |
Long |
Yes |
Target cost unit is the primary user ID |
| toUnitId |
Long |
Yes |
Target cost unit ID, -1 indicates that the allocated resource is removed to unassigned, and greater than 0 indicates that it is assigned to the specified cost unit |
| resourceInstanceList |
List<(ResourceInstanceDto)> |
Yes |
Resource instance list |
ResourceInstanceDto:
| Name |
Type |
Required |
Description |
| resourceUserId |
Long |
Yes |
Owner ID of the resource |
| resourceId |
String |
Yes |
Instance ID of the resource |
| commodityCode |
String |
Yes |
Commodity Code of the resource |
Response parameters
| Name |
Type |
Description |
| success |
boolean |
Is success or not |
| code |
String |
Error code |
| message |
String |
Detail information |
| data |
CostUnitOperateResponse |
Message body |
CostUnitOperateResponse:
| Name |
Type |
Description |
| ownerUid |
Long |
Owner user ID of the cost unit |
| unitId |
Long |
ID of the new cost unit |
| isSucccess |
Boolean |
Is success or not |
Error codes
| Error code | Message | Description |
|---|
| 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
https://business.ap-southeast-1.aliyuncs.com/?Action=AllocateCostUnitResource&FromUnitId=******&FromUnitUserId=***********&RegionId=cn-hangzhou&ResourceInstanceList.1.CommodityCode=ecs&ResourceInstanceList.1.ResourceId=*************&ResourceInstanceList.1.ResourceUserId=***********&ToUnitId=******&ToUnitUserId=***********&Public parameters
Response sample