mirror of https://github.com/veops/cmdb.git
Dev api 231229 (#345)
* fix(api): predefined value for float * feat(api): update public clouds config * feat(api): commands add-user support is_admin
This commit is contained in:
parent
7036fe023c
commit
ace160ae19
|
@ -35,8 +35,22 @@ def add_user():
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from api.models.acl import App
|
||||||
|
from api.lib.perm.acl.cache import AppCache
|
||||||
|
from api.lib.perm.acl.cache import RoleCache
|
||||||
|
from api.lib.perm.acl.role import RoleCRUD
|
||||||
|
from api.lib.perm.acl.role import RoleRelationCRUD
|
||||||
|
|
||||||
username = click.prompt('Enter username', confirmation_prompt=False)
|
username = click.prompt('Enter username', confirmation_prompt=False)
|
||||||
password = click.prompt('Enter password', hide_input=True, confirmation_prompt=True)
|
password = click.prompt('Enter password', hide_input=True, confirmation_prompt=True)
|
||||||
email = click.prompt('Enter email ', confirmation_prompt=False)
|
email = click.prompt('Enter email ', confirmation_prompt=False)
|
||||||
|
is_admin = click.prompt('Admin (Y/N) ', confirmation_prompt=False, type=bool, default=False)
|
||||||
|
|
||||||
UserCRUD.add(username=username, password=password, email=email)
|
UserCRUD.add(username=username, password=password, email=email)
|
||||||
|
|
||||||
|
if is_admin:
|
||||||
|
app = AppCache.get('acl') or App.create(name='acl')
|
||||||
|
acl_admin = RoleCache.get('acl_admin') or RoleCRUD.add_role('acl_admin', app.id, True)
|
||||||
|
rid = RoleCache.get_by_name(None, username).id
|
||||||
|
|
||||||
|
RoleRelationCRUD.add(acl_admin, acl_admin.id, [rid], app.id)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import copy
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
import uuid
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import requests
|
import requests
|
||||||
|
@ -176,6 +177,11 @@ def cmdb_counter():
|
||||||
from api.lib.cmdb.cache import CMDBCounterCache
|
from api.lib.cmdb.cache import CMDBCounterCache
|
||||||
|
|
||||||
current_app.test_request_context().push()
|
current_app.test_request_context().push()
|
||||||
|
if not UserCache.get('worker'):
|
||||||
|
from api.lib.perm.acl.user import UserCRUD
|
||||||
|
|
||||||
|
UserCRUD.add(username='worker', password=uuid.uuid4().hex, email='worker@xxx.com')
|
||||||
|
|
||||||
login_user(UserCache.get('worker'))
|
login_user(UserCache.get('worker'))
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,427 +1,344 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "amiLaunchIndex",
|
"name": "amiLaunchIndex",
|
||||||
"type": "整数",
|
"type": "Integer",
|
||||||
"desc": "The AMI launch index, which can be used to find this instance in the launch group.",
|
"desc": "The AMI launch index, which can be used to find this instance in the launch group.",
|
||||||
"example": "0"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "architecture",
|
"name": "architecture",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The architecture of the image.",
|
"desc": "The architecture of the image.",
|
||||||
"example": "x86_64"
|
"example": "i386"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "blockDeviceMapping",
|
"name": "blockDeviceMapping",
|
||||||
"type": "json",
|
"type": "Array of InstanceBlockDeviceMapping objects",
|
||||||
"desc": "Any block device mapping entries for the instance.",
|
"desc": "Any block device mapping entries for the instance.",
|
||||||
"example": {
|
"example": ""
|
||||||
"item": {
|
},
|
||||||
"deviceName": "/dev/xvda",
|
{
|
||||||
"ebs": {
|
"name": "bootMode",
|
||||||
"volumeId": "vol-1234567890abcdef0",
|
"type": "String",
|
||||||
"status": "attached",
|
"desc": "The boot mode that was specified by the AMI. If the value is uefi-preferred, the AMI supports both UEFI and Legacy BIOS. The currentInstanceBootMode parameter is the boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.",
|
||||||
"attachTime": "2015-12-22T10:44:09.000Z",
|
"example": "legacy-bios"
|
||||||
"deleteOnTermination": "true"
|
},
|
||||||
}
|
{
|
||||||
}
|
"name": "capacityReservationId",
|
||||||
}
|
"type": "String",
|
||||||
},
|
"desc": "The ID of the Capacity Reservation.",
|
||||||
{
|
"example": ""
|
||||||
"name": "bootMode",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"desc": "The boot mode that was specified by the AMI. If the value is uefi-preferred, the AMI supports both UEFI and Legacy BIOS. The currentInstanceBootMode parameter is the boot mode that is used to boot the instance at launch or start.",
|
"name": "capacityReservationSpecification",
|
||||||
"example": null
|
"type": "CapacityReservationSpecificationResponse object",
|
||||||
},
|
"desc": "Information about the Capacity Reservation targeting option.",
|
||||||
{
|
"example": ""
|
||||||
"name": "capacityReservationId",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"desc": "The ID of the Capacity Reservation.",
|
"name": "clientToken",
|
||||||
"example": null
|
"type": "String",
|
||||||
},
|
"desc": "The idempotency token you provided when you launched the instance, if applicable.",
|
||||||
{
|
"example": ""
|
||||||
"name": "capacityReservationSpecification",
|
},
|
||||||
"type": "json",
|
{
|
||||||
"desc": "Information about the Capacity Reservation targeting option.",
|
"name": "cpuOptions",
|
||||||
"example": null
|
"type": "CpuOptions object",
|
||||||
},
|
"desc": "The CPU options for the instance.",
|
||||||
{
|
"example": ""
|
||||||
"name": "clientToken",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"desc": "The idempotency token you provided when you launched the instance, if applicable.",
|
"name": "currentInstanceBootMode",
|
||||||
"example": "xMcwG14507example"
|
"type": "String",
|
||||||
},
|
"desc": "The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.",
|
||||||
{
|
"example": "legacy-bios"
|
||||||
"name": "cpuOptions",
|
},
|
||||||
"type": "json",
|
{
|
||||||
"desc": "The CPU options for the instance.",
|
"name": "dnsName",
|
||||||
"example": {
|
"type": "String",
|
||||||
"coreCount": "1",
|
"desc": "[IPv4 only] The public DNS name assigned to the instance. This name is not available until the instance enters the running state. This name is only available if you've enabled DNS hostnames for your VPC.",
|
||||||
"threadsPerCore": "1"
|
"example": ""
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "ebsOptimized",
|
||||||
"name": "currentInstanceBootMode",
|
"type": "Boolean",
|
||||||
"type": "文本",
|
"desc": "Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.",
|
||||||
"desc": "The boot mode that is used to boot the instance at launch or start. For more information, see Boot modes in the Amazon EC2 User Guide.",
|
"example": ""
|
||||||
"example": null
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "elasticGpuAssociationSet",
|
||||||
"name": "dnsName",
|
"type": "Array of ElasticGpuAssociation objects",
|
||||||
"type": "文本",
|
"desc": "The Elastic GPU associated with the instance.",
|
||||||
"desc": "[IPv4 only] The public DNS name assigned to the instance. This name is not available until the instance enters the running state. This name is only available if you've enabled DNS hostnames for your VPC.",
|
"example": ""
|
||||||
"example": "ec2-54-194-252-215.eu-west-1.compute.amazonaws.com"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "elasticInferenceAcceleratorAssociationSet",
|
||||||
"name": "ebsOptimized",
|
"type": "Array of ElasticInferenceAcceleratorAssociation objects",
|
||||||
"type": "Boolean",
|
"desc": "The elastic inference accelerator associated with the instance.",
|
||||||
"desc": "Indicates whether the instance is optimized for Amazon EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization isn't available with all instance types. Additional usage charges apply when using an EBS Optimized instance.",
|
"example": ""
|
||||||
"example": "false"
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "enaSupport",
|
||||||
"name": "elasticGpuAssociationSet",
|
"type": "Boolean",
|
||||||
"type": "json",
|
"desc": "Specifies whether enhanced networking with ENA is enabled.",
|
||||||
"desc": "The Elastic GPU associated with the instance.",
|
"example": ""
|
||||||
"example": null
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "enclaveOptions",
|
||||||
"name": "elasticInferenceAcceleratorAssociationSet",
|
"type": "EnclaveOptions object",
|
||||||
"type": "json",
|
"desc": "Indicates whether the instance is enabled for AWS Nitro Enclaves.",
|
||||||
"desc": "The elastic inference accelerator associated with the instance.",
|
"example": ""
|
||||||
"example": null
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "groupSet",
|
||||||
"name": "enaSupport",
|
"type": "Array of GroupIdentifier objects",
|
||||||
"type": "Boolean",
|
"desc": "The security groups for the instance.",
|
||||||
"desc": "Specifies whether enhanced networking with ENA is enabled.",
|
"example": ""
|
||||||
"example": null
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "hibernationOptions",
|
||||||
"name": "enclaveOptions",
|
"type": "HibernationOptions object",
|
||||||
"type": "json",
|
"desc": "Indicates whether the instance is enabled for hibernation.",
|
||||||
"desc": "Indicates whether the instance is enabled for AWS Nitro Enclaves.",
|
"example": ""
|
||||||
"example": null
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "hypervisor",
|
||||||
"name": "groupSet",
|
"type": "String",
|
||||||
"type": "json",
|
"desc": "The hypervisor type of the instance. The value xen is used for both Xen and Nitro hypervisors.",
|
||||||
"desc": "The security groups for the instance.",
|
"example": "ovm"
|
||||||
"example": {
|
},
|
||||||
"item": {
|
{
|
||||||
"groupId": "sg-e4076980",
|
"name": "iamInstanceProfile",
|
||||||
"groupName": "SecurityGroup1"
|
"type": "IamInstanceProfile object",
|
||||||
}
|
"desc": "The IAM instance profile associated with the instance, if applicable.",
|
||||||
}
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hibernationOptions",
|
"name": "imageId",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "Indicates whether the instance is enabled for hibernation.",
|
"desc": "The ID of the AMI used to launch the instance.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hypervisor",
|
"name": "instanceId",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The hypervisor type of the instance. The value xen is used for both Xen and Nitro hypervisors.",
|
"desc": "The ID of the instance.",
|
||||||
"example": "xen"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "iamInstanceProfile",
|
"name": "instanceLifecycle",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "The IAM instance profile associated with the instance, if applicable.",
|
"desc": "Indicates whether this is a Spot Instance or a Scheduled Instance.",
|
||||||
"example": {
|
"example": "spot"
|
||||||
"arn": "arn:aws:iam::123456789012:instance-profile/AdminRole",
|
},
|
||||||
"id": "ABCAJEDNCAA64SSD123AB"
|
{
|
||||||
}
|
"name": "instanceState",
|
||||||
},
|
"type": "InstanceState object",
|
||||||
{
|
"desc": "The current state of the instance.",
|
||||||
"name": "imageId",
|
"example": ""
|
||||||
"type": "文本",
|
},
|
||||||
"desc": "The ID of the AMI used to launch the instance.",
|
{
|
||||||
"example": "ami-bff32ccc"
|
"name": "instanceType",
|
||||||
},
|
"type": "String",
|
||||||
{
|
"desc": "The instance type.",
|
||||||
"name": "instanceId",
|
"example": "a1.medium"
|
||||||
"type": "文本",
|
},
|
||||||
"desc": "The ID of the instance.",
|
{
|
||||||
"example": "i-1234567890abcdef0"
|
"name": "ipAddress",
|
||||||
},
|
"type": "String",
|
||||||
{
|
"desc": "The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable. A Carrier IP address only applies to an instance launched in a subnet associated with a Wavelength Zone.",
|
||||||
"name": "instanceLifecycle",
|
"example": "Required: No"
|
||||||
"type": "文本",
|
},
|
||||||
"desc": "Indicates whether this is a Spot Instance or a Scheduled Instance.",
|
{
|
||||||
"example": null
|
"name": "ipv6Address",
|
||||||
},
|
"type": "String",
|
||||||
{
|
"desc": "The IPv6 address assigned to the instance.",
|
||||||
"name": "instanceState",
|
"example": ""
|
||||||
"type": "json",
|
},
|
||||||
"desc": "The current state of the instance.",
|
{
|
||||||
"example": {
|
"name": "kernelId",
|
||||||
"code": "16",
|
"type": "String",
|
||||||
"name": "running"
|
"desc": "The kernel associated with this instance, if applicable.",
|
||||||
}
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "instanceType",
|
"name": "keyName",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The instance type.",
|
"desc": "The name of the key pair, if this instance was launched with an associated key pair.",
|
||||||
"example": "t2.micro"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ipAddress",
|
"name": "launchTime",
|
||||||
"type": "文本",
|
"type": "Timestamp",
|
||||||
"desc": "The public IPv4 address, or the Carrier IP address assigned to the instance, if applicable.",
|
"desc": "The time the instance was launched.",
|
||||||
"example": "54.194.252.215"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ipv6Address",
|
"name": "licenseSet",
|
||||||
"type": "文本",
|
"type": "Array of LicenseConfiguration objects",
|
||||||
"desc": "The IPv6 address assigned to the instance.",
|
"desc": "The license configurations for the instance.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "kernelId",
|
"name": "maintenanceOptions",
|
||||||
"type": "文本",
|
"type": "InstanceMaintenanceOptions object",
|
||||||
"desc": "The kernel associated with this instance, if applicable.",
|
"desc": "Provides information on the recovery and maintenance options of your instance.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "keyName",
|
"name": "metadataOptions",
|
||||||
"type": "文本",
|
"type": "InstanceMetadataOptionsResponse object",
|
||||||
"desc": "The name of the key pair, if this instance was launched with an associated key pair.",
|
"desc": "The metadata options for the instance.",
|
||||||
"example": "my_keypair"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "launchTime",
|
"name": "monitoring",
|
||||||
"type": "Time",
|
"type": "Monitoring object",
|
||||||
"desc": "The time the instance was launched.",
|
"desc": "The monitoring for the instance.",
|
||||||
"example": "2018-05-08T16:46:19.000Z"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "licenseSet",
|
"name": "networkInterfaceSet",
|
||||||
"type": "json",
|
"type": "Array of InstanceNetworkInterface objects",
|
||||||
"desc": "The license configurations for the instance.",
|
"desc": "The network interfaces for the instance.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maintenanceOptions",
|
"name": "outpostArn",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "Provides information on the recovery and maintenance options of your instance.",
|
"desc": "The Amazon Resource Name (ARN) of the Outpost.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "metadataOptions",
|
"name": "placement",
|
||||||
"type": "json",
|
"type": "Placement object",
|
||||||
"desc": "The metadata options for the instance.",
|
"desc": "The location where the instance launched, if applicable.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "monitoring",
|
"name": "platform",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "The monitoring for the instance.",
|
"desc": "The platform. This value is windows for Windows instances; otherwise, it is empty.",
|
||||||
"example": {
|
"example": "windows"
|
||||||
"state": "disabled"
|
},
|
||||||
}
|
{
|
||||||
},
|
"name": "platformDetails",
|
||||||
{
|
"type": "String",
|
||||||
"name": "networkInterfaceSet",
|
"desc": "The platform details value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.",
|
||||||
"type": "json",
|
"example": ""
|
||||||
"desc": "The network interfaces for the instance.",
|
},
|
||||||
"example": {
|
{
|
||||||
"item": {
|
"name": "privateDnsName",
|
||||||
"networkInterfaceId": "eni-551ba033",
|
"type": "String",
|
||||||
"subnetId": "subnet-56f5f633",
|
"desc": "[IPv4 only] The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state. The Amazon-provided DNS server resolves Amazon-provided private DNS hostnames if you've enabled DNS resolution and DNS hostnames in your VPC. If you are not using the Amazon-provided DNS server in your VPC, your custom domain name servers must resolve the hostname as appropriate.",
|
||||||
"vpcId": "vpc-11112222",
|
"example": "Required: No"
|
||||||
"description": "Primary network interface",
|
},
|
||||||
"ownerId": "123456789012",
|
{
|
||||||
"status": "in-use",
|
"name": "privateDnsNameOptions",
|
||||||
"macAddress": "02:dd:2c:5e:01:69",
|
"type": "PrivateDnsNameOptionsResponse object",
|
||||||
"privateIpAddress": "192.168.1.88",
|
"desc": "The options for the instance hostname.",
|
||||||
"privateDnsName": "ip-192-168-1-88.eu-west-1.compute.internal",
|
"example": ""
|
||||||
"sourceDestCheck": "true",
|
},
|
||||||
"groupSet": {
|
{
|
||||||
"item": {
|
"name": "privateIpAddress",
|
||||||
"groupId": "sg-e4076980",
|
"type": "String",
|
||||||
"groupName": "SecurityGroup1"
|
"desc": "The private IPv4 address assigned to the instance.",
|
||||||
}
|
"example": ""
|
||||||
},
|
},
|
||||||
"attachment": {
|
{
|
||||||
"attachmentId": "eni-attach-39697adc",
|
"name": "productCodes",
|
||||||
"deviceIndex": "0",
|
"type": "Array of ProductCode objects",
|
||||||
"status": "attached",
|
"desc": "The product codes attached to this instance, if applicable.",
|
||||||
"attachTime": "2018-05-08T16:46:19.000Z",
|
"example": ""
|
||||||
"deleteOnTermination": "true"
|
},
|
||||||
},
|
{
|
||||||
"association": {
|
"name": "ramdiskId",
|
||||||
"publicIp": "54.194.252.215",
|
"type": "String",
|
||||||
"publicDnsName": "ec2-54-194-252-215.eu-west-1.compute.amazonaws.com",
|
"desc": "The RAM disk associated with this instance, if applicable.",
|
||||||
"ipOwnerId": "amazon"
|
"example": ""
|
||||||
},
|
},
|
||||||
"privateIpAddressesSet": {
|
{
|
||||||
"item": {
|
"name": "reason",
|
||||||
"privateIpAddress": "192.168.1.88",
|
"type": "String",
|
||||||
"privateDnsName": "ip-192-168-1-88.eu-west-1.compute.internal",
|
"desc": "The reason for the most recent state transition. This might be an empty string.",
|
||||||
"primary": "true",
|
"example": ""
|
||||||
"association": {
|
},
|
||||||
"publicIp": "54.194.252.215",
|
{
|
||||||
"publicDnsName": "ec2-54-194-252-215.eu-west-1.compute.amazonaws.com",
|
"name": "rootDeviceName",
|
||||||
"ipOwnerId": "amazon"
|
"type": "String",
|
||||||
}
|
"desc": "The device name of the root device volume (for example, /dev/sda1).",
|
||||||
}
|
"example": ""
|
||||||
},
|
},
|
||||||
"ipv6AddressesSet": {
|
{
|
||||||
"item": {
|
"name": "rootDeviceType",
|
||||||
"ipv6Address": "2001:db8:1234:1a2b::123"
|
"type": "String",
|
||||||
}
|
"desc": "The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.",
|
||||||
}
|
"example": "ebs"
|
||||||
}
|
},
|
||||||
}
|
{
|
||||||
},
|
"name": "sourceDestCheck",
|
||||||
{
|
"type": "Boolean",
|
||||||
"name": "outpostArn",
|
"desc": "Indicates whether source/destination checking is enabled.",
|
||||||
"type": "文本",
|
"example": ""
|
||||||
"desc": "The Amazon Resource Name (ARN) of the Outpost.",
|
},
|
||||||
"example": null
|
{
|
||||||
},
|
"name": "spotInstanceRequestId",
|
||||||
{
|
"type": "String",
|
||||||
"name": "placement",
|
"desc": "If the request is a Spot Instance request, the ID of the request.",
|
||||||
"type": "json",
|
"example": ""
|
||||||
"desc": "The location where the instance launched, if applicable.",
|
},
|
||||||
"example": {
|
{
|
||||||
"availabilityZone": "eu-west-1c",
|
"name": "sriovNetSupport",
|
||||||
"groupName": null,
|
"type": "String",
|
||||||
"tenancy": "default"
|
"desc": "Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.",
|
||||||
}
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "platform",
|
"name": "stateReason",
|
||||||
"type": "文本",
|
"type": "StateReason object",
|
||||||
"desc": "The value is Windows for Windows instances; otherwise blank.",
|
"desc": "The reason for the most recent state transition.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "platformDetails",
|
"name": "subnetId",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The platform details value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.",
|
"desc": "The ID of the subnet in which the instance is running.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "privateDnsName",
|
"name": "tagSet",
|
||||||
"type": "文本",
|
"type": "Array of Tag objects",
|
||||||
"desc": "[IPv4 only] The private DNS hostname name assigned to the instance. This DNS hostname can only be used inside the Amazon EC2 network. This name is not available until the instance enters the running state.",
|
"desc": "Any tags assigned to the instance.",
|
||||||
"example": "ip-192-168-1-88.eu-west-1.compute.internal"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "privateDnsNameOptions",
|
"name": "tpmSupport",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "The options for the instance hostname.",
|
"desc": "If the instance is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "privateIpAddress",
|
"name": "usageOperation",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The private IPv4 address assigned to the instance.",
|
"desc": "The usage operation value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.",
|
||||||
"example": "192.168.1.88"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "productCodes",
|
"name": "usageOperationUpdateTime",
|
||||||
"type": "json",
|
"type": "Timestamp",
|
||||||
"desc": "The product codes attached to this instance, if applicable.",
|
"desc": "The time that the usage operation was last updated.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ramdiskId",
|
"name": "virtualizationType",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The RAM disk associated with this instance, if applicable.",
|
"desc": "The virtualization type of the instance.",
|
||||||
"example": null
|
"example": "hvm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "reason",
|
"name": "vpcId",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "The reason for the most recent state transition. This might be an empty string.",
|
"desc": "The ID of the VPC in which the instance is running.",
|
||||||
"example": null
|
"example": ""
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"name": "rootDeviceName",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "The device name of the root device volume (for example, /dev/sda1).",
|
|
||||||
"example": "/dev/xvda"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "rootDeviceType",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "The root device type used by the AMI. The AMI can use an EBS volume or an instance store volume.",
|
|
||||||
"example": "ebs"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sourceDestCheck",
|
|
||||||
"type": "Boolean",
|
|
||||||
"desc": "Indicates whether source/destination checking is enabled.",
|
|
||||||
"example": "true"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "spotInstanceRequestId",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "If the request is a Spot Instance request, the ID of the request.",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "sriovNetSupport",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "stateReason",
|
|
||||||
"type": "json",
|
|
||||||
"desc": "The reason for the most recent state transition.",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "subnetId",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "The ID of the subnet in which the instance is running.",
|
|
||||||
"example": "subnet-56f5f633"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tagSet",
|
|
||||||
"type": "json",
|
|
||||||
"desc": "Any tags assigned to the instance.",
|
|
||||||
"example": {
|
|
||||||
"item": {
|
|
||||||
"key": "Name",
|
|
||||||
"value": "Server_1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tpmSupport",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "If the instance is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "usageOperation",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "The usage operation value for the instance. For more information, see AMI billing information fields in the Amazon EC2 User Guide.",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "usageOperationUpdateTime",
|
|
||||||
"type": "Time",
|
|
||||||
"desc": "The time that the usage operation was last updated.",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "virtualizationType",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "The virtualization type of the instance.",
|
|
||||||
"example": "hvm"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "vpcId",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "The ID of the VPC in which the instance is running.",
|
|
||||||
"example": "vpc-11112222"
|
|
||||||
}
|
|
||||||
]
|
]
|
|
@ -1,292 +1,284 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "status",
|
"name": "status",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "ACTIVE",
|
"desc": "弹性云服务器状态。\n\n取值范围:\n\nACTIVE、BUILD、DELETED、ERROR、HARD_REBOOT、MIGRATING、PAUSED、REBOOT、REBUILD、RESIZE、REVERT_RESIZE、SHUTOFF、SHELVED、SHELVED_OFFLOADED、SOFT_DELETED、SUSPENDED、VERIFY_RESIZE\n\n弹性云服务器状态说明请参考[云服务器状态](https://support.huaweicloud.com/api-ecs/ecs_08_0002.html)",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u72b6\u6001\u3002\n\n\u53d6\u503c\u8303\u56f4:\n\nACTIVE\u3001BUILD\u3001DELETED\u3001ERROR\u3001HARD_REBOOT\u3001MIGRATING\u3001PAUSED\u3001REBOOT\u3001REBUILD\u3001RESIZE\u3001REVERT_RESIZE\u3001SHUTOFF\u3001SHELVED\u3001SHELVED_OFFLOADED\u3001SOFT_DELETED\u3001SUSPENDED\u3001VERIFY_RESIZE\n\n\u5f39\u6027\u4e91\u670d\u52a1\u5668\u72b6\u6001\u8bf4\u660e\u8bf7\u53c2\u8003[\u4e91\u670d\u52a1\u5668\u72b6\u6001](https://support.huaweicloud.com/api-ecs/ecs_08_0002.html)"
|
"example": "ACTIVE"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "updated",
|
"name": "updated",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "2019-05-22T03:30:52Z",
|
"desc": "弹性云服务器更新时间。\n\n时间格式例如:2019-05-22T03:30:52Z",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u66f4\u65b0\u65f6\u95f4\u3002\n\n\u65f6\u95f4\u683c\u5f0f\u4f8b\u5982:2019-05-22T03:30:52Z"
|
"example": "2019-05-22T03:30:52Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "auto_terminate_time",
|
"name": "auto_terminate_time",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "2020-01-19T03:30:52Z",
|
"desc": "弹性云服务器定时删除时间。\n\n时间格式例如:2020-01-19T03:30:52Z",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u81ea\u52a8\u91ca\u653e\u65f6\u95f4\u3002\n\n\u65f6\u95f4\u683c\u5f0f\u4f8b\u5982:2020-01-19T03:30:52Z"
|
"example": "2020-01-19T03:30:52Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hostId",
|
"name": "hostId",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "c7145889b2e3202cd295ceddb1742ff8941b827b586861fd0acedf64",
|
"desc": "弹性云服务器所在主机的主机ID。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5728\u4e3b\u673a\u7684\u4e3b\u673aID\u3002"
|
"example": "c7145889b2e3202cd295ceddb1742ff8941b827b586861fd0acedf64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OS-EXT-SRV-ATTR:host",
|
"name": "OS-EXT-SRV-ATTR:host",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "pod01.cn-north-1c",
|
"desc": "弹性云服务器所在主机的主机名称。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5728\u4e3b\u673a\u7684\u4e3b\u673a\u540d\u79f0\u3002"
|
"example": "pod01.cn-north-1c"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "addresses",
|
"name": "addresses",
|
||||||
"type": "json",
|
"type": "object",
|
||||||
"example": null,
|
"desc": "弹性云服务器的网络属性。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u7f51\u7edc\u5c5e\u6027\u3002"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "key_name",
|
"name": "key_name",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "KeyPair-test",
|
"desc": "弹性云服务器使用的密钥对名称。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u4f7f\u7528\u7684\u5bc6\u94a5\u5bf9\u540d\u79f0\u3002"
|
"example": "KeyPair-test"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "image",
|
"name": "image",
|
||||||
"type": "json",
|
"type": "",
|
||||||
"example": null,
|
"desc": "弹性云服务器镜像信息。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u955c\u50cf\u4fe1\u606f\u3002"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OS-EXT-STS:task_state",
|
"name": "OS-EXT-STS:task_state",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "rebooting",
|
"desc": "扩展属性,弹性云服务器当前任务的状态。\n\n取值范围请参考[云服务器状态](https://support.huaweicloud.com/api-ecs/ecs_08_0002.html)表3。",
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u5f53\u524d\u4efb\u52a1\u7684\u72b6\u6001\u3002\n\n\u53d6\u503c\u8303\u56f4\u8bf7\u53c2\u8003[\u4e91\u670d\u52a1\u5668\u72b6\u6001](https://support.huaweicloud.com/api-ecs/ecs_08_0002.html)\u88683\u3002"
|
"example": "rebooting"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OS-EXT-STS:vm_state",
|
"name": "OS-EXT-STS:vm_state",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "active",
|
"desc": "扩展属性,弹性云服务器当前状态。\n\n云服务器状态说明请参考[云服务器状态](https://support.huaweicloud.com/api-ecs/ecs_08_0002.html)。",
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u5f53\u524d\u72b6\u6001\u3002\n\n\u4e91\u670d\u52a1\u5668\u72b6\u6001\u8bf4\u660e\u8bf7\u53c2\u8003[\u4e91\u670d\u52a1\u5668\u72b6\u6001](https://support.huaweicloud.com/api-ecs/ecs_08_0002.html)\u3002"
|
"example": "active"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OS-EXT-SRV-ATTR:instance_name",
|
"name": "OS-EXT-SRV-ATTR:instance_name",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "instance-0048a91b",
|
"desc": "扩展属性,弹性云服务器别名。",
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u522b\u540d\u3002"
|
"example": "instance-0048a91b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "OS-EXT-SRV-ATTR:hypervisor_hostname",
|
"name": "OS-EXT-SRV-ATTR:hypervisor_hostname",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "nova022@36",
|
"desc": "扩展属性,弹性云服务器所在虚拟化主机名。",
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5728\u865a\u62df\u5316\u4e3b\u673a\u540d\u3002"
|
"example": "nova022@36"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "flavor",
|
"name": "flavor",
|
||||||
"type": "json",
|
"type": "",
|
||||||
"example": null,
|
"desc": "弹性云服务器规格信息。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u89c4\u683c\u4fe1\u606f\u3002"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"type": "文本",
|
"type": "string",
|
||||||
"example": "4f4b3dfa-eb70-47cf-a60a-998a53bd6666",
|
"desc": "弹性云服务器ID,格式为UUID。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668ID,\u683c\u5f0f\u4e3aUUID\u3002"
|
"example": "4f4b3dfa-eb70-47cf-a60a-998a53bd6666"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "security_groups",
|
"name": "security_groups",
|
||||||
"type": "json",
|
"type": "array",
|
||||||
"example": {
|
"desc": "弹性云服务器所属安全组列表。",
|
||||||
"$ref": "#/definitions/ServerSecurityGroup"
|
"example": ""
|
||||||
},
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5c5e\u5b89\u5168\u7ec4\u5217\u8868\u3002"
|
{
|
||||||
},
|
"name": "OS-EXT-AZ:availability_zone",
|
||||||
{
|
"type": "string",
|
||||||
"name": "OS-EXT-AZ:availability_zone",
|
"desc": "扩展属性,弹性云服务器所在可用区名称。",
|
||||||
"type": "文本",
|
"example": "cn-north-1c"
|
||||||
"example": "cn-north-1c",
|
},
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5728\u53ef\u7528\u533a\u540d\u79f0\u3002"
|
{
|
||||||
},
|
"name": "user_id",
|
||||||
{
|
"type": "string",
|
||||||
"name": "user_id",
|
"desc": "创建弹性云服务器的用户ID,格式为UUID。",
|
||||||
"type": "文本",
|
"example": "05498fe56b8010d41f7fc01e280b6666"
|
||||||
"example": "05498fe56b8010d41f7fc01e280b6666",
|
},
|
||||||
"desc": "\u521b\u5efa\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u7528\u6237ID,\u683c\u5f0f\u4e3aUUID\u3002"
|
{
|
||||||
},
|
"name": "name",
|
||||||
{
|
"type": "string",
|
||||||
"name": "name",
|
"desc": "弹性云服务器名称。",
|
||||||
"type": "文本",
|
"example": "ecs-test-server"
|
||||||
"example": "ecs-test-server",
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u540d\u79f0\u3002"
|
{
|
||||||
},
|
"name": "created",
|
||||||
{
|
"type": "string",
|
||||||
"name": "created",
|
"desc": "弹性云服务器创建时间。\n\n时间格式例如:2019-05-22T03:19:19Z",
|
||||||
"type": "文本",
|
"example": "2017-07-15T11:30:52Z"
|
||||||
"example": "2017-07-15T11:30:52Z",
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u521b\u5efa\u65f6\u95f4\u3002\n\n\u65f6\u95f4\u683c\u5f0f\u4f8b\u5982:2019-05-22T03:19:19Z"
|
{
|
||||||
},
|
"name": "tenant_id",
|
||||||
{
|
"type": "string",
|
||||||
"name": "tenant_id",
|
"desc": "弹性云服务器所属租户ID,即项目id,和project_id表示相同的概念,格式为UUID。",
|
||||||
"type": "文本",
|
"example": "743b4c0428d94531b9f2add666646666"
|
||||||
"example": "743b4c0428d94531b9f2add666646666",
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5c5e\u79df\u6237ID,\u5373\u9879\u76eeid,\u548cproject_id\u8868\u793a\u76f8\u540c\u7684\u6982\u5ff5,\u683c\u5f0f\u4e3aUUID\u3002"
|
{
|
||||||
},
|
"name": "OS-DCF:diskConfig",
|
||||||
{
|
"type": "string",
|
||||||
"name": "OS-DCF:diskConfig",
|
"desc": "扩展属性, diskConfig的类型。\n\n- MANUAL,镜像空间不会扩展。\n- AUTO,系统盘镜像空间会自动扩展为与flavor大小一致。",
|
||||||
"type": "文本",
|
"example": "AUTO"
|
||||||
"example": "AUTO",
|
},
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027, diskConfig\u7684\u7c7b\u578b\u3002\n\n- MANUAL,\u955c\u50cf\u7a7a\u95f4\u4e0d\u4f1a\u6269\u5c55\u3002\n- AUTO,\u7cfb\u7edf\u76d8\u955c\u50cf\u7a7a\u95f4\u4f1a\u81ea\u52a8\u6269\u5c55\u4e3a\u4e0eflavor\u5927\u5c0f\u4e00\u81f4\u3002"
|
{
|
||||||
},
|
"name": "accessIPv4",
|
||||||
{
|
"type": "string",
|
||||||
"name": "accessIPv4",
|
"desc": "预留属性。",
|
||||||
"type": "文本",
|
"example": ""
|
||||||
"example": null,
|
},
|
||||||
"desc": "\u9884\u7559\u5c5e\u6027\u3002"
|
{
|
||||||
},
|
"name": "accessIPv6",
|
||||||
{
|
"type": "string",
|
||||||
"name": "accessIPv6",
|
"desc": "预留属性。",
|
||||||
"type": "文本",
|
"example": ""
|
||||||
"example": null,
|
},
|
||||||
"desc": "\u9884\u7559\u5c5e\u6027\u3002"
|
{
|
||||||
},
|
"name": "fault",
|
||||||
{
|
"type": "",
|
||||||
"name": "fault",
|
"desc": "弹性云服务器故障信息。\n\n可选参数,在弹性云服务器状态为ERROR且存在异常的情况下返回。",
|
||||||
"type": "文本",
|
"example": ""
|
||||||
"example": null,
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6545\u969c\u4fe1\u606f\u3002\n\n\u53ef\u9009\u53c2\u6570,\u5728\u5f39\u6027\u4e91\u670d\u52a1\u5668\u72b6\u6001\u4e3aERROR\u4e14\u5b58\u5728\u5f02\u5e38\u7684\u60c5\u51b5\u4e0b\u8fd4\u56de\u3002"
|
{
|
||||||
},
|
"name": "progress",
|
||||||
{
|
"type": "integer",
|
||||||
"name": "progress",
|
"desc": "弹性云服务器进度。",
|
||||||
"type": "整数",
|
"example": 0
|
||||||
"example": null,
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u8fdb\u5ea6\u3002"
|
{
|
||||||
},
|
"name": "OS-EXT-STS:power_state",
|
||||||
{
|
"type": "integer",
|
||||||
"name": "OS-EXT-STS:power_state",
|
"desc": "扩展属性,弹性云服务器电源状态。",
|
||||||
"type": "整数",
|
"example": 4
|
||||||
"example": 4,
|
},
|
||||||
"desc": "\u6269\u5c55\u5c5e\u6027,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7535\u6e90\u72b6\u6001\u3002"
|
{
|
||||||
},
|
"name": "config_drive",
|
||||||
{
|
"type": "string",
|
||||||
"name": "config_drive",
|
"desc": "config drive信息。",
|
||||||
"type": "文本",
|
"example": ""
|
||||||
"example": null,
|
},
|
||||||
"desc": "config drive\u4fe1\u606f\u3002"
|
{
|
||||||
},
|
"name": "metadata",
|
||||||
{
|
"type": "object",
|
||||||
"name": "metadata",
|
"desc": "弹性云服务器元数据。\n\n> 说明:\n> \n> 元数据包含系统默认添加字段和用户设置的字段。\n\n系统默认添加字段\n\n1. charging_mode\n云服务器的计费类型。\n\n- “0”:按需计费(即postPaid-后付费方式)。\n- “1”:按包年包月计费(即prePaid-预付费方式)。\"2\":竞价实例计费\n\n2. metering.order_id\n按“包年/包月”计费的云服务器对应的订单ID。\n\n3. metering.product_id\n按“包年/包月”计费的云服务器对应的产品ID。\n\n4. vpc_id\n云服务器所属的虚拟私有云ID。\n\n5. EcmResStatus\n云服务器的冻结状态。\n\n- normal:云服务器正常状态(未被冻结)。\n- freeze:云服务器被冻结。\n\n> 当云服务器被冻结或者解冻后,系统默认添加该字段,且该字段必选。\n\n6. metering.image_id\n云服务器操作系统对应的镜像ID\n\n7. metering.imagetype\n镜像类型,目前支持:\n\n- 公共镜像(gold)\n- 私有镜像(private)\n- 共享镜像(shared)\n\n8. metering.resourcespeccode\n云服务器对应的资源规格。\n\n9. image_name\n云服务器操作系统对应的镜像名称。\n\n10. os_bit\n操作系统位数,一般取值为“32”或者“64”。\n\n11. lockCheckEndpoint\n回调URL,用于检查弹性云服务器的加锁是否有效。\n\n- 如果有效,则云服务器保持锁定状态。\n- 如果无效,解除锁定状态,删除失效的锁。\n\n12. lockSource\n弹性云服务器来自哪个服务。订单加锁(ORDER)\n\n13. lockSourceId\n弹性云服务器的加锁来自哪个ID。lockSource为“ORDER”时,lockSourceId为订单ID。\n\n14. lockScene\n弹性云服务器的加锁类型。\n\n- 按需转包周期(TO_PERIOD_LOCK)\n\n15. virtual_env_type\n\n- IOS镜像创建虚拟机,\"virtual_env_type\": \"IsoImage\" 属性;\n- 非IOS镜像创建虚拟机,在19.5.0版本以后创建的虚拟机将不会添加virtual_env_type 属性,而在此之前的版本创建的虚拟机可能会返回\"virtual_env_type\": \"FusionCompute\"属性 。\n\n> virtual_env_type属性不允许用户增加、删除和修改。\n\n16. metering.resourcetype\n云服务器对应的资源类型。\n\n17. os_type\n操作系统类型,取值为:Linux、Windows。\n\n18. cascaded.instance_extrainfo\n系统内部虚拟机扩展信息。\n\n19. __support_agent_list\n云服务器是否支持企业主机安全、主机监控。\n\n- “hss”:企业主机安全\n- “ces”:主机监控\n\n20. agency_name\n委托的名称。\n\n委托是由租户管理员在统一身份认证服务(Identity and Access Management,IAM)上创建的,可以为弹性云服务器提供访问云服务的临时凭证。",
|
||||||
"type": "json",
|
"example": ""
|
||||||
"example": null,
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u5143\u6570\u636e\u3002\n\n> \u8bf4\u660e:\n> \n> \u5143\u6570\u636e\u5305\u542b\u7cfb\u7edf\u9ed8\u8ba4\u6dfb\u52a0\u5b57\u6bb5\u548c\u7528\u6237\u8bbe\u7f6e\u7684\u5b57\u6bb5\u3002\n\n\u7cfb\u7edf\u9ed8\u8ba4\u6dfb\u52a0\u5b57\u6bb5\n\n1. charging_mode\n\u4e91\u670d\u52a1\u5668\u7684\u8ba1\u8d39\u7c7b\u578b\u3002\n\n- \u201c0\u201d:\u6309\u9700\u8ba1\u8d39(\u5373postPaid-\u540e\u4ed8\u8d39\u65b9\u5f0f)\u3002\n- \u201c1\u201d:\u6309\u5305\u5e74\u5305\u6708\u8ba1\u8d39(\u5373prePaid-\u9884\u4ed8\u8d39\u65b9\u5f0f)\u3002\"2\":\u7ade\u4ef7\u5b9e\u4f8b\u8ba1\u8d39\n\n2. metering.order_id\n\u6309\u201c\u5305\u5e74/\u5305\u6708\u201d\u8ba1\u8d39\u7684\u4e91\u670d\u52a1\u5668\u5bf9\u5e94\u7684\u8ba2\u5355ID\u3002\n\n3. metering.product_id\n\u6309\u201c\u5305\u5e74/\u5305\u6708\u201d\u8ba1\u8d39\u7684\u4e91\u670d\u52a1\u5668\u5bf9\u5e94\u7684\u4ea7\u54c1ID\u3002\n\n4. vpc_id\n\u4e91\u670d\u52a1\u5668\u6240\u5c5e\u7684\u865a\u62df\u79c1\u6709\u4e91ID\u3002\n\n5. EcmResStatus\n\u4e91\u670d\u52a1\u5668\u7684\u51bb\u7ed3\u72b6\u6001\u3002\n\n- normal:\u4e91\u670d\u52a1\u5668\u6b63\u5e38\u72b6\u6001(\u672a\u88ab\u51bb\u7ed3)\u3002\n- freeze:\u4e91\u670d\u52a1\u5668\u88ab\u51bb\u7ed3\u3002\n\n> \u5f53\u4e91\u670d\u52a1\u5668\u88ab\u51bb\u7ed3\u6216\u8005\u89e3\u51bb\u540e,\u7cfb\u7edf\u9ed8\u8ba4\u6dfb\u52a0\u8be5\u5b57\u6bb5,\u4e14\u8be5\u5b57\u6bb5\u5fc5\u9009\u3002\n\n6. metering.image_id\n\u4e91\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u5e94\u7684\u955c\u50cfID\n\n7. metering.imagetype\n\u955c\u50cf\u7c7b\u578b,\u76ee\u524d\u652f\u6301:\n\n- \u516c\u5171\u955c\u50cf(gold)\n- \u79c1\u6709\u955c\u50cf(private)\n- \u5171\u4eab\u955c\u50cf(shared)\n\n8. metering.resourcespeccode\n\u4e91\u670d\u52a1\u5668\u5bf9\u5e94\u7684\u8d44\u6e90\u89c4\u683c\u3002\n\n9. image_name\n\u4e91\u670d\u52a1\u5668\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u5e94\u7684\u955c\u50cf\u540d\u79f0\u3002\n\n10. os_bit\n\u64cd\u4f5c\u7cfb\u7edf\u4f4d\u6570,\u4e00\u822c\u53d6\u503c\u4e3a\u201c32\u201d\u6216\u8005\u201c64\u201d\u3002\n\n11. lockCheckEndpoint\n\u56de\u8c03URL,\u7528\u4e8e\u68c0\u67e5\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u52a0\u9501\u662f\u5426\u6709\u6548\u3002\n\n- \u5982\u679c\u6709\u6548,\u5219\u4e91\u670d\u52a1\u5668\u4fdd\u6301\u9501\u5b9a\u72b6\u6001\u3002\n- \u5982\u679c\u65e0\u6548,\u89e3\u9664\u9501\u5b9a\u72b6\u6001,\u5220\u9664\u5931\u6548\u7684\u9501\u3002\n\n12. lockSource\n\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6765\u81ea\u54ea\u4e2a\u670d\u52a1\u3002\u8ba2\u5355\u52a0\u9501(ORDER)\n\n13. lockSourceId\n\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u52a0\u9501\u6765\u81ea\u54ea\u4e2aID\u3002lockSource\u4e3a\u201cORDER\u201d\u65f6,lockSourceId\u4e3a\u8ba2\u5355ID\u3002\n\n14. lockScene\n\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u52a0\u9501\u7c7b\u578b\u3002\n\n- \u6309\u9700\u8f6c\u5305\u5468\u671f(TO_PERIOD_LOCK)\n\n15. virtual_env_type\n\n- IOS\u955c\u50cf\u521b\u5efa\u865a\u62df\u673a,\"virtual_env_type\": \"IsoImage\" \u5c5e\u6027;\n- \u975eIOS\u955c\u50cf\u521b\u5efa\u865a\u62df\u673a,\u572819.5.0\u7248\u672c\u4ee5\u540e\u521b\u5efa\u7684\u865a\u62df\u673a\u5c06\u4e0d\u4f1a\u6dfb\u52a0virtual_env_type \u5c5e\u6027,\u800c\u5728\u6b64\u4e4b\u524d\u7684\u7248\u672c\u521b\u5efa\u7684\u865a\u62df\u673a\u53ef\u80fd\u4f1a\u8fd4\u56de\"virtual_env_type\": \"FusionCompute\"\u5c5e\u6027 \u3002\n\n> virtual_env_type\u5c5e\u6027\u4e0d\u5141\u8bb8\u7528\u6237\u589e\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u3002\n\n16. metering.resourcetype\n\u4e91\u670d\u52a1\u5668\u5bf9\u5e94\u7684\u8d44\u6e90\u7c7b\u578b\u3002\n\n17. os_type\n\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b,\u53d6\u503c\u4e3a:Linux\u3001Windows\u3002\n\n18. cascaded.instance_extrainfo\n\u7cfb\u7edf\u5185\u90e8\u865a\u62df\u673a\u6269\u5c55\u4fe1\u606f\u3002\n\n19. __support_agent_list\n\u4e91\u670d\u52a1\u5668\u662f\u5426\u652f\u6301\u4f01\u4e1a\u4e3b\u673a\u5b89\u5168\u3001\u4e3b\u673a\u76d1\u63a7\u3002\n\n- \u201chss\u201d:\u4f01\u4e1a\u4e3b\u673a\u5b89\u5168\n- \u201cces\u201d:\u4e3b\u673a\u76d1\u63a7\n\n20. agency_name\n\u59d4\u6258\u7684\u540d\u79f0\u3002\n\n\u59d4\u6258\u662f\u7531\u79df\u6237\u7ba1\u7406\u5458\u5728\u7edf\u4e00\u8eab\u4efd\u8ba4\u8bc1\u670d\u52a1(Identity and Access Management,IAM)\u4e0a\u521b\u5efa\u7684,\u53ef\u4ee5\u4e3a\u5f39\u6027\u4e91\u670d\u52a1\u5668\u63d0\u4f9b\u8bbf\u95ee\u4e91\u670d\u52a1\u7684\u4e34\u65f6\u51ed\u8bc1\u3002"
|
{
|
||||||
},
|
"name": "OS-SRV-USG:launched_at",
|
||||||
{
|
"type": "string",
|
||||||
"name": "OS-SRV-USG:launched_at",
|
"desc": "弹性云服务器启动时间。时间格式例如:2019-05-22T03:23:59.000000",
|
||||||
"type": "文本",
|
"example": "2018-08-15T14:21:22.000000"
|
||||||
"example": "2018-08-15T14:21:22.000000",
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u542f\u52a8\u65f6\u95f4\u3002\u65f6\u95f4\u683c\u5f0f\u4f8b\u5982:2019-05-22T03:23:59.000000"
|
{
|
||||||
},
|
"name": "OS-SRV-USG:terminated_at",
|
||||||
{
|
"type": "string",
|
||||||
"name": "OS-SRV-USG:terminated_at",
|
"desc": "弹性云服务器删除时间。\n\n时间格式例如:2019-05-22T03:23:59.000000",
|
||||||
"type": "文本",
|
"example": "2019-05-22T03:23:59.000000"
|
||||||
"example": "2019-05-22T03:23:59.000000",
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u5220\u9664\u65f6\u95f4\u3002\n\n\u65f6\u95f4\u683c\u5f0f\u4f8b\u5982:2019-05-22T03:23:59.000000"
|
{
|
||||||
},
|
"name": "os-extended-volumes:volumes_attached",
|
||||||
{
|
"type": "array",
|
||||||
"name": "os-extended-volumes:volumes_attached",
|
"desc": "挂载到弹性云服务器上的磁盘。",
|
||||||
"type": "json",
|
"example": ""
|
||||||
"example": {
|
},
|
||||||
"$ref": "#/definitions/ServerExtendVolumeAttachment"
|
{
|
||||||
},
|
"name": "description",
|
||||||
"desc": "\u6302\u8f7d\u5230\u5f39\u6027\u4e91\u670d\u52a1\u5668\u4e0a\u7684\u78c1\u76d8\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "弹性云服务器的描述信息。",
|
||||||
{
|
"example": "ecs description"
|
||||||
"name": "description",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": "ecs description",
|
"name": "host_status",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u63cf\u8ff0\u4fe1\u606f\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "nova-compute状态。\n\n- UP:服务正常\n- UNKNOWN:状态未知\n- DOWN:服务异常\n- MAINTENANCE:维护状态\n- 空字符串:弹性云服务器无主机信息",
|
||||||
{
|
"example": "UP"
|
||||||
"name": "host_status",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": "UP",
|
"name": "OS-EXT-SRV-ATTR:hostname",
|
||||||
"desc": "nova-compute\u72b6\u6001\u3002\n\n- UP:\u670d\u52a1\u6b63\u5e38\n- UNKNOWN:\u72b6\u6001\u672a\u77e5\n- DOWN:\u670d\u52a1\u5f02\u5e38\n- MAINTENANCE:\u7ef4\u62a4\u72b6\u6001\n- \u7a7a\u5b57\u7b26\u4e32:\u5f39\u6027\u4e91\u670d\u52a1\u5668\u65e0\u4e3b\u673a\u4fe1\u606f"
|
"type": "string",
|
||||||
},
|
"desc": "弹性云服务器的主机名。",
|
||||||
{
|
"example": ""
|
||||||
"name": "OS-EXT-SRV-ATTR:hostname",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": null,
|
"name": "OS-EXT-SRV-ATTR:reservation_id",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "批量创建场景,弹性云服务器的预留ID。",
|
||||||
{
|
"example": "r-f06p3js8"
|
||||||
"name": "OS-EXT-SRV-ATTR:reservation_id",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": "r-f06p3js8",
|
"name": "OS-EXT-SRV-ATTR:launch_index",
|
||||||
"desc": "\u6279\u91cf\u521b\u5efa\u573a\u666f,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u9884\u7559ID\u3002"
|
"type": "integer",
|
||||||
},
|
"desc": "批量创建场景,弹性云服务器的启动顺序。",
|
||||||
{
|
"example": 0
|
||||||
"name": "OS-EXT-SRV-ATTR:launch_index",
|
},
|
||||||
"type": "整数",
|
{
|
||||||
"example": null,
|
"name": "OS-EXT-SRV-ATTR:kernel_id",
|
||||||
"desc": "\u6279\u91cf\u521b\u5efa\u573a\u666f,\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7684\u542f\u52a8\u987a\u5e8f\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "若使用AMI格式的镜像,则表示kernel image的UUID;否则,留空。",
|
||||||
{
|
"example": ""
|
||||||
"name": "OS-EXT-SRV-ATTR:kernel_id",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": null,
|
"name": "OS-EXT-SRV-ATTR:ramdisk_id",
|
||||||
"desc": "\u82e5\u4f7f\u7528AMI\u683c\u5f0f\u7684\u955c\u50cf,\u5219\u8868\u793akernel image\u7684UUID;\u5426\u5219,\u7559\u7a7a\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "若使用AMI格式镜像,则表示ramdisk image的UUID;否则,留空。",
|
||||||
{
|
"example": ""
|
||||||
"name": "OS-EXT-SRV-ATTR:ramdisk_id",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": null,
|
"name": "OS-EXT-SRV-ATTR:root_device_name",
|
||||||
"desc": "\u82e5\u4f7f\u7528AMI\u683c\u5f0f\u955c\u50cf,\u5219\u8868\u793aramdisk image\u7684UUID;\u5426\u5219,\u7559\u7a7a\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "弹性云服务器系统盘的设备名称。",
|
||||||
{
|
"example": "/dev/vda"
|
||||||
"name": "OS-EXT-SRV-ATTR:root_device_name",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": "/dev/vda",
|
"name": "OS-EXT-SRV-ATTR:user_data",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7cfb\u7edf\u76d8\u7684\u8bbe\u5907\u540d\u79f0\u3002"
|
"type": "string",
|
||||||
},
|
"desc": "创建弹性云服务器时指定的user_data。",
|
||||||
{
|
"example": "IyEvYmluL2Jhc2gKZWNobyAncm9vdDokNiRjcGRkSjckWm5WZHNiR253Z0l0SGlxUjZxbWtLTlJaeU9lZUtKd3dPbG9XSFdUeGFzWjA1STYwdnJYRTdTUTZGbEpFbWlXZ21WNGNmZ1pac1laN1BkMTBLRndyeC8nIHwgY2hwYXNzd2Q6666"
|
||||||
"name": "OS-EXT-SRV-ATTR:user_data",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"example": "IyEvYmluL2Jhc2gKZWNobyAncm9vdDokNiRjcGRkSjckWm5WZHNiR253Z0l0SGlxUjZxbWtLTlJaeU9lZUtKd3dPbG9XSFdUeGFzWjA1STYwdnJYRTdTUTZGbEpFbWlXZ21WNGNmZ1pac1laN1BkMTBLRndyeC8nIHwgY2hwYXNzd2Q6666",
|
"name": "locked",
|
||||||
"desc": "\u521b\u5efa\u5f39\u6027\u4e91\u670d\u52a1\u5668\u65f6\u6307\u5b9a\u7684user_data\u3002"
|
"type": "boolean",
|
||||||
},
|
"desc": "弹性云服务器是否为锁定状态。\n\n- true:锁定\n- false:未锁定",
|
||||||
{
|
"example": false
|
||||||
"name": "locked",
|
},
|
||||||
"type": "boolean",
|
{
|
||||||
"example": null,
|
"name": "tags",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u662f\u5426\u4e3a\u9501\u5b9a\u72b6\u6001\u3002\n\n- true:\u9501\u5b9a\n- false:\u672a\u9501\u5b9a"
|
"type": "array",
|
||||||
},
|
"desc": "弹性云服务器标签。",
|
||||||
{
|
"example": ""
|
||||||
"name": "tags",
|
},
|
||||||
"type": "文本、多值",
|
{
|
||||||
"example": {
|
"name": "os:scheduler_hints",
|
||||||
"type": "文本"
|
"type": "",
|
||||||
},
|
"desc": "弹性云服务器调度信息",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6807\u7b7e\u3002"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "os:scheduler_hints",
|
"name": "enterprise_project_id",
|
||||||
"type": "json",
|
"type": "string",
|
||||||
"example": null,
|
"desc": "弹性云服务器所属的企业项目ID。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u8c03\u5ea6\u4fe1\u606f"
|
"example": "0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "enterprise_project_id",
|
"name": "sys_tags",
|
||||||
"type": "文本",
|
"type": "array",
|
||||||
"example": "0",
|
"desc": "弹性云服务器系统标签。",
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u6240\u5c5e\u7684\u4f01\u4e1a\u9879\u76eeID\u3002"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sys_tags",
|
"name": "cpu_options",
|
||||||
"type": "文本、多值",
|
"type": "",
|
||||||
"example": {
|
"desc": "自定义CPU选项。",
|
||||||
"$ref": "#/definitions/ServerSystemTag"
|
"example": ""
|
||||||
},
|
},
|
||||||
"desc": "\u5f39\u6027\u4e91\u670d\u52a1\u5668\u7cfb\u7edf\u6807\u7b7e\u3002"
|
{
|
||||||
},
|
"name": "hypervisor",
|
||||||
{
|
"type": "",
|
||||||
"name": "cpu_options",
|
"desc": "hypervisor信息。",
|
||||||
"type": "json",
|
"example": ""
|
||||||
"example": null,
|
}
|
||||||
"desc": "\u81ea\u5b9a\u4e49CPU\u9009\u9879\u3002"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "hypervisor",
|
|
||||||
"type": "文本",
|
|
||||||
"example": null,
|
|
||||||
"desc": "hypervisor\u4fe1\u606f\u3002"
|
|
||||||
}
|
|
||||||
]
|
]
|
|
@ -1,297 +1,248 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "Placement",
|
"name": "Placement",
|
||||||
"type": "json",
|
"type": "Placement",
|
||||||
"desc": "实例所在的位置。",
|
"desc": "实例所在的位置。",
|
||||||
"example": {
|
"example": ""
|
||||||
"HostId": "host-h3m57oik",
|
},
|
||||||
"ProjectId": 1174660,
|
{
|
||||||
"HostIds": [],
|
"name": "InstanceId",
|
||||||
"Zone": "ap-guangzhou-1",
|
"type": "String",
|
||||||
"HostIps": []
|
"desc": "实例ID。",
|
||||||
}
|
"example": "ins-9bxebleo"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "InstanceId",
|
"name": "InstanceType",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "实例ID。",
|
"desc": "实例机型。",
|
||||||
"example": "ins-xlsyru2j"
|
"example": "S1.SMALL1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "InstanceType",
|
"name": "CPU",
|
||||||
"type": "文本",
|
"type": "Integer",
|
||||||
"desc": "实例机型。",
|
"desc": "实例的CPU核数,单位:核。",
|
||||||
"example": "S2.SMALL2"
|
"example": "1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "CPU",
|
"name": "Memory",
|
||||||
"type": "整数",
|
"type": "Integer",
|
||||||
"desc": "实例的CPU核数,单位:核。",
|
"desc": "实例内存容量,单位:GB。",
|
||||||
"example": 1
|
"example": "1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Memory",
|
"name": "RestrictState",
|
||||||
"type": "整数",
|
"type": "String",
|
||||||
"desc": "实例内存容量,单位:GB。",
|
"desc": "NORMAL:表示正常状态的实例\nEXPIRED:表示过期的实例\nPROTECTIVELY_ISOLATED:表示被安全隔离的实例。",
|
||||||
"example": 1
|
"example": "NORMAL"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "RestrictState",
|
"name": "InstanceName",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "实例业务状态。取值范围: NORMAL:表示正常状态的实例 EXPIRED:表示过期的实例 PROTECTIVELY_ISOLATED:表示被安全隔离的实例。",
|
"desc": "实例名称。",
|
||||||
"example": "PROTECTIVELY_ISOLATED"
|
"example": "测试实例"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "InstanceName",
|
"name": "InstanceChargeType",
|
||||||
"type": "文本",
|
"type": "String",
|
||||||
"desc": "实例名称。",
|
"desc": "PREPAID:表示预付费,即包年包月\nPOSTPAID_BY_HOUR:表示后付费,即按量计费\nCDHPAID:专用宿主机付费,即只对专用宿主机计费,不对专用宿主机上的实例计费。\nSPOTPAID:表示竞价实例付费。",
|
||||||
"example": "test"
|
"example": "PREPAID"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "InstanceChargeType",
|
"name": "SystemDisk",
|
||||||
"type": "文本",
|
"type": "SystemDisk",
|
||||||
"desc": "实例计费模式。取值范围: PREPAID:表示预付费,即包年包月 POSTPAID_BY_HOUR:表示后付费,即按量计费 CDHPAID:专用宿主机付费,即只对专用宿主机计费,不对专用宿主机上的实例计费。 SPOTPAID:表示竞价实例付费。",
|
"desc": "实例系统盘信息。",
|
||||||
"example": "POSTPAID_BY_HOUR"
|
"example": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "SystemDisk",
|
"name": "DataDisks",
|
||||||
"type": "json",
|
"type": "Array of DataDisk",
|
||||||
"desc": "实例系统盘信息。",
|
"desc": "实例数据盘信息。",
|
||||||
"example": {
|
"example": ""
|
||||||
"DiskSize": 50,
|
},
|
||||||
"CdcId": null,
|
{
|
||||||
"DiskId": "disk-czsodtl1",
|
"name": "PrivateIpAddresses",
|
||||||
"DiskType": "CLOUD_SSD"
|
"type": "Array of String",
|
||||||
}
|
"desc": "实例主网卡的内网IP列表。",
|
||||||
},
|
"example": "[\"172.16.32.78\"]"
|
||||||
{
|
},
|
||||||
"name": "DataDisks",
|
{
|
||||||
"type": "json",
|
"name": "PublicIpAddresses",
|
||||||
"desc": "实例数据盘信息。",
|
"type": "Array of String",
|
||||||
"example": [
|
"desc": "实例主网卡的公网IP列表。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
{
|
"example": "[\"123.207.11.190\"]"
|
||||||
"DeleteWithInstance": true,
|
},
|
||||||
"Encrypt": true,
|
{
|
||||||
"CdcId": null,
|
"name": "InternetAccessible",
|
||||||
"DiskType": "CLOUD_SSD",
|
"type": "InternetAccessible",
|
||||||
"ThroughputPerformance": 0,
|
"desc": "实例带宽信息。",
|
||||||
"KmsKeyId": null,
|
"example": ""
|
||||||
"DiskSize": 50,
|
},
|
||||||
"SnapshotId": null,
|
{
|
||||||
"DiskId": "disk-bzsodtn1"
|
"name": "VirtualPrivateCloud",
|
||||||
}
|
"type": "VirtualPrivateCloud",
|
||||||
]
|
"desc": "实例所属虚拟私有网络信息。",
|
||||||
},
|
"example": ""
|
||||||
{
|
},
|
||||||
"name": "PrivateIpAddresses",
|
{
|
||||||
"type": "文本、多值",
|
"name": "ImageId",
|
||||||
"desc": "实例主网卡的内网IP列表。",
|
"type": "String",
|
||||||
"example": [
|
"desc": "生产实例所使用的镜像ID。",
|
||||||
"172.16.32.78"
|
"example": "img-9qabwvbn"
|
||||||
]
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "RenewFlag",
|
||||||
"name": "PublicIpAddresses",
|
"type": "String",
|
||||||
"type": "文本、多值",
|
"desc": "NOTIFY_AND_MANUAL_RENEW:表示通知即将过期,但不自动续费\nNOTIFY_AND_AUTO_RENEW:表示通知即将过期,而且自动续费\nDISABLE_NOTIFY_AND_MANUAL_RENEW:表示不通知即将过期,也不自动续费。\n注意:后付费模式本项为null",
|
||||||
"desc": "实例主网卡的公网IP列表。 注意:此字段可能返回 null,表示取不到有效值。",
|
"example": "NOTIFY_AND_MANUAL_RENEW"
|
||||||
"example": [
|
},
|
||||||
"123.207.11.190"
|
{
|
||||||
]
|
"name": "CreatedTime",
|
||||||
},
|
"type": "Timestamp ISO8601",
|
||||||
{
|
"desc": "创建时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。",
|
||||||
"name": "InternetAccessible",
|
"example": "2020-03-10T02:43:51Z"
|
||||||
"type": "json",
|
},
|
||||||
"desc": "实例带宽信息。",
|
{
|
||||||
"example": {
|
"name": "ExpiredTime",
|
||||||
"PublicIpAssigned": true,
|
"type": "Timestamp ISO8601",
|
||||||
"InternetChargeType": "TRAFFIC_POSTPAID_BY_HOUR",
|
"desc": "到期时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。注意:后付费模式本项为null",
|
||||||
"BandwidthPackageId": null,
|
"example": "2020-04-10T02:47:36Z"
|
||||||
"InternetMaxBandwidthOut": 1
|
},
|
||||||
}
|
{
|
||||||
},
|
"name": "OsName",
|
||||||
{
|
"type": "String",
|
||||||
"name": "VirtualPrivateCloud",
|
"desc": "操作系统名称。",
|
||||||
"type": "json",
|
"example": "CentOS 7.6 64bit"
|
||||||
"desc": "实例所属虚拟私有网络信息。",
|
},
|
||||||
"example": {
|
{
|
||||||
"SubnetId": "subnet-mv4sn55k",
|
"name": "SecurityGroupIds",
|
||||||
"AsVpcGateway": false,
|
"type": "Array of String",
|
||||||
"Ipv6AddressCount": 1,
|
"desc": "实例所属安全组。该参数可以通过调用 DescribeSecurityGroups 的返回值中的sgId字段来获取。",
|
||||||
"VpcId": "vpc-m0cnatxj",
|
"example": "[\"sg-p1ezv4wz\"]"
|
||||||
"PrivateIpAddresses": [
|
},
|
||||||
"172.16.3.59"
|
{
|
||||||
]
|
"name": "LoginSettings",
|
||||||
}
|
"type": "LoginSettings",
|
||||||
},
|
"desc": "实例登录设置。目前只返回实例所关联的密钥。",
|
||||||
{
|
"example": ""
|
||||||
"name": "ImageId",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"desc": "生产实例所使用的镜像ID。",
|
"name": "InstanceState",
|
||||||
"example": "img-8toqc6s3"
|
"type": "String",
|
||||||
},
|
"desc": "PENDING:表示创建中\nLAUNCH_FAILED:表示创建失败\nRUNNING:表示运行中\nSTOPPED:表示关机\nSTARTING:表示开机中\nSTOPPING:表示关机中\nREBOOTING:表示重启中\nSHUTDOWN:表示停止待销毁\nTERMINATING:表示销毁中。",
|
||||||
{
|
"example": ""
|
||||||
"name": "RenewFlag",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"desc": "自动续费标识。取值范围: NOTIFY_AND_MANUAL_RENEW:表示通知即将过期,但不自动续费 NOTIFY_AND_AUTO_RENEW:表示通知即将过期,而且自动续费 DISABLE_NOTIFY_AND_MANUAL_RENEW:表示不通知即将过期,也不自动续费。 注意:后付费模式本项为null",
|
"name": "Tags",
|
||||||
"example": "NOTIFY_AND_MANUAL_RENEW"
|
"type": "Array of Tag",
|
||||||
},
|
"desc": "实例关联的标签列表。",
|
||||||
{
|
"example": ""
|
||||||
"name": "CreatedTime",
|
},
|
||||||
"type": "json",
|
{
|
||||||
"desc": "创建时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。",
|
"name": "StopChargingMode",
|
||||||
"example": "2020-09-22T00:00:00+00:00"
|
"type": "String",
|
||||||
},
|
"desc": "KEEP_CHARGING:关机继续收费\nSTOP_CHARGING:关机停止收费\nNOT_APPLICABLE:实例处于非关机状态或者不适用关机停止计费的条件",
|
||||||
{
|
"example": "NOT_APPLICABLE"
|
||||||
"name": "ExpiredTime",
|
},
|
||||||
"type": "json",
|
{
|
||||||
"desc": "到期时间。按照ISO8601标准表示,并且使用UTC时间。格式为:YYYY-MM-DDThh:mm:ssZ。注意:后付费模式本项为null",
|
"name": "Uuid",
|
||||||
"example": "2020-09-22T00:00:00+00:00"
|
"type": "String",
|
||||||
},
|
"desc": "实例全局唯一ID",
|
||||||
{
|
"example": "68b510db-b4c1-4630-a62b-73d0c7c970f9"
|
||||||
"name": "OsName",
|
},
|
||||||
"type": "文本",
|
{
|
||||||
"desc": "操作系统名称。",
|
"name": "LatestOperation",
|
||||||
"example": "CentOS 7.4 64bit"
|
"type": "String",
|
||||||
},
|
"desc": "实例的最新操作。例:StopInstances、ResetInstance。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
{
|
"example": "RenewInstances"
|
||||||
"name": "SecurityGroupIds",
|
},
|
||||||
"type": "文本、多值",
|
{
|
||||||
"desc": "实例所属安全组。该参数可以通过调用 DescribeSecurityGroups 的返回值中的sgId字段来获取。",
|
"name": "LatestOperationState",
|
||||||
"example": [
|
"type": "String",
|
||||||
"sg-p1ezv4wz"
|
"desc": "SUCCESS:表示操作成功\nOPERATING:表示操作执行中\nFAILED:表示操作失败注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
]
|
"example": "SUCCESS"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LoginSettings",
|
"name": "LatestOperationRequestId",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "实例登录设置。目前只返回实例所关联的密钥。",
|
"desc": "实例最新操作的唯一请求 ID。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
"example": {
|
"example": "3554eb5b-1cfa-471a-ae76-dc436c9d43e8"
|
||||||
"Password": "123qwe!@#QWE",
|
},
|
||||||
"KeepImageLogin": "False",
|
{
|
||||||
"KeyIds": [
|
"name": "DisasterRecoverGroupId",
|
||||||
"skey-b4vakk62"
|
"type": "String",
|
||||||
]
|
"desc": "分散置放群组ID。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
}
|
"example": "null"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "InstanceState",
|
"name": "IPv6Addresses",
|
||||||
"type": "文本",
|
"type": "Array of String",
|
||||||
"desc": "实例状态。取值范围: PENDING:表示创建中 LAUNCH_FAILED:表示创建失败 RUNNING:表示运行中 STOPPED:表示关机 STARTING:表示开机中 STOPPING:表示关机中 REBOOTING:表示重启中 SHUTDOWN:表示停止待销毁 TERMINATING:表示销毁中。",
|
"desc": "实例的IPv6地址。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
"example": "RUNNING"
|
"example": "null"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Tags",
|
"name": "CamRoleName",
|
||||||
"type": "json",
|
"type": "String",
|
||||||
"desc": "实例关联的标签列表。",
|
"desc": "CAM角色名。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
"example": [
|
"example": "null"
|
||||||
{
|
},
|
||||||
"Value": "test",
|
{
|
||||||
"Key": "test"
|
"name": "HpcClusterId",
|
||||||
}
|
"type": "String",
|
||||||
]
|
"desc": "高性能计算集群ID。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
},
|
"example": "null"
|
||||||
{
|
},
|
||||||
"name": "StopChargingMode",
|
{
|
||||||
"type": "文本",
|
"name": "RdmaIpAddresses",
|
||||||
"desc": "实例的关机计费模式。 取值范围: KEEP_CHARGING:关机继续收费 STOP_CHARGING:关机停止收费NOT_APPLICABLE:实例处于非关机状态或者不适用关机停止计费的条件",
|
"type": "Array of String",
|
||||||
"example": "NOT_APPLICABLE"
|
"desc": "高性能计算集群IP列表。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
},
|
"example": "null"
|
||||||
{
|
},
|
||||||
"name": "Uuid",
|
{
|
||||||
"type": "文本",
|
"name": "DedicatedClusterId",
|
||||||
"desc": "实例全局唯一ID",
|
"type": "String",
|
||||||
"example": "e85f1388-0422-410d-8e50-bef540e78c18"
|
"desc": "实例所在的专用集群ID。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
},
|
"example": "cluster-du3jken"
|
||||||
{
|
},
|
||||||
"name": "LatestOperation",
|
{
|
||||||
"type": "文本",
|
"name": "IsolatedSource",
|
||||||
"desc": "实例的最新操作。例:StopInstances、ResetInstance。 注意:此字段可能返回 null,表示取不到有效值。",
|
"type": "String",
|
||||||
"example": "ResetInstancesType"
|
"desc": "ARREAR:表示欠费隔离\nEXPIRE:表示到期隔离\nMANMADE:表示主动退还隔离\nNOTISOLATED:表示未隔离",
|
||||||
},
|
"example": ""
|
||||||
{
|
},
|
||||||
"name": "LatestOperationState",
|
{
|
||||||
"type": "文本",
|
"name": "GPUInfo",
|
||||||
"desc": "实例的最新操作状态。取值范围: SUCCESS:表示操作成功 OPERATING:表示操作执行中 FAILED:表示操作失败 注意:此字段可能返回 null,表示取不到有效值。",
|
"type": "GPUInfo",
|
||||||
"example": "SUCCESS"
|
"desc": "GPU信息。如果是gpu类型子机,该值会返回GPU信息,如果是其他类型子机则不返回。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
},
|
"example": ""
|
||||||
{
|
},
|
||||||
"name": "LatestOperationRequestId",
|
{
|
||||||
"type": "文本",
|
"name": "LicenseType",
|
||||||
"desc": "实例最新操作的唯一请求 ID。 注意:此字段可能返回 null,表示取不到有效值。",
|
"type": "String",
|
||||||
"example": "c7de1287-061d-4ace-8caf-6ad8e5a2f29a"
|
"desc": "实例的操作系统许可类型,默认为TencentCloud",
|
||||||
},
|
"example": "TencentCloud"
|
||||||
{
|
},
|
||||||
"name": "DisasterRecoverGroupId",
|
{
|
||||||
"type": "文本",
|
"name": "DisableApiTermination",
|
||||||
"desc": "分散置放群组ID。 注意:此字段可能返回 null,表示取不到有效值。",
|
"type": "Boolean",
|
||||||
"example": ""
|
"desc": "TRUE:表示开启实例保护,不允许通过api接口删除实例\nFALSE:表示关闭实例保护,允许通过api接口删除实例默认取值:FALSE。",
|
||||||
},
|
"example": "false"
|
||||||
{
|
},
|
||||||
"name": "IPv6Addresses",
|
{
|
||||||
"type": "文本、多值",
|
"name": "DefaultLoginUser",
|
||||||
"desc": "实例的IPv6地址。 注意:此字段可能返回 null,表示取不到有效值。",
|
"type": "String",
|
||||||
"example": [
|
"desc": "默认登录用户。",
|
||||||
"2001:0db8:86a3:08d3:1319:8a2e:0370:7344"
|
"example": "root"
|
||||||
]
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "DefaultLoginPort",
|
||||||
"name": "CamRoleName",
|
"type": "Integer",
|
||||||
"type": "文本",
|
"desc": "默认登录端口。",
|
||||||
"desc": "CAM角色名。 注意:此字段可能返回 null,表示取不到有效值。",
|
"example": "22"
|
||||||
"example": ""
|
},
|
||||||
},
|
{
|
||||||
{
|
"name": "LatestOperationErrorMsg",
|
||||||
"name": "HpcClusterId",
|
"type": "String",
|
||||||
"type": "文本",
|
"desc": "实例的最新操作错误信息。注意:此字段可能返回 null,表示取不到有效值。",
|
||||||
"desc": "高性能计算集群ID。 注意:此字段可能返回 null,表示取不到有效值。",
|
"example": "None"
|
||||||
"example": ""
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "RdmaIpAddresses",
|
|
||||||
"type": "文本、多值",
|
|
||||||
"desc": "高性能计算集群IP列表。 注意:此字段可能返回 null,表示取不到有效值。",
|
|
||||||
"example": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "IsolatedSource",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "实例隔离类型。取值范围: ARREAR:表示欠费隔离 EXPIRE:表示到期隔离 MANMADE:表示主动退还隔离 NOTISOLATED:表示未隔离 注意:此字段可能返回 null,表示取不到有效值。",
|
|
||||||
"example": "NOTISOLATED"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "GPUInfo",
|
|
||||||
"type": "json",
|
|
||||||
"desc": "GPU信息。如果是gpu类型子机,该值会返回GPU信息,如果是其他类型子机则不返回。 注意:此字段可能返回 null,表示取不到有效值。",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "LicenseType",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "实例的操作系统许可类型,默认为TencentCloud",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "DisableApiTermination",
|
|
||||||
"type": "Boolean",
|
|
||||||
"desc": "实例销毁保护标志,表示是否允许通过api接口删除实例。取值范围: TRUE:表示开启实例保护,不允许通过api接口删除实例 FALSE:表示关闭实例保护,允许通过api接口删除实例 默认取值:FALSE。",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "DefaultLoginUser",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "默认登录用户。",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "DefaultLoginPort",
|
|
||||||
"type": "整数",
|
|
||||||
"desc": "默认登录端口。",
|
|
||||||
"example": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "LatestOperationErrorMsg",
|
|
||||||
"type": "文本",
|
|
||||||
"desc": "实例的最新操作错误信息。 注意:此字段可能返回 null,表示取不到有效值。",
|
|
||||||
"example": null
|
|
||||||
}
|
|
||||||
]
|
]
|
|
@ -94,8 +94,13 @@ class AttributeValueManager(object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _check_is_choice(attr, value_type, value):
|
def _check_is_choice(attr, value_type, value):
|
||||||
choice_values = AttributeManager.get_choice_values(attr.id, value_type, attr.choice_web_hook, attr.choice_other)
|
choice_values = AttributeManager.get_choice_values(attr.id, value_type, attr.choice_web_hook, attr.choice_other)
|
||||||
if str(value) not in list(map(str, [i[0] for i in choice_values])):
|
if value_type == ValueTypeEnum.FLOAT:
|
||||||
return abort(400, ErrFormat.not_in_choice_values.format(value))
|
if float(value) not in list(map(float, [i[0] for i in choice_values])):
|
||||||
|
return abort(400, ErrFormat.not_in_choice_values.format(value))
|
||||||
|
|
||||||
|
else:
|
||||||
|
if str(value) not in list(map(str, [i[0] for i in choice_values])):
|
||||||
|
return abort(400, ErrFormat.not_in_choice_values.format(value))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _check_is_unique(value_table, attr, ci_id, type_id, value):
|
def _check_is_unique(value_table, attr, ci_id, type_id, value):
|
||||||
|
|
Loading…
Reference in New Issue