Assigning a Private IP Address
Function
This API is used to assign a private IP address.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
vpc:privateIps:create
Write
privateIp *
-
-
-
subnet *
- g:ResourceTag/<tag-key>
- vpc:SubnetId
- vpc:VpcId
- vpc:AvailabilityZone
URI
POST /v1/{project_id}/privateips
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
project_id |
Yes |
Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
privateips |
Yes |
Array of privateip objects |
Specifies the private IP addresses. For details, see Table 3. By default, a maximum of 20 private IP addresses can be assigned. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
subnet_id |
Yes |
String |
Specifies the ID of the subnet from which IP addresses are assigned. If you use the management console, the value of this parameter is the Network ID value. |
|
ip_address |
No |
String |
|
Example Request
- Assign two private IP addresses from the subnet whose ID is 531dec0f-3116-411b-a21b-e612e42349fd. One IP address is automatically assigned, and the other is specified to 192.168.1.17.
POST https://{Endpoint}/v1/{project_id}/privateips { "privateips": [ { "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd" }, { "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd", "ip_address": "192.168.1.17" } ] }
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
privateips |
Array of privateip objects |
Specifies the private IP address objects. For details, see Table 5. |
Example Response
{
"privateips": [
{
"status": "DOWN",
"id": "c60c2ce1-1e73-44bd-bf48-fd688448ff7b",
"subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
"tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
"device_owner": "",
"ip_address": "192.168.1.10"
},
{
"status": "DOWN",
"id": "4b123c18-ae92-4dfa-92cd-d44002359aa1",
"subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
"tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
"device_owner": "",
"ip_address": "192.168.1.17"
}
]
}
Status Code
See Status Codes.
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot