Icon Created with Sketch.

Baetyl Cloud API docs

  • Node Management
    • Query Node
    • List Node
    • Query Node Stats
    • Create Node
    • Update Node
    • Delete Node
    • Query Binding Apps of Node
    • Get Installation Command
  • Application Management
    • Update Application
    • Delete Application
    • Create Application
    • Query Application
    • List Application
  • Configuration Management
    • Update Configuration
    • Create Configuration
    • Delete Configuration
    • Get Configuration
    • Get Related Apps
    • List Configuration
  • Secret Management
    • Update Secret
    • Create Secret
    • Delete Secret
    • Get Secret
    • Get Related Apps
    • List Secrets
  • Registry Management
    • Update Description
    • Create Registry
    • Delete Registry
    • Get Registry
    • Get Related Registry
    • List Registry
    • Reset Password

Baetyl Cloud Open API

Node Management

Query Node

Basic Information

Path: /v1/nodes/{name}

Method: GET

Interface description:
unnecessary to check returned report and desire

Request Parameters

path parameters

Parameter Name Example Remarks
name

Response

Name Type Necessary Default Value Remarks Additional Information
name string No node name
namespace string No namespace
description string No description
ready boolean No whether device is connected
createTime string No created time
labels object No labels
annotations object No annotations, type of map[string]string, for storing attributes of brand
├─ brand string No brand is just an example

List Node

Basic Information

Path: /v1/nodes

Method: GET

Interface description:
1. unnecessary to check returned report and desire
2. only check ready field

Request Parameters

Query

Parameter Name Necessary Example Remarks
selector No For example, selector="env=test,project=java" means to match nodes whose env label is test and the project label is java. selector="env in(dev,test),project=java" means to match nodes whose project label is java and the env label is dev or test. query by labels
fieldSelector No metadata.name=test query by fields
limit No 10 paging limits
continue No qwertyuhgfdsasdfghjkjd paging continuation token,returnd by last paging query

Response

Name Type Necessary Default Value Remarks Additional Information
total number No count of node
listOptions object No list options
items object [] No node list

item Type: object

├─ name string Yes node name
├─ namespace string Yes namespace
├─ description string Yes description
├─ ready boolean Yes whether device is connected
├─ createTime string Yes created time
├─ labels object Yes labels
├─ annotations object No annotations, type of map[string]string, for storing attributes of brand
├─ brand string No brand example

Query Node Stats

Basic Information

Path: /v1/nodes/{name}/stats

Method: GET

Interface description:
unnecessary to check returned desire

Request Parameters

path parameters

Parameter Name Example Remarks
name

Response

Name Type Necessary Default Value Remarks Additional Information
ready boolean No whether device is connected
report object No report info
├─ time string No report time
├─ node object No node info
├─hostname string No hostname
├─ address string No device address
├─ arch string No device architecture
├─kernelVer string No kerner version
├─ os string No operating system
├─containerRuntime string No container runtime
├─ machineID string No machine id
├─ bootID string No boot id
├─ systemUUID string No system uuid
├─ osImage string No os image
├─ nodestats object No node stats
├─ usage object No resource usage
├─ cpu string No cpu usage
├─ memory string No memory usage
├─ capacity object No resource capacity
├─ cpu string No cpu capacity
├─ memory string No memory capacity
├─ percent object No usage percent
├─ cpu number No cpu usage percent
├─ memory number No memory usage percent
├─ apps object [] No application info

item Type: object

├─ name string No application name
├─ version string No application version
├─ sysapps object [] No same as apps

item Type: object

├─ name string No
├─ version string No
├─ appstats object [] No application stats

item Type: object

├─ name string No application name
├─ version string No application version
├─ status string No application status,Running: deployed;Pending: deploying; Failed:task failed
├─ cause string No cause of status
├─ instances object No instance stats
├─key(instance name) object No instance name
├─ name string No instance name
├─serviceName string No service name
├─ status string No instance status, Running: deployed; Pending: deploying; Succeeded: task succeeded Failed: task failed; Unknown: unknown
├─ cause string No cause of status
├─ createTime string No created time
├─ usage object No resource usage
├─ cpu string No cpu usage
├─ memory string No memory usage
├─ sysappstats object [] No same as appstats

item Type: object

├─ name string No
├─ version string No
├─ status string No
├─ cause string No
├─ instances object No
├─key(instance name) object No
├─ name string No
├─serviceName string No
├─ status string No
├─ cause string No
├─ createTime string No
├─ usage object No
├─ cpu string No
├─ memory string No
├─ core object No baetyl-core info
├─ goVersion string No golang version
├─ binVersion string No current version
├─ gitRevision string No git version

Create Node

Basic Information

Path: /v1/nodes

Method: POST

Interface description:
unnecessary to check returned report and desire

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Body

