LoadBalancer Listeners
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();
// Options for listener
$options = [
'name' => 'listenerName',
'description' => 'Load Balancer Listener',
'loadbalancerId' => '{loadbalancerId}',
'adminStateUp' => true,
'protocol' => 'HTTPS',
'protocolPort' => 443,
'connectionLimit' => 1000
];
// Create the listener
$listener = $networking->createLoadBalancerListener($options);
Read
$service = $openstack->networkingV2();
$listener = $service->getLoadBalancerListener('{listenerId}');
$listener->retrieve();
Update
$networking = $openstack->networkingV2();
// Get the listener
$listener = $networking->getLoadBalancerListener('{listenerId}');
$listener->name = 'newListener';
$listener->description = 'New Description';
$listener->update();
Delete
$networking = $openstack->networkingV2();
// Get the listener
$listener = $networking->getLoadBalancerListener('{listenerId}');
$listener->delete();
List
$networking = $openstack->networkingV2();
foreach ($networking->listLoadBalancerListeners() as $listener) {
// Do Stuff
}