You can call this operation to grant a permission on an elastic network interface (ENI) to an Alibaba Cloud partner (a certified ISV) or an individual user.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateNetworkInterfacePermission | The operation that you want to perform. Set the value to CreateNetworkInterfacePermission. |
RegionId | String | Yes | cn-hangzhou | The region ID of the ENI. You can call the DescribeRegions operation to query the most recent region list. |
NetworkInterfaceId | String | Yes | eni-bp14v2sdd3v8htln**** | The ID of the ENI. |
Permission | String | Yes | InstanceAttach | The permission on the ENI. Valid values: InstanceAttach: allows authorized users to attach the ENI to an ECS instance. The ENI and the ECS instance must be in the same zone. |
AccountId | Long | Yes | 1234567890 | The ID of the Alibaba Cloud partner (a certified ISV) or individual user. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
NetworkInterfacePermission | Struct | Details about the permission on the ENI. | |
AccountId | Long | 1234567890 | The ID of the Alibaba Cloud partner (a certified ISV). |
NetworkInterfaceId | String | eni-bp14v2sdd3v8htln**** | The ID of the ENI. |
NetworkInterfacePermissionId | String | eni-perm-bp1cs4lwn56lfb**** | The ID of the permission on the ENI. |
Permission | String | InstanceAttach | The permission on the ENI. |
PermissionState | String | Granted | The status of the permission on the ENI. Valid values:
|
ServiceName | String | Elastic Compute Service | The name of the Alibaba Cloud service. |
RequestId | String | 0FCD3DEF-63D3-4605-A818-805C8BD7DB87 | The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=CreateNetworkInterfacePermission
&AccountId=1234567890
&RegionId=cn-hangzhou
&NetworkInterfaceId=eni-bp14v2sdd3v8htln****
&Permission=InstanceAttach
&<Common request parameters>
Sample success responses
XML
format
<CreateNetworkInterfacePermissionResponse>
<RequestId>0FCD3DEF-63D3-4605-A818-805C8BD7DB87</RequestId>
<NetworkInterfacePermission>
<PermissionState>Granted</PermissionState>
<Permission>InstanceAttach</Permission>
<AccountId>1234567890</AccountId>
<NetworkInterfacePermissionId>eni-perm-bp1cs4lwn56lfb****</NetworkInterfacePermissionId>
<NetworkInterfaceId>eni-bp14v2sdd3v8htln****</NetworkInterfaceId>
<ServiceName>Elastic Compute Service</ServiceName>
</NetworkInterfacePermission>
</CreateNetworkInterfacePermissionResponse>
JSON
format
{
"RequestId": "0FCD3DEF-63D3-4605-A818-805C8BD7DB87",
"NetworkInterfacePermission": {
"PermissionState": "Granted",
"Permission": "InstanceAttach",
"AccountId": "1234567890",
"NetworkInterfacePermissionId": "eni-perm-bp1cs4lwn56lfb****",
"NetworkInterfaceId": "eni-bp14v2sdd3v8htln****",
"ServiceName": "Elastic Compute Service"
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
403 | InvalidUserType.NotSupported | %s | The error message returned because your account does not support this operation. |
403 | Abs.InvalidAccount.NotFound | %s | The error message returned because your Alibaba Cloud account does not exist or your AccessKey pair has expired. |
400 | MissingParameter | %s | The error message returned because a required parameter is not specified. |
403 | Forbidden.NotSupportRAM | %s | The error message returned because RAM users are not authorized to perform this operation. |
400 | UnsupportedParameter | %s | The error message returned because a specified parameter is not supported. |
403 | Forbidden.SubUser | %s | The error message returned because you are not authorized to manage the specified resource. Contact the owner of the Alibaba Cloud account for authorization. |
400 | InvalidParameter | %s | The error message returned because a specified parameter is invalid. |
400 | InvalidInstanceID.Malformed | %s | The error message returned because the specified InstanceId parameter is invalid. |
400 | InvalidOperation.InvalidEniState | %s | The error message returned because the operation is not supported while the ENI is in the current state. |
400 | NotBelongUser | %s | The error message returned because you are not authorized to manage the specified resource. |
400 | InvalidOperation.PermissionExisted | %s | The error message returned because the specified permission already exists. |
404 | InvalidOperation.PermissionNotExisted | %s | The error message returned because the specified permission does not exist. |
404 | InvalidEniId.NotFound | %s | The error message returned because the specified NetworkInterfaceId parameter does not exist. |
For a list of error codes, visit the API Error Center.