修改凭据
PUT /accounts/{account_id}/core/v1/credentials/{credential_id}
将整个存储资源替换为提供的 JSON 请求正文,同时保留不可由用户修改的键值。
参数
| 名称 | Type | 在 | Required | Description |
|---|---|---|---|---|
account_id |
string |
path |
True |
包含帐户资源的 ID
|
凭证 ID |
string |
path |
True |
要列出的凭据集合的 ID |
请求正文
将整个存储资源替换为提供的 JSON 请求正文,同时保留不可由用户修改的键值。
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
资源的媒体类型。定义的值为:
|
version |
string |
True |
资源的版本。定义的值为:
|
id |
string |
False |
资源的全局唯一标识符。定义的值为:
|
name |
string |
True |
包含用户指定名称的 JSON 字符串。为用户创建凭据时,名称将设置为该用户的 UUID。定义的值为:
|
keyType |
string |
False |
包含可选的用户指定的数据验证类型描述符的 JSON 字符串,用于 keyStore 的内容。扩展更新约束:
|
keyStore |
True |
包含 JSON 字符串的 JSON 对象。keyStore 中的每个字符串代表凭据的一部分。每个字符串的名称表示凭据部分,相应的 key-value 以 base64 格式存储凭据该部分的值。定义的值为:
|
|
valid |
string |
False |
描述凭据是否可以使用的 JSON 字符串。默认值(如果省略)为"true"。定义的值为:
|
validFromTimestamp |
string |
False |
包含指示凭据何时有效的时间戳的 JSON 字符串。这些用于凭据轮换。定义的值为:
|
validUntilTimestamp |
string |
False |
包含指示凭据何时不再有效的时间戳的 JSON 字符串。这些用于凭据轮换。定义的值是:
|
元数据 |
False |
与资源关联的客户端和服务指定的元数据。定义的值为:
|
请求示例
{
"type": "application/astra-credential",
"version": "1.1",
"name": "oldCert",
"keyStore": {
"privKey": "SGkh",
"pubKey": "VGhpcyBpcyBhbiBleGFtcGxlLg=="
}
}
响应
Status: 204, Indicates if the credential resource was updated.
响应
Status: 403, Forbidden
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/11",
"title": "Operation not permitted",
"detail": "The requested operation isn't permitted.",
"status": "403"
}
响应
Status: 406, Not acceptable
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/32",
"title": "Unsupported content type",
"detail": "The response can't be returned in the requested format.",
"status": "406"
}
响应
Status: 500, Internal server error
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/34",
"title": "Internal server error",
"detail": "The server was unable to process this request.",
"status": "500"
}
响应
Status: 412, Precondition failed
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/38",
"title": "Precondition not met",
"detail": "The conditional headers aren't satisfied.",
"status": "412"
}
响应
Status: 409, Conflict
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/39",
"title": "Credential exists",
"detail": "A credential of this type already exists.",
"status": "409"
}
响应
Status: 502, Bad gateway
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/40",
"title": "Communication failed",
"detail": "Communication wasn't made with downstream services.",
"status": "502"
}
响应
Status: 503, Service unavailable
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
响应示例
{
"type": "https://astra.netapp.io/problems/41",
"title": "Service not ready",
"detail": "Currently, the service can't respond to this request.",
"status": "503"
}
错误
Status: 400, Bad request
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
|
invalidParams |
数组["invalidParams"] |
False |
无效查询参数列表 |
错误响应示例
{
"type": "https://astra.netapp.io/problems/7",
"title": "Invalid JSON payload",
"detail": "The request body is not valid JSON.",
"status": "400"
}
定义
查看定义
keyStore
包含 JSON 字符串的 JSON 对象。keyStore 中的每个字符串代表凭据的一部分。每个字符串的名称表示凭据部分,相应的 key-value 以 base64 格式存储凭据该部分的值。定义的值为:
-
符合 base64 编码数据架构,对字符串的长度没有限制。
将字符串映射到字符串的哈希
类型 Astra 标签
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
|
value |
string |
True |
type_astra_metadata_update
与资源关联的客户端和服务指定的元数据。定义的值为:
-
符合 Astra 元数据架构如果在创建时未指定,则将创建没有标签的元数据对象。如果在更新时未指定,则元数据对象的标签、creationTimestamp 和 createdBy 将保留而不进行修改。
| 名称 | Type | Required | Description |
|---|---|---|---|
labels |
数组["类型 Astra 标签"] |
False |
|
creationTimestamp |
string |
False |
|
modificationTimestamp |
string |
False |
|
已创建 |
string |
False |
|
modifiedBy |
string |
False |
invalidFields
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
无效请求正文字段的名称 |
原因 |
string |
True |
请求正文字段无效的原因 |
invalidParams
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
无效查询参数的名称 |
原因 |
string |
True |
查询参数无效的原因 |