class Catalog extends OperatorResource implements Catalog

Represents an Identity v2 service catalog.

Traits

Constants

DEFAULT_URL_TYPE

Methods

populateFromResponse (ResponseInterface $response) : AbstractResource

All models which represent an API resource should be able to be populated from a {see ResponseInterface} object.

getServiceUrl (string $serviceName, string $serviceType, string $region, string $urlType = self::DEFAULT_URL_TYPE)

Attempts to retrieve the base URL for a service from the catalog according to the arguments provided.

Details

populateFromResponse(ResponseInterface $response)

All models which represent an API resource should be able to be populated from a {see ResponseInterface} object.

Parameters

$response ResponseInterface

Return value

AbstractResource

Example code

$abstractResource = $catalog->populateFromResponse($response);

getServiceUrl(string $serviceName, string $serviceType, string $region, string $urlType = self::DEFAULT_URL_TYPE)

Attempts to retrieve the base URL for a service from the catalog according to the arguments provided.

Parameters

$serviceName string
$serviceType string
$region string The region of the service as it appears in the catalog
$urlType string The URL type of the service as it appears in the catalog

Exceptions

RuntimeException If no endpoint is matched

Example code

$catalog->getServiceUrl($serviceName, $serviceType, $region, $urlType);