Creating a Public Network (Shared) Load Balancer
Scenarios
Call APIs to create a load balancer and bind a new EIP to it.
Prerequisites
You have created a VPC and a subnet.
Procedure
Bind an EIP to the port that has been bound to the private IP address of the load balancer. For details about the parameters, see Table 1.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
publicip |
Yes |
Object |
Specifies the EIP. For details, see Table 2. |
bandwidth |
Yes |
Object |
Specifies the bandwidth. For details, see Table 3. |
enterprise_project_id |
No |
String |
NOTE:
For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
|
ip_version |
No |
Integer |
|
ip_address |
No |
String |
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
|
size |
No |
Integer |
|
id |
No |
String |
|
share_type |
Yes |
String |
|
charge_mode |
No |
String |
|
- Step 1: Apply for an EIP.
POST https://{VPCEndpoint}/v1/8b7e35ad379141fc9df3e178bd64f55c/publicips { "publicip": { "type": "5_bgp", "ip_version": 4 }, "bandwidth": { "name": "bandwidth123", "size": 10, "share_type": "PER" } }
- Example response
{ "publicip": { "id": "f588ccfa-8750-4d7c-bf5d-2ede24414706", "status": "PENDING_CREATE", "type": "5_bgp", "public_ip_address": "139.9.204.183", "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c", "ip_version": 4, "create_time": "2019-06-29 06:45:32", "bandwidth_size": 1 } }
- Step 2: Bind the EIP. (The value of public_id is the same as that in the ▪ Example response, and the value of port_id is the same as that of vip_port_id in Example response 1.)
PUT /v1/8b7e35ad379141fc9df3e178bd64f55c/publicips/f588ccfa-8750-4d7c-bf5d-2ede24414706 { "publicip": { "port_id": "a7ecbdb5-5a63-41dd-a830-e16c0a7e04a7" } }
- Example response
{ "publicip": { "id": "f588ccfa-8750-4d7c-bf5d-2ede24414706", "status": "ACTIVE", "type": "5_bgp", "port_id": "a7ecbdb5-5a63-41dd-a830-e16c0a7e04a7", "public_ip_address": "139.9.204.183", "private_ip_address": "192.168.1.131", "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c", "create_time": "2019-06-29 07:33:18", "bandwidth_size": 1, "ip_version": 4 } }
- After the preceding steps are complete, the load balancer has the capability of accessing the public network. You can access the load balancer using 139.9.204.183, the value of parameter public_ip_address.
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