Add Machine
Requests
HTTP request
POST /apis/platform.tkestack.io/v1/machines
create a Machine
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dryRun | string | False | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
| fieldManager | string | False | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. |
| pretty | string | False | If 'true', then the output is pretty printed. |
Request body
Content-Type
*/*
Sample request
Machine instance in Kubernetes cluster
{
"apiVersion": "platform.tkestack.io/v1",
"kind": "Machine",
"metadata": {
"annotations": {
"cpaas.io/display-name": "192.168.0.105"
},
"name": "mc-192-168-0-105"
},
"spec": {
"clusterName": "global",
"displayName": "",
"ip": "192.168.0.105",
"ipv6": "",
"networkDevice": "",
"password": "cGFzc3dvcmQ=",
"port": 22,
"proxy": {},
"publicIP": "",
"role": "",
"type": "Baremetal",
"username": "root"
}
}Parmeters
| Name | Type | Required | Description |
|---|---|---|---|
| apiVersion | string | True | See common parameters |
| kind | string | True | See common parameters |
| metadata | object | True | See common parameters |
| spec | object | True |
MachineSpec is a description of machine.
Path: spec |
| spec.clusterName | string | True |
cluster name
Path: spec.clusterName |
| spec.displayName | string | True |
displayName
Path: spec.displayName |
| spec.ip | string | True |
ip
Path: spec.ip |
| spec.ipv6 | string | True |
ipv6
Path: spec.ipv6 |
| spec.networkDevice | string | True |
networkDevice
Path: spec.networkDevice |
| spec.password | string (byte) | True |
password
Path: spec.password |
| spec.port | integer (int32) | True |
port
Path: spec.port |
| spec.proxy | object | True |
MachineProxy is the proxy to connect Machine's ssh.
Path: spec.proxy |
| spec.publicIP | string | True |
publicIP
Path: spec.publicIP |
| spec.role | string | True |
master/node
Path: spec.role |
| spec.type | string | True |
type
Path: spec.type |
| spec.username | string | True |
user name
Path: spec.username |
Responses
Content-Type
application/json,
application/yaml,
application/vnd.kubernetes.protobuf
Status code: 201
Created
Sample response
Machine instance in Kubernetes cluster
{
"apiVersion": "platform.tkestack.io/v1",
"kind": "Machine",
"metadata": {
"annotations": {
"cpaas.io/display-name": "192.168.0.105"
},
"creationTimestamp": "2021-06-25T02:25:45Z",
"name": "mc-192-168-0-105",
"resourceVersion": "100232",
"selfLink": "/apis/platform.tkestack.io/v1/machines/mc-192-168-0-105",
"uid": "719f0a5b-a730-41e3-8c15-1572625b3f23"
},
"spec": {
"clusterName": "global",
"displayName": "",
"finalizers": [
"machine"
],
"ip": "192.168.0.105",
"ipv6": "",
"networkDevice": "",
"password": "cGFzc3dvcmQ=",
"port": 22,
"proxy": {},
"publicIP": "",
"role": "",
"type": "Baremetal",
"username": "root"
},
"status": {
"phase": "Initializing"
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| kind | string | See common parameters |
| metadata | object | See common parameters |
| spec | object |
MachineSpec is a description of machine.
Path: spec |
| spec.clusterName | string |
cluster name
Path: spec.clusterName |
| spec.displayName | string |
displayName
Path: spec.displayName |
| spec.finalizers | array |
Finalizers is an opaque list of values that must be empty to permanently remove object from storage.
Path: spec.finalizers |
| spec.finalizers[] | string |
Path: spec.finalizers[] |
| spec.ip | string |
ip
Path: spec.ip |
| spec.ipv6 | string |
ipv6
Path: spec.ipv6 |
| spec.networkDevice | string |
networkDevice
Path: spec.networkDevice |
| spec.password | string (byte) |
password
Path: spec.password |
| spec.port | integer (int32) |
port
Path: spec.port |
| spec.proxy | object |
MachineProxy is the proxy to connect Machine's ssh.
Path: spec.proxy |
| spec.publicIP | string |
publicIP
Path: spec.publicIP |
| spec.role | string |
master/node
Path: spec.role |
| spec.type | string |
type
Path: spec.type |
| spec.username | string |
user name
Path: spec.username |
| status | object |
MachineStatus represents information about the status of an machine.
Path: status |
| status.phase | string |
machine phase
Path: status.phase |