NeutonOS
  1. virtual-machines
NeutonOS
  • 产品 API 使用指南
  • SDDC
    • 概览
      • overview
        • /overview/
    • 计算
      • 虚拟机
        • virtual-machines
          • /virtual-machines/
            GET
          • /virtual-machines/
            POST
          • /virtual-machines/{clone}
            POST
          • /virtual-machines/{id}
            GET
          • /virtual-machines/{id}
            DELETE
          • /virtual-machines/{id}
            PATCH
          • /virtual-machines/{id}/{failure-migrate}
            POST
          • /virtual-machines/{id}/{flatten}
            POST
          • /virtual-machines/{id}/{migrate}
            POST
          • /virtual-machines/{id}/{reboot}
            POST
          • /virtual-machines/{id}/{rollback}
            POST
          • /virtual-machines/{id}/{start}
            POST
          • /virtual-machines/{id}/{stop}
            POST
          • /virtual-machines/{id}/{verify-gpasswd}
            POST
        • vm-cd-roms
          • /vm-cd-roms/
          • /vm-cd-roms/
          • /vm-cd-roms/{id}
          • /vm-cd-roms/{id}
        • vm-cleanup-jobs
          • /vm-cleanup-jobs/
          • /vm-cleanup-jobs/{id}
        • vm-disk-cleanup-jobs
          • /vm-disk-cleanup-jobs/
          • /vm-disk-cleanup-jobs/{id}
        • vm-disks
          • /vm-disks/
          • /vm-disks/
          • /vm-disks/{id}
          • /vm-disks/{id}
          • /vm-disks/{id}
        • vm-migration-jobs
          • /vm-migration-jobs/
          • /vm-migration-jobs/{id}
        • vm-nic-cleanup-jobs
          • /vm-nic-cleanup-jobs/
          • /vm-nic-cleanup-jobs/{id}
        • vm-nics
          • /vm-nics/
          • /vm-nics/
          • /vm-nics/{id}
          • /vm-nics/{id}
          • /vm-nics/{id}
        • vm-scheduling-rules
          • /vm-scheduling-rules/
          • /vm-scheduling-rules/
          • /vm-scheduling-rules/{id}
          • /vm-scheduling-rules/{id}
      • 虚拟机快照
        • vm-cd-rom-snaps
          • /vm-cd-rom-snaps/
          • /vm-cd-rom-snaps/{id}
        • vm-disk-snaps
          • /vm-disk-snaps/
          • /vm-disk-snaps/{id}
        • vm-nic-snaps
          • /vm-nic-snaps/
          • /vm-nic-snaps/{id}
        • vm-snaps
          • /vm-snaps/
          • /vm-snaps/
          • /vm-snaps/{id}
          • /vm-snaps/{id}
          • /vm-snaps/{id}
      • 镜像
        • vm-images
          • /vm-images/
          • /vm-images/
          • /vm-images/{id}
          • /vm-images/{id}
          • /vm-images/{id}
          • /vm-images/{id}:upload
        • os-releases
          • /os-releases/
          • /os-releases/{id}
    • 网络
      • 虚拟交换机
        • nics
          • /nics/
          • /nics/{id}
        • vsws
          • /vsws/
          • /vsws/
          • /vsws/{id}
          • /vsws/{id}
          • /vsws/{id}
          • /vsws/{id}/{attach-nics}
          • /vsws/{id}/{detach-nics}
      • 桥接网络
        • br-net-nss
          • /br-net-nss/
          • /br-net-nss/{id}
        • br-nets
          • /br-nets/
          • /br-nets/
          • /br-nets/{id}
          • /br-nets/{id}
          • /br-nets/{id}
        • bridges
          • /bridges/
          • /bridges/{id}
        • l3-nets
          • /l3-nets/
          • /l3-nets/{id}
    • 块存储
      • 块存储策略
        • bs-policies
          • /bs-policies/
          • /bs-policies/
          • /bs-policies/summary
          • /bs-policies/{id}
          • /bs-policies/{id}
          • /bs-policies/{id}
      • 块存储卷
        • bs-volumes
          • /bs-volumes/
          • /bs-volumes/
          • /bs-volumes/{clone}
          • /bs-volumes/{id}
          • /bs-volumes/{id}
          • /bs-volumes/{id}
          • /bs-volumes/{id}/{flatten}
          • /bs-volumes/{id}/{rollback}
      • 卷快照
        • bs-snaps
          • /bs-snaps/
          • /bs-snaps/
          • /bs-snaps/{id}
          • /bs-snaps/{id}
          • /bs-snaps/{id}
    • 弹性存储
      • 存储池
      • 硬盘
    • 集群
      • 拓扑
        • chassises
          • /chassises/
          • /chassises/
          • /chassises/{id}
          • /chassises/{id}
          • /chassises/{id}
          • /chassises/{id}/{switch-chassis}
        • data-centers
          • /data-centers/
          • /data-centers/
          • /data-centers/{id}
          • /data-centers/{id}
          • /data-centers/{id}
        • racks
          • /racks/
          • /racks/
          • /racks/{id}
          • /racks/{id}
          • /racks/{id}
        • rooms
          • /rooms/
          • /rooms/
          • /rooms/{id}
          • /rooms/{id}
          • /rooms/{id}
      • 节点
        • nodes
          • /nodes/
          • /nodes/
          • /nodes/summary
          • /nodes/{id}
          • /nodes/{id}
          • /nodes/{id}
          • /nodes/{id}/{unset-role-check}
          • /nodes/{ip}/node-info
        • node-validators
          • /node-validators/
          • /node-validators/
          • /node-validators/{id}
    • 运维管理
      • 监控分析
        • metrics
          • /metrics/alert
          • /metrics/label-names/{metric}
          • /metrics/label-values/{metric}/{label_name}
          • /metrics/monitor
        • monitor-views
          • /monitor-views/
          • /monitor-views/
          • /monitor-views/{id}
          • /monitor-views/{id}
          • /monitor-views/{id}
          • /monitor-views/{id}/{reset-to-default}
        • samples
          • /samples/query
          • /samples/query-range
      • 告警信息
        • alerts
          • /alerts/
          • /alerts/stats
          • /alerts/{id}
          • /alerts/{id}
      • 告警规则
        • alert-rules
          • /alert-rules/
          • /alert-rules/
          • /alert-rules/{id}
          • /alert-rules/{id}
          • /alert-rules/{id}
        • flows
          • /flows/
          • /flows/
          • /flows/{id}
        • email-configs
          • /email-configs/
          • /email-configs/{id}
          • /email-configs/{id}
      • 事件
        • events
          • /events/
          • /events/{id}
      • 审计日志
        • audit-logs
          • /audit-logs/
          • /audit-logs/{id}
    • 标签管理
      • label-keys
        • /label-keys/
        • /label-keys/
        • /label-keys/{id}
        • /label-keys/{id}
      • label-values
        • /label-values/
        • /label-values/
        • /label-values/{id}
        • /label-values/{id}
        • /label-values/{id}/{attach}
        • /label-values/{id}/{detach}
    • 权限访问
      • tokens
        • /tokens/{login}
        • /tokens/{logout}
        • /tokens/{reauth-in-project}
    • 加密
      • rsa-keys
        • /rsa-keys/
    • 用户管理
      • users
        • /users/
        • /users/
        • /users/{verify-password}
        • /users/{id}
        • /users/{id}
        • /users/{id}
        • /users/{id}/{allow-login}
        • /users/{id}/{set-default-project}
        • /users/{id}/{ui-profile}
        • /users/{id}/{ui-profile}
        • /users/{id}/projects
        • /users/{id}/projects/{project_id}/{set-role}
      • roles
        • /roles/
        • /roles/{id}
      • projects
        • /projects/
        • /projects/
        • /projects/{id}
        • /projects/{id}
        • /projects/{id}
        • /projects/{id}/{add-user}
        • /projects/{id}/{remove-user}
        • /projects/{id}/users
    • 产品信息
      • version
        • /version/
      • license-summary
        • /license-summary/
    • 系统设置
      • settings
        • /settings/
        • /settings/
      • sysctl-confs
        • /sysctl-confs/
        • /sysctl-confs/{id}
      • cluster-topologies
        • /cluster-topologies/
        • /cluster-topologies/{id}
        • /cluster-topologies/{id}/{failover}
      • cluster-failover-histories
        • /cluster-failover-histories/
        • /cluster-failover-histories/{id}
  • SDS
    • action-logs
      • /action-logs/
      • /action-logs/{action_log_id}
    • alert-info-groups
      • /alert-info-groups/
      • /alert-info-groups/report
      • /alert-info-groups/stats
      • /alert-info-groups/{alert_info_group_id}
      • /alert-info-groups/{alert_info_group_id}
      • /alert-info-groups/{alert_info_group_id}:ack
      • /alert-info-groups/{alert_info_group_id}:resolve
    • alert-infos
      • /alert-infos/
      • /alert-infos/report
      • /alert-infos/stats
      • /alert-infos/{alert_info_id}
      • /alert-infos/{alert_info_id}
      • /alert-infos/{alert_info_id}:ack
      • /alert-infos/{alert_info_id}:resolve
    • alert-rule-groups
      • /alert-rule-groups/
      • /alert-rule-groups/{id}/detail
      • /alert-rule-groups/{id}/detail
    • alert-rules
      • /alert-rules/schema
      • /alert-rules/{rule_id}
      • /alert-rules/{rule_id}
      • /alert-rules/{rule_id}
      • /alert-rules/{rule_id}/blacklist
      • /alert-rules/{rule_id}/blacklist
      • /alert-rules/{rule_id}/blacklist
    • chunks
      • /chunks/{chunk_id}
    • disks
      • /disks/
      • /disks/{disk_id}
      • /disks/{disk_id}
      • /disks/{disk_id}/partitions
      • /disks/{disk_id}/partitions
      • /disks/{disk_id}/samples
    • osds
      • /osds/
      • /osds/
      • /osds/{osd_id}
      • /osds/{osd_id}
      • /osds/{osd_id}/chunks
      • /osds/{osd_id}/predictions
      • /osds/{osd_id}/samples
      • /osds/{osd_id}:activate
      • /osds/{osd_id}:maintain
      • /osds/{osd_id}:rebuild
      • /osds/{osd_id}:switch-role
      • /osds/{osd_id}:unmaintain
      • /osds/{osd_id}:unset-isolation
    • pools
      • /pools/
      • /pools/
      • /pools/{calc-capacity}
      • /pools/{check-full}
      • /pools/{pool_id}
      • /pools/{pool_id}
      • /pools/{pool_id}
      • /pools/{pool_id}/osds
      • /pools/{pool_id}/osds
      • /pools/{pool_id}/predictions
      • /pools/{pool_id}/samples
      • /pools/{pool_id}/topology
      • /pools/{pool_id}:disable-device-type-check
      • /pools/{pool_id}:enable-device-type-check
      • /pools/{pool_id}:initialize
      • /pools/{pool_id}:reweight
      • /pools/{pool_id}:switch-role
      • /pools/{pool_id}:update-ec-crush-rule
      • /pools/{pool_id}:update-gc-policy
  1. virtual-machines

