Bu sayfa henüz yerel dilinizde mevcut değildir. Daha fazla dil seçeneği eklemek için yoğun bir şekilde çalışıyoruz. Desteğiniz için teşekkür ederiz.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Load Balancer

Updated on 2022-08-15 GMT+08:00

Function

This API is used to create a private network load balancer. After the load balancer is created, its details, such as load balancer ID, IP address, and subnet ID, are returned.

To create a public network load balancer, you also need to call the API for assigning an EIP and associate this IP address to the port bound to the IP address of the private network load balancer.

You can set the enterprise_project_id parameter to perform fine-grained authorization for resources.

URI

POST /v2/{project_id}/elb/loadbalancers

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Request

Table 2 Parameter description

Parameter

Mandatory

Type

Description

loadbalancer

Yes

Loadbalancer object

Specifies the load balancer. For details, see Table 3.

Table 3 loadbalancer parameter description

Parameter

Mandatory

Type

Description

name

No

String

Specifies the load balancer name.

The value contains a maximum of 255 characters.

description

No

String

Provides supplementary information about the load balancer.

The value contains a maximum of 255 characters.

tenant_id

No

String

Specifies the ID of the project where the load balancer is used.

The value contains a maximum of 255 characters.

The value must be the same as the value of project_id in the token.

vip_subnet_id

Yes

String

Specifies the ID of the subnet where the load balancer resides. Obtain the value by listing the subnets. The private IP address of the load balancer is in this subnet.

Only IPv4 subnets are supported.

provider

No

String

Specifies the provider of the load balancer.

The value can only be vlb.

vip_address

No

String

Specifies the private IP address of the load balancer.

This IP address must be the one in the subnet specified by vip_subnet_id. If this parameter is not specified, an IP address is automatically assigned to the load balancer from the subnet specified by vip_subnet_id.

The value contains a maximum of 64 characters.

admin_state_up

No

Boolean

Specifies the administrative status of the load balancer.

This parameter is reserved, and the default value is true.

enterprise_project_id

No

String

Specifies the enterprise project ID. When creating a load balancer, you can assign an enterprise project to the load balancer.

The value is character string 0 or a UUID with hyphens (-). Value 0 indicates the default enterprise project.

The default value is 0.

Response

Table 4 Parameter description

Parameter

Type

Description

loadbalancer

Loadbalancer object

Specifies the load balancer. For details, see Table 5.

Table 5 loadbalancer parameter description

Parameter

Type

Description

id

String

Specifies the load balancer ID.

tenant_id

String

Specifies the ID of the project where the load balancer is used.

The value contains a maximum of 255 characters.

name

String

Specifies the load balancer name.

The value contains a maximum of 255 characters.

description

String

Provides supplementary information about the load balancer.

The value contains a maximum of 255 characters.

vip_subnet_id

String

Specifies the ID of the subnet where the load balancer resides.

vip_port_id

String

Specifies the ID of the port bound to the private IP address of the load balancer.

provider

String

Specifies the provider of the load balancer.

vip_address

String

Specifies the private IP address of the load balancer.

The value contains a maximum of 64 characters.

listeners

Array of Listeners objects

Lists the IDs of listeners added to the load balancer. For details, see Table 6.

pools

Array of Pools objects

Lists the IDs of backend server groups associated with the load balancer. For details, see Table 7.

operating_status

String

This parameter is reserved, and its value can be ONLINE or FROZEN.

It specifies the operating status of the load balancer.

provisioning_status

String

This parameter is reserved, and its value can only be ACTIVE.

It specifies the provisioning status of the load balancer.

admin_state_up

Boolean

Specifies the administrative status of the load balancer.

This parameter is reserved. The value can be true or false.

  • true: Enabled
  • false: Disabled

tags

Array

Lists load balancer tags.

created_at

String

Specifies the time when the load balancer was created.

The UTC time is in YYYY-MM-DDTHH:MM:SS format.

The value contains a maximum of 19 characters.

updated_at

String

Specifies the time when the load balancer was updated.

The UTC time is in YYYY-MM-DDTHH:MM:SS format.

The value contains a maximum of 19 characters.

enterprise_project_id

String

Specifies the enterprise project ID. When creating a load balancer, you can assign an enterprise project to the load balancer.

The value is character string 0 or a UUID with hyphens (-). Value 0 indicates the default enterprise project.

Table 6 listeners parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated listener.

Table 7 pools parameter description

Parameter

Type

Description

id

String

Specifies the ID of the associated backend server group.

