文档

GetSSHKey - 查询 SSH Key

更新时间:

通过 OpenAPI 查询 SSH Key。

适用版本

企业专属版、企业标准版

服务接入点与授权信息

产品

资源

所需权限

代码管理

SSH密钥

只读

请求语法

GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/keys/{keyId}

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

pt-0fh3****0fbG_35af****0484

请求参数

参数

类型

位置

是否必填

描述

示例值

organizationId

string

path

组织 ID。

5ebbc0228123212b59xxxxx

keyId

integer

path

SSH Key 的主键 ID。

50998

请求示例

curl -X 'GET' \
  'https://test.rdc.aliyuncs.com/oapi/v1/codeup/organizations/5ebbc0228123212b59xxxxx/keys/50998' \
  -H 'accept: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

返回参数

参数

类型

描述

示例值

-

object

Schema of Response。

createdAt

string

创建时间。

2022-03-18 14:24:54

expireTime

string

过期时间。

2022-03-18 14:24:54

fingerPrint

string

指纹信息。

xxx

id

integer

SSH Key 的主键 ID。

5240

key

string

SSH Key 的公钥串。

f0b1e61db5961df5975a93f9129d2513

keyScope

string

作用范围: ALL - 全部(读/写操作,包括 clone/pull/push),READ - 只读(仅支持 clone/pull)。

ALL

lastUsedTime

string

最后使用时间。

2022-03-18 14:24:54

title

string

SSH Key 的标题。

My Title

updatedAt

string

更新时间。

2022-03-18 14:24:54

返回示例

{
    "createdAt": "2022-03-18 14:24:54",
    "expireTime": "2022-03-18 14:24:54",
    "fingerPrint": "xxx",
    "id": 5240,
    "key": "f0b1e61db5961df5975a93f9129d2513",
    "keyScope": "ALL",
    "lastUsedTime": "2022-03-18 14:24:54",
    "title": "My Title",
    "updatedAt": "2022-03-18 14:24:54"
}

错误码

访问错误码中心查看 API 相关错误码。