BareMetal API, REST: Server.BatchCreateServers
Creates multiple servers in the specified folder.
https://google.aip.dev/130 --)
HTTP request
POST https://baremetal.api.yandexcloud.kz/baremetal/v2/clouds/{cloudId}/folders/{folderId}/servers:batchCreate
Path parameters
|
Field |
Description |
|
cloudId |
string Required field. ID of the parent cloud. To get the cloud ID, use a yandex.cloud.resourcemanager.v1.CloudService.List request. |
|
folderId |
string Required field. ID of the parent folder shared by all servers being created. To get the folder ID, use a yandex.cloud.resourcemanager.v1.FolderService.List request. |
Body parameters
{
"requests": [
{
"cloudId": "string",
"folderId": "string",
"server": {
"serverId": "string",
"cloudId": "string",
"folderId": "string",
"name": "string",
"description": "string",
"hardwarePoolId": "string",
"state": "string",
"osSettings": {
"imageId": "string",
"sshPublicKey": "string",
// Includes only one of the fields `sshPublicKeyText`, `userSshId`
"sshPublicKeyText": "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
"storages": [
{
"partitions": [
{
"type": "string",
"sizeBytes": "string",
"mountPoint": "string"
}
],
// Includes only one of the fields `disk`, `raid`
"disk": {
"id": "string",
"type": "string",
"sizeBytes": "string"
},
"raid": {
"type": "string",
"disks": [
{
"id": "string",
"type": "string",
"sizeBytes": "string"
}
]
}
// end of the list of possible fields
}
]
},
"rentalPeriodStartTime": "string",
"rentalPeriodId": "string",
"nextRentalPeriodId": "string",
"rentalPeriodEndTime": "string",
"networkInterfaces": [
{
"networkInterfaceId": "string",
"macAddress": "string",
// Includes only one of the fields `privateInterface`, `publicInterface`
"privateInterface": {
"nativeSubnetId": "string",
"ipAddress": "string",
"macLimit": "string",
"vlanSubinterfaces": [
{
"taggedSubnetId": "string",
"ipAddress": "string",
"macLimit": "string"
}
]
},
"publicInterface": {
"ipAddress": "string",
"nativeSubnetId": "string",
"macLimit": "string",
"internetTrafficPlan": "string",
// Includes only one of the fields `nativeSubnet`, `newNativeSubnet`
"nativeSubnet": {
"subnetId": "string"
},
"newNativeSubnet": {
"addressingType": "string"
}
// end of the list of possible fields
},
// end of the list of possible fields
"configurationNetworkInterfaceId": "string"
}
],
"prolongationState": "string",
"disks": [
{
"id": "string",
"type": "string",
"sizeBytes": "string"
}
],
// Includes only one of the fields `customConfiguration`, `stockConfigurationId`
"customConfiguration": {
"configurationId": "string",
"name": "string",
"cpu": {
"id": "string",
"name": "string",
"vendor": "string",
"physicalCores": "string",
"frequencyMhz": "string",
"count": "string",
"threads": "string"
},
"diskDrives": [
{
"type": "string",
"count": "string",
"sizeBytes": "string"
}
],
"ram": {
"id": "string",
"sizeBytes": "string"
}
},
"stockConfigurationId": "string",
// end of the list of possible fields
"createTime": "string",
"updateTime": "string",
"annotations": "object"
}
}
]
}
|
Field |
Description |
|
requests[] |
List of create server requests. The number of elements must be in the range 1-100. |
CreateServerRequest
|
Field |
Description |
|
cloudId |
string ID of the parent cloud. To get the cloud ID, use a yandex.cloud.resourcemanager.v1.CloudService.List request. |
|
folderId |
string ID of the parent folder. To get the folder ID, use a yandex.cloud.resourcemanager.v1.FolderService.List request. |
|
server |
The server to create. |
Server
A Server resource.
|
Field |
Description |
|
serverId |
string ID of the server. |
|
cloudId |
string ID of the cloud that the server belongs to. |
|
folderId |
string ID of the folder that the server belongs to. |
|
name |
string Name of the server. |
|
description |
string Description of the server. |
|
hardwarePoolId |
string ID of the hardware pool that the server belongs to. The maximum string length in characters is 20. |
|
state |
enum (State) State of the server.
|
|
osSettings |
Operating system specific settings of the server. Optional, will be empty if the server is |
|
rentalPeriodStartTime |
string (date-time) Timestamp indicating the start date and time of the server's rental period. Optional, may be String in RFC3339 To work with values in this field, use the APIs described in the |
|
rentalPeriodId |
string A period of time for which a Bare Metal Server is rented. |
|
nextRentalPeriodId |
string A period of time for which a Bare Metal Server will be changed on after ending of current rental period. The maximum string length in characters is 20. |
|
rentalPeriodEndTime |
string (date-time) Timestamp indicating the end date and time of the server's rental period. Optional, may be String in RFC3339 To work with values in this field, use the APIs described in the |
|
networkInterfaces[] |
Array of network interfaces that are attached to the instance. The number of elements must be in the range 1-2. |
|
prolongationState |
enum (ProlongationState) Prolongation state of the server's rent.
|
|
disks[] |
Array of disks that are attached to the server. |
|
customConfiguration |
Custom configuration. Includes only one of the fields Configuration of the server. One of elements is required for server creation |
|
stockConfigurationId |
string ID of the stock configuration. Includes only one of the fields Configuration of the server. One of elements is required for server creation |
|
createTime |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
|
updateTime |
string (date-time) Update timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
|
annotations |
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 |
OsSettings
|
Field |
Description |
|
imageId |
string ID of the image that the server was created from. |
|
sshPublicKey |
string Public SSH key of the server. |
|
sshPublicKeyText |
string Public SSH key for the server. Input only field. The maximum string length in characters is 20000. Includes only one of the fields Root user SSH key. Input only field. One of elements is required. |
|
userSshId |
string ID of the user SSH key to use for the server. Input only field. To get the user SSH key ID, use a yandex.cloud.organizationmanager.v1.UserSshKeyService.List request. The maximum string length in characters is 50. Includes only one of the fields Root user SSH key. Input only field. One of elements is required. |
|
passwordPlainText |
string Raw password. Input only field. The minimum string length in characters is 6. Includes only one of the fields Password for the server. Input only field. One of elements is required. |
|
passwordLockboxSecret |
Reference to the Lockbox secret used to obtain the password. Input only field. Includes only one of the fields Password for the server. Input only field. One of elements is required. |
|
storages[] |
List of storages. If not specified, the default value based on the selected configuration will be used as the field value. |
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 |
|
partitions[] |
Array of partitions created on the storage. |
|
disk |
Disk storage. Includes only one of the fields Storage type. |
|
raid |
RAID storage. Includes only one of the fields Storage type. |
StoragePartition
|
Field |
Description |
|
type |
enum (StoragePartitionType) Partition type.
|
|
sizeBytes |
string (int64) Size of the storage partition. |
|
mountPoint |
string Storage mount point. |
Disk
Disk.
|
Field |
Description |
|
id |
string ID of the disk. |
|
type |
enum (DiskDriveType) Type of the disk drive.
|
|
sizeBytes |
string (int64) Size of the disk. |
Raid
RAID storage.
|
Field |
Description |
|
type |
enum (RaidType) RAID type.
|
|
disks[] |
Array of disks in the RAID configuration. |
NetworkInterface
|
Field |
Description |
|
networkInterfaceId |
string ID of the network interface. Should not be specified when creating a server. |
|
macAddress |
string MAC address that is assigned to the network interface. |
|
privateInterface |
Private interface. Includes only one of the fields Type of the network interface. One of elements is required. |
|
publicInterface |
Public interface. Includes only one of the fields Type of the network interface. One of elements is required. |
|
configurationNetworkInterfaceId |
string ID of the configuration network interface that determines the network interface configuration. |
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 |
|
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. |
|
internetTrafficPlan |
enum (InternetTrafficPlan) Internet traffic plan. Defines how much data can be transfered with server interface.
|
|
nativeSubnet |
Use existing native subnet. Includes only one of the fields Native subnet configuration. Input only field. One of elements is required. |
|
newNativeSubnet |
Create new native subnet. Includes only one of the fields Native subnet configuration. Input only field. One of elements is required. |
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).
|
UserConfiguration
|
Field |
Description |
|
configurationId |
string ID of the configuration. |
|
name |
string Name of the configuration. |
|
cpu |
CPU configuration. |
|
diskDrives[] |
Array of disk drive configurations. |
|
ram |
Random-access memory (RAM). |
UserCPU
CPU configuration.
|
Field |
Description |
|
id |
string ID of the CPU from configurator. |
|
name |
string Name of the CPU. |
|
vendor |
string Vendor of the CPU. |
|
physicalCores |
string (int64) Number of physical cores per CPU (socket). |
|
frequencyMhz |
string (int64) Frequency of the CPU in megahertz (MHz). |
|
count |
string (int64) Number of cpu. |
|
threads |
string (int64) Number of threads (logical cores) per CPU (socket). |
DiskDriveConfiguration
|
Field |
Description |
|
type |
enum (DiskDriveType) Type of the disk drive.
|
|
count |
string (int64) Number of disk drives. |
|
sizeBytes |
string (int64) Size of a single disk drive. |
UserRAM
|
Field |
Description |
|
id |
string ID of the RAM from configurator. |
|
sizeBytes |
string (int64) Ram size. |
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. |