Updated on 2023-04-26 GMT+08:00

Modifying a BCS Service

Function

This API is used to add peers, delete peers, add organizations, or delete organizations of a service. You can perform only one of these operations at a time. Adding and deleting peers are not supported for services deployed using IEF. This API is not applicable to services billed in yearly/monthly mode. The name of an IEF node can contain 4 to 24 characters.

URI

PUT /v2/{project_id}/blockchains/{blockchain_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID obtained from IAM. Generally, a project ID contains 32 characters.

blockchain_id

Yes

String

BCS service ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Account token.

Minimum: 1

Maximum: 32768

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

node_orgs

Yes

Array of NodeOrgs objects

Organizations to add peers for.

publicips

No

Array of IefNodeinfo objects

Information about the IEF node when you add an organization for a BCS service deployed using IEF. This parameter is required when the organization is bound with the node.

is_delete_org

No

Boolean

Indicates whether to delete organizations.

Table 4 NodeOrgs

Parameter

Mandatory

Type

Description

name

Yes

String

Organization name, which must be the same as the IEF node name if the organization is bound with a node. The name can contain 4 to 24 characters, including letters, digits, and hyphens (-). It cannot start with a hyphen (-).

node_count

Yes

Long

Number of peers in the organization. The value is an integer in the range from 1 to 2.

pvc_name

No

String

PVC name, which is required when you add an organization for a BCS service deployed using CCE.

Table 5 IefNodeinfo

Parameter

Mandatory

Type

Description

status

Yes

String

Node status, which must be ACTIVE if the node is to be used.

public_ip_address

Yes

String

Node EIP.

id

Yes

String

Node ID.

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

operation_id

String

Request result.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 401

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 404

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Example Requests

{
  "node_orgs" : [ {
    "name" : "organization",
    "node_count" : 1
  } ],
  "is_delete_org" : false
}

Example Responses

Status code: 200

Ok

{
  "operation_id" : "BCSSVC01-03-1617158790255323683"
}

Status code: 400

Bad Request

{
  "error_code" : "BCS.4006014",
  "error_msg" : "Invalid Parameter quotasType : ecs"
}

Status code: 401

Unauthorized

{
  "error_code" : "BCS.4010401",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "BCS.4030403",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "BCS.4040404",
  "error_msg" : "Not Found:the url is not found"
}

Status code: 500

InternalServerError

{
  "error_code" : "BCS.5000500",
  "error_msg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

Ok

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

InternalServerError

Error Codes

See Error Codes.