Adding Compute Resources
Function
This API is used to add compute resources.
URI
POST /v1/{project_id}/computing-resource
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID, which is used for resource isolation. For details about how to obtain the project ID, see Obtaining a Project ID. |
Request
Table 2 describes the request parameters.
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| type | Yes | String | Resource type. The value can contain a maximum of 10 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
| driver_memory | Yes | String | Driver memory. The value must be greater than or equal to 512 MB. |
| driver_cores | Yes | Integer | Number of driver cores. The value must be greater than or equal to 1. |
| executor_memory | Yes | String | Executor memory. The value must be greater than or equal to 1 GB. |
| executor_cores | Yes | Integer | Number of executor cores. The value must be greater than or equal to 1. |
| num_executors | Yes | Integer | Number of cores. The value must be greater than or equal to 1. |
Response
Table 3 describes the response parameters.
| Parameter | Type | Description |
|---|---|---|
| is_success | Boolean | Whether the request is successful |
| message | String | Message indicating a successful response |
| error_code | String | Error code that indicates a request has failed. This parameter is unavailable when a request is successful. |
| error_msg | String | Error message that indicates a request has failed. This parameter is unavailable when a request is successful. |
Example
- Example request
{ "type": "B2", "driver_memory": "13 GB", "driver_cores": 1, "executor_memory": "10 GB", "executor_cores": 3, "num_executors": 5 } - Example of a successful response
{ "is_success": true, "message": "Succeed to add computing resource." } - Example of a failed response
{ "is_success": false, "error_code": "res.1006", "error_msg": "The content for the request is invalid." }
Status Code
For details about status codes, see Status Codes.
Last Article: Configuring Compute Resources
Next Article: Changing Compute Resources
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.