vServer O&M API (1.0)

Download OpenAPI specification:Download

API for Scheduled O&M (Operation & Maintenance) on vServer — schedule a daily START, STOP or REBOOT of your servers, run a task on demand, and track what happened on every server.

Before you start

Authentication. All endpoints use the standard VNG Cloud OAuth2 flow. See the Authorization section on the API documentation home page: obtain a client ID and client secret from VNG Cloud IAM, exchange them at the authorization server for an access_token, then send Authorization: Bearer <access_token> with every request.

Activate the service first. Scheduled O&M runs actions on your servers through a service account created in your IAM account. Call POST /v1/om/activation once before creating any task. Every write operation (create, update, duplicate, cancel, delete, trigger) is rejected with 403 and an error_code until the activation status is ACTIVE. Read operations keep working, so you can still see tasks and history while the service is not active.

Typical flow.

  1. GET /v1/om/activation — if status is not ACTIVE, call POST /v1/om/activation.
  2. GET /v1/om/quota — check how many tasks you can still create.
  3. POST /api/v1/scheduled-tasks — create a task. The response returns the task id.
  4. POST /api/v1/scheduled-tasks/{taskId}/trigger — optionally run it now.
  5. GET /api/v1/scheduled-tasks/{taskId}/histories then GET .../histories/{executionId} — check the result on each server.

Schedule. A task runs once a day at the hour:minute you set in config, between effective_from and effective_until. Hourly, weekly and monthly schedules are not supported yet. Once effective_until has passed the task becomes EXPIRED and stops running.

Region. There is a single endpoint for all regions. A task belongs to exactly one region (HCM-03 or HAN-01), chosen with the region field, and can only target servers and tags in that region. To cover both regions, create one task per region.

Asynchronous actions. Write operations return 202 once the task is saved. The action on your servers is performed later by a background worker — at the scheduled time, or a few seconds after a manual trigger. Read the execution history to see the outcome.

Conventions.

  • Date-times are strings in the format yyyy-MM-dd HH:mm:ss, in UTC+7 (Asia/Ho_Chi_Minh), both in requests and in responses — for example 2026-12-01 08:00:00.
  • List endpoints are paginated with page (starts at 1, default 1) and size (default 20) and return listData, page, pageSize, totalPage and totalItem.
  • Task ids start with st-, execution ids with exec- and history ids with his-. Server ids are vServer instance ids (ins-...).

Errors. Every error response has the shape {"message": "...", "error_code": "..."}. error_code is only filled for activation errors (see the Activation section) and is null otherwise. For status 500 the message is usually the literal Internal Server Error. Branch on the HTTP status code and error_code; do not parse message.

A missing, invalid or expired token is rejected before reaching the service with 401 and a different shape: {"errors": [{"code": "IAM_UNAUTHORIZED", "message": "You are not authorized."}]}. Get a new access_token and retry.

Activation

Turn Scheduled O&M on for your account and check that it is still healthy.

Activation creates a service account in your IAM account and attaches the O&M policy to it. Scheduled tasks act on your servers with this service account. Do not delete or disable it — if you do, executions fail and the status becomes SA_BROKEN until you activate again.

When a write operation is rejected because of activation, the response is 403 with one of these error_code values:

error_code Meaning What to do
OM_NOT_ACTIVATED The service has never been activated Call POST /v1/om/activation
SA_BROKEN The service account is missing or unusable Call POST /v1/om/activation again — it repairs the account
OM_DEACTIVATED The service has been de-activated Call POST /v1/om/activation again

Get activation status

Returns whether Scheduled O&M is active for your account. The check verifies that the service account still exists, is enabled and can obtain a token.

  • ACTIVE — you can create and manage tasks. If health is SA_SECRET_STALE, the stored credentials are out of date but will be repaired automatically at the next execution; no action is needed.
  • NOT_ACTIVATED — call POST /v1/om/activation.
  • SA_BROKEN — the service account was deleted, disabled, or is unusable. Call POST /v1/om/activation to repair it. This status is also returned when IAM is temporarily unreachable; retry the check later.