Name Type Necessary Default Value Remarks Additional Information
name string No node name
labels object No labels
annotations object No annotations, type of map[string]string, for storing attributes of brand
├─ brand string No brand example
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No node name
namespace string No namespace
description string No description
ready boolean No whether device is connected
createTime string No created time
labels object No labels
annotations object No annotations
├─ brand string No

Update Node

Basic Information

Path: /v1/nodes/{name}

Method: PUT

Interface description:
unnecessary to check returned report and desire

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name node name

Body

Name Type Necessary Default Value Remarks Additional Information
labels object No labels
annotatins object No annotations,type of map[string]string
├─ brand string No brand is just an example
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No node name
namespace string No namespace
description string No description
ready boolean No whether device is connected
createTime string No CreatedTime
labels object No labels
annotations object No annotations
├─ brand string No

Delete Node

Basic Information

Path: /v1/nodes/{name}

Method: DELETE

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name node-1 node name

Response

Name Type Necessary Default Value Remarks Additional Information
success boolean No whether delete successfully

Query Binding Applications of Node

Basic Information

Path: /v1/nodes/{name}/apps

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name

Response

Name Type Necessary Default Value Remarks Additional Information
total number No total of applications
listOptions null No list options
items object [] No applications list

item Type: object

├─ name string Yes application name
├─ selector string Yes label selector
├─ namespace string Yes namespace
├─ createTime string Yes created time

Get Installation Command

Basic Information

Path: /v1/nodes/:name/init

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name node name

Response

Name Type Necessary Default Value Remarks Additional Information
cmd string Yes installation command

Node Provision

Download Registration Information

Basic Information

Path: /v1/register/:batchName/download

Method: GET

Interface description:
Used to download all the registration records contained in a product batch
Binary data is returned in a normal response, and the error returns the following structure error message:
{
    "code": "ResourceNotFound",
    "message": "The (batch) resource (0513021) is not found.",
    "request-id": "a14fd53d-f3ea-4edb-bef2-b183b9ed0b87"
}

Request Parameters

path parameters

Parameter Name Example Remarks
batchName r0 product name

Response

{"type":"object","title":"title","properties":{}}

Create Product

Basic Information

Path: /v1/register

Method: POST

Interface description:
Create a product that can be used for batch device registration management. Provide multiple activation methods

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Body

Name Type Necessary Default Value Remarks Additional Information
name string No name
securityType string No Token verification method(None/Token)
fingerprint object No activation method information
├─ type integer No 1 activation method,sn=1,input=2,hostname=4,bootid=8,systemuuid=16,machineid=32
├─ snPath string No /var/lib/baetyl/sn/fingerprint.txt when sn is selected, the path and name of the activation file. Note that you need to use an absolute path
├─ inputField string No sn when input is selected, the field name obtained.
description string No description
enableWhitelist integer No 1 whether to enable pre-registration, open by default
quotaNum integer No 200 quantitative restrictions
securityKey string No corresponding to the key of the verification method, if the user-defined token is empty, it will be generated by the system
callbackName string No callback name
labels object No labels are key/value pairs that are attached to this object,after activation, set to the corresponding node

Response

Name Type Necessary Default Value Remarks Additional Information
name string Yes
quotaNum integer Yes
enableWhitelist integer Yes
securityType string Yes
securityKey string No
callbackName string No
labels object Yes
fingerprint object Yes
├─ type integer Yes
├─ snPath string No
├─ inputField string No
description string No
createTime string Yes
updateTime string Yes

List Product

Basic Information

Path: /v1/register

Method: GET

Interface description:
Get the list of products that have been created, support paging query and filter query by name

Request Parameters

Query

Parameter Name Necessary Example Remarks
pageNo Yes
pageSize Yes
name Yes

Response

Name Type Necessary Default Value Remarks Additional Information
total number No
pageNo number Yes
pageSize number Yes
items object [] No

item Type: object

├─ name string No
├─ createTime string No
├─ updateTime string No
├─ quotaNum number No
├─ securityType string No
├─ callbackName string No
├─ description string No

Get Product

Basic Information

Path: /v1/register/:batch

Method: GET

Interface description:
Get detailed information about a product

Request Parameters

path parameters

Parameter Name Example Remarks
batch product001 product name

Response

Name Type Necessary Default Value Remarks Additional Information
name string Yes
quotaNum number Yes
enableWhitelist number Yes
securityType string Yes
labels object Yes
fingerprint object No
├─ type number Yes
├─ snPath string No
├─ inputField string No
createTime string Yes
updateTime string Yes
securityKey string No
callbackName string No
description string No

Delete Product

Basic Information

Path: /v1/register/:batch

Method: DELETE

Interface description:
 Delete a specified product, if there is a registration record whether activated or not, it cannot be deleted

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
batch product001 product name

Response

Name Type Necessary Default Value Remarks Additional Information

Update Product

Basic Information

Path: /v1/register/:batch

Method: PUT

Interface description:
Update some information of a product

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
batch

