BareMetal API, REST: Server.Create
Creates a server in the specified folder.
HTTP request
POST https://baremetal.api.yandexcloud.kz/baremetal/v1alpha/servers
Body parameters
{
"folderId": "string",
"name": "string",
"description": "string",
"hardwarePoolId": "string",
"configurationId": "string",
"rentalPeriodId": "string",
"networkInterfaces": [
{
// Includes only one of the fields `privateSubnet`, `publicSubnet`
"privateSubnet": {
"privateSubnetId": "string"
},
"publicSubnet": {
"publicSubnetId": "string"
},
// end of the list of possible fields
// Includes only one of the fields `privateInterface`, `publicInterface`
"privateInterface": {
"nativeSubnetId": "string",
"ipAddress": "string",
"macLimit": "string",
"vlanSubinterfaces": [
{
"taggedSubnetId": "string",
"ipAddress": "string",
"macLimit": "string"
}
]
},
"publicInterface": {
// Includes only one of the fields `nativeSubnet`, `newNativeSubnet`
"nativeSubnet": {
"subnetId": "string"
},
"newNativeSubnet": {
"addressingType": "string"
},
// end of the list of possible fields
"ipAddress": "string",
"nativeSubnetId": "string",
"macLimit": "string"
},
// end of the list of possible fields
"id": "string"
}
],
"osSettingsSpec": {
// Includes only one of the fields `sshPublicKey`, `userSshId`
"sshPublicKey": "string",
"userSshId": "string",
// end of the list of possible fields
// Includes only one of the fields `passwordPlainText`, `passwordLockboxSecret`
"passwordPlainText": "string",
"passwordLockboxSecret": {
"secretId": "string",
"versionId": "string",
"key": "string"
},
// end of the list of possible fields
"imageId": "string",
"storages": [
{
// Includes only one of the fields `disk`, `raid`
"disk": {
"id": "string",
"type": "string",
"sizeGib": "string"
},
"raid": {
"type": "string",
"disks": [
{
"id": "string",
"type": "string",
"sizeGib": "string"
}
]
},
// end of the list of possible fields
"partitions": [
{
"type": "string",
"sizeGib": "string",
"mountPoint": "string"
}
]
}
]
},
"labels": "object"
}
|
Field |
Description |
|
folderId |
string ID of the folder to create server in. The maximum string length in characters is 50. Value must match the regular expression |
|
name |
string Name of the server. The string length in characters must be 2-56. Value must match the regular expression |
|
description |
string Description of the server. The maximum string length in characters is 1024. |
|
hardwarePoolId |
string Required field. ID of the hardware pool that the server belongs to. The maximum string length in characters is 20. |
|
configurationId |
string ID of the configuration to use for the server. Value must match the regular expression |
|
rentalPeriodId |
string A period of time for which the server is rented. The maximum string length in characters is 20. |
|
networkInterfaces[] |
Network configuration for the server. Specifies how the network interface is configured The maximum number of elements is 2. |
|
osSettingsSpec |
Operating system specific settings for provisioning the server. Optional, if omitted, the |
|
labels |
object (map<string, string>) Resource labels as The maximum string length in characters for each value is 63. The string length in characters for each key must be 1-63. Each key must match the regular expression |
NetworkInterfaceSpec
(-- api-linter: yc::1704::file-separation=disabled
Required for backward compatibility with old clients. --)
|
Field |
Description |
|
privateSubnet |
@deprecated Private subnet. Includes only one of the fields @deprecated. Use |
|
publicSubnet |
@deprecated Public subnet. Includes only one of the fields @deprecated. Use |
|
privateInterface |
Private interface. Includes only one of the fields |
|
publicInterface |
Public interface. Includes only one of the fields |
|
id |
string ID of the network interface. Should not be specified when creating a server. The maximum string length in characters is 20. Value must match the regular expression |
PrivateSubnetNetworkInterface
|
Field |
Description |
|
privateSubnetId |
string ID of the private subnet. |
PublicSubnetNetworkInterface
|
Field |
Description |
|
publicSubnetId |
string ID of the public subnet. |
PrivateNetworkInterface
|
Field |
Description |
|
nativeSubnetId |
string ID of the private subnet which is used as native subnet for interface. |
|
ipAddress |
string IPv4 address that is assigned to the server for this network interface. |
|
macLimit |
string (int64) Limit of MAC addresses in the native subnet. |
|
vlanSubinterfaces[] |
Array of VLAN subinterfaces. Additional tagged subnets for the interface. |
VLANSubinterface
|
Field |
Description |
|
taggedSubnetId |
string ID of the private subnet which is used as tagged subnet for interface. |
|
ipAddress |
string IPv4 address that is assigned to the VLAN subinterface. |
|
macLimit |
string (int64) Limit of MAC addresses in the tagged subnet. |
PublicNetworkInterface
|
Field |
Description |
|
nativeSubnet |
Use existing native subnet. Includes only one of the fields Native subnet configuration. |
|
newNativeSubnet |
Create new native subnet. Includes only one of the fields Native subnet configuration. |
|
ipAddress |
string IPv4 address that is assigned to the server for this network interface. |
|
nativeSubnetId |
string ID of the public subnet which is used as native subnet for interface. |
|
macLimit |
string (int64) Limit of MAC addresses in the native subnet. |
NativeSubnet
Configuration for using existing native subnet.
|
Field |
Description |
|
subnetId |
string ID of the existing public subnet. |
NewNativeSubnet
Configuration for creating new native subnet.
|
Field |
Description |
|
addressingType |
enum (AddressingType) Addressing type (DHCP | Static).
|
OsSettingsSpec
|
Field |
Description |
|
sshPublicKey |
string Public SSH key for the server. The maximum string length in characters is 20000. Includes only one of the fields Root user SSH key. |
|
userSshId |
string ID of the user SSH key to use for the server. The maximum string length in characters is 50. Includes only one of the fields Root user SSH key. |
|
passwordPlainText |
string Raw password. The minimum string length in characters is 6. Includes only one of the fields Password for the server. |
|
passwordLockboxSecret |
Reference to the Lockbox secret used to obtain the password. Includes only one of the fields Password for the server. |
|
imageId |
string ID of the image that the server was created from. The maximum string length in characters is 20. Value must match the regular expression |
|
storages[] |
List of storages to be created on the server. If not specified, the default value based on the |
LockboxSecret
|
Field |
Description |
|
secretId |
string Required field. The unique identifier for the lockbox secret that contains the user password. |
|
versionId |
string The unique identifier for the lockbox version. |
|
key |
string Required field. The key used to access a specific secret entry. |
Storage
Storage, a OS-level storage entity used for creating partitions. For example, this could
represent a plain disk or a software RAID of disks.
|
Field |
Description |
|
disk |
Disk storage. Includes only one of the fields Storage type. |
|
raid |
RAID storage. Includes only one of the fields Storage type. |
|
partitions[] |
Array of partitions created on the storage. |
Disk
Disk.
|
Field |
Description |
|
id |
string ID of the disk. |
|
type |
enum (DiskDriveType) Type of the disk drive.
|
|
sizeGib |
string (int64) Size of the disk in gibibytes (2^30 bytes). |
Raid
RAID storage.
|
Field |
Description |
|
type |
enum (RaidType) RAID type.
|
|
disks[] |
Array of disks in the RAID configuration. |
StoragePartition
|
Field |
Description |
|
type |
enum (StoragePartitionType) Partition type.
|
|
sizeGib |
string (int64) Size of the storage partition in gibibytes (2^30 bytes). |
|
mountPoint |
string Storage mount point. |
Response
HTTP Code: 200 - OK
{
"id": "string",
"description": "string",
"createdAt": "string",
"createdBy": "string",
"modifiedAt": "string",
"done": "boolean",
"metadata": "object",
// Includes only one of the fields `error`, `response`
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
},
"response": "object"
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
|
Field |
Description |
|
id |
string ID of the operation. |
|
description |
string Description of the operation. 0-256 characters long. |
|
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
|
createdBy |
string ID of the user or service account who initiated the operation. |
|
modifiedAt |
string (date-time) The time when the Operation resource was last modified. String in RFC3339 To work with values in this field, use the APIs described in the |
|
done |
boolean If the value is |
|
metadata |
object Service-specific metadata associated with the operation. |
|
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
|
response |
object The normal response of the operation in case of success. Includes only one of the fields The operation result. |
Status
The error result of the operation in case of failure or cancellation.
|
Field |
Description |
|
code |
integer (int32) Error code. An enum value of google.rpc.Code |
|
message |
string An error message. |
|
details[] |
object A list of messages that carry the error details. |