Authorizations:
Authorization

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/v1/om/activation',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
Example
{
  • "status": "ACTIVE"
}

Activate Scheduled O&M

Creates the O&M service account in your IAM account and attaches the O&M policy to it. Takes a few seconds.

The call is idempotent and is also the way to repair a broken activation: if the service account already exists, it only fixes what is wrong (re-attaches the policy, renews the credentials, or recreates the account if you deleted it). Existing tasks are kept.

If you disabled the service account in the IAM console, enable it there first — this call cannot enable it and returns 409 with OM_SA_DISABLED.

Authorizations:
Authorization

Responses

Request samples

const request = require('request');

const options = {
  method: 'POST',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/v1/om/activation',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "status": "ACTIVE"
}

Quota

How many scheduled tasks your account can create.

Get quota

Returns your Scheduled O&M quotas. Today there is one quota, OM_TASK: the number of tasks you can keep (default 20). Creating or duplicating a task uses one unit; deleting a task releases it. Canceled and expired tasks still count until you delete them.

Authorizations:
Authorization

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/v1/om/quota',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
[
  • {
    }
]

Scheduled Tasks

Create, list, update, duplicate, cancel, delete and manually run scheduled tasks.

Task status.

status Meaning Allowed operations
ACTIVE The task runs on schedule update, cancel, duplicate, trigger
CANCELED Stopped by you — it never runs again duplicate, delete
EXPIRED effective_until has passed duplicate, delete

A canceled task cannot be resumed. To run it again, duplicate it (POST .../{taskId}/duplicate).

Create a scheduled task

Creates a task that runs action_type on the target servers every day at config.hour:config.minute (UTC+7), from effective_from to effective_until. The task is ACTIVE immediately and uses one unit of the OM_TASK quota.

Rules checked before the task is saved:

  • Scheduled O&M must be activated (403 otherwise — see Activation).
  • targets must contain at least one server or one tag. Every server must exist in region, and every tag key and value must exist in region.
  • effective_until must be later than effective_from. If effective_from is in the past, it is moved to the current time. If both are on the same day and effective_until is not later (for example 00:00:00), effective_until is moved to 23:59:59 of that day.
  • The window must contain at least one run time; otherwise the request fails with Schedule cannot produce a next execution within the effective window.

To run the task right away, call POST /api/v1/scheduled-tasks/{taskId}/trigger after creating it.

Authorizations:
Authorization
Request Body schema: application/json
name
required
string (TaskName) ^[a-zA-Z0-9_.-]{5,50}$

5-50 characters: letters a-z A-Z, digits 0-9, _, - and . only. No spaces or accented characters

description
string (TaskDescription) <= 1024 characters ^[a-zA-Z0-9.@_\-\s]*$

Optional. Letters a-z A-Z, digits 0-9, spaces, ., @, _ and - only. No accented characters

region
required
string (Region)
Enum: "HCM-03" "HAN-01"

Region of the task and of all its targets

action_type
required
string (ActionType)
Enum: "START" "STOP" "REBOOT"

Action performed on every target server. A server already in the target state (for example already stopped for STOP) counts as a success

required
object (ScheduleConfig)

Daily run time, in UTC+7. Only the daily schedule is supported: sending hourly, weekly or monthly with "enabled": true, or daily with "enabled": false, returns 400.

effective_from
required
string

Start of the window, yyyy-MM-dd HH:mm:ss UTC+7. A past value is moved to the current time

effective_until
required
string

End of the window, yyyy-MM-dd HH:mm:ss UTC+7. Must be later than effective_from

required
object (Targets)

Servers and tags to act on. At least one server or one tag is required. Every server and every tag key/value must exist in the task's region

Responses

Request samples

Content type
application/json
{
  • "name": "stop-dev-servers-nightly",
  • "description": "Stop dev servers every night",
  • "region": "HCM-03",
  • "action_type": "STOP",
  • "config": {
    },
  • "effective_from": "2026-12-01 00:00:00",
  • "effective_until": "2027-06-01 00:00:00",
  • "targets": {
    }
}