Body

Name Type Necessary Default Value Remarks Additional Information
quotaNum number No
labels object No
fingerprint object No
├─ snPath string No
├─ type integer No
├─ inputField string No
callbackName string No
description string No

Response

Name Type Necessary Default Value Remarks Additional Information
name string No
quotaNum number No
enableWhitelist number No
securityType string No
labels object No
fingerprint object No
├─ type number No
├─ snPath string No
├─ inputField string No
createTime string No
updateTime string No
securityKey string No
callbackName string No
description string No

Get Installation Commands

Basic Information

Path: /v1/register/:batch/init

Method: GET

Interface description:
Generate an online installation command, copy the online command and execute it on the terminal to install

Request Parameters

path parameters

Parameter Name Example Remarks
batch

Response

Name Type Necessary Default Value Remarks Additional Information
cmd string Yes

Create Registration Record

Basic Information

Path: /v1/register/:batchName/record

Method: POST

Interface description:
Add a registration record

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
batchName

Body

Name Type Necessary Default Value Remarks Additional Information
name string No
fingerprintValue string No fingerprint information, used for comparison when activated
nodeName string No

Response

Name Type Necessary Default Value Remarks Additional Information
name string Yes
batchName string Yes
namespace string Yes
fingerprintValue string Yes
active integer Yes whether it has been activated. 1 means activated, 0 means not activated
nodeName string Yes
activeIp string Yes
createTime string Yes
updateTime string Yes

Automatically Generate Registration Records

Basic Information

Path: /v1/register/:batchName/generate

Method: POST

Interface description:
Automatically generate and insert multiple registration records

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
batchName

Body

Name Type Necessary Default Value Remarks Additional Information
num number Yes

Response

Name Type Necessary Default Value Remarks Additional Information
items string [] No

item Type: string

├─ No
total number No

List Registration Records

Basic Information

Path: /v1/register/:batchName/record

Method: GET

Interface description:
Get a list of registration records, you can page query and filter query

Request Parameters

path parameters

Parameter Name Example Remarks
batchName

Query

Parameter Name Necessary Example Remarks
pageNo Yes
pageSize Yes
name Yes

Response

Name Type Necessary Default Value Remarks Additional Information
total number No
pageNo number Yes
pageSize string Yes
items object [] No

item Type: object

├─ name string No
├─ batchName string No
├─ namespace string No
├─ fingerprintValue string No
├─ active number No
├─ nodeName string No
├─ activeIp string No
├─ createTime string No
├─ updateTime string No

Get Registration Records

Basic Information

Path: /v1/register/:batchName/record/:recordName

Method: GET

Interface description:
Get the data of a specified registration record

Request Parameters

path parameters

Parameter Name Example Remarks
batchName
recordName

Response

Name Type Necessary Default Value Remarks Additional Information
name string Yes
batchName string Yes
namespace string Yes
fingerprintValue string Yes
active number Yes
nodeName string Yes
activeIp string Yes
createTime string Yes
updateTime string Yes

Update Registration Records

Basic Information

Path: /v1/register/:batchName/record/:recordName

Method: PUT

Interface description:
Update the information of a specified registration record

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
batchName
recordName

Body

Name Type Necessary Default Value Remarks Additional Information
nodeName string No

Response

Name Type Necessary Default Value Remarks Additional Information
name string No
batchName string No
namespace string No
fingerprintValue string No
active number No
nodeName string No
activeIp string No
createTime string No
updateTime string No

Delete Registration Records

Basic Information

Path: /v1/register/:batchName/record/:recordName

Method: DELETE

Interface description:
Delete a specified registration record

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
batchName
recordName

Response

Name Type Necessary Default Value Remarks Additional Information

Application Management

Update Application

Basic Information

Path: /v1/apps/{name}

Method: PUT

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name

Body

Name Type Necessary Default Value Remarks Additional Information
selector string No node selector
labels object No labels
description string No description
services object [] No services list

item Type: object

├─ name string No service name
├─ labels object No labels,type of map[string]string
├─ image string No image, necessary for container application,auto filled for function application
├─ hostname string No hostname
├─ number No instance counts
├─volumeMounts object [] No volume mount list,1. auto completed for function application, 2. for a list of functions, the back end needs to convert it to a configuration and then mount it too

item Type: object

├─ name string No volume mount name
├─ mountPath string No mount path
├─ readOnly boolean No whether read only
├─ immutable boolean No whether user can edit
├─ ports object [] No port mapping list

item Type: object

├─ hostPort integer No host port the service can be accessed through this port on the host where the service resides, ranging from 0 to 65535
├─ containerPort integer No container port the port on which the service is exposed, through which other services started by baetyl can access the service, ranging from 0 to 65535
├─ hostIP string No host IP host IP to bind the external port
├─ protocol string No protocol protocol for port, should be TCP or UDP, default to TCP
├─ devices object [] No device mount list(not support yet,can implement by using hostPath + privileged)

