百度智能云

All Product Document

          Load Balance

          Application BLB Instance Related Interface

          CreateLoadBalancer

          Description

          • Create a LoadBalancer and return the assigned service address and instance ID.
          • The payment method is postpaid.
          • Identity and access management is required. If it does not pass the identity and access management, you may go to identity and access management under the Security Authentication in Baidu Open Cloud Console for authentication.

          Request Structure

          POST /v{version}/appblb?clientToken={clientToken} HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: authorization string 
          
          { 
              "name": name, 
              "desc": desc, 
              "subnetId": subnetShortId, 
              "vpcId": vpcShortId, 
              "address": address,
              "eip": eip,
               "tags":[ 
                  { 
                      "tagKey": tagKey, 
                      "tagValue": tagValue 
                  } 
              ] 
          } 

          Request Header

          There are no other special headers except the public headers.

          Request Parameter

          Parameter name Type Required or not Parameter position Description
          version String Yes URL parameter API version number (the current value is 1)
          clientToken String Yes Query parameter Idempotent Token, no longer than 64 bits
          name String No RequestBody parameter LoadBalancer's name is easy to remember. It is 1-65 bytes in length beginning with a letter. It can contain letters, numbers and characters of -_/.. This parameter will be generated automatically if not loaded
          desc String No RequestBody parameter The description of the LoadBalancer instance is convenient for users to add more detailed description information. It is 0-450 bytes in length and supports Chinese. Empty by default
          subnetId String Yes RequestBody parameter Subnet of LoadBalancer instance
          vpcId String Yes RequestBody parameter vpcShortId of VPC of LoadBalancer instance vip
          address String No RequestBody parameter Specifies the private IP address of the load balance instance, which must be included in the subnet IP address range.
          eip String No RequestBody parameter Bind the existing eip.
          tags List<TagModel> No RequestBody parameter List of tag key-value pairs to be created

          Return Status Code

          "200" for return successful and Error Code for return failed.

          Return Header

          There are no other special headers except the public headers.

          Return Parameter

          Parameter name Type Description
          address String This instance may be assessed through the service address IP assigned
          name String LoadBalancer name
          desc String Description of LoadBalancer
          blbId String LoadBalancer ID. Subsequent operations on this instance need to carry this ID in the request

          Request Example

          POST /v1/appblb?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1 
          HOST blb.bj.baidubce.com 
          Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02 
          
          { 
              "name":"blb-for-test", 
              "subnetId":"sbn-hj9k8v413tqm", 
              "vpcId": "vpc-tuf4sqw82i5m" ,
               "address": "192.168.0.24",
              "eip": "100.88.8.139"
          } 

          Response Example

          HTTP/1.1 200 OK 
          x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
          Date: Wed, 10 Apr 2016 08:26:52 GMT 
          Transfer-Encoding: chunked 
          Content-Type: application/json;charset=UTF-8 
          Server: BWS 
          
          { 
              "blbId": "lb-BLuOPSLZ", 
              "name": "blb-for-test", 
              "desc": "", 
              "address": "10.32.251.93" 
          } 

          UpdateLoadBalancer

          Description

          • Update the configuration information of a LoadBalancer.

          Request Structure

          PUT /v{version}/appblb/{blb_id}?clientToken={clientToken} HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: authorization string 
          
          { 
              "name": name 
              "desc": desc 
          } 

          Request Header

          There are no other special headers except the public headers.

          Request Parameter

          Parameter name Type Required or not Parameter position Description
          version String Yes URL parameter API version number (the current value is 1)
          blbId String Yes Query parameter The ID of the LoadBalancer to be updated
          clientToken String Yes Query parameter Idempotent Token, no longer than 64 bits
          name String No RequestBody parameter LoadBalancer's name is easy to remember. It is 1-65 bytes in length beginning with a letter. It can contain letters, numbers and characters of -_/.. This parameter will be generated automatically if not loaded
          desc String No RequestBody parameter The description of the LoadBalancer instance is convenient for users to add more detailed description information. It is 0-450 bytes in length and supports Chinese. Empty by default
          allowDelete Boolean No RequestBody parameter Whether to allow deletion. The default value is true, which means deletion is allowed

          Return Status Code

          "200" for return successful and Error Code for return failed.

          Return Header

          There are no other special headers except the public headers.

          Return Parameter

          None

          Request Example

          PUT /v1/appblb/lb-9f59e197?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1 
          HOST blb.bj.baidubce.com 
          Authorization bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02 
          
          { 
              "name":"blb-for-test", 
              "desc": "For testing environment" 
          } 

          Response Example

          HTTP/1.1 200 OK 
          x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
          Date: Wed, 10 Apr 2016 08:26:52 GMT 
          Transfer-Encoding: chunked 
          Content-Type: application/json;charset=UTF-8 
          Server: BWS 

          DescribeLoadBalancers

          Description

          • Query all LoadBalancer information under the user account.
          • Support query by LoadBalancer id, name and address. Matching rules support partial inclusion (regular is not supported).
          • Support to find the bound LoadBalancer of the BCC specified by the bccId parameter.
          • The return result is the intersection of multiple query conditions.
          • The result supports marker paging. The default paging size is 1,000, and can be specified by the maxKeys parameter.

          Request Structure

          GET /v{version}/appblb?address={address}&name={name}&blbId={blbId}&marker={marker}&maxKeys={maxKeys} HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: authorization string 

          Request Header

          There are no other special headers except the public headers.

          Request Parameter

          Parameter name Type Required or not Parameter position Description
          version String Yes URL parameter API version number (the current value is 1)
          address String No Query parameter Address of LoadBalancer to be queried is in the format of dotted decimal IP
          name String No Query parameter LoadBalancer name to query
          blbId String No Query parameter LoadBalancer ID to query
          bccId String No Query parameter LoadBalancer binding the BCC
          exactlyMatch boolean No Query parameter "true" indicates the query condition is precise match, otherwise it is fuzzy match. Default value is false
          marker String No Query parameter The starting location of query for batch acquisition of lists, and is one string generated by the system.
          maxKeys int No Query parameter Maximum number contained in each page, generally not exceeding 1000. The default value is 1000.

          Return Status Code

          "200" for return successful and Error Code for return failed.

          Return Header

          There are no other special headers except the public headers.

          Return Parameter

          Parameter name Type Description
          blbList List<AppBLBModel> List containing query results
          marker String Mark the starting position of the query. The item does not exist if the result list is empty
          isTruncated boolean True means there are additional data in the following pages and false means the current page is the last page.
          nextMarker String The marker value requiring to be passed in order to acquire the next page. The domain doesn't appear when isTruncated is false.
          maxKeys int Maximum number contained in each page.

          Request Example

          GET /v1/appblb?name=test&maxKeys=2 HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02 

          Response Example

          HTTP/1.1 200 OK 
          x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
          Date: Wed, 10 Apr 2016 08:26:52 GMT 
          Transfer-Encoding: chunked 
          Content-Type: application/json;charset=UTF-8 
          Server: BWS 
          
          { 
              "blbList": [ 
                  { 
                      "blbId": "lb-a7e5zPPk", 
                      "status": available, 
                      "name": "test-blb", 
                      "desc": "For Production Environment", 
                      "vpcId":"vpc-fy6vdykpwkqb", 
                      "address": "10.32.249.113" 
                  }, 
                  { 
                      "blbId": "lb-gj5gVpeq", 
                      "status": available, 
                      "name": "nametest", 
                      "desc": "For Testing Environment", 
                      "vpcId":"vpc-a8n5p6kybbx4", 
                      "address": "10.32.251.4" 
                  } 
              ], 
              "marker": "blb-0A20F971", 
              "nextMarker": "blb-0A20FB09", 
              "isTruncated": true, 
              "maxKeys": 2 
          } 

          DescribeLoadBalancerDetail

          Description

          • Query details of all LoadBalancers under user account by id
          • Contain all the listener port information of LoadBalancer

          Request Structure

          GET /v{version}/appblb/{blbId} HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: authorization string 

          Request Header

          There are no other special headers except the public headers.

          Request Parameter

          Parameter name Type Required or not Parameter position Description
          version String Yes URL parameter API version number (the current value is 1)
          blbId String Yes URL parameter The identifier of the LoadBalancer to query

          Return Status Code

          "200" for return successful and Error Code for return failed.

          Return Header

          There are no other special headers except the public headers.

          Return Parameter

          Parameter name Type Description
          blbId String LoadBalancer identifier
          status blbStatus BLB status
          desc String Description of LoadBalancer
          address String Intranet address of LoadBalancer
          publicIp String Public address of LoadBalancer
          cidr String Network cidr of LoadBalancer
          vpcName String Name of vpc to which LoadBalancer belongs
          subnetCider String cidr for the subnet of LoadBalancer
          subnetName String Name for the subnet of LoadBalancer
          createTime String Creation time of LoadBalancer
          releaseTime String Auto release time of LoadBalancer
          listener List<ListenerModel> List of mount listeners under LoadBalancer
          tags List<TagModel> List of tag key-value pairs
          allowDelete Boolean Allow deletion

          Request Example

          GET /v1/appblb/lb-7fb1e926 HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: bce-auth-v1/5e5a8adf11ae475ba95f1bd38228b44f/2016-04-10T08:26:52Z/1800/host;x-bce-date/ec3c0069f9abb1e247773a62707224124b2b31b4c171133677f9042969791f02 

          Response Example

          HTTP/1.1 200 OK 
          x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
          Date: Wed, 10 Apr 2016 08:26:52 GMT 
          Transfer-Encoding: chunked 
          Content-Type: application/json;charset=UTF-8 
          Server: BWS 
          
          { 
              "blbId":"lb-gj5gVpeq",          
              "status":"available",           
              "name":"nametest",              
              "desc":"",                      
              "address":"192.168.0.2",        
              "publicIp":"123.2.3.4",         
              "cidr":"192.168.0.0/16",        
              "vpcName":"test",               
              "subnetName": "System Predefined Subnet",    
              "subnetCider": "192.168.0.0/20",    
              "createTime":"2019-03-07T02:35:31Z",    
              "releaseTime":"2019-03-07T02:35:31Z",   
              "listener":[                            
              { 
                  "port":80,                      
                  "type": "TCP"                   
              } 
              ] 
          } 

          DeleteLoadBalancer

          Description

          • Release the specified LoadBalancer which cannot be retrieved.

          Request Structure

          DELETE /v{version}/appblb/{blbId} HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: authorization string 

          Request Header

          There are no other special headers except the public headers.

          Request Parameter

          Parameter name Type Required or not Parameter position Description
          version String Yes URL parameter API version number (the current value is 1)
          blbId String Yes URL parameter The ID of the LoadBalancer to be released

          Return Status Code

          "200" for return successful and Error Code for return failed.

          Return Header

          There are no other special headers except the public headers.

          Return Parameter

          None

          Request Example

          DELETE /v1/appblb/lb-j8UqijYf HTTP/1.1 
          Host: blb.bj.baidubce.com 
          Authorization: bce-auth-v1/ae4780f344774daa832f34caadd4d7de/2016-06-03T07:09:25Z/1800/host/fa13c6057d34b0152a0959541f49bea9ae4eeece2317ac3e371dda33c27f5f76 

          Response Example

          HTTP/1.1 200 OK 
          x-bce-request-id: 946002ee-cb4f-4aad-b686-5be55df27f09
          Date: Fri, 03 Jun 2016 07:09:45 GMT 
          Transfer-Encoding: chunked 
          Content-Type: application/json;charset=UTF-8 
          Server: BWS
          Previous
          Common BLB Interface
          Next
          Application BLB Monitor Related Interface