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