item Type: object

├─ devicePath string No devicePath + ":"+policy
├─ policy string No not support yest;read-write policy r:read-only;rw:read-write, w:write-only, m:mknod
├─ description string No not support yes
├─ args string [] No boot arguments

item Type: string

├─ No
├─ env object [] No environmnet varible

item Type: object

├─ name string No variable name
├─ value string No varible value
├─ resources object No
├─ limits object No available resources,type of map,key can be cpu,memory
├─ cpu string No cpu capacity,integer or decimal
├─ memory string No memory capacity,value format: 50M or 50Mi or 1024
├─ requests object No resource request,key can be cpu,memory
├─ cpu string No cpu request,integer or decimal
├─ memory string No memory request,value format: 50M or 50Mi or 1024
├─ runtime string No runtime,not supported temporally
├─ restart object No restart policy, not supported temporally
├─ retry object No
├─ max number No
├─ policy string No Always-always restart; OnFailure - restart on failure ;Never - nerver restart
├─ backoff object No
├─ min integer Yes
├─ max integer Yes
├─ factor number Yes
├─ functionConfig object No function configuration
├─ name string No function configuration, necessary for function application
├─ runtime string No runtime of function configuration,necessary for function application
├─ functions object [] No function list

item Type: object

├─ name string No function name,necessary for function application
├─ handler string No function entrypoint, necessary for function application
├─ codedir string No path of code,(PRD)function entry files which are located in relative directories under "function package"
├─ security object No security option
├─ privileged boolean No privilege mode
├─ hostNetwork boolean No host network
volumes object [] No volume list

item Type: object

├─ name string No volume mount name,necessary/span>
├─ hostPath object No host path mappping
├─ path string No host path
├─ config object No configuration
├─ name string No configuration name
├─ secret object No secret
├─ name string No secret name
registries object [] No image repository credential,map[string]{"name":""}

item Type: object

├─ name string No credential name

Response

Name Type Necessary Default Value Remarks Additional Information
name string No application name
namespace string No namespace
selector string No node selector
labels object No labels
description string No description
version string No version
services object [] No services list

item Type: object

├─ name string No service name
├─ image string Yes image
├─ replica number No intance counts if hostPort is configured, replica can not greater than 1
├─volumeMounts object No volume mounts list
├─ name string No volume mount name
├─ mountPath string No mount path
├─ readOnly boolean No whether read only
├─ immutable boolean No whether user can edit, false by default,user can not edit when it's set true
├─ restart object No restart policy,not supported temporally
├─ retry object No
├─ backoff object No
├─ resources object No resource limit
├─ limits object No available resource
├─ cpu string No cpu capacity
├─ memory string No memory capacity
├─ requests object No resource request
├─ cpu string No cpu request
├─ memory string No memory request
├─ hostname string No hostname
├─ ports object [] No port mapping list

item Type: object

├─ hostPort integer No host port the service can be accessed through this port on the host where the service resides, ranging from 0 to 65535
├─ containerPort integer No container port the port on which the service is exposed, through which other services started by baetyl can access the service, ranging from 0 to 65535
├─ devices object [] No device mount list(not supported yet)

item Type: object

├─ devicePath string No device path
├─ args string [] No boot arguments

item Type: string

├─ No
├─ env object [] No environmnet variable

item Type: object

├─ name string No varible name
├─ value string No varible value
├─ functionConfig object No function configuration
├─ name string No function configuration name
├─ runtime string No runtime of function configuration
├─ functions object [] No function list

item Type: object

├─ name string No function name
├─ handler string No function entry
├─ codedir string No path of code
├─ security object No security options
├─ privileged boolean No privilege mode
├─ hostNetwork boolean No host network
volumes object [] No volume list

item Type: object

├─ name string No volume mount name
├─ config object No configuration
├─ name string No configuration name
├─ hostPath object No host path mapping
├─ path string No host path
registries object [] No image repository credential list

item Type: object

├─ name string No credential name
├─ version string No credential version
type string Yes type of application:container application, function application, for container and function

Delete Application

Basic Information

Path: /v1/apps/{name}

Method: DELETE

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name application name

Body

Name Type Necessary Default Value Remarks Additional Information

Response

Name Type Necessary Default Value Remarks Additional Information
success boolean Yes whether delete successfully

Create Application

Basic Information

Path: /v1/apps

Method: POST

Interface description:
for function applications, a configuration will be added to the service by default
name: baetyl-function-code-<configuration name>
Type:configuration
read-only
path: /var/lib/baetyl/code

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Query

Parameter Name Necessary Example Remarks
from No
base No

Body

Name Type Necessary Default Value Remarks Additional Information
name string Yes application name
selector string No node selector
labels object Yes labels
description string Yes description
services object [] Yes service list

item Type: object

