Help Center/ SecMaster/ API Reference/ API/ Metering and Billing/ On-Demand Subscription of SecMaster
Updated on 2024-07-25 GMT+08:00

On-Demand Subscription of SecMaster

Function

Enable the on-demand SecMaster.

Calling Method

For details, see Calling APIs.

URI

POST /v1/{project_id}/subscriptions/orders

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant project ID.

Minimum: 32

Maximum: 36

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Minimum: 1

Maximum: 2097152

X-Language

Yes

String

Current language environment.

Minimum: 2

Maximum: 6

Enumeration values:

  • zh-cn
  • en-us
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

region_id

Yes

String

Region ID, for example, cn-north-4.

Minimum: 1

Maximum: 64

domain_id

Yes

String

domainId

Minimum: 32

Maximum: 36

tag_list

No

Array of TagInfo objects

Charging tag.

product_list

No

Array of ProductPostPaid objects

Product list.

operate_type

No

String

Specifies the operation type. The value can be create or addition.

Default: create

Minimum: 6

Maximum: 10

Enumeration values:

  • create
  • addition
Table 4 TagInfo

Parameter

Mandatory

Type

Description

key

Yes

String

Identifier. The value is a string of 2 to 36 characters consisting of only letters, digits, underscores (_), and hyphens (-).

Minimum: 2

Maximum: 36

value

Yes

String

Content. The value is a string of 2 to 36 characters consisting of only letters, digits, underscores (_), and hyphens (-).

Minimum: 2

Maximum: 36

Table 5 ProductPostPaid

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the identifier, which must be unique in each price query and is used for identifying the mappings between requests and responses.

product_id

Yes

String

Offering ID, which is obtained from the CBC price inquiry.

cloud_service_type

Yes

String

Cloud service type. The fixed value is hws.service.type.sa.

resource_type

Yes

String

Specifies the resource type of the purchased product. For example, the resource type for typical scenarios in SecMaster is hws.resource.type.secmaster.typical.

resource_spec_code

Yes

String

Specifies the resource specifications of the purchased product. For example, the resource specification for the basic edition in SecMaster is secmaster.basic.

usage_measure_id

Yes

Integer

Specifies the usage measurement unit. This parameter is mandatory for a pay-per-use task. For example, the resources are billed by hour, the usage value is 1, and the usage measurement unit is hour. The options are: 4: Hours 10: GB. The bandwidth usage is measured by traffic (GB). 11: MB. The bandwidth usage is measured by traffic (MB).

Minimum: 1

Maximum: 20

Enumeration values:

  • 4
  • 10
  • 11

usage_value

Yes

Number

Specifies the usage value. This parameter is mandatory for a pay-per-use task. For example, the resources are billed by hour, the usage value is 1, and the usage measurement unit is hour.

Minimum: 1

Maximum: 1

resource_size

Yes

Integer

Specifies the number of quotas.

Minimum: 1

Maximum: 9999

usage_factor

Yes

String

Specifies the usage factor. This parameter is mandatory for a pay-per-use task. The value is the same as the usage factor of SDRs. The mappings between cloud services and usage factors are as follows: Typical configuration: Duration Situation management: duration Security orchestration: count Intelligent analysis: flow

Minimum: 4

Maximum: 10

resource_id

No

String

Resource ID, which is transferred only when the quota is added.

Response Parameters

None

Example Requests

https://{endpoint}/v1/{projectId}/subscriptions/orders

{
  "domain_id" : "abcdef8a41164a2280ec65f1f4c4mlnyz",
  "region_id" : "cn-north-4",
  "product_list" : [ {
    "product_id" : "OFFI908269345109094402",
    "cloud_service_type" : "hws.service.type.sa",
    "id" : "E52E1A22-9408-459A-9F67-7B5C11B1E71A",
    "resource_spec_code" : "secmaster.professional",
    "resource_type" : "hws.resource.type.secmaster.typical",
    "usage_factor" : "duration",
    "usage_value" : 1,
    "usage_measure_id" : 4,
    "resource_size" : 1
  } ]
}

Example Responses

Status code: 400

Parameter error.

{
  "error_msg" : "You already have [standard edition] package. To use more, upgrade the SecMaster edition you are using or increase the quota.",
  "error_code" : "SecMaster.00010201"
}

Status Codes

Status Code

Description

200

Request successful.

400

Parameter error.

403

Insufficient permissions.

Error Codes

See Error Codes.