CreateCostCenterRule

Updated at:
Copy as MD

Create a financial unit auto-allocation rule

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:ModifyCostUnit

create

*All resources

*

None None

Request parameters

Parameter

Type

Required

Description

Example

CostCenterId

integer

No

Financial unit ID

485938

FilterExpression

object

No

Rule expression

ExpressionType

string

No

Operation type

Valid values:

  • DIMENSION :

    Leaf node filter type (used when the code is not a tag)

  • TAG :

    Leaf node filter type (used when the code is a tag)

  • NARY :

    Sub-condition relationship (used for non-leaf conditions)

NARY

OperatorType

string

No

Relational expression

Valid values:

  • OR :

    OR

  • AND :

    AND

AND

Operands

array

No

Condition expression

any

No

Condition expression See the example for the overall structure (supports multi-level nesting). The fields below are for field description only.

{ "Operands": [ { "FilterValues": { "Code": "TAG-xxx", "Values": [ "xxxx" ], "SelectType": "IN" }, "ExpressionType": "TAG" }, { "FilterValues": { "Code": "INSTANCE_ID", "Values": [ "xxxxx" ], "SelectType": "LIKE" }, "ExpressionType": "DIMENSION" }, { "FilterValues": { "Code": "INSTANCE_NICK", "Values": [ "111" ], "SelectType": "LIKE" }, "ExpressionType": "DIMENSION" }, { "FilterValues": { "Code": "RESOURCE_GROUP", "Values": [ "xxxxx" ], "SelectType": "IN" }, "ExpressionType": "DIMENSION" }, { "FilterValues": { "Code": "ARTICLE", "Values": [ "xxxxx" ], "SelectType": "IN" }, "ExpressionType": "DIMENSION" }, { "FilterValues": { "Code": "PRODUCT", "Values": [ "xxxxx" ], "SelectType": "IN" }, "ExpressionType": "DIMENSION" }, { "FilterValues": { "Code": "OWNER", "Values": [ "xxxxx" ], "SelectType": "IN" }, "ExpressionType": "DIMENSION" } ] }

Operand

any

No

Filter condition (deprecated)

N/A

FilterValues

object

No

Sub-condition filter

Code

string

No

Condition filter key

Valid values:

  • OWNER :

    Account

  • ARTICLE :

    Product detail

  • RESOURCE_GROUP :

    Resource group

  • xxx (user-defined tag key) :

    Business tag, based on the actual configuration value of the user

  • PRODUCT :

    Product

  • INSTANCE_NICK :

    Instance name

  • INSTANCE_ID :

    Instance ID (billing granularity)

TAG-test-xxx-key

CodeName

string

No

Condition filter key name (deprecated)

N/A

Values

array

No

Condition filter value list

string

No

Condition filter value. Only one value can be entered for INSTANCE_NICK or INSTANCE_ID.

["TAG-test-xxx"]

SelectType

string

No

Association relationship between code and value

Valid values:

  • LIKE :

    Used in other cases for Code

  • IN :

    Used when Code is INSTANCE_NICK or INSTANCE_ID

IN

Nbid

string

No

First-level marketplace ID. If left empty, the ID of the marketplace to which the current user belongs is used by default.

2084210001

Response elements

Element

Type

Description

Example

object

BssApiPlainResult

Data

integer

Financial unit allocation rule ID

1111

Metadata

any

Response structure metadata

{}

RequestId

string

Request ID.

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

Examples

Success response

JSON format

{
  "Data": 1111,
  "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 InvalidParameter The specified request contains invalid parameters.
400 CostCenter.RuleExpressionIllegal The auto-allocation rule configuration is invalid.
400 CostCenter.UnitNotExist The financial unit does not exist or is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.