LoadBalancer HealthMonitors¶
Create HealthMonitor¶
Show auth code<?php
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => [
'project' => [
'id' => '{projectId}'
]
]
]);
$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);
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Get HealthMonitor¶
Show auth code<?php
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => [
'project' => [
'id' => '{projectId}'
]
]
]);
$networking = $openstack->networkingV2();
// Get the health monitor
$healthmonitor = $networking->getLoadBalancerHealthMonitor('{healthmonitorId}');
$healthmonitor->retrieve();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
List HealthMonitors¶
Show auth code<?php
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => [
'project' => [
'id' => '{projectId}'
]
]
]);
$networking = $openstack->networkingV2();
foreach ($networking->listLoadBalancerHealthMonitors() as $healthmonitor) {
// Do Stuff
}
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Update HealthMonitor¶
Show auth code<?php
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => [
'project' => [
'id' => '{projectId}'
]
]
]);
$networking = $openstack->networkingV2();
// Get the healthmonitor
$healthmonitor = $networking->getLoadBalancerHealthMonitor('{healthmonitorId}');
$healthmonitor->delay = 30;
$healthmonitor->timeout = 60;
$healthmonitor->httpMethod = 'POST';
$healthmonitor->update();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.
Delete HealthMonitor¶
Show auth code<?php
require 'vendor/autoload.php';
$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => [
'project' => [
'id' => '{projectId}'
]
]
]);
$networking = $openstack->networkingV2();
// Get the health montitor
$healthmonitor = $networking->getLoadBalancerHealthMonitor('{healthmonitorId}');
$healthmonitor->delete();
To see all the required and optional parameters for this operation, along with their types and descriptions, view the reference documentation.