Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions content/openapi/oneflow_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SERVICE_ID> <ROLE_NAME> <SCHED_ID>
```

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 <SERVICE_ID> <SCHED_ID>
```

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 >}}

Expand Down
Loading