Help Center/ ModelArts/ API Reference/ Node Management/ Locking Node Functions in Batches
Updated on 2025-11-19 GMT+08:00

Locking Node Functions in Batches

Function

This API is used to lock node functions in batches. The locked functions cannot be used on the console. This API is used when you need to temporarily disable functions of some nodes to prevent misoperations, or perform system maintenance or tests. You can use this API to lock node functions in batches. Before using this API, ensure that the node function exists and you have the administrator permissions. After the lock operation is complete, the functions of the specified node are disabled on the console, and related operations cannot be performed. If the node function does not exist, you do not have the permission to perform the operation, or the request parameters are invalid, the API will return an error message.

Debugging

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

URI

POST /v2/{project_id}/pools/{pool_name}/nodes/batch-lock

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: User project ID. For details, see Obtaining a Project ID and Name.

Constraints: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

pool_name

Yes

String

Definition: Resource pool ID. The value is the metadata.name field in the resource pool details.

Constraints: N/A

Range: N/A

Default Value: N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

nodeNames

Yes

Array of strings

Definition: Names of nodes whose lock status needs to be changed.

Constraints: N/A

actions

Yes

Array of strings

Definition: Function type to be changed.

Constraints: N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

nodes

Array of NodesResultMsg objects

Definition: IDs and statuses of resource pool nodes that are operated in batches.

Range: N/A

Table 4 NodesResultMsg

Parameter

Type

Description

name

String

Definition*: ID of the unlocked resource pool node. The value is the same as that of metadata.name in the node details.

Range: N/A

status

String

Definition: Batch operation result of resource pool nodes.

Range:

  • failed: The operation failed.

  • success: The operation succeeded.

Status code: 404

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A

error_msg

String

Definition: Error message.

Range: N/A

Example Requests

Lock node functions in batches.

POST /v2/{project_id}/pools/{pool_name}/nodes/batch-lock

{
  "nodeNames" : [ "os-node-created-xzz78" ],
  "actions" : [ "delete" ]
}

Example Responses

Status code: 200

OK

{
  "nodes" : [ {
    "name" : "os-node-created-xzz78",
    "status" : "success"
  } ]
}

Status code: 404

Not found

{
  "error_code" : "ModelArts.50015001",
  "error_msg" : "pool not found"
}

Status Codes

Status Code

Description

200

OK

404

Not found

Error Codes

See Error Codes.