diff --git a/content/openapi/oneflow_v1.json b/content/openapi/oneflow_v1.json index 7aac6628a..5ddbf197a 100644 --- a/content/openapi/oneflow_v1.json +++ b/content/openapi/oneflow_v1.json @@ -532,6 +532,55 @@ } } }, + "/service/{id}/sched_action/{sched_id}": { + "delete": { + "tags": [ + "services" + ], + "summary": "Delete a scheduled action from all VMs of a Service", + "description": "Delete the scheduled action identified by `sched_id` from every Virtual Machine belonging to the Service resource identified by ID. VMs that no longer have the scheduled action are skipped.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Service ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "sched_id", + "in": "path", + "description": "Scheduled action ID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, "/service/{id}/scale": { "post": { "tags": [ @@ -670,6 +719,64 @@ } } }, + "/service/{id}/role/{name}/sched_action/{sched_id}": { + "delete": { + "tags": [ + "services" + ], + "summary": "Delete a scheduled action from all VMs of a Role", + "description": "Delete the scheduled action identified by `sched_id` from every Virtual Machine belonging to the Role identified by `name` of the Service resource identified by ID. VMs that no longer have the scheduled action are skipped.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "Service ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "name", + "in": "path", + "description": "Role name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "sched_id", + "in": "path", + "description": "Scheduled action ID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, "/service/{id}/role_action": { "post": { "tags": [ diff --git a/content/product/virtual_machines_operation/multi-vm_workflows/appflow_use_cli.md b/content/product/virtual_machines_operation/multi-vm_workflows/appflow_use_cli.md index 096a0aff4..9f765c44e 100644 --- a/content/product/virtual_machines_operation/multi-vm_workflows/appflow_use_cli.md +++ b/content/product/virtual_machines_operation/multi-vm_workflows/appflow_use_cli.md @@ -1030,6 +1030,30 @@ The `/etc/one/oneflow-server.conf` file contains default values for `period` and {{< alert title="Note" type="info" >}} You can also perform an operation in the whole service using the command `service action`. All the above operations and options are supported.{{< /alert >}} +### Deleting Scheduled Actions from Service VMs + +When an action is scheduled through OneFlow, the scheduled action is created in the VMs that belong to the selected Role or Service. You can remove that scheduled action centrally from OneFlow instead of deleting it VM by VM. + +To delete a scheduled action from all the VMs in a Role, use the scheduled action ID shown in the Service or VM scheduled actions view: + +```default +$ oneflow sched-delete +``` + +For example, to delete scheduled action `3` from every VM in the `frontend` Role: + +```default +$ oneflow sched-delete my-service frontend 3 +``` + +You can also delete a scheduled action from all the VMs in the Service: + +```default +$ oneflow service sched-delete +``` + +The operation is idempotent: VMs that no longer have the scheduled action are skipped. + {{< alert title="Warning" type="warning" >}} Schedule actions are only supported by VM-type Roles.{{< /alert >}}