├─ name string No service name
├─ labels object No labels, type of map[string]string
├─ image string No image,necessary for container application, auto filled for function application
├─ hostname string No hostname
├─ replica number No instance count if hostPort is configured, replica can not greater than 1
├─ volumeMounts object [] No volume mount list,1. auto completed for function application, 2. for a list of functions, the back end needs to convert it to a configuration and then mount it too

item Type: object

├─ name string No volume mount name
├─ mountPath string No mount path
├─ readOnly boolean No whether read-only
├─ immutable boolean No whether user can edit, false by default, when it set true, user can not edit
├─ ports object [] No port mapping list

item Type: object

├─ hostPort integer No host port the service can be accessed through this port on the host where the service resides, ranging from 0 to 65535
├─ containerPort integer No container port the port on which the service is exposed, through which other services started by baetyl can access the service, ranging from 0 to 65535
├─ hostIP string No host IP host IP to bind the external port
├─ protocol string No protocol protocol for port, should be TCP or UDP, default to TCP
├─ devices object [] No device mapping(not support yet, can implement by using hostPath and privileged)

item Type: object

├─ devicePath string No devicePath + ":"+policy
├─ policy string No not support yet, read-write policy r:read-only;rw:read-write, w:write-only, m:mknod
├─ description string No not support yet
├─ args string [] No boot arguments

item Type: string

├─ No
├─ env object [] No environmnet varible

item Type: object

├─ name string No varible name
├─ value string No varible value
├─ resources object No resource limits
├─ limits object No available resource,type of map,key can be cpu,memory
├─ cpu string No avaible cpu,integer or decimal
├─ memory string No available memory, value format: 50M or 50Mi or 1024
├─ requests object No resource request, type of map,key can be cpu,memory
├─ cpu string No request cpu,integer or decimal
├─ memory string No request memory,value format: 50M or 50Mi or 1024
├─ runtime string No runtime(not support yet)
├─ restart object No restart policy (not support yet)
├─ retry object No
├─ max number No
├─ policy string No Always-always restart; OnFailure - restart on failure ;Never - nerver restart
├─ backoff object No
├─ min integer Yes
├─ max integer Yes
├─ factor number Yes
├─ functionConfig object No function configuration
├─ name string No function configuration, necessary for function application
├─ runtime string No runtime of function configuration, necessary for function application
├─ functions object [] No function list, could be empty

item Type: object

├─ name string No function name,necessary for function application
├─ handler string No function entry, necessary for function application
├─ codedir string No path of code,(PRD)function entry files which are located in relative directories under "function package"
├─ security object No security options
├─ privileged boolean No privilege mode
├─ hostNetwork boolean No host network
volumes object [] No volume

item Type: object

├─ name string Yes volume mount name
├─ hostPath object No host path mapping
├─ path string No host path
├─ config object No configuration
├─ name string No configuration name
├─ secret object Yes secret
├─ name string No secret name
registries object [] No image repository credential,map[string]{"name":""}

item Type: object

├─ name string Yes credential name
type string Yes type of application:container application、function application,for container and function relatively

Response

Name Type Necessary Default Value Remarks Additional Information
name string No application name
namespace string No namespace
selector string No node selector
description string No description
version string No version
services object [] No service list

item Type: object

├─ name string No service name
├─ image string No image
├─ replica number No instance counts if hostPort is configured, replica can not greater than 1
├─ volumeMounts object No volume mount list
├─ name string No volume mount name
├─ mountPath string No mount path
├─ readOnly boolean No whether read-only
├─ immutable boolean No whether user can edit, false by default, when it set true, user can not edit
├─ restart object No restart policy (not support yet)
├─ retry object No
├─ backoff object No
├─ resources object No resource limits
├─ limits object No available resource
├─ cpu string No available cpu
├─ memory string No available memory
├─ requests object No resource request
├─ cpu string No cpu requeset
├─ memory string No request memory
├─ hostname string No hostname
├─ ports object [] No port list

item Type: object

├─ hostPort integer No host port the service can be accessed through this port on the host where the service resides, ranging from 0 to 65535
├─ containerPort integer No container port the port on which the service is exposed, through which other services started by baetyl can access the service, ranging from 0 to 65535
├─ devices object [] No device mapping(not support yet, can implement by using hostPath and privileged)

item Type: object

├─ devicePath string No device path
├─ args string [] No boot arguments

item Type: string

├─ No
├─ env object [] No environmnet varible

item Type: object

├─ name string No varible name
├─ value string No varible name
├─ functionConfig object No function configuration
├─ name string No function configuration name
├─ runtime string No runtime of function configuration
├─ functions object [] No function list

item Type: object

├─ name string No function name
├─ handler string No function entry
├─ codedir string No path of code
├─ security object No security options
├─ privileged boolean No privilege mode
├─ hostNetwork boolean No host network
volumes object [] No volume list

item Type: object

