Updated on 2025-11-28 GMT+08:00

Purchasing a CA

Function

Purchase a CA.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    pca:ca:create

    Write

    ca *

    -

    -

    -

    -

    • g:EnterpriseProjectId

    • g:RequestTag/<tag-key>

    • g:TagKeys

URI

POST /v1/private-certificate-authorities/order

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. For details, see [Obtaining a User Token] (https://support.huaweicloud.com/en-us/api-iam/iam_30_0001.html).

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

cloud_service_type

Yes

String

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

Minimum: 1

Maximum: 64

charging_mode

Yes

Integer

Billing mode: - 0: yearly/monthly

period_type

Yes

Integer

Subscription period type. The options are as follows: 2: month; 3: year.

period_num

Yes

Integer

Number of subscription periods.

is_auto_renew

Yes

Integer

Whether to enable auto-renewal. 1: yes; 0: no

promotion_info

No

String

Discount information.

Minimum: 0

Maximum: 2048

subscription_num

Yes

Integer

Subscription quantity

is_auto_pay

No

Integer

Whether to perform automatic payment. 1: yes; 0: no. The default value is 0.

enterprise_project_id

No

String

Enterprise project ID.

Minimum: 1

Maximum: 64

product_infos

Yes

Array of ProductInfo objects

Product list. For details, see parameter description of the ProductInfo field.

Array Length: 0 - 10

Table 3 ProductInfo

Parameter

Mandatory

Type

Description

cloud_service_type

Yes

String

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

Minimum: 1

Maximum: 64

resource_type

Yes

String

Resource type. The value of CA is hws.resource.type.pca.duration.

Minimum: 1

Maximum: 64

resource_spec_code

Yes

String

Resource specification code. The value of CA is ca.duration.

Minimum: 1

Maximum: 64

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

order_id

String

Order ID.

Minimum: 1

Maximum: 64

ca_ids

Array of strings

ID list of the purchased CA certificates.

Minimum: 1

Maximum: 64

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code

Minimum: 3

Maximum: 36

error_msg

String

Error message

Minimum: 0

Maximum: 1024

Example Requests

When you use this API to create a CA, a token is required in the X-Auth-Token field in the request header, and the token must have the permission to access the API.

POST https://ccm.cn-north-4.myhuaweicloud.com/v1/private-certificate-authorities/order

{
  "cloud_service_type" : "hws.service.type.ccm",
  "period_type" : 2,
  "period_num" : 1,
  "charging_mode" : 0,
  "is_auto_renew" : 0,
  "is_auto_pay" : 0,
  "promotion_info" : "",
  "enterprise_project_id" : "0",
  "product_infos" : [ {
    "cloud_service_type" : "hws.service.type.ccm",
    "resource_type" : "hws.resource.type.pca.duration",
    "resource_spec_code" : "ca.duration"
  } ],
  "subscription_num" : 1
}

Example Responses

Status code: 200

Request succeeded.

{
  "order_id" : "CS1803192259ROA8U",
  "ca_ids" : [ "4284547e-68ef-4a94-adea-9df1e5d8ad65", "211c079c-bab8-41af-8948-c5e2531232c6" ]
}

Status code: 400

Invalid request parameter.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 401

Token required for the requested page.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 403

Authentication failed.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 404

No resources available or found.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status code: 500

Internal server error.

{
  "error_code" : "PCA.XXX",
  "error_msg" : "XXX"
}

Status Codes

Status Code

Description

200

Request succeeded.

400

Invalid request parameter.

401

Token required for the requested page.

403

Authentication failed.

404

No resources available or found.

500

Internal server error.

Error Codes

See Error Codes.