Example Request

  • Example request 1: Creating a private network load balancer
    POST https://{Endpoint}/v2/1867112d054b427e808cc6096d8193a1/elb/loadbalancers
    
    {
        "loadbalancer": {
            "name": "loadbalancer1",
            "description": "simple lb",
            "tenant_id": "1867112d054b427e808cc6096d8193a1",
            "vip_subnet_id": "58077bdb-d470-424b-8c45-2e3c65060a5b",
            "vip_address": "10.0.0.4",
            "admin_state_up": true,
            "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" 
        }
    }
  • Example request 2: Creating a public network load balancer

    (Bind an EIP to the port that has been bound to the load balancer's private IP address. For details about the parameters, see Table 8.)

    Table 8 Request parameters

    Parameter

    Mandatory

    Type

    Description

    publicip

    Yes

    Object

    Specifies the EIP. For details, see Table 9.

    bandwidth

    Yes

    Object

    Specifies the bandwidth. For details, see Table 10.

    enterprise_project_id

    No

    String

    • Specifies the enterprise project ID. The value is 0 or a UUID that can contain a maximum of 36 characters, including hyphens (-).
    • When assigning an EIP, you need to bind an enterprise project ID to the EIP.
    • If this parameter is not specified, the default value is 0.
    NOTE:

    For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide.

    Table 9 publicip parameter description

    Parameter

    Mandatory

    Type

    Description

    type

    Yes

    String

    • Specifies the EIP type.
    • Note:
      • The configured value must be supported by the system.
      • publicip_id is an IPv4 port. If publicip_type is not specified, the default value is 5_bgp.

    ip_version

    No

    Integer

    • Specifies the EIP version.
    • The value can be 4 and 6. 4 indicates an IPv4 address, and 6 indicates an IPv6 address.
    • Note:
      • The configured value must be supported by the system.
      • If this parameter is left blank or is an empty string, an IPv4 address is assigned by default.

    ip_address

    No

    String

    • Specifies the EIP to be assigned. The system automatically assigns an EIP if you do not specify it.
    • The value must be a valid IPv4 address in the available IP address range.
    Table 10 bandwidth parameter description

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    • Specifies the bandwidth name.
    • The value can contain 1 to 64 characters that can contain letters, digits, underscores (_), hyphens (-), and periods (.).
    • This parameter is mandatory when share_type is set to PER. This parameter will be ignored when share_type is set to WHOLE with an ID specified.

    size

    Yes

    Integer

    • Specifies the bandwidth (Mbit/s).
    • The value ranges from 1 to 3001 to 100 by default. (The range may vary depending on the configuration in each region. You can see the bandwidth range of each region on the management console.)
    • This parameter is mandatory when share_type is set to PER. This parameter will be ignored when share_type is set to WHOLE with an ID specified.
    • The minimum unit for bandwidth adjustment varies depending on the bandwidth range. The details are as follows:
      • The minimum increment is 1 Mbit/s if the allowed bandwidth ranges from 0 to 300 Mbit/s.
      • The minimum increment is 50 Mbit/s if the allowed bandwidth ranges from 301 Mbit/s to 1000 Mbit/s.
      • The minimum increment is 500 Mbit/s if the allowed bandwidth is greater than 1000 Mbit/s.

    id

    No

    String

    • Specifies the bandwidth ID. You can specify an existing shared bandwidth when assigning an EIP.
    • The value can be the ID of the shared bandwidth whose type is set to WHOLE.

    share_type

    Yes

    String

    • Specifies the bandwidth type.
    • The value is PER, indicating that the bandwidth is dedicated.

    charge_mode

    No

    String

    • If the value is traffic, the bandwidth is billed by traffic.
    • 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.

Example Response

  • Example response 1
    {
        "loadbalancer": {
            "description": "",
            "admin_state_up": true,
            "tenant_id": "1867112d054b427e808cc6096d8193a1",
     
            "provisioning_status": "ACTIVE",
            "vip_subnet_id": "58077bdb-d470-424b-8c45-2e3c65060a5b",
            "listeners": [],
            "vip_address": "10.0.0.4",
            "vip_port_id": "519f6af5-74aa-4347-9dba-84c440192877",
            "provider": "vlb",
            "pools": [],
            "tags": [],
            "id": "b0657373-0c68-41d1-980f-1a44d9e3ff01",
            "operating_status": "ONLINE",
            "name": "loadbalancer1",
            "created_at": "2018-07-25T01:54:13", 
            "updated_at": "2018-07-25T01:54:14",
            "enterprise_project_id": "0aad99bc-f5f6-4f78-8404-c598d76b0ed2" 
        }
    }
  • Example response 2
    {
      "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.

Status Code

For details, see Status Codes.

Sitemizi ve deneyiminizi iyileştirmek için çerezleri kullanırız. Sitemizde tarama yapmaya devam ederek çerez politikamızı kabul etmiş olursunuz. Daha fazla bilgi edinin

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback