Home  >  Article  >  Operation and Maintenance  >  How to grant the Instance RAM role to one or more ECS instances

How to grant the Instance RAM role to one or more ECS instances

坏嘻嘻
坏嘻嘻Original
2018-09-19 16:45:121971browse

The content of this article is about how to grant instance RAM roles to one or more ECS instances. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

AttachInstanceRamRole

Grant the instance RAM role to one or more ECS instances. If the instance already has a RAM role, an error message will appear indicating that you cannot attach a new role.

Request parameters

How to grant the Instance RAM role to one or more ECS instances

##Return parameters

are all public return parameters. See public parameters for details

Example

Request example

https://ecs.aliyuncs.com/?Action=AttachInstanceRamRole
&RegionId=cn-hangzhou
&RamRoleName=RamRoleTest
&InstanceIds=["i-instance1"]
&<公共请求参数>

Return example

XML format

<AttachInstanceRamRoleResponse>
    <RequestId>E6352369-5C2B-41CD-AB50-471550C8F674</RequestId>
    <AttachInstanceRamRoleResults>
        <AttachInstanceRamRoleResult>
             <InstanceId>i-instance1</InstanceId>
             <Code>200</Code>
             <Message>success</Message>
        </AttachInstanceRamRoleResult>
    </AttachInstanceRamRoleResults>
    <TotalCount>1</TotalCount>
    <FailCount>0</FailCount>
    <RamRoleName>RamRoleTest</RamRoleName>
</AttachInstanceRamRoleResponse>

JSON format

{
    "RequestId": "D9553E4C-6C3A-4D66-AE79-9835AF705639",
    "AttachInstanceRamRoleResults": {
        "AttachInstanceRamRoleResult": [
            {
                "Message": "success",
                "InstanceId": "i-instance1",
                "Code": "200"
            }
        ]
    },
    "TotalCount": 1,
    "FailCount": 0,
    "RamRoleName": "RamRoleTest"
}

Error code

The following are error codes unique to this interface. For more error codes, please visit the API Error Center.

How to grant the Instance RAM role to one or more ECS instances

The above is the detailed content of How to grant the Instance RAM role to one or more ECS instances. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn