获取密钥对 | 大装置帮助中心
跳到主要内容

获取密钥对

接口描述

GET /compute/bms/data/v1/subscriptions/{subscription_name}/resourceGroups/{resource_group_name}/zones/{zone}/keypair/get

请求头(Request Header)

参考认证(authentication)

请求参数(Request Parameters)

名称类型必须位置默认值取值范围描述
subscription_namestringpath--订阅
resource_group_namestringpath--资源组
zonestringpath--可用区
instancestringquery--裸金属实例uuid

请求体(Request Body)

请求示例(Request Example)

curl -L -X GET 'https://bms.cn-sh-01.sensecoreapi.dev/compute/bms/data/v1/subscriptions/2488c031-873f-4396-8b9e-98c68ca016ae/resourceGroups/default/zones/cn-sh-01a/keypair/get?instance=bebff67f-f2ee-11ed-8be0-a642d45a3a89' \
-H 'Accept: application/json' \
-H 'Authorization: xxx'

响应参数(Response Parameters)

名称类型描述
key_pairsobject密钥对列表
next_page_tokenstring从先前的列表请求返回的下一页令牌值(如果存在)
totalint数据总数

其中,key_pairs的参数如下:

名称类型描述
idstring密钥对id
namestring密钥对名称
public_keystring公钥
private_keystring私钥
key_idstring公钥id
tenant_idstring租户id
user_idstring用户id
tagsstring标签
instancesobject绑定实例列表
create_timestring创建时间
update_timestring更新时间

其中,instances的参数如下:

名称类型描述
idstring实例id
namestring实例名称
display_namestring实例展示名称

响应示例(Response Example)

{
"key_pairs": [
{
"id": "0AF000720000189B055B3468E5521DC0",
"name": "test1",
"public_key": "",
"private_key": "",
"key_id": "",
"tenant_id": "ea1dab25-0a25-480d-8fcd-0a6188e46127",
"user_id": "5e225021-0cdc-400d-ab13-fb83b02eee3c",
"tags": {},
"instances": [],
"create_time": "2023-08-01T17:02:33.798155Z",
"update_time": "0001-01-01T00:00:00Z"
},
{
"id": "0AF000AA0000189BA765A9A33F656431",
"name": "test2",
"public_key": "",
"private_key": "",
"key_id": "",
"tenant_id": "ea1dab25-0a25-480d-8fcd-0a6188e46127",
"user_id": "5e225021-0cdc-400d-ab13-fb83b02eee3c",
"tags": {},
"instances": [],
"create_time": "2023-08-03T16:14:25.946659Z",
"update_time": "0001-01-01T00:00:00Z"
}
],
"next_page_token": "",
"total": 2
}