/virtual-machines/{clone}

POST
/virtual-machines/{clone}
最后修改时间:2022-11-07 17:51:46
责任人:未设置

请求参数

Path 参数
clone
string 
必需
Header 参数
x-sddc-token
string 
可选
默认值:
78ce2df0c80e4b10a28c7779af4dc10f
Body 参数application/json
VmCloneReq API request
spec
object (VmCloneReqSpec) 
可选
VmCloneReqSpec define clone VM spec
description
string 
可选
Description is the description of VM.
flattened
boolean 
可选
Flattened is independent clone VM or not
name
string 
必需
Name is the name of VM.
vm_nics
array[object (VmCloneVmNicSpec defines nic spec for clone req.) {3}] 
可选
VmNics is the nics of the virtual machine.
vm_snap_id
integer <int64>
必需
VmSnapID is vm-snap ID.
示例
{
    "spec": {
        "description": "string",
        "flattened": true,
        "name": "string",
        "vm_nics": [
            {
                "ip_address": "string",
                "mac_address": "string",
                "vm_nic_snap_id": 0
            }
        ],
        "vm_snap_id": 0
    }
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://10.16.11.91:6012/sddc/v1/virtual-machines/' \
--header 'x-sddc-token: 78ce2df0c80e4b10a28c7779af4dc10f' \
--header 'Content-Type: application/json' \
--data-raw '{
    "spec": {
        "description": "string",
        "flattened": true,
        "name": "string",
        "vm_nics": [
            {
                "ip_address": "string",
                "mac_address": "string",
                "vm_nic_snap_id": 0
            }
        ],
        "vm_snap_id": 0
    }
}'