├─ name string Yes volume mount name
├─ config object Yes configuration
├─ name string No configuration name
├─ hostPath object Yes host path mapping
├─ path string No host path
├─ secret object Yes secret
├─ name string Yes secret name
registries object [] No image repository credential

item Type: object

├─ name string No credential name
type string Yes type of application: container application、function application,for container and function relatively
createTime string No created time

Query Application

Basic Information

Path: /v1/apps/{name}

Method: GET

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name

Body

Name Type Necessary Default Value Remarks Additional Information
name string Yes
selector string No
labels object Yes
description string Yes
services object [] Yes

item Type: object

├─ name string No
├─ labels object No map[string]string
├─ image string No necessary for container application
├─ hostname string No
├─ replica number No if hostPort is configured, replica can not greater than 1
├─ volumeMounts object [] No

item Type: object

├─ name string No
├─ mountPath string No
├─ readOnly boolean No
├─ ports object [] No

item Type: object

├─ hostPort integer No the service can be accessed through this port on the host where the service resides, ranging from 0 to 65535
├─ containerPort integer No the port on which the service is exposed, through which other services started by baetyl can access the service, ranging from 0 to 65535
├─ hostIP string No host IP to bind the external port
├─ protocol string No protocol for port, should be TCP or UDP, default to TCP
├─ devices object [] No

item Type: object

├─ devicePath string No devicePath + ":"+policy
├─ policy string No not support yet;read-write policy r:read-only;rw:read-write, w:write-only, m:mknod
├─ description string No not support yet
├─ args string [] No

item Type: string

├─ No
├─ env object [] No

item Type: object

├─ name string No
├─ value string No
├─ resources object No
├─ limits object No type of map,key can be cpu,memory
├─ cpu string No integer or decimal
├─ memory string No value format: 50M or 50Mi or 1024
├─ requests object No type of map,key can be cpu,memory
├─ cpu string No integer or decimal
├─ memory string No value format: 50M or 50Mi or 1024
├─ runtime string No
├─ restart object No
├─ retry object No
├─ max number No
├─ policy string No Always-always restart; OnFailure - restart on failure ;Never - nerver restart
├─ backoff object No
├─ min integer Yes
├─ max integer Yes
├─ factor number Yes
├─ function object No
├─ config string No function configuration name, necessary for function application
├─ runtime string No runtime of function configuration, necessary for function application
├─ items object [] No can not be empty for function application

item Type: object

├─ name string No function name, necessary for function application
├─ handler string No function entry, necessary for function application
├─ path string No directory of container,necessary for function application
volumes object [] No

item Type: object

├─ name string Yes
├─ hostPath object No
├─ path string No
├─ config object No
├─ name string No
├─ secret object Yes
├─ name No
registries object [] No map[string]{"name":""}

item Type: object

├─ name string Yes
security object No security options
├─ privileged boolean No privilege mode
hostNetwork boolean No host network
type string Yes type of application: container application and function application

Response

Name Type Necessary Default Value Remarks Additional Information
name string No application name
namespace string No namespace
select string No node selector
description string No description
version string No version
services object [] No service list

item Type: object

├─ name string No application name
├─ image string Yes image name
├─ replica number No instance counts if hostPort is configured, replica can not greater than 1
├─ volumeMounts object [] No volume mount list,1. auto completed for function application, 2. for a list of functions, the back end needs to convert it to a configuration and then mount it too

item Type: object

├─ name string Yes volume mount name
├─ mountPath string Yes mount path
├─ readOnly boolean No whether read-only
├─ immutable boolean No whether user can edit, false by default, when is set true user can not edit
├─ restart object No restart policy (not support yet)
├─ retry object No
├─ backoff object No
├─ resources object No resource limits
├─ limits object No available resource
├─ cpu string No cpu capacity
├─ memory string No memory capacity
├─ requests object No resource request
├─ cpu string No request cpu
├─ memory string No memory request
├─ hostname string No hostname
├─ ports object [] No port mapping list

item Type: object

├─ hostPort integer No host port the service can be accessed through this port on the host where the service resides, ranging from 0 to 65535
├─ containerPort integer No container port the port on which the service is exposed, through which other services started by baetyl can access the service, ranging from 0 to 65535
├─ devices object [] No device mapping (not support yet, can implement by using hostPath and privileged)

item Type: object

├─ devicePath string No device path
├─ args string [] No boot arguments

item Type: string

├─ No
├─ env object [] No environmnet varible

item Type: object

├─ name string No varible name
├─ value string No varible value
├─ functionConfig object No function configuration
├─ name string No function configuration name
├─ runtime string No runtime of function configuration
├─ functions object [] No function list

item Type: object

├─ name string No function name
├─ handler string No function entry
├─ codedir string No path of code
├─ security object No security options
├─ privileged boolean No privilege mode
├─ hostNetwork boolean No host network
volumes object [] No volume list

item Type: object

