Apiary Powered Documentation
Sign in with Apiary account.
RESTful API provided by FrontEnd module, listen at port 5870 by default.
This document corresponds to version 1.3.1
Verify and allocate a new session before call functions, set session ID in header 'Nano-Session' for authentication.
[system_disk_size, data_disk_n_size...], size in bytes
system type, "linux", "windows", etc
installed guest module, "qemu"/"cloud-init"
cloud-init params
network address of interface, IPv4 dot format: '172.10.6.8'
monitor address of guest, 'host:port'
[system_disk_size, data_disk_n_size...], size in bytes
installed guest module, "qemu"/"cloud-init"
cloud-init params
IP/domain of hosting server
creating progress, range from 0 to 100
created time in format 'YYYY-MM-DD HH:MI:SS'
[system_disk_size, data_disk_n_size...], size in bytes
installed guest module, "qemu"/"cloud-init"
cloud-init params
IP/domain of hosting server
creating progress, range from 0 to 100
created time in format 'YYYY-MM-DD HH:MI:SS'
disk write bps limit, 0 = unlimited
10485760
disk write iops limit, 0 = unlimited
100
disk read bps limit, 0 = unlimited
10485760
disk read iops limit, 0 = unlimited
100
network receive bps, 0 = unlimited
10485760
network send bps, 0 = unlimited
10485760
allow root user login via SSH, enable in default
true
specify admin name, using root
when omitted
nano
password in plain text, nano generate a new one when omitted
data disk mount path, /opt/data
in default
name of storage pool, using local storage when omit
name of address pool, using bridge mode by default when omit
name of storage pool, using local storage when omit
name of address pool, using bridge mode by default when omit
disk path for storage system disk of guests, available for local mode
disk path for storage data disk of guests, available for local mode
[disabledPools, enabledPools]
[offlineCells, onlineCells]
[stoppedInstances, runningInstances, lostInstances, migratingInstances]
system start time in 'YYYY-MM-DD HH:MI:SS' format
[offlineCells, onlineCells]
[stoppedInstances, runningInstances, lostInstances, migratingInstances]
true
true
false
template created time, format YYYY-MM-DD HH:MI:SS
template modified time, format YYYY-MM-DD HH:MI:SS
template created time, format YYYY-MM-DD HH:MI:SS
template modified time, format YYYY-MM-DD HH:MI:SS
index of match interface, 0 for all, 1 for first
created time, format YYYY-MM-DD HH:MI:SS
modified time, format YYYY-MM-DD HH:MI:SS
APIs for manage resource pools
Manage compute pools
Query all compute pools in current zone
Get status of a compute pool
pool | name of compute pool |
---|
Create a new compute pool
pool | name of compute pool |
---|
name of storage pool, using local storage when omit
name of address pool, using bridge mode by default when omit
Delete a compute pool
pool | name of compute pool |
---|
Modify configure of a compute pool
pool | name of compute pool |
---|
name of storage pool, using local storage when omit
name of address pool, using bridge mode by default when omit
Manage compute cells in a pool
query cells not attached to any pool
Add a new cell to the compute pool
pool | pool name |
---|---|
cell | cell name |
Remove an attached cell from the compute pool
pool | pool name |
---|---|
cell | cell name |
Modify a compute cell
pool | pool name |
---|---|
cell | cell name |
APIs manage the storage pools
Query configures of all storage pool
Create a new stoarge pool
pool | name of storage pool |
---|
Modify stoarge pool, only available on an empty storage pool.
pool | name of storage pool |
---|
Delete a storage pool, only available on an empty storage pool.
pool | name of storage pool |
---|
Collect status and statistic data on compute zone
Query lastest status of a whole zone
Collect statistic status of compute pools
Collect status of all compute pools
Collect statistic status on a compute pool
pool | name of a compute pool |
---|
Collect statistic status of compute cells
Collect statistic status of compute cells in a pool
pool | name of target pool |
---|
Collect statistic status of a compute cell
cell | name of target cell |
---|---|
pool | name of target pool |
Manage storage configure of a cell
pool | name of target pool |
---|---|
cell | name of target cell |
Get Storage Paths for a cell
Modify Storage Paths
Query status of instances
Query status of all instances in a pool
pool | name of target pool |
---|
Query status of instances in a cell
cell | name of target cell |
---|---|
pool | name of target pool |
Manage Address Pools
Query all address pools
Get address pool status
name | pool name |
---|
Create a new address pool
name | pool name |
---|
Modify address pool
name | pool name |
---|
Delete an address pool
name | pool name |
---|
Manage Address Range
Query all ranges in pool
name | name of address pool |
---|---|
type | range type |
Get address range status
start | start address of range |
---|---|
name | name of address pool |
type | range type |
Add a new address range
start | start address of range |
---|---|
name | name of address pool |
type | range type |
Remove an address range
start | start address of range |
---|---|
name | name of address pool |
type | range type |
Manage All guests and instances
Interface for query all guest in specified pool, cell or status flags
pool | target pool name |
---|---|
cell | target cell |
status | running status |
created | guest created |
Creating, Deleting or query one guest
Get status with ID when creating, 201 for creating guest, 200 for created guest
id | guest id |
---|
Creating a new guest, return an ID for later querying
[system_disk_size, data_disk_n_size...], size in bytes
installed guest module, "qemu"/"cloud-init"
cloud-init params
IP/domain of hosting server
creating progress, range from 0 to 100
created time in format 'YYYY-MM-DD HH:MI:SS'
delete guest, release all allocated resources
id | guest id |
---|
Enable or disable auto start option of guest
id | guest ID |
---|
Change status of auto start option
Manage cores of guest
id | guest ID |
---|
Change number of cores
id | guest ID |
---|
Change memory size of guest, only available when guest offline
Manage disk capacity of guest
id | guest ID |
---|---|
disk | index of target disk, system:0, data0:1, data1:2... |
Change disk capacity of the guest to larger. Only allow operating in an offline instance.
Shrink the disk capacity of guest
id | guest ID |
---|---|
disk | index of target disk, system:0, data0:1, data1:2... |
Shrink size of guest disk file to minimal for building images. Only allow operating in an offline instance.
Manage operating system of guest
id | guest ID |
---|
Reset operating system of the guest from a disk image, all user data discard.
Manage administator password
id | guest ID |
---|
Reset a new password for administator of guest
new password, automated generate when omitted
username, automated choose username by system type when omitted
Get current name and password of administrator
Manage name of guest
id | guest ID |
---|
Change guest name
Manage QoS of CPU cores
id | guest ID |
---|
Change CPU priority
Manage Disk QoS
id | guest ID |
---|
Change disk QoS configure
disk write bps limit, 0 = unlimited
10485760
disk write iops limit, 0 = unlimited
100
disk read bps limit, 0 = unlimited
10485760
disk read iops limit, 0 = unlimited
100
Manage network QoS
id | guest ID |
---|
change network QoS configure
network receive bps, 0 = unlimited
10485760
network send bps, 0 = unlimited
10485760
Manage security policy of guest
id | guest id |
---|
Manage default action of security policy, invoked when a packet does not match any rules.
id | guest id |
---|
Change the default action when no rules matched
Manage security policy rules
Append new security policy rule to tail
id | guest id |
---|
index of match interface, 0 for all, 1 for first
Modify Security Policy Rule
index | index of policy rule |
---|---|
id | guest id |
index of match interface, 0 for all, 1 for first
Change Rule Order
index | index of policy rule |
---|---|
id | guest id |
Remove Security Policy Rule
index | index of policy rule |
---|---|
id | guest id |
Manage guest instances
id | guest ID |
---|
Get current status of an instance
Start guest(create instance)
boot from network source/PXE
boot source id/URI
Stop guest(delete instance)
Manage media in the running instance
id | guest ID |
---|
Insert media into a running instance
media type, 0 = Media Image
Eject media from a running instance
Manage snapshots of a guest
id | guest ID |
---|
Query all snapshots attached to the guest
Create a new snapshot, only available when guest stopped
Resume to a specified snapshot, available on stopped guest
Operate on a specified snapshot
id | guest id |
---|---|
name | snapshot |
Query info of a snapshot
created time in 'YYYY-MM-DD HH:MI:SS' format
Delete a snapshot
create channel for monitor and control instance. Create a new temporary channel id ABC
using POST Method, then connect and consumed channel with websocket address ws://host/monitor_channels/ABC
using noVNC or other clients. Unused channel will be released if no connection established in time.
Establish a new monitor channel
APIs manage disk and media images
Search Media Images
Search media images with login session
Manage Media Images
Synchronize media images from local directory
Query all media image
Get info of media image
id | media image id |
---|
Create a new media image
Modify info of media image
id | media image id |
---|
Delete a media image
id | media image id |
---|
APIs manage file of media images
id | image id |
---|
Download binary media image data
Upload iso data as media image
Search disk images
tags | image tags |
---|
Search disk images
Manage Disk Images
Synchronize disk images from local directory
Get status of disk image
id | disk image id |
---|
Clone a new disk image from the source guest, or create an empty one for uploading when the guest ID omits.
Modify info of disk image
id | disk image id |
---|
delete a disk image
id | disk image id |
---|
APIs manage files of disk images
id | image id |
---|
Upload a qcow2 file as disk image
APIs for maintaing system
Manage system templates
Query All Templates
Get configure of a system template
id | template id |
---|
Create System Template
Modify System Templates
id | template id |
---|
Delete System Template
id | template id |
---|
APIs manage security policy groups
Get Security Group
id | group id |
---|
Create Security Group
Modify Security Group
id | group id |
---|
Delete Security Group
id | group id |
---|
Query Security Policy Rule
id | group id |
---|
Add Security Policy Rule
id | group id |
---|
index of match interface, 0 for all, 1 for first
Modify Security Policy Rule
id | group id |
---|---|
index | index of policy rule, start from 0 |
index of match interface, 0 for all, 1 for first
Change Rule Order
id | group id |
---|---|
index | index of policy rule, start from 0 |
Remove Security Policy Rule
id | group id |
---|---|
index | index of policy rule, start from 0 |
Manage instance migrations
Create and start a new migration task
Query status of a migration task
id | migration task id |
---|
Query all pending migrations
Manage batch creating tasks
Create a bulk of new guests, return a task ID for query status
[system_disk_size, data_disk_n_size...]
installed guest module, "qemu"/"cloud-init"
cloud-init params
Query task status of batch creating
id | id of batch task |
---|
Manage batch deleting tasks
Delete a bulk of guests, return a task ID for query status
Query task status of batch deleting
id | id of batch task |
---|
APIs manage batch stopping tasks
Stop a bulk of guests, return a task ID for query status
Query task status of batch stopping
id | id of batch task |
---|
APIs for search resources
Search secuirity policy groups by condition
owner | return policy created by owner |
---|---|
group | return policy in specified group |
enabled_only | enabled group only |
global_only | global group only |
Query security group by current user/group
Search guests by conditions with current user, keyword could using guest name or target IP
search keyword, match guest name/IP, hosting cell name/IP
Management APIs for FrontEnd module
Manage user roles
Query all user roles in the system
Get configure data for the specified role
role_name | name of user role |
---|
Add a new user role to system
role_name | name of user role |
---|
Change resource can access for a specified role
role_name | name of user role |
---|
Remove a role from the system, only available when the role don't bind to any user or group
role_name | name of user role |
---|
APIs manage user groups
Query all user groups in the system
Get detail data of a user group
group_name | name of user group |
---|
Add a new user group to the system
group_name | name of user group |
---|
Modify a user group
group_name | name of user group |
---|
Remove a user group from the system
group_name | name of user group |
---|
APIs manage members of a user group
Query all members of a user group
group_name | name of user group |
---|
Add a new member to the user group
user_name | user name |
---|---|
group_name | name of user group |
Remove a member from the user group
user_name | user name |
---|---|
group_name | name of user group |
APIs manage users
Query all users in the system
Get info of a user
user_name | user name |
---|
Create a new user in the system
user_name | user name |
---|
Modify user info
user_name | user name |
---|
Delete a user
user_name | user name |
---|
APIs manage user password
user_name | user name |
---|
Verify and update a new user password
APIs for searching users
Search users by group
group | user group |
---|
Manage authenticated session
Verify and allocate a new sesion for all other requests, set session ID in header 'Nano-Session' for authentication.
Keep session alive
session_id | session ID |
---|
Get attached info with authenticated session
session_id | session ID |
---|
Manage resource visibility with login session
Get current visibility configure with the group of current user
Modify current visibility configure with the group of current user
true
true
false
APIs manage system logs
Query system logs by conditions
limit | max entries returned |
---|---|
start | start offset |
after | query logs after this date |
before | query logs before this date |
Add a single log entry
Delete logs