返回响应

🟢201成功
application/json
Body
VirtualMachine is a virtual machine.
metadata
object (ResourceMeta is the metadata all resource type must have.) 
必需
created_at
string <date-time>
必需
creation_finish
string <date-time>
可选
deletion_begin
string <date-time>
可选
deletion_finish
string <date-time>
可选
id
integer <int64>
必需
labels
array[object (ResourceMetaLabel is the label metadata of resource.) {4}] 
可选
name
string 
可选
project_id
integer <int64>
可选
state
object (ResourceMetaState is the state metadata of resource.) 
可选
spec
object (VirtualMachineSpec vm's spec.) 
必需
+X:resourceRef:resource=VirtualMachine;field=Spec;
arch
string 
必需
bios
string 
必需
boot_device_order
array[string]
必需
StringSlice stores a string slice to database with format: a,b,c
cloud_init_uuid
string 
必需
core_num_per_socket
integer <int64>
必需
cpu_mode
string 
必需
cpu_num
integer <int64>
必需
created_at
string <date-time>
必需
creation_finish
string <date-time>
可选
deleted_at
object (NullTime represents a time.Time that may be null.) 
可选
NullTime implements the Scanner interface so
it can be used as a scan destination, similar to NullString.
deletion_begin
string <date-time>
可选
deletion_finish
string <date-time>
可选
description
string 
必需
dest_node_id
integer <int64>
可选
etag
string 
必需
flattened
boolean 
必需
graphics_auth_enabled
boolean 
必需
graphics_spice_enabled
boolean 
必需
ha_enabled
boolean 
必需
hostname
string 
必需
hugepage_enabled
boolean 
必需
id
integer <int64>
必需
memory_mb
integer <int64>
必需
name
string 
必需
node_id
integer <int64>
可选
os_distribution
string 
必需
os_name
string 
必需
os_type
string 
必需
os_user_name
string 
必需
power_action_forced
boolean 
可选
power_action_time
string <date-time>
可选
power_action_type
string 
可选
power_state
string 
必需
project_id
integer <int64>
必需
rollback_time
string <date-time>
可选
rollback_vm_snap_id
integer <int64>
可选
socket_num
integer <int64>
必需
ssh_public_key
string 
必需
thread_num_per_core
integer <int64>
必需
time_zone
string 
必需
updated_at
string <date-time>
必需
user_data
string 
必需
uuid
string 
必需
vm_snap_id
integer <int64>
可选
status
object (VirtualMachineStatus vm's status.) 
必需
+X:resourceRef:resource=VirtualMachine;field=Status;
bios
string 
必需
boot_device_order
array[string]
可选
StringSlice stores a string slice to database with format: a,b,c
core_num_per_socket
integer <int64>
必需
cpu_mode
string 
必需
cpu_num
integer <int64>
必需
created_at
string <date-time>
必需
deleted_at
object (NullTime represents a time.Time that may be null.) 
可选
NullTime implements the Scanner interface so
it can be used as a scan destination, similar to NullString.
dest_node_id
integer <int64>
可选
etag
string 
必需
flattened
boolean 
必需
graphics_auth_enabled
boolean 
必需
graphics_spice_enabled
boolean 
必需
graphics_spice_port
integer <int64>
可选
graphics_vnc_port
integer <int64>
可选
id
integer <int64>
必需
ID is field of status table must be set according to spec table.
ip_addresses
array[string]
可选
last_node_id
integer <int64>
可选
launched_at
string <date-time>
可选
machine_type
string 
可选
memory_mb
integer <int64>
必需
node_id
integer <int64>
可选
power_action_time
string <date-time>
可选
power_state
string 
必需
power_state_reason
string 
必需
rollback_time
string <date-time>
可选
socket_num
integer <int64>
必需
storage_fenced
boolean 
必需
terminated_at
string <date-time>
可选
thread_num_per_core
integer <int64>
必需
time_zone
string 
必需
unschedulable
boolean 
必需
unstoppable
boolean 
必需
updated_at
string <date-time>
必需
vm_migration_job_id
integer <int64>
可选
vm_snap_num
integer <int64>
必需
示例
{
    "metadata": {
        "created_at": "2019-08-24T14:15:22Z",
        "creation_finish": "2019-08-24T14:15:22Z",
        "deletion_begin": "2019-08-24T14:15:22Z",
        "deletion_finish": "2019-08-24T14:15:22Z",
        "id": 0,
        "labels": [
            {
                "label_key_id": 0,
                "label_key_name": "string",
                "label_value_id": 0,
                "label_value_name": "string"
            }
        ],
        "name": "string",
        "project_id": 0,
        "state": {
            "diff_fields": {
                "irreconcilable": [
                    "string"
                ],
                "reconciling": [
                    "string"
                ]
            },
            "state": "string"
        }
    },
    "spec": {
        "arch": "string",
        "bios": "string",
        "boot_device_order": [
            "string"
        ],
        "cloud_init_uuid": "string",
        "core_num_per_socket": 0,
        "cpu_mode": "string",
        "cpu_num": 0,
        "created_at": "2019-08-24T14:15:22Z",
        "creation_finish": "2019-08-24T14:15:22Z",
        "deleted_at": {
            "Time": "2019-08-24T14:15:22Z",
            "Valid": true
        },
        "deletion_begin": "2019-08-24T14:15:22Z",
        "deletion_finish": "2019-08-24T14:15:22Z",
        "description": "string",
        "dest_node_id": 0,
        "etag": "string",
        "flattened": true,
        "graphics_auth_enabled": true,
        "graphics_spice_enabled": true,
        "ha_enabled": true,
        "hostname": "string",
        "hugepage_enabled": true,
        "id": 0,
        "memory_mb": 0,
        "name": "string",
        "node_id": 0,
        "os_distribution": "string",
        "os_name": "string",
        "os_type": "string",
        "os_user_name": "string",
        "power_action_forced": true,
        "power_action_time": "2019-08-24T14:15:22Z",
        "power_action_type": "string",
        "power_state": "string",
        "project_id": 0,
        "rollback_time": "2019-08-24T14:15:22Z",
        "rollback_vm_snap_id": 0,
        "socket_num": 0,
        "ssh_public_key": "string",
        "thread_num_per_core": 0,
        "time_zone": "string",
        "updated_at": "2019-08-24T14:15:22Z",
        "user_data": "string",
        "uuid": "string",
        "vm_snap_id": 0
    },
    "status": {
        "bios": "string",
        "boot_device_order": [
            "string"
        ],
        "core_num_per_socket": 0,
        "cpu_mode": "string",
        "cpu_num": 0,
        "created_at": "2019-08-24T14:15:22Z",
        "deleted_at": {
            "Time": "2019-08-24T14:15:22Z",
            "Valid": true
        },
        "dest_node_id": 0,
        "etag": "string",
        "flattened": true,
        "graphics_auth_enabled": true,
        "graphics_spice_enabled": true,
        "graphics_spice_port": 0,
        "graphics_vnc_port": 0,
        "id": 0,
        "ip_addresses": [
            "string"
        ],
        "last_node_id": 0,
        "launched_at": "2019-08-24T14:15:22Z",
        "machine_type": "string",
        "memory_mb": 0,
        "node_id": 0,
        "power_action_time": "2019-08-24T14:15:22Z",
        "power_state": "string",
        "power_state_reason": "string",
        "rollback_time": "2019-08-24T14:15:22Z",
        "socket_num": 0,
        "storage_fenced": true,
        "terminated_at": "2019-08-24T14:15:22Z",
        "thread_num_per_core": 0,
        "time_zone": "string",
        "unschedulable": true,
        "unstoppable": true,
        "updated_at": "2019-08-24T14:15:22Z",
        "vm_migration_job_id": 0,
        "vm_snap_num": 0
    }
}
修改于 2022-11-07 17:51:46
上一页
/virtual-machines/
下一页
/virtual-machines/{id}
Built with