├─ name string Yes volume mount name
├─ config object Yes configuration
├─ name string No configuration name
├─ hostPath object Yes host path mapping
├─ path string No host path
├─ secret object Yes secret
├─ name string Yes secret name
registries object [] No image repository credential

item Type: object

├─ name string No credential name
type string Yes type of application:container application、function application
createTime string No created time

List Application

Basic Information

Path: /v1/apps

Method: GET

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Query

Parameter Name Necessary Example Remarks
selector No abc=test selector
fieldSelector No metadata.name=test field selector
limit No 10 total of query
continue No qwertyuhgfdsasdfghjkjd whether continue to query

Body

Name Type Necessary Default Value Remarks Additional Information

Response

Name Type Necessary Default Value Remarks Additional Information
name string No application name
namespace string No namespace
selector string No node selector
description string No description
version string No version
createTime string No created time
labels object No labels
type string Yes type of application:function application, container application,for container and function

Configuration Management

Update Configuration

Basic Information

Path: /v1/configs/{name}

Method: PUT

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Configuration Name

Body

Name Type Necessary Default Value Remarks Additional Information
labels object No Labels are key/value pairs that are attached to this object
data object [] No Configuration Data

item Type: object

├─ key string No key
├─ value object No value
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
labels object No Labels are key/value pairs that are attached to this object
data object [] No Configuration Data

item Type: object

├─ key string No key
├─ value object No value
description string No Description
namespace string No Namespace
createTime string No CreatedTime
updateTime string No UpdatedTime
version string No Version

Create Configuration

Basic Information

Path: /v1/configs

Method: POST

Interface description:
For the data field of configuration item data, key is the file name and value is the file information. According to the "type" field in value, it is divided into kv type, file type, and function type:

kv type:

{
    "type": "kv",
    "value":"content"
}

file type:

{
    "type": "object",
    "source":"awss3",
    "endpoint":"http://xx.xx.com",
    "bucket":"baetyl",
    "object":"func.zip",
    "unpack":"zip",
    "ak":"xx",
    "sk":"xx",
    "md5": "xxxx"
}

tips: the enumerated values of bos, minio and awss3 are baidubos, minio, awss3

function type:

{
    "type": "function",
    "function":"process",
    "version":"1",
    "runtime":"python36",
    "handler": "index.handler",
    "bucket":"baetyl-cloud-xx",
    "object":"process.zip",
    "source":"baidubos",
    "unpack": "zip"
}

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Body

Name Type Necessary Default Value Remarks Additional Information
name string Yes Name
labels object No Labels are key/value pairs that are attached to this object
data object [] No Configuration Data

item Type: object

├─ key string No key
├─ value object No value
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
labels object No Labels are key/value pairs that are attached to this object
data object [] No Configuration Data

item Type: object

├─ key string No key
├─ value object No value
description string No Description
namespace string No Namespace
createTime string No CreatedTime
updateTime string No UpdatedTime
version string No Version

Delete Configuration

Basic Information

Path: /v1/configs/{name}

Method: DELETE

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Configuration Name

Response

Name Type Necessary Default Value Remarks Additional Information
success boolean No

Get Configuration

Basic Information

Path: /v1/configs/{name}

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name Configuration Name

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
labels object No Labels are key/value pairs that are attached to this object
data object [] No Configuration Data

item Type: object

├─ key string No key
├─ value object No value
description string No Description
namespace string No Namespace
createTime string No CreatedTime
updateTime string No UpdatedTime
version string No Version

Get Related Apps

Basic Information

Path: /v1/configs/{name}/apps

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name Configuration Name

Response

Name Type Necessary Default Value Remarks Additional Information
total number No Total amount
listOptions object No Query Options
├─ selector string No Label Selector
├─ fieldSelector string No Field Selector
├─ limit integer No limit
├─ continue string No
items object [] No App List

item Type: object

├─ name string No App Name
├─ labels object No App Labels
├─ description string No App Description
├─ namespace string No App Namespace
├─ createTime string No CreatedTime
├─ version string No Version
├─ type string No App Type
├─ selector string No Node Selector

List Configuration

Basic Information

Path: /v1/configs

Method: GET

Interface description:

Request Parameters

Query

Parameter Name Necessary Example Remarks
selector No abc=test To get function configuration, use Label Selector: ?selector=baetyl-function
fieldSelector No metadata.name=test Label Selector
limit No limit
continue No

Response

Name Type Necessary Default Value Remarks Additional Information
total number No Total amount
listOptions object No Query Options
├─ selector string No Label Selector
├─ fieldSelector string No Field Selector
├─ limit integer No limit
├─ continue string No
items object [] No Configuration List

item Type: object

├─ name string No Configuration Name
├─ labels object No Configuration Labels
├─ description string No Description
├─ namespace string No Namespace
├─ createTime string No CreatedTime
├─ updateTime string No UpdatedTime
├─ version string No Version

Secret Management

Update Secret

Basic Information

Path: /v1/secrets/{name}

