Endpoints

Each service should have one or more related endpoints. An endpoint is essentially a base URL for an API, along with some metadata about the endpoint itself and represents a set of URL endpoints for OpenStack web services.

More information can be found in the official documentation.

In order to work with endpoints you have to create the service first.

Create

$identity = $openstack->identityV3();

$endpoint = $identity->createEndpoint([
    'interface' => \OpenStack\Identity\v3\Enum::INTERFACE_INTERNAL,
    'name'      => '{endpointName}',
    'region'    => '{region}',
    'url'       => '{endpointUrl}',
    'serviceId' => '{serviceId}'
]);

Read

$identity = $openstack->identityV3();

$endpoint = $identity->getEndpoint('{endpointId}');
$endpoint->retrieve();

Update

$identity = $openstack->identityV3();

$endpoint = $identity->getEndpoint('{endpointId}');

$endpoint->interface = \OpenStack\Identity\v3\Enum::INTERFACE_PUBLIC;

$endpoint->update();

Delete

$identity = $openstack->identityV3();

$endpoint = $identity->getEndpoint('{endpointId}');
$endpoint->delete();

List

$identity = $openstack->identityV3();

foreach ($identity->listEndpoints() as $endpoint) {
    /** @var $endpoint \OpenStack\Identity\v3\Models\Endpoint */
}