Response samples

Content type
application/json
{
  • "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}

List scheduled tasks

Lists your tasks (deleted tasks excluded), newest first by default. Each item carries a summary of its most recent run in the last_execution_* fields. Targets are not included — use GET .../{taskId} or the Task Targets endpoints.

If a task has no run in its history — it has never run, or its runs are older than 3 months and were removed — last_execution_time is absent, last_execution_status is RUNNING and both counters are 0. Check that last_execution_time is present before reading last_execution_status.

Authorizations:
Authorization
query Parameters
page
integer >= 1
Default: 1
Example: page=1

Page number, starting at 1

size
integer >= 1
Default: 20
Example: size=20

Items per page

name
string
Example: name=nightly

Filter by task name — partial match

status
string
Enum: "ACTIVE" "CANCELED" "EXPIRED"
Example: status=ACTIVE

Filter by task status

action_type
string
Enum: "START" "STOP" "REBOOT"
Example: action_type=STOP

Filter by action

sort_by
string
Value: "last_execution_status"
Example: sort_by=last_execution_status

Only last_execution_status is supported (alphabetical order of the status). Any other value, or no value, sorts by creation time, newest first

sort_dir
string
Enum: "asc" "desc"
Example: sort_dir=asc

Sort direction for sort_by. Default asc

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks',
  qs: {
    page: '1',
    size: '20',
    name: 'nightly',
    status: 'ACTIVE',
    action_type: 'STOP',
    sort_by: 'last_execution_status',
    sort_dir: 'asc'
  },
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "listData": [
    ],
  • "page": 1,
  • "pageSize": 20,
  • "totalPage": 1,
  • "totalItem": 1
}

Get a scheduled task

Returns a task with its schedule window and its full list of targets. The last_execution_* fields are not included here — use GET .../{taskId}/histories.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a scheduled task

Changes an ACTIVE task. Send only the fields you want to change; the others keep their value.

  • config: send hour and/or minute; the missing one keeps its current value.
  • targets: replaces the whole target list. To add one server, send the full list including the existing ones (get them from GET .../{taskId}).
  • region: changing the region removes all current targets, so targets for the new region are required in the same request.
  • effective_until, if sent, must be in the future and later than effective_from.

Changing the schedule or the effective window recomputes next_execution_time.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

Request Body schema: application/json
name
string (TaskName) ^[a-zA-Z0-9_.-]{5,50}$

5-50 characters: letters a-z A-Z, digits 0-9, _, - and . only. No spaces or accented characters

description
string (TaskDescription) <= 1024 characters ^[a-zA-Z0-9.@_\-\s]*$

Optional. Letters a-z A-Z, digits 0-9, spaces, ., @, _ and - only. No accented characters

region
string
Enum: "HCM-03" "HAN-01"

Moving the task to another region removes all its targets — send targets for the new region in the same request

action_type
string (ActionType)
Enum: "START" "STOP" "REBOOT"

Action performed on every target server. A server already in the target state (for example already stopped for STOP) counts as a success

object

New run time. Send hour, minute or both

effective_from
string

New start of the window, yyyy-MM-dd HH:mm:ss UTC+7

effective_until
string

New end of the window, yyyy-MM-dd HH:mm:ss UTC+7. Must be in the future and later than effective_from

object

Replaces the whole target list. Send every server and tag the task should keep

Responses

Request samples

Content type
application/json
{
  • "config": {
    },
  • "effective_until": "2027-12-31 23:59:59"
}

Response samples