Method: PUT

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Secret Name

Body

Name Type Necessary Default Value Remarks Additional Information
data object No Secret Data
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
data object No Secret Data
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Create Secret

Basic Information

Path: /v1/secrets

Method: POST

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Body

Name Type Necessary Default Value Remarks Additional Information
name string Yes Name
data object No Secret Data
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
data object No Secret Data
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Delete Secret

Basic Information

Path: /v1/secrets/{name}

Method: DELETE

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Secret Name

Response

Name Type Necessary Default Value Remarks Additional Information
success boolean No

Get Secret

Basic Information

Path: /v1/secrets/{name}

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name Secret Name

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
data object No Secret Data
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Get Related Apps

Basic Information

Path: /v1/secrets/{name}/apps

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name Secret Name

Response

Name Type Necessary Default Value Remarks Additional Information
total number No Total amount
listOptions object No Query Options
├─ selector string No Label Selector
├─ fieldSelector string No Field Selector
├─ limit integer No limit
├─ continue string No
items object [] No App List

item Type: object

├─ name string No App Name
├─ labels object No App Labels
├─ description string No App Description
├─ namespace string No App Namespace
├─ createTime string No CreatedTime
├─ version string No Version
├─ type string No App Type
├─ selector string No Node Selector

List Secrets

Basic Information

Path: /v1/secrets

Method: GET

Interface description:

Request Parameters

Query

Parameter Name Necessary Example Remarks
fieldSelector No metadata.name=test Field Selector
selector No Label Selector
limit No limit
continue No

Response

Name Type Necessary Default Value Remarks Additional Information
total number No Total amount
listOptions object No Query Options
├─ selector string No Label Selector
├─ fieldSelector string No Field Selector
├─ limit integer No limit
├─ continue string No
items object [] No List

item Type: object

├─ name string No Secret Name
├─ namespace string No Namespace
├─ createTime string No CreatedTime
├─ updateTime string No UpdatedTime
├─ description string No Description
├─ version string No Version

Registry Management

Update Description

Basic Information

Path: /v1/registries/{name}

Method: PUT

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Registry Name

Body

Name Type Necessary Default Value Remarks Additional Information
description string No Description

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
address string No Registry Address
username string No Username
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Create Registry

Basic Information

Path: /v1/registries

Method: POST

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

Body

Name Type Necessary Default Value Remarks Additional Information
name string No Name
description string No Description
address string No Registry Address
username string No Username
password string No Password

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
address string No Registry Address
username string No Username
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Delete Registry

Basic Information

Path: /v1/registries/{name}

Method: DELETE

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Registry Name

Response

Name Type Necessary Default Value Remarks Additional Information
success boolean No Success Flag

Get Registry

Basic Information

Path: /v1/registries/{name}

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name Registry Name

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
address string No Registry Address
username string No Username
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Get Related Registry

Basic Information

Path: /v1/registries/{name}/apps

Method: GET

Interface description:

Request Parameters

path parameters

Parameter Name Example Remarks
name Registry Name

Response

Name Type Necessary Default Value Remarks Additional Information
total number No Total amount
listOptions object No Query Options
├─ selector string No Label Selector
├─ fieldSelector string No Field Selector
├─ limit integer No limit
├─ continue string No
items object [] No App List

item Type: object

├─ name string No App Name
├─ labels object No App Labels
├─ description string No App Description
├─ namespace string No App Namespace
├─ createTime string No CreatedTime
├─ version string No Version
├─ type string No App Type
├─ selector string No Node Selector

List Registry

Basic Information

Path: /v1/registries

Method: GET

Interface description:

Request Parameters

Query

Parameter Name Necessary Example Remarks
fieldSelector No metadata.name=test Field Selector
selector No Label Selector
limit No limit
continue No

Response

Name Type Necessary Default Value Remarks Additional Information
total number No Total amount
listOptions object No Query Options
├─ selector string No Label Selector
├─ fieldSelector string No Field Selector
├─ limit integer No limit
├─ continue string No
items object [] No List

item Type: object

├─ name string No Name
├─ namespace string No Namespace
├─ address string No Registry Address
├─ username string No Username
├─ createTime string No CreatedTime
├─ updateTime string No UpdatedTime
├─ description string No Description
├─ version string No Version

Reset Password

Basic Information

Path: /v1/registries/{name}/refresh

Method: POST

Interface description:

Request Parameters

Headers

Parameter Name Parameter Value Necessary Example Remarks
Content-Type application/json Yes

path parameters

Parameter Name Example Remarks
name Registry Name

Body

Name Type Necessary Default Value Remarks Additional Information
password string No Password

Response

Name Type Necessary Default Value Remarks Additional Information
name string No Name
namespace string No Namespace
address string No Registry Address
username string No Username
createTime string No CreatedTime
updateTime string No UpdatedTime
description string No Description
version string No Version

Build by YMFE.