Declare scripts for a cluster
Declares executable scripts for a cluster.
You can update the path to the script files and execution details for the scripts after the cluster is deployed. The latest scripts will be executed when the cluster is being scaling.
Request
Basic information | |
---|---|
HTTP URL | https://cloud-api.celerdata.com/api/1.0/clusters/cluster_id/deployment-scripts |
HTTP method | POST |
Frequency | 600/minute |
Path variables
Parameter | Example value | Required | Type | Description |
---|---|---|---|---|
cluster_id | 4ae48a3f-f840-46fa-b0e7-0709a220fa40 | Yes | String | The ID of the cluster. You can sign in to the CelerData Cloud BYOC console and then navigate to the Cluster properties section of the cluster's Overview page to obtain the cluster ID. |
:<variable_name>
indicates a URL path variable in web development tools such as Postman. :cluster_id
in the above URL path, as such, indicates the ID of the cluster you want to suspend. However, if you use other tools such as curl, you need to replace :cluster_id
with the actual cluster ID by hand in the curl
command.
Header parameters
Parameter | Example value | Required | Type | Description |
---|---|---|---|---|
Authorization | Bearer OGQ5MDA4MZGTNJMWNS0ZY2Y2LWFJNZYTOTBINMZIYTGZZDUY | Yes | String | The access token used to access the CelerData Cloud BYOC API. Format: Bearer <access_token> . |
See Obtain access token.
Request body
{
"scripts": [
{
"script_path": "s3://<path_to_script>",
"logs_dir":"s3://<path_for_log>/"
},
],
"parallel": true,
"timeout":3600
}
Parameter | Example value | Required | Type | Description |
---|---|---|---|---|
scripts | {"script_path": "s3://bucket/path/aaa.sh","logs_dir":"s3://bucket/log/"} | Yes | List | List of objects that declare the S3 path of the scripts and logs. |
parallel | true | No | Boolean | Whether to run the scripts in parallel if there are multiple scripts. |
timeout | 3600 | No | Int | The total timeout duration for executing the scripts. |
Response
Sample response
{
"code": 20000,
"message": ""
}
Response elements
Parameter | Example value | Type | Description |
---|---|---|---|
code | 20000 | Integer | The error code. If the error code returned is 20000 , the request succeeded. If any other error code is returned, the request failed. |
message | - | String | The error message. This element is returned only when the code returned is not 20000 .NOTICE Do not conclude whether a request succeeded or failed based on the return value of message . |
See also
CelerData also supports script execution via Terraform. For more information, see Run scripts via Terraform.