QueryCostCenterShareRule

Updated at:
Copy as MD

Query cost center sharing rules

Operation description

Queries the sharing rules of user cost centers.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

bss:DescribeCostUnit

list

*All Resources

*

None None

Request parameters

Parameter

Type

Required

Description

Example

OwnerAccountId

integer

No

The owner account ID of the cost center.

1529600453335198

NextToken

string

No

Reserved field.

AAAAAV3MpHK1AP0pfERHZN5pu6nYCisJwqt18pP5E9yb47iu

MaxResults

integer

No

Reserved field.

20

EcIdAccountIds

array<object>

No

The list of enterprises and accounts. If empty, the current account is queried.

object

No

The list information.

EcId

string

Yes

The enterprise entity ID.

1004064243473974

AccountIds

array

No

The list of accounts to access. If empty, all accounts under the current entity ID are selected.

integer

No

The member account ID.

1501603440974415

Nbid

string

No

The primary marketplace ID. If empty, the marketplace ID of the current user is used by default.

2684201000001

Response elements

Element

Type

Description

Example

object

BssApiTokenResult

NextToken

string

Reserved field.

eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6NH0=

MaxResults

integer

Reserved field.

20

TotalCount

integer

The total number of records.

20

Data

array<object>

The returned data list.

array<object>

The object information.

OwnerAccountId

integer

The owner account ID of the cost center.

1529600453335198

ShareRuleId

integer

The sharing rule ID.

1826

ShareRuleName

string

The sharing rule name.

test

ShareRuleType

string

The sharing rule type.

Valid values:

  • AVERAGE :

    Split evenly

  • CUSTOM :

    Custom split ratio

  • RATIO :

    Split by ratio

AVERAGE

FromCostCenterShareRuleDetails

array<object>

The source cost center rule details.

object

The object information.

OwnerAccountId

integer

The owner account ID of the cost center.

1529600453335198

RootCostCenterId

integer

The root cost center ID.

583050

CostCenterId

integer

The cost center ID.

637127

ParentCostCenterId

integer

The parent cost center ID.

637537

PrevCostCenterId

integer

The previous cost center ID.

583059

CostCenterCode

string

The cost center code.

970354711219#

CostCenterName

string

The cost center name.

Cost Plan

GmtCreate

string

The creation time.

2025-07-16 13:49:59

GmtModified

string

The modification time.

2025-07-16 13:49:59

ToCostCenterShareRuleDetails

array<object>

The target cost center rule details.

object

The object information.

OwnerAccountId

integer

The owner account ID of the cost center.

1529600453335198

RootCostCenterId

integer

The root cost center ID.

583050

CostCenterId

integer

The cost center ID.

637127

ParentCostCenterId

integer

The parent cost center ID.

637537

PrevCostCenterId

integer

The previous cost center ID.

583055

CostCenterCode

string

The cost center code.

970354711215#

CostCenterName

string

The cost center name.

Cost Allocation

ShareRatio

number

The sharing ratio.

0.2

GmtCreate

string

The creation time.

2025-07-16 13:49:59

GmtModified

string

The modification time.

2025-07-16 13:49:59

GmtModified

string

2026-01-01 00:00:00

Metadata

any

The response metadata.

{}

RequestId

string

The request ID.

79EE7556-0CFD-44EB-9CD6-B3B526E3A85F

Examples

Success response

JSON format

{
  "NextToken": "eyJwYWdlTnVtIjoyLCJwYWdlU2l6ZSI6NH0=",
  "MaxResults": 20,
  "TotalCount": 20,
  "Data": [
    {
      "OwnerAccountId": 1529600453335198,
      "ShareRuleId": 1826,
      "ShareRuleName": "test",
      "ShareRuleType": "AVERAGE",
      "FromCostCenterShareRuleDetails": [
        {
          "OwnerAccountId": 1529600453335198,
          "RootCostCenterId": 583050,
          "CostCenterId": 637127,
          "ParentCostCenterId": 637537,
          "PrevCostCenterId": 583059,
          "CostCenterCode": "970354711219#",
          "CostCenterName": "Cost Plan",
          "GmtCreate": "2025-07-16 13:49:59",
          "GmtModified": "2025-07-16 13:49:59"
        }
      ],
      "ToCostCenterShareRuleDetails": [
        {
          "OwnerAccountId": 1529600453335198,
          "RootCostCenterId": 583050,
          "CostCenterId": 637127,
          "ParentCostCenterId": 637537,
          "PrevCostCenterId": 583055,
          "CostCenterCode": "970354711215#",
          "CostCenterName": "Cost Allocation",
          "ShareRatio": 0.2,
          "GmtCreate": "2025-07-16 13:49:59",
          "GmtModified": "2025-07-16 13:49:59"
        }
      ],
      "GmtModified": "2026-01-01 00:00:00"
    }
  ],
  "Metadata": "{}",
  "RequestId": "79EE7556-0CFD-44EB-9CD6-B3B526E3A85F"
}

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.