LoadBalancer HealthMonitors

Warning

Load balancing functions accessed via the neutron endpoint are deprecated and will be removed in a future release. Users are strongly encouraged to migrate to using the octavia endpoint. This library does not support the octavia endpoint yet. Consider helping us to implement it .

More information can be found in the official documentation.

Create

$networking = $openstack->networkingV2();

// Health Monitor options
$options = [
    'poolId'        => '{poolId}',
    'type'          => 'HTTPS',
    'delay'         => 1,
    'timeout'       => 1,
    'httpMethod'    => 'GET',
    'urlPath'       => '/',
    'expectedCodes' => '200,201,302',
    'maxRetries'    => 5,
    'adminStateUp'  => true
];

// Create the listener
$healthmonitor = $networking->createLoadBalancerHealthMonitor($options);

Read

$service = $openstack->networkingV2();
$healthMonitor = $service->getLoadBalancerHealthMonitor('{healthMonitorId}');

$healthMonitor->retrieve();

Update

$networking = $openstack->networkingV2();

// Get the healthmonitor
$healthmonitor = $networking->getLoadBalancerHealthMonitor('{healthmonitorId}');

$healthmonitor->delay = 30;
$healthmonitor->timeout = 60;
$healthmonitor->httpMethod = 'POST';
$healthmonitor->update();

Delete

$networking = $openstack->networkingV2();

// Get the health montitor
$healthmonitor = $networking->getLoadBalancerHealthMonitor('{healthmonitorId}');

$healthmonitor->delete();

List

$networking = $openstack->networkingV2();

foreach ($networking->listLoadBalancerHealthMonitors() as $healthmonitor) {
    // Do Stuff
}