Content type
application/json
{
  • "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}

Delete a scheduled task

Deletes a CANCELED or EXPIRED task and releases one unit of the OM_TASK quota. An ACTIVE task must be canceled first (POST .../{taskId}/cancel). A deleted task no longer appears in any endpoint.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

Responses

Request samples

const request = require('request');

const options = {
  method: 'DELETE',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "message": "Cannot delete ACTIVE task. Cancel it first",
  • "error_code": null
}

Cancel a scheduled task

Stops an ACTIVE task: its status becomes CANCELED and it never runs again. A run that has already started is not interrupted. The history is kept.

Canceling cannot be undone. To run the same task again, duplicate it. Canceled tasks still count towards the quota until you delete them.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

Responses

Request samples

const request = require('request');

const options = {
  method: 'POST',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/cancel',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}

Duplicate a scheduled task

Creates a new ACTIVE task from an existing one, in any status (ACTIVE, CANCELED or EXPIRED). Uses one unit of the OM_TASK quota.

The body is optional. Every field you send overrides the copied value; every field you omit is copied from the original task, including its targets and its effective window. If the original window has already ended, send a new effective_from and effective_until, otherwise the request fails because the schedule has no run time left.

To duplicate into another region, send region together with targets for that region.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

Request Body schema: application/json
name
string (TaskName) ^[a-zA-Z0-9_.-]{5,50}$

5-50 characters: letters a-z A-Z, digits 0-9, _, - and . only. No spaces or accented characters

description
string (TaskDescription) <= 1024 characters ^[a-zA-Z0-9.@_\-\s]*$

Optional. Letters a-z A-Z, digits 0-9, spaces, ., @, _ and - only. No accented characters

region
string
Enum: "HCM-03" "HAN-01"

Region of the new task. If it differs from the original, targets is required

action_type
string (ActionType)
Enum: "START" "STOP" "REBOOT"

Action performed on every target server. A server already in the target state (for example already stopped for STOP) counts as a success

object (ScheduleConfig)

Daily run time, in UTC+7. Only the daily schedule is supported: sending hourly, weekly or monthly with "enabled": true, or daily with "enabled": false, returns 400.

effective_from
string

yyyy-MM-dd HH:mm:ss UTC+7

effective_until
string

yyyy-MM-dd HH:mm:ss UTC+7. Must be in the future and later than effective_from

object

Targets of the new task. Omit to copy the original targets

Responses

Request samples

Content type
application/json
{
  • "name": "start-dev-servers-morning",
  • "action_type": "START",
  • "config": {
    }
}

Response samples

Content type
application/json
{
  • "id": "st-a3b4c5d6-e7f8-4a9b-8c0d-1e2f3a4b5c6d"
}

Run a scheduled task now

Runs an ACTIVE task immediately, outside its schedule. The run has trigger_type = MANUAL and does not change next_execution_time.

The response returns as soon as the run is queued. Follow it with GET .../{taskId}/histories?trigger_type=MANUAL.

Rate limit. A task can be triggered at most once every 60 seconds. A second trigger within that window returns 429 with the number of seconds to wait.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

Responses

Request samples

const request = require('request');

const options = {
  method: 'POST',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/trigger',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "id": "st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35"
}

Task Targets

The servers and tags a task acts on.

A task targets servers directly (targets.instances), by tag (targets.tags), or both. A tag target is resolved at every run: every server carrying that tag key and value at that moment is included. Servers deleted from vServer are skipped automatically.

List target servers of a task

Lists the servers the task targets directly, in the order they were added. Tag targets are listed by GET .../{taskId}/tags.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

query Parameters
page
integer >= 1
Default: 1
Example: page=1

Page number, starting at 1

size
integer >= 1
Default: 20
Example: size=20

Items per page

search
string
Example: search=web

Filter by server name or server id — partial match, case-insensitive

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/instances',
  qs: {page: '1', size: '20', search: 'web'},
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "listData": [
    ],
  • "page": 1,
  • "pageSize": 20,
  • "totalPage": 1,
  • "totalItem": 2
}

List target tags of a task

Lists the tag targets of the task, in the order they were added.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

query Parameters
page
integer >= 1
Default: 1
Example: page=1

Page number, starting at 1

size
integer >= 1
Default: 20
Example: size=20

Items per page

search
string
Example: search=env

Filter by tag key or tag value — partial match, case-insensitive

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/tags',
  qs: {page: '1', size: '20', search: 'env'},
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "listData": [
    ],
  • "page": 1,
  • "pageSize": 20,
  • "totalPage": 1,
  • "totalItem": 1
}

