public function serviceCatalog($type = NULL) {
    // If no type is specified, return the entire
    // catalog.
    if (empty($type)) {
      return $this->serviceCatalog;
    }

    $list = array();
    foreach ($this->serviceCatalog as $entry) {
      if ($entry['type'] == $type) {
        $list[] = $entry;
      }
    }

    return $list;
  }
public function serviceCatalog($type = NULL) {
    // If no type is specified, return the entire
    // catalog.
    if (empty($type)) {
      return $this->serviceCatalog;
    }

    $list = array();
    foreach ($this->serviceCatalog as $entry) {
      if ($entry['type'] == $type) {
        $list[] = $entry;
      }
    }

    return $list;
  }
public function serviceCatalog ( $ type = NULL ) { // If no type is specified, return the entire // catalog. if ( empty ( $ type ) ) { return $ this -> serviceCatalog ; } $ list = array ( ) ; foreach ( $ this -> serviceCatalog as $ entry ) { if ( $ entry [ 'type' ] == $ type ) { $ list [ ] = $ entry ; } } return $ list ; }
Get the service catalog, optionaly filtering by type.

This returns the service catalog (largely unprocessed) that
is returned during an authentication request. If a type is passed in,
only entries of that type are returned. If no type is passed in, the
entire service catalog is returned.

The service catalog contains information about what services (if any) are
available for the present user. Object storage (Swift) Compute instances
(Nova) and other services will each be listed here if they are enabled
on your account. Only services that have been turned on for the account
will be available. (That is, even if you *can* create a compute instance,
until you have actually created one, it will not show up in this list.)

One of the authentication methods MUST be run before obtaining the service
catalog.

The return value is an indexed array of associative arrays, where each assoc
array describes an individual service.
@code
<?php
array(
array(
'name' : 'Object Storage',
'type' => 'object-store',
'endpoints' => array(
'tenantId' => '123456',
'adminURL' => 'https://example.hpcloud.net/1.0',
'publicURL' => 'https://example.hpcloud.net/1.0/123456',
'region' => 'region-a.geo-1',
'id' => '1.0',
),
),
array(
'name' => 'Identity',
'type' => 'identity'
'endpoints' => array(
'publicURL' => 'https://example.hpcloud.net/1.0/123456',
'region' => 'region-a.geo-1',
'id' => '2.0',
'list' => 'http://example.hpcloud.net/extension',
),
)

);
?>
@endcode

This will not be populated until after authentication has been done.

Types:

While this is by no means an exhaustive list, here are a few types that
might appear in a service catalog (and upon which you can filter):

- identity: Identity Services (i.e. Keystone)
- compute: Compute instance (Nova)
- object-store: Object Storage (Swift)
- hpext:cdn: HPCloud CDN service (yes, the colon belongs in there)

Other services will be added.

@todo Paging on the service catalog is not yet implemented.

@retval array
@return array
An associative array representing
the service catalog.
Get the service catalog optionaly filtering by type .