You need to enable JavaScript to run this app.
文档中心
复制全文
下载 pdf
资源生命周期管理
UpdateResource - 通过此接口更新云资源
复制全文
下载 pdf
UpdateResource - 通过此接口更新云资源

通过此接口更新云资源

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。

参数
类型
是否必填
示例值
描述
Action
String
是

UpdateResource

要执行的操作,取值:UpdateResource。

Version
String
是

2025-06-01

API的版本,取值:2025-06-01。

TypeName
String
是

Volcengine::IAM::User

资源类型的抽象描述,格式为“Volcengine::服务名称::资源名称”,可以通过 ListResourceTypes 查询支持的资源类型

Identifier
String
是

user-cc

资源实例的唯一标识符,标识符可以由单个或多个资源属性组成,可以通过 ListResources 在查看资源标识信息,也可以通过 GetResource 使用该标识唯一定位资源

PatchDocument
Array of Object
是

[
{
"op": "add",
"path": "/Description",
"value": "this is a iam user created by ccapi"
},
{
"op": "replace",
"path": "/SecurityConfig/SafeAuthType",
"value": "email"
}
]

资源所要更新的属性及值,必须符合Json Patch格式(https://datatracker.ietf.org/doc/html/rfc6902),每段Patch操作定义了对特定资源属性的更新,包含三个要素:1. op:操作类型,必填,如add, remove, replace等;2. path:资源属性的相对路径,必填,可以通过DescribeResourceType获取。 3. value:需要更新的属性值,非必填,remove时无需传入值。

ClientToken
String
否

1e810dfe1468721d0664a49b9d9f74f4

幂等标识,指定此令牌以确保资源操作的幂等性,以区分重试请求和新请求,token有效期为24小时。

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构。

参数
类型
示例值
描述
TypeName
String

Volcengine::IAM::User

资源类型的抽象描述,格式为“Volcengine::服务名称::资源名称”,可以通过 ListResourceTypes 查询支持的资源类型

Identifier
String

user-cc

资源实例的唯一标识符,标识符可以由单个或多个资源属性组成,可以通过 GetResource 使用该标识唯一定位资源

Operation
String

UPDATE

资源操作类型

OperationStatus
String

SUCCESS

资源操作请求的状态,包括“SUCCESS”、“IN_PROGRESS”、“FAILED”、“PENDING”

TaskID
String

task-3e4ec995-6956-4907-b925-f92dd964636f

资源操作的任务ID,可以通过 GetTask 获取任务详情

ResourceModel
String

{"AccountId":2000000191,"CreateDate":"20250919T084713Z","Description":"this is a iam user created by ccapi","DisplayName":"demo","Email":"","EmailIsVerify":false,"LoginProfile":{"CreateDate":"20250919T084721Z","LastLoginDate":"00010101T000000Z","LastLoginIp":"","LastResetPasswordTime":1758271641,"LoginAllowed":false,"LoginLocked":false,"PasswordExpireAt":0,"PasswordResetRequired":true,"SafeAuthExemptDuration":10,"SafeAuthExemptRequired":1,"SafeAuthExemptUnit":0,"SafeAuthFlag":false,"SafeAuthType":"","UpdateDate":"20250919T084721Z"},"MobilePhone":"","MobilePhoneIsVerify":false,"Policies":[{"PolicyName":"IAMReadOnlyAccess","PolicyType":"System"}],"SecurityConfig":{"SafeAuthClose":0,"SafeAuthExemptDuration":10,"SafeAuthType":"phone,email,vmfa"},"Tags":[{"Key":"usage","Value":"ccapi"}],"Trn":"trn:iam::2000000191:user/user-cccccc","UpdateDate":"20250919T084713Z","UserId":1819738,"UserName":"user-cc"}

资源属性模型,展示资源属性和当前值,用Json方式表达

EventTime
String

2025-09-19T16:15:50.273+08:00

资源操作执行的时间

ErrorCode
String

NotFound

错误码信息

StatusMessage
String

an error occurred when calling UpdateResource operation: Volcengine::IAM::User Handler returned status FAILED: NotFound: UserNotExist: User 'user-cc' does not exist..(HandlerErrorCode: NotFound)

状态描述信息

请求示例

{
    "Identifier": "user-cc",
    "PatchDocument": [
      {
        "op": "add",
        "path": "/Description",
        "value": "this is a iam user created by ccapi"
      },
      {
        "op": "replace",
        "path": "/SecurityConfig/SafeAuthType",
        "value": "email"
      }
    ],
    "TypeName": "Volcengine::IAM::User"
  }

返回示例

{
  "ResponseMetadata": {
    "RequestId": "20250922122019B67E5DFA12B875386A47",
    "Region": "cn-beijing"
  },
  "Result": {
    "EventTime": "2025-09-22T12:20:35.646+08:00",
    "TypeName": "Volcengine::IAM::User",
    "Identifier": "user-cc",
    "Operation": "UPDATE",
    "OperationStatus": "IN_PROGRESS",
    "TaskID": "task-9a8a657c-5914-43e9-b37c-6e9d75c11815"
  }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
ServiceNotEnabled

an error occurred when calling %s operation: %s

400
QuotaLimitExceeded

an error occurred when calling %s operation: %s

400
InvalidParameter

Params %s is invalid

参数无效

400
MissingParameter

an error occurred when calling %s operation: %s

400
InvalidRequest

an error occurred when calling %s operation: %s

401
InvalidCredentials

an error occurred when calling %s operation: %s

403
RequestForbidden

an error occurred when calling %s operation: %s

403
AccountInvalid

an error occurred when calling %s operation: %s

404
NotFound

an error occurred when calling %s operation: %s

404
EntityNotFound

taskID %s was not found

未查询到

409
ResourceConflict

an error occurred when calling %s operation: %s

409
AlreadyExists

an error occurred when calling %s operation: %s

409
NotStabilized

an error occurred when calling %s operation: %s

409
ConcurrentModification

The resource has been updated by another process

422
NotUpdatable

an error occurred when calling %s operation: %s

429
Throttling

an error occurred when calling %s operation: %s

500
GeneralServiceException

an error occurred when calling %s operation: %s

500
NoResource

an error occurred when calling %s operation: %s

500
ServiceLimitExceeded

an error occurred when calling %s operation: %s

500
ServiceInternalError

an error occurred when calling %s operation: %s

500
InternalFailure

an error occurred when calling %s operation: %s

500
InternalError

Some internal service error occurred, please wait and try again.

系统错误,请稍后重试

504
NetworkFailure

an error occurred when calling %s operation: %s

最近更新时间:2025.09.25 17:18:07
这个页面对您有帮助吗?
有用
有用
无用
无用