普通型blb实例
更新时间:2019-10-30
普通型blb实例提供了负载均衡常规功能组件,能够满足用户对负载均衡的通用需求,具备轻量化、配置简单、价格便宜等特点。
具体各个参数含义请参考blb官方文档,api参考下的普通型blb接口
创建blb实例
使用以下代码可以创建blb实例:
Plain Text
1 /**
2 * Create an nat with the specified options.
3 *
4 * @param string $name
5 * name of nat
6 *
7 * @param string $vpcId
8 * id of vpc which nat created in
9 *
10 * @param string $subnetId
11 * id of subnet which blb created in
12 *
13 * @param string $desc
14 * description of blb
15 *
16 * @param string $clientToken
17 * if the clientToken is not specified by the user, a random String
18 * generated by default algorithm will be used.
19 *
20 * @param array $options
21 * The optional bce configuration, which will overwrite the
22 * default configuration that was passed while creating EipClient instance.
23 *
24 * @return mixed
25 */
26 public function createBlb($vpcId = null, $subnetId = null, $name = null, $desc = null, $clientToken = null, $options = array())
27 {
28
29 }
使用示例如下:
Plain Text
1public function testCreateBlb()
2 {
3 $resp = $this->client->createBlb("vpc-545hyqfg6m5s","sbn-e54j0dxwshj6");
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
修改blb实例
使用以下代码可以修改blb实例:
Plain Text
1 /**
2 * update single blb
3 *
4 * @param string $blbId
5 * id of blb instance
6 *
7 * @param string $name
8 * name of blb instance to be updated
9 *
10 * @param string $desc
11 * description of blb instance to be updated
12 *
13 * @param string $clientToken
14 * if the clientToken is not specified by the user, a random String
15 * generated by default algorithm will be used.
16 *
17 * @param array $options
18 * The optional bce configuration, which will overwrite the
19 * default configuration that was passed while creating EipClient instance.
20 *
21 * @return mixed
22 */
23 public function updateBlb($blbId, $name = null, $desc = null, $clientToken = null, $options = array())
24 {
25
26 }
使用示例如下:
Plain Text
1public function testUpdateBlb()
2 {
3 $resp = $this->client->updateBlb('lb-48872493', 'testName', 'testDesc');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
查询blb实例列表
使用以下代码可以查询blb列表:
Plain Text
1 /**
2 * get a list of blb owned by the authenticated user and specified conditions.
3 *
4 * @param string $address
5 * address of blb in vpc. The optional parameter
6 *
7 * @param string $blbId
8 * id of blb instance. The optional parameter
9 *
10 * @param string $name
11 * name of nat instance. The optional parameter
12 *
13 * @param string $bccId
14 * id of bcc instance which is bound to blb instance. The optional parameter
15 *
16 * @param string $marker
17 * The optional parameter marker specified in the original request to specify
18 * where in the results to begin listing.
19 *
20 * @param int $maxKeys
21 * The optional parameter to specifies the max number of list result to return.
22 * The default value is 1000.
23 *
24 * @param array $options
25 * The optional bce configuration, which will overwrite the
26 * default configuration that was passed while creating EipClient instance.
27 *
28 * @return mixed
29 */
30 public function listBlbs($address = null, $name = null, $blbId = null, $bccId = null, $marker = null, $maxKeys = 1000, $options = array())
31 {
32
33 }
使用示例如下:
Plain Text
1public function testListBlb()
2 {
3 $resp = $this->client->listBlbs();
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
删除blb实例
使用以下代码可以删除blb实例:
Plain Text
1 /**
2 * delete the blb
3 * Only the Postpaid instance or Prepaid which is expired can be released.
4 *
5 * @param string $blbId
6 * id of blb instance to be released
7 *
8 * @param string $clientToken
9 * if the clientToken is not specified by the user, a random String
10 * generated by default algorithm will be used.
11 *
12 * @param array $options
13 * The optional bce configuration, which will overwrite the
14 * default configuration that was passed while creating EipClient instance.
15 *
16 * @return mixed
17 */
18 public function deleteBlb($blbId, $clientToken = null, $options = array())
19 {
20
21 }
使用示例如下:
Plain Text
1 public function testDeleteBlb()
2 {
3 $resp = $this->client->deleteBlb('lb-90d60843');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
创建tcpListener实例
使用以下代码可以创建tcpListener实例:
Plain Text
1 /**
2 * Create a tcp listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param int $healthCheckTimeoutInSecond
17 * timeout of health check, default 3 seconds
18 *
19 * @param int $healthCheckInterval
20 * interval of health check, default 3 seconds
21 *
22 * @param int $unhealthyThreshold
23 * times threshold of unhealthy check, default 3 times
24 *
25 * @param int $healthyThreshold
26 * times threshold of healthy check, default 3 times
27 *
28 * @param string $clientToken
29 * if the clientToken is not specified by the user, a random String
30 * generated by default algorithm will be used.
31 *
32 * @param array $options
33 * The optional bce configuration, which will overwrite the
34 * default configuration that was passed while creating EipClient instance.
35 *
36 * @return mixed
37 */
38 public function createTcpListener($blbId, $listenerPort, $backendPort, $scheduler, $healthCheckTimeoutInSecond = 3, $healthCheckInterval = 3, $unhealthyThreshold = 3, $healthyThreshold = 3, $clientToken = null, $options = array())
39 {
40
41 }
使用示例如下:
Plain Text
1 public function testCreateTcpListener()
2 {
3 $resp = $this->client->createTcpListener('lb-48872493', 8000, 8008, 'RoundRobin');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
创建udpListener实例
使用以下代码可以创建udpListener实例:
Plain Text
1 /**
2 * Create a udp listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param string $healthCheckString
17 * string to send for health check
18 *
19 * @param int $healthCheckTimeoutInSecond
20 * timeout of health check, default 3 seconds
21 *
22 * @param int $healthCheckInterval
23 * interval of health check, default 3 seconds
24 *
25 * @param int $unhealthyThreshold
26 * times threshold of unhealthy check, default 3 times
27 *
28 * @param int $healthyThreshold
29 * times threshold of healthy check, default 3 times
30 *
31 * @param string $clientToken
32 * if the clientToken is not specified by the user, a random String
33 * generated by default algorithm will be used.
34 *
35 * @param array $options
36 * The optional bce configuration, which will overwrite the
37 * default configuration that was passed while creating EipClient instance.
38 *
39 * @return mixed
40 */
41 public function createUdpListener($blbId, $listenerPort, $backendPort, $scheduler, $healthCheckString, $healthCheckTimeoutInSecond = 3, $healthCheckInterval = 3, $unhealthyThreshold = 3, $healthyThreshold = 3, $clientToken = null, $options = array())
42 {
43
44 }
使用示例如下:
Plain Text
1 public function testCreateUdpListener()
2 {
3 $resp = $this->client->createUdpListener('lb-48872493', 8001, 8008, 'RoundRobin', 'aaa');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
创建httpListener实例
使用以下代码可以创建httpListener实例:
Plain Text
1 /**
2 * Create a http listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param boolean $keepSession
17 * switch for keep session
18 *
19 * @param string $keepSessionType
20 * type to keep session
21 *
22 * @param int $keepSessionDuration
23 * duration to keep session
24 *
25 * @param string $keepSessionCookieName
26 * cookie name for keep session
27 *
28 * @param boolean $xForwardFor
29 * switch for acquiring real ip
30 *
31 * @param string $healthCheckType
32 * type for health check
33 *
34 * @param int $healthCheckPort
35 * port for health check
36 *
37 * @param string $healthCheckURI
38 * uri for health check
39 *
40 * @param int $healthCheckTimeoutInSecond
41 * timeout of health check, default 3 seconds
42 *
43 * @param int $healthCheckInterval
44 * interval of health check, default 3 seconds
45 *
46 * @param int $unhealthyThreshold
47 * times threshold of unhealthy check, default 3 times
48 *
49 * @param int $healthyThreshold
50 * times threshold of healthy check, default 3 times
51 *
52 * @param string $healthCheckNormalStatus
53 * normal status for http health check
54 *
55 * @param int $serverTimeout
56 * timeout for backend server
57 *
58 * @param int $redirectPort
59 * port for redirect
60 *
61 * @param string $clientToken
62 * if the clientToken is not specified by the user, a random String
63 * generated by default algorithm will be used.
64 *
65 * @param array $options
66 * The optional bce configuration, which will overwrite the
67 * default configuration that was passed while creating EipClient instance.
68 *
69 * @return mixed
70 */
71 public function createHttpListener($blbId, $listenerPort, $backendPort, $scheduler, $keepSession = false,
72 $keepSessionType = null, $keepSessionDuration = 3600, $keepSessionCookieName = null,
73 $xForwardFor = false, $healthCheckType = null, $healthCheckPort = null, $healthCheckURI = null,
74 $healthCheckTimeoutInSecond = 3, $healthCheckInterval = 3, $unhealthyThreshold = 3, $healthyThreshold = 3,
75 $healthCheckNormalStatus = null, $serverTimeout = 30, $redirectPort = null, $clientToken = null, $options = array())
76 {
77
78 }
使用示例如下:
Plain Text
1 public function testCreateHttpListener()
2 {
3 $resp = $this->client->createHttpListener('lb-48872493', 8002, 8008, 'RoundRobin');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
创建httpsListener实例
使用以下代码可以创建httpsListener实例:
Plain Text
1 /**
2 * Create a https listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param array $certIds
17 * SSL certs for listener
18 *
19 * @param boolean $keepSession
20 * switch for keep session
21 *
22 * @param string $keepSessionType
23 * type to keep session
24 *
25 * @param int $keepSessionDuration
26 * duration to keep session
27 *
28 * @param string $keepSessionCookieName
29 * cookie name for keep session
30 *
31 * @param boolean $xForwardFor
32 * switch for acquiring real ip
33 *
34 * @param string $healthCheckType
35 * type for health check
36 *
37 * @param int $healthCheckPort
38 * port for health check
39 *
40 * @param string $healthCheckURI
41 * uri for health check
42 *
43 * @param int $healthCheckTimeoutInSecond
44 * timeout of health check, default 3 seconds
45 *
46 * @param int $healthCheckInterval
47 * interval of health check, default 3 seconds
48 *
49 * @param int $unhealthyThreshold
50 * times threshold of unhealthy check, default 3 times
51 *
52 * @param int $healthyThreshold
53 * times threshold of healthy check, default 3 times
54 *
55 * @param string $healthCheckNormalStatus
56 * normal status for http health check
57 *
58 * @param int $serverTimeout
59 * timeout for backend server
60 *
61 * @param boolean $ie6Compatible
62 * switch for compatibility with IE6
63 *
64 * @param string $clientToken
65 * if the clientToken is not specified by the user, a random String
66 * generated by default algorithm will be used.
67 *
68 * @param array $options
69 * The optional bce configuration, which will overwrite the
70 * default configuration that was passed while creating EipClient instance.
71 *
72 * @return mixed
73 */
74 public function createHttpsListener($blbId, $listenerPort, $backendPort, $scheduler, $certIds, $keepSession = false,
75 $keepSessionType = null, $keepSessionDuration = 3600, $keepSessionCookieName = null,
76 $xForwardFor = false, $healthCheckType = null, $healthCheckPort = null, $healthCheckURI = null,
77 $healthCheckTimeoutInSecond = 3, $healthCheckInterval = 3, $unhealthyThreshold = 3, $healthyThreshold = 3,
78 $healthCheckNormalStatus = null, $serverTimeout = 30, $ie6Compatible = true, $clientToken = null, $options = array())
79 {
80
81 }
使用示例如下:
Plain Text
1 public function testCreateHttpsListener()
2 {
3 $resp = $this->client->createHttpsListener('lb-5538a312', 8000, 8008, 'RoundRobin', array('cert-ahc9dhfh7icf'));
4 print_r($resp);
5 $this->assertNotNull($resp);
查询tcpListener实例
使用以下代码可以查询tcpListener实例:
Plain Text
1 /**
2 * list tcp listener.
3 *
4 * @param string $blbId
5 * id of blb instance
6 *
7 * @param int listenerPort
8 * port of listener
9 *
10 * @param string $marker
11 * The optional parameter marker specified in the original request to specify
12 * where in the results to begin listing.
13 *
14 * @param int $maxKeys
15 * The optional parameter to specifies the max number of list result to return.
16 * The default value is 1000.
17 *
18 * @param array $options
19 * The optional bce configuration, which will overwrite the
20 * default configuration that was passed while creating EipClient instance.
21 *
22 * @return mixed
23 */
24 public function listTcpListeners($blbId, $listenerPort = null, $marker = null, $maxKeys = 1000, $options = array())
25 {
26
27 }
使用示例如下:
Plain Text
1 public function testListTcpListeners()
2 {
3 $resp = $this->client->listTcpListeners('lb-48872493');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
查询udpListener实例
使用以下代码可以查询udpListener实例:
Plain Text
1 /**
2 * list udp listener.
3 *
4 * @param string $blbId
5 * id of blb instance
6 *
7 * @param int listenerPort
8 * port of listener
9 *
10 * @param string $marker
11 * The optional parameter marker specified in the original request to specify
12 * where in the results to begin listing.
13 *
14 * @param int $maxKeys
15 * The optional parameter to specifies the max number of list result to return.
16 * The default value is 1000.
17 *
18 * @param array $options
19 * The optional bce configuration, which will overwrite the
20 * default configuration that was passed while creating EipClient instance.
21 *
22 * @return mixed
23 */
24 public function listUdpListeners($blbId, $listenerPort = null, $marker = null, $maxKeys = 1000, $options = array())
25 {
26
27 }
使用示例如下:
Plain Text
1 public function testListUdpListeners()
2 {
3 $resp = $this->client->listUdpListeners('lb-48872493');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
查询httpListener实例
使用以下代码可以查询httpListener实例:
Plain Text
1 /**
2 * list http listener.
3 *
4 * @param string $blbId
5 * id of blb instance
6 *
7 * @param int listenerPort
8 * port of listener
9 *
10 * @param string $marker
11 * The optional parameter marker specified in the original request to specify
12 * where in the results to begin listing.
13 *
14 * @param int $maxKeys
15 * The optional parameter to specifies the max number of list result to return.
16 * The default value is 1000.
17 *
18 * @param array $options
19 * The optional bce configuration, which will overwrite the
20 * default configuration that was passed while creating EipClient instance.
21 *
22 * @return mixed
23 */
24 public function listHttpListeners($blbId, $listenerPort = null, $marker = null, $maxKeys = 1000, $options = array())
25 {
26
27 }
使用示例如下:
Plain Text
1 public function testListHttpListeners()
2 {
3 $resp = $this->client->listHttpListeners('lb-48872493');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
查询httpsListener实例
使用以下代码可以查询httpsListener实例:
Plain Text
1 /**
2 * list https listener.
3 *
4 * @param string $blbId
5 * id of blb instance
6 *
7 * @param int listenerPort
8 * port of listener
9 *
10 * @param string $marker
11 * The optional parameter marker specified in the original request to specify
12 * where in the results to begin listing.
13 *
14 * @param int $maxKeys
15 * The optional parameter to specifies the max number of list result to return.
16 * The default value is 1000.
17 *
18 * @param array $options
19 * The optional bce configuration, which will overwrite the
20 * default configuration that was passed while creating EipClient instance.
21 *
22 * @return mixed
23 */
24 public function listHttpsListeners($blbId, $listenerPort = null, $marker = null, $maxKeys = 1000, $options = array())
25 {
26
27 }
使用示例如下:
Plain Text
1 public function testListHttpsListeners()
2 {
3 $resp = $this->client->listHttpsListeners('lb-5538a312');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
更新tcpListener实例
使用以下代码可以更新tcpListener实例:
Plain Text
1 /**
2 * update a tcp listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param int $healthCheckTimeoutInSecond
17 * timeout of health check, default 3 seconds
18 *
19 * @param int $healthCheckInterval
20 * interval of health check, default 3 seconds
21 *
22 * @param int $unhealthyThreshold
23 * times threshold of unhealthy check, default 3 times
24 *
25 * @param int $healthyThreshold
26 * times threshold of healthy check, default 3 times
27 *
28 * @param string $clientToken
29 * if the clientToken is not specified by the user, a random String
30 * generated by default algorithm will be used.
31 *
32 * @param array $options
33 * The optional bce configuration, which will overwrite the
34 * default configuration that was passed while creating EipClient instance.
35 *
36 * @return mixed
37 */
38 public function updateTcpListener($blbId, $listenerPort, $backendPort = null, $scheduler = null, $healthCheckTimeoutInSecond = null, $healthCheckInterval = null, $unhealthyThreshold = null, $healthyThreshold = null, $clientToken = null, $options = array())
39 {
40
41 }
使用示例如下:
Plain Text
1 public function testUpdateTcpListener()
2 {
3 $resp = $this->client->updateTcpListener('lb-48872493', 8000, 8009);
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
更新udpListener实例
使用以下代码可以更新udpListener实例:
Plain Text
1 /**
2 * update a udp listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param string $healthCheckString
17 * string to send for health check
18 *
19 * @param int $healthCheckTimeoutInSecond
20 * timeout of health check, default 3 seconds
21 *
22 * @param int $healthCheckInterval
23 * interval of health check, default 3 seconds
24 *
25 * @param int $unhealthyThreshold
26 * times threshold of unhealthy check, default 3 times
27 *
28 * @param int $healthyThreshold
29 * times threshold of healthy check, default 3 times
30 *
31 * @param string $clientToken
32 * if the clientToken is not specified by the user, a random String
33 * generated by default algorithm will be used.
34 *
35 * @param array $options
36 * The optional bce configuration, which will overwrite the
37 * default configuration that was passed while creating EipClient instance.
38 *
39 * @return mixed
40 */
41 public function updateUdpListener($blbId, $listenerPort, $backendPort, $scheduler, $healthCheckString, $healthCheckTimeoutInSecond = null, $healthCheckInterval = null, $unhealthyThreshold = null, $healthyThreshold = null, $clientToken = null, $options = array())
42 {
43
44 }
使用示例如下:
Plain Text
1 public function testUpdateUdpListener()
2 {
3 $resp = $this->client->updateUdpListener('lb-48872493', 8001, 8009, 'RoundRobin', 'bbb');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
更新httpListener实例
使用以下代码可以更新httpListener实例:
Plain Text
1 /**
2 * update a http listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param boolean $keepSession
17 * switch for keep session
18 *
19 * @param string $keepSessionType
20 * type to keep session
21 *
22 * @param int $keepSessionDuration
23 * duration to keep session
24 *
25 * @param string $keepSessionCookieName
26 * cookie name for keep session
27 *
28 * @param boolean $xForwardFor
29 * switch for acquiring real ip
30 *
31 * @param string $healthCheckType
32 * type for health check
33 *
34 * @param int $healthCheckPort
35 * port for health check
36 *
37 * @param string $healthCheckURI
38 * uri for health check
39 *
40 * @param int $healthCheckTimeoutInSecond
41 * timeout of health check, default 3 seconds
42 *
43 * @param int $healthCheckInterval
44 * interval of health check, default 3 seconds
45 *
46 * @param int $unhealthyThreshold
47 * times threshold of unhealthy check, default 3 times
48 *
49 * @param int $healthyThreshold
50 * times threshold of healthy check, default 3 times
51 *
52 * @param string $healthCheckNormalStatus
53 * normal status for http health check
54 *
55 * @param int $serverTimeout
56 * timeout for backend server
57 *
58 * @param int $redirectPort
59 * port for redirect
60 *
61 * @param string $clientToken
62 * if the clientToken is not specified by the user, a random String
63 * generated by default algorithm will be used.
64 *
65 * @param array $options
66 * The optional bce configuration, which will overwrite the
67 * default configuration that was passed while creating EipClient instance.
68 *
69 * @return mixed
70 */
71 public function updateHttpListener($blbId, $listenerPort, $backendPort = null, $scheduler = null, $keepSession = null,
72 $keepSessionType = null, $keepSessionDuration = null, $keepSessionCookieName = null,
73 $xForwardFor = null, $healthCheckType = null, $healthCheckPort = null, $healthCheckURI = null,
74 $healthCheckTimeoutInSecond = null, $healthCheckInterval = null, $unhealthyThreshold = null, $healthyThreshold = null,
75 $healthCheckNormalStatus = null, $serverTimeout = null, $redirectPort = null, $clientToken = null, $options = array())
76 {
77
78 }
使用示例如下:
Plain Text
1 public function testUpdateHttpListener()
2 {
3 $resp = $this->client->updateHttpListener('lb-48872493', 8002, 8009);
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
更新httpsListener实例
使用以下代码可以更新httpsListener实例:
Plain Text
1 /**
2 * update a https listener with the specified options.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param int $listenerPort
8 * front end port of listener
9 *
10 * @param int $backendPort
11 * back end port of listener
12 *
13 * @param string $scheduler
14 * scheduler of load balance
15 *
16 * @param array $certIds
17 * SSL certs for listener
18 *
19 * @param boolean $keepSession
20 * switch for keep session
21 *
22 * @param string $keepSessionType
23 * type to keep session
24 *
25 * @param int $keepSessionDuration
26 * duration to keep session
27 *
28 * @param string $keepSessionCookieName
29 * cookie name for keep session
30 *
31 * @param boolean $xForwardFor
32 * switch for acquiring real ip
33 *
34 * @param string $healthCheckType
35 * type for health check
36 *
37 * @param int $healthCheckPort
38 * port for health check
39 *
40 * @param string $healthCheckURI
41 * uri for health check
42 *
43 * @param int $healthCheckTimeoutInSecond
44 * timeout of health check, default 3 seconds
45 *
46 * @param int $healthCheckInterval
47 * interval of health check, default 3 seconds
48 *
49 * @param int $unhealthyThreshold
50 * times threshold of unhealthy check, default 3 times
51 *
52 * @param int $healthyThreshold
53 * times threshold of healthy check, default 3 times
54 *
55 * @param string $healthCheckNormalStatus
56 * normal status for http health check
57 *
58 * @param int $serverTimeout
59 * timeout for backend server
60 *
61 * @param boolean $ie6Compatible
62 * switch for compatibility with IE6
63 *
64 * @param string $clientToken
65 * if the clientToken is not specified by the user, a random String
66 * generated by default algorithm will be used.
67 *
68 * @param array $options
69 * The optional bce configuration, which will overwrite the
70 * default configuration that was passed while creating EipClient instance.
71 *
72 * @return mixed
73 */
74 public function updateHttpsListener($blbId, $listenerPort, $backendPort = null, $scheduler = null, $certIds = null, $keepSession = null,
75 $keepSessionType = null, $keepSessionDuration = null, $keepSessionCookieName = null,
76 $xForwardFor = null, $healthCheckType = null, $healthCheckPort = null, $healthCheckURI = null,
77 $healthCheckTimeoutInSecond = null, $healthCheckInterval = null, $unhealthyThreshold = null, $healthyThreshold = null,
78 $healthCheckNormalStatus = null, $serverTimeout = null, $ie6Compatible = null, $clientToken = null, $options = array())
79 {
80
81 }
使用示例如下:
Plain Text
1 public function testUpdateHttpsListener()
2 {
3 $resp = $this->client->updateHttpsListener('lb-5538a312', 8000, 8010);
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
删除Listener实例
使用以下代码可以删除Listener实例:
Plain Text
1 /**
2 * delete a listener.
3 *
4 * @param string $blbId
5 * id of blb
6 *
7 * @param array $portList
8 * ports of listener to be deleted
9 *
10 * @param string $clientToken
11 * if the clientToken is not specified by the user, a random String
12 * generated by default algorithm will be used.
13 *
14 * @param array $options
15 * The optional bce configuration, which will overwrite the
16 * default configuration that was passed while creating EipClient instance.
17 *
18 * @return mixed
19 */
20 public function deleteListeners($blbId, $portList, $clientToken = null, $options = array())
21 {
22
23 }
使用示例如下:
Plain Text
1 public function testDeleteListener()
2 {
3 $resp = $this->client->deleteListeners('lb-48872493', array(8000, 8001));
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
增加后端服务器实例
使用以下代码可以增加后端服务器实例:
Plain Text
1 /**
2 * add backend server
3 *
4 * @param string $blbId
5 * blb instance id
6 *
7 * @param array $backendServerList
8 * back end servers to be added
9 *
10 * @param string $clientToken
11 * if the clientToken is not specified by the user, a random String
12 * generated by default algorithm will be used.
13 *
14 * @param array $options
15 * The optional bce configuration, which will overwrite the
16 * default configuration that was passed while creating EipClient instance.
17 *
18 * @return mixed
19 */
20 public function addBackendServer($blbId, $backendServerList, $clientToken = null, $options = array())
21 {
22
23 }
使用示例如下:
Plain Text
1 public function testAddServers()
2 {
3 $b1 = new BackendServer('i-xtsPZTGY', 2);
4 $b2 = new BackendServer('i-Xf3hfqWt', 3);
5 $backendServerList = array($b1, $b2);
6 $resp = $this->client->addBackendServer('lb-21e928b8', $backendServerList);
7 print_r($resp);
8 $this->assertNotNull($resp);
9 }
用端口查询后端服务器实例
使用以下代码可以查询后端服务器实例:
Plain Text
1 /**
2 * list backend servers mounted with blb instance. Health Status will be presented while listener port is necessary
3 *
4 * @param string $blbId
5 * blb instance id
6 *
7 * @param int listenerPort
8 * port of listener
9 *
10 * @param string $marker
11 * The optional parameter marker specified in the original request to specify
12 * where in the results to begin listing.
13 *
14 * @param int $maxKeys
15 * The optional parameter to specifies the max number of list result to return.
16 * The default value is 1000.
17 *
18 * @param string $clientToken
19 * if the clientToken is not specified by the user, a random String
20 * generated by default algorithm will be used.
21 *
22 * @param array $options
23 * The optional bce configuration, which will overwrite the
24 * default configuration that was passed while creating EipClient instance.
25 *
26 * @return mixed
27 */
28 public function listBackendServersWithPort($blbId, $listenerPort, $marker = null, $maxKeys = 1000, $clientToken = null, $options = array())
29 {
30
31 }
使用示例如下:
Plain Text
1 public function testListBackendServersWithPort()
2 {
3 $resp = $this->client->listBackendServersWithPort('lb-21e928b8', 80);
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
查询后端服务器实例
使用以下代码可以查询后端服务器实例:
Plain Text
1 /**
2 * list backend servers mounted with blb instance
3 *
4 * @param string $blbId
5 * blb instance id
6 *
7 * @param string $marker
8 * The optional parameter marker specified in the original request to specify
9 * where in the results to begin listing.
10 *
11 * @param int $maxKeys
12 * The optional parameter to specifies the max number of list result to return.
13 * The default value is 1000.
14 *
15 * @param string $clientToken
16 * if the clientToken is not specified by the user, a random String
17 * generated by default algorithm will be used.
18 *
19 * @param array $options
20 * The optional bce configuration, which will overwrite the
21 * default configuration that was passed while creating EipClient instance.
22 *
23 * @return mixed
24 */
25 public function listBackendServers($blbId, $marker = null, $maxKeys = 1000, $clientToken = null, $options = array())
26 {
27
28 }
使用示例如下:
Plain Text
1 public function testListBackendServers()
2 {
3 $resp = $this->client->listBackendServers('lb-21e928b8');
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }
更新后端服务器实例
使用以下代码可以更新后端服务器实例:
Plain Text
1 /**
2 * update weight of backend servers
3 *
4 * @param string $blbId
5 * blb instance id
6 *
7 * @param array $backendServerList
8 * back end servers to be updated
9 *
10 * @param string $clientToken
11 * if the clientToken is not specified by the user, a random String
12 * generated by default algorithm will be used.
13 *
14 * @param array $options
15 * The optional bce configuration, which will overwrite the
16 * default configuration that was passed while creating EipClient instance.
17 *
18 * @return mixed
19 */
20 public function updateBackendServer($blbId, $backendServerList, $clientToken = null, $options = array())
21 {
22
23 }
使用示例如下:
Plain Text
1 public function testUpdateServers()
2 {
3 $b1 = new BackendServer('i-xtsPZTGY', 20);
4 $b2 = new BackendServer('i-Xf3hfqWt', 31);
5 $backendServerList = array($b1, $b2);
6 $resp = $this->client->updateBackendServer('lb-21e928b8', $backendServerList);
7 print_r($resp);
8 $this->assertNotNull($resp);
9 }
移除后端服务器实例
使用以下代码可以移除后端服务器实例:
Plain Text
1 /**
2 * remove backend servers
3 *
4 * @param string $blbId
5 * blb instance id
6 *
7 * @param array $backendServerList
8 * back end servers to be removed
9 *
10 * @param string $clientToken
11 * if the clientToken is not specified by the user, a random String
12 * generated by default algorithm will be used.
13 *
14 * @param array $options
15 * The optional bce configuration, which will overwrite the
16 * default configuration that was passed while creating EipClient instance.
17 *
18 * @return mixed
19 */
20 public function removeBackendServers($blbId, $backendServerList, $clientToken = null, $options = array())
21 {
22
23 }
使用示例如下:
Plain Text
1 public function testRemoveServers()
2 {
3 $resp = $this->client->removeBackendServers('lb-21e928b8', array('i-xtsPZTGY', 'i-Xf3hfqWt'));
4 print_r($resp);
5 $this->assertNotNull($resp);
6 }