Create Maintenance Window
Creates a maintenance window for security patches. PhoenixAI will automatically apply the patch during the maintenance window.
Request
| Basic information | |
|---|---|
| HTTP URL | https://cloud-api.celerdata.com/api/1.0/clusters/:cluster_id/maintenance-windows |
| 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 PhoenixAI Cloud 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 PhoenixAI Cloud API. Format: Bearer <access_token>. |
See Obtain access token.
Request body
{
"window_type": "WEEKLY",
"day_of_week": "SUNDAY",
"start_time": "02:00",
"end_time": "05:00",
"timezone": "America/Los_Angeles",
"enabled": true
}
| Parameter | Example value | Required | Type | Description |
|---|---|---|---|---|
| window_type | "WEEKLY" | Yes | STRING | The recurrence of the maintenance window. Valid values: WEEKLY and MONTHLY. Multiple windows in a cluster must be the same type. |
| day_of_week | "SUNDAY" | Yes | STRING | Day of the week if window_type is set to WEEKLY. Valid values: SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, and SATURDAY. |
| day_of_month | 1 | Yes | INT | Day of the month if window_type is set to MONTHLY. Value range: [1, 31]. |
| start_time | "02:00" | Yes | STRING | The start time of the window. Format: HH:mm, in 24-hour range. Always specify time values in zero-padded format (for example, "02:00" instead of "2:00"). Otherwise, Terraform may report a persistent diff. You must allocate at least two hours for each window. The window cannot cross midnight. |
| end_time | "05:00" | Yes | STRING | The end time of the window. Format: HH:mm, in 24-hour range. Always specify time values in zero-padded format (for example, "02:00" instead of "2:00"). Otherwise, Terraform may report a persistent diff. You must allocate at least two hours for each window. The window cannot cross midnight. |
| timezone | "America/Los_Angeles" | Yes | STRING | IANA zone name. Raw offsets such as +08:00 are rejected. |
| enabled | true | Yes | BOOLEAN | Whether to enable the window. |
warning
Requests to set identical windows (by creating a new one or updating existing ones) are rejected.
Response
Sample response
{
"code": 20000,
"data": {
"window_id": "w-1a2b3c"
}
}
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. |
| data | - | Object | The result of the API call. The data object may not be returned for some API actions. It returns the object of window information. |
| data.window_id | w-1a2b3c | String | The ID of the window. |