云服务器内容精选

  • 响应示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 { "servers": [ { "tenant_id": "c685484a8cc2416b97260938705deb64", "addresses": { "08a7715f-7de6-4ff9-a343-95ba4209f24a": [ { "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:0e:c4:77", "OS-EXT-IPS:type": "fixed", "addr": "192.168.0.107", "version": 4 } ] }, "metadata": { "op_svc_userid": "1311c433dd9b408886f57d695c229cbe" }, "OS-EXT-STS:task_state": null, "OS-DCF:diskConfig": "MANUAL", "OS-EXT-AZ:availability_zone": "az-dc-1", "links": [ { "rel": "self", "href": "https://openstack.example.com/v2.1/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd" }, { "rel": "bookmark", "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd" } ], "OS-EXT-STS:power_state": 1, "id": "95bf2490-5428-432c-ad9b-5e3406f869dd", "os-extended-volumes:volumes_attached": [ { "id": "dfa375b5-9856-44ad-a937-a4802b6434c3" }, { "id": "bb9f1b27-843b-4561-b62e-ca18eeaec417" }, { "id": "86e801c3-acc6-465d-890c-d43ba493f553" }, { "id": "0994d3ac-3c6a-495c-a439-c597a4f08fa6" } ], "OS-EXT-SRV-ATTR:host": "bms.az1", "image": { "links": [ { "rel": "bookmark", "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/images/1a6635d8-afea-4f2b-abb6-27a202bad319" } ], "id": "1a6635d8-afea-4f2b-abb6-27a202bad319" }, "OS-SRV-USG:terminated_at": null, "accessIPv4": "", "accessIPv6": "", "created": "2017-05-24T06:14:05Z", "hostId": "e9c3ee0fcc58ab6085cf30df70b5544eab958858fb50d925f023e53e", "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova004@2", "key_name": "$key_name", "flavor": { "links": [ { "rel": "bookmark", "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/flavors/physical.83.medium" } ], "id": "physical.83.medium" }, "security_groups": [ { "name": "0011b620-4982-42e4-ad12-47c95ca495c4" } ], "config_drive": "", "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-0000ebd3", "user_id": "1311c433dd9b408886f57d695c229cbe", "name": "bms", "progress": 0, "OS-SRV-USG:launched_at": "2017-05-25T03:40:25.066078", "updated": "2017-05-25T03:40:25Z", "status": "ACTIVE" } ] }
  • 请求示例 查询裸金属服务器的详情列表。 1 https://{E CS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers/detail 查询标签中包含__type_baremetal的裸金属服务器的详情列表。 1 https://{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers/detail?tags=__type_baremetal 查询标签中包含__type_baremetal且名称包含bms-test01的裸金属服务器的的详情列表。 1 https://{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers/detail?tags=__type_baremetal&name=bms-test01
  • 请求参数 参数 是否必选 参数类型 描述 changes-since 否 String 裸金属服务器上次更新状态的时间戳信息。格式为ISO 8601时间格式,例如:2013-06-09T06:42:18Z。 image 否 String 镜像ID。 可以在 镜像服务 控制台查询,也可以调用“查询镜像列表”API获取。 说明: 在使用image作为条件过滤时,不能同时支持其他过滤条件和分页条件。如果同时指定image及其他条件,则以image条件为准;当条件不含image时,接口功能不受限制。 flavor 否 String 规格ID。 可以在裸金属服务器控制台查询,也可以调用查询裸金属服务器规格信息列表(OpenStack原生)API获取。 name 否 String 裸金属服务器名称,使用模糊匹配的方式查询。 例如,“?name=bob”正则表达式会同时返回bob和bobb。如果必须仅匹配bob,则可以使用与基础数据库服务器的语法相匹配的正则表达式,如MySQL或PostgreSQL(官方网站:https://www.postgresql.org/docs/9.2/static/functions-matching.html)。 status 否 String 裸金属服务器状态。 取值范围: ACTIVE:运行中/正在关机/删除中 BUILD:创建中 ERROR:故障 HARD_REBOOT:强制重启中 REBOOT:重启中 SHUTOFF:关机/正在开机/删除中/重建中/重装操作系统中/重装操作系统失败/冻结 limit 否 Integer 每页返回裸金属服务器的条数。 marker 否 String 从marker指定的裸金属服务器ID的下一条数据开始查询。 tags 否 String 查询tag字段中包含该值的裸金属服务器。 微版本2.26新增 not-tags 否 String 查询tag字段中不包含该值的裸金属服务器,值为标签的Key。 说明: 如果之前添加的Tag为“Key.Value”的形式,则查询的时候需要使用“Key”来查询。 例如:之前添加的tag为“a.b”,则升级后,查询时需使用“not-tags=a”。 微版本2.26新增 reservation_id 否 String 批量创建裸金属服务器时,指定该预留ID,可以查询同批次创建的裸金属服务器。 微版本2.26新增 sort_key 否 String 用于排序的属性,包括uuid(裸金属服务器的uuid)、vm_state(裸金属服务器的状态)、display_name(裸金属服务器名称)、task_state(裸金属服务器任务状态)、power_state(电源状态)、created_at(创建时间)、updated_at(更新时间)、availability_zone(可用区)。可以指定多对sort_key和sort_dir。 默认排序顺序为created_at逆序。 sort_dir 否 String 排序方向。 asc:升序 desc:降序(默认值)
  • URI GET /v2.1/{project_id}/servers/detail{?changes-since={changes-since}&image={image}&flavor={flavor}&name={name}&status={status}&limit={limit}&marker={marker}&tags={tags}¬-tags={not-tags}&reservation_id={reservation_id}&sort_key={sort_key}&sort_dir={sort_dir}} 参数说明请参见表1。 表1 参数说明 参数 是否必选 描述 project_id 是 项目ID。 获取方式请参见获取项目ID。
  • 响应示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 { "count": 2, "servers": [ { "id": "b544be62-1b3b-4982-ad98-572b002ac23b", "name": "bms-test1", "addresses": { "5849fdf1-9d79-4589-80c2-fe557990c417": [ { "version": "4", "addr": "192.168.1.63", "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:3a:8d:f1", "OS-EXT-IPS:port_id": "c79d2813-94c9-4135-973e-cbf5d23e78e6", "OS-EXT-IPS:type": "fixed" } ] }, "flavor": { "disk": "9309", "vcpus": "32", "ram": "193047", "id": "physical.s1.medium.ondemand", "name": "physical.s1.medium.ondemand", "gpus": [{ "name":"Nvidia Tesla V100S 32GB", "count":8, "memory_mb":32768 }], "asic_accelerators": [] }, "accessIPv4": "", "accessIPv6": "", "status": "ACTIVE", "progress": 0, "hostId": "cd243addb5d2c64e89218180b7a3ed95abe6882e81c337cc563137df", "updated": "2018-09-10T01:20:58Z", "created": "2018-09-06T09:29:27Z", "metadata": { "baremetalPortIDList": "[c79d2813-94c9-4135-973e-cbf5d23e78e6]", "chargingMode": "0" }, "tags": [ "__type_baremetal" ], "description": "bms-test1", "locked": false, "config_drive": "", "tenant_id": "bbf1946d374b44a0a2a95533562ba954", "user_id": "0c50494c5816425eb05c40b5e81ab65a", "key_name": "$key_name", "OS-EXT-STS:power_state": 1, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:host": "bms.dc1", "OS-EXT-SRV-ATTR:instance_name": "instance-0014bdc2", "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova002@2", "OS-DCF:diskConfig": "MANUAL", "OS-EXT-AZ:availability_zone": "az-dc-1", "os:scheduler_hints": {}, "OS-EXT-SRV-ATTR:root_device_name": "/dev/vda", "OS-EXT-SRV-ATTR:ramdisk_id": "", "enterprise_project_id": "0", "OS-SRV-USG:launched_at": "2018-09-06T09:30:36.000000", "OS-EXT-SRV-ATTR:kernel_id": "", "OS-EXT-SRV-ATTR:launch_index": 0, "host_status": "UP", "OS-EXT-SRV-ATTR:reservation_id": "r-qjad3fv0", "OS-EXT-SRV-ATTR:hostname": "bms-test1", "sys_tags": [ { "key": "_sys_enterprise_project_id", "value": "0" } ] }, { "id": "a1541cfc-8ac3-43e9-a70d-b8d4b395b256", "name": "bms_test2", "addresses": { "5849fdf1-9d79-4589-80c2-fe557990c417": [ { "version": "4", "addr": "192.168.1.50", "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:8f:38:2c", "OS-EXT-IPS:port_id": "460aa585-9f83-4719-9527-fc39ebaca9aa", "OS-EXT-IPS:type": "fixed" } ] }, "flavor": { "disk": "9309", "vcpus": "32", "ram": "193047", "id": "physical.s1.medium", "name": "physical.s1.medium" }, "accessIPv4": "", "accessIPv6": "", "status": "SHUTOFF", "hostId": "cd243addb5d2c64e89218180b7a3ed95abe6882e81c337cc563137df", "updated": "2018-09-06T10:00:25Z", "created": "2018-08-30T12:40:47Z", "metadata": { "metering.order_id": "CS18083020422CNV9", "baremetalPortIDList": "[460aa585-9f83-4719-9527-fc39ebaca9aa]", "metering.product_id": "00301-167001-0--0", "chargingMode": "1" }, "tags": [ "__type_baremetal", "_sys_enterprise_project_id=9dd1131d-71fd-40fe-8f14-3fe6b6b5ef8b", "key1=value1", "three=3", "two=2" ], "description": "bms_test2", "locked": false, "config_drive": "", "tenant_id": "bbf1946d374b44a0a2a95533562ba954", "user_id": "3fc5ab2b0c544979abcaafd86edd80e6", "key_name": "$key_name", "OS-EXT-STS:power_state": 4, "OS-EXT-STS:vm_state": "stopped", "OS-EXT-SRV-ATTR:host": "bms.dc1", "OS-EXT-SRV-ATTR:instance_name": "instance-0014581b", "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova002@2", "OS-DCF:diskConfig": "MANUAL", "OS-EXT-AZ:availability_zone": "az-dc-1", "os:scheduler_hints": {}, "OS-EXT-SRV-ATTR:root_device_name": "/dev/vda", "OS-EXT-SRV-ATTR:ramdisk_id": "", "enterprise_project_id": "0", "OS-SRV-USG:launched_at": "2018-08-30T12:42:10.000000", "OS-EXT-SRV-ATTR:kernel_id": "", "OS-EXT-SRV-ATTR:launch_index": 0, "host_status": "UP", "OS-EXT-SRV-ATTR:reservation_id": "r-i5w3yc9a", "OS-EXT-SRV-ATTR:hostname": "bms-test2", "sys_tags": [ { "key": "_sys_enterprise_project_id", "value": "0" }] } ] }