Execution History

What happened each time a task ran.

An execution is one run of a task (scheduled or manual). It has one history row per target server.

Execution status.

status Meaning
PENDING The run is queued
RUNNING The run is in progress
SUCCESS No server failed (a server already in the target state counts as success)
PARTIAL_FAILED Some servers succeeded, some failed
FAILED Every server failed, or the run could not start (see error_message)
SKIPPED The run was skipped, for example because it started too late (see error_message)

Per-server status (histories[].status): SUCCESS, FAILED, TIMEOUT or SKIPPED.

Common per-server error_code values. The list may grow; display error_message for anything you do not recognize.

error_code Meaning
VM_NOT_FOUND The server no longer exists
VM_IN_PROCESS The server is busy with another operation
VM_MIGRATING The server is being migrated
PERMISSION_DENIED The O&M service account is not allowed to act on the server
API_TIMEOUT vServer did not answer in time
API_ERROR vServer returned an unexpected error
SA_BROKEN The O&M service account is unusable — activate again

List executions of a task

Lists the runs of a task, most recent scheduled_time first. Each item is a summary; the per-server result is in GET .../{taskId}/histories/{executionId}.

History older than 3 months is removed automatically.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

query Parameters
page
integer >= 1
Default: 1
Example: page=1

Page number, starting at 1

size
integer >= 1
Default: 20
Example: size=20

Items per page

status
string
Enum: "PENDING" "RUNNING" "SUCCESS" "PARTIAL_FAILED" "FAILED" "SKIPPED"
Example: status=PARTIAL_FAILED

Filter by execution status

trigger_type
string
Enum: "SCHEDULED" "MANUAL"
Example: trigger_type=MANUAL

Filter by how the run was started

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/histories',
  qs: {page: '1', size: '20', status: 'PARTIAL_FAILED', trigger_type: 'MANUAL'},
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "listData": [
    ],
  • "page": 1,
  • "pageSize": 20,
  • "totalPage": 1,
  • "totalItem": 1
}

Get an execution

Returns one run of the task and the result on each server in histories.

When the run failed before reaching any server (for example because the service account is broken), histories is empty and the reason is in the top-level error_message.

Authorizations:
Authorization
path Parameters
taskId
required
string
Example: st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35

Task id, from GET /api/v1/scheduled-tasks (field id)

executionId
required
string
Example: exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01

Execution id, from GET .../{taskId}/histories (field id). Must belong to taskId

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/scheduled-tasks/st-6f1c2a9e-3b7d-4e5a-9c21-8d4f0b7e1a35/histories/exec-0193f2a4-7c1e-7b2a-9e44-5d6c7a8b9f01',
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "data": {
    }
}

List executions on a server

Lists every action Scheduled O&M performed on one server, across all your tasks, most recent first. Useful to answer "why did my server stop last night?".

An unknown instanceId returns an empty list, not 404.

Authorizations:
Authorization
path Parameters
instanceId
required
string
Example: ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d

vServer server id

query Parameters
page
integer >= 1
Default: 1
Example: page=1

Page number, starting at 1

size
integer >= 1
Default: 20
Example: size=20

Items per page

status
string
Enum: "SUCCESS" "FAILED" "TIMEOUT" "SKIPPED"
Example: status=FAILED

Filter by per-server result

Responses

Request samples

const request = require('request');

const options = {
  method: 'GET',
  url: 'https://hcm-3.api.vngcloud.vn/vserver-om-api/api/v1/instances/ins-0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d/histories',
  qs: {page: '1', size: '20', status: 'FAILED'},
  headers: {Authorization: 'Bearer REPLACE_BEARER_TOKEN'}
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Response samples

Content type
application/json
{
  • "listData": [
    ],
  • "page": 1,
  • "pageSize": 20,
  • "totalPage": 1,
  • "totalItem": 1
}