# Class PersistentResource

The root class for all other objects used or defined by this SDK.

It contains common code for error handling as well as service functions that are useful. Because it is an abstract class, it cannot be called directly, and it has no publicly-visible properties.

  OpenCloud\Common\Base
  OpenCloud\Common\Resource\BaseResource
  OpenCloud\Common\Resource\PersistentResource

#### Direct known subclasses

OpenCloud\Common\Resource\NovaResource, OpenCloud\Database\Resource\Database, OpenCloud\Volume\Resource\VolumeType, OpenCloud\Database\Resource\User, OpenCloud\DNS\Resource\AbstractResource, OpenCloud\LoadBalancer\Resource\AbstractResource, OpenCloud\LoadBalancer\Resource\LoadBalancer, OpenCloud\LoadBalancer\Resource\Node, OpenCloud\Queues\Resource\Queue, OpenCloud\Volume\Resource\Snapshot, OpenCloud\Volume\Resource\Volume

#### Indirect known subclasses

OpenCloud\Autoscale\Resource\AbstractResource, OpenCloud\Autoscale\Resource\Group, OpenCloud\CloudMonitoring\Resource\AgentTarget, OpenCloud\CloudMonitoring\Resource\AgentToken, OpenCloud\CloudMonitoring\Resource\Alarm, OpenCloud\CloudMonitoring\Resource\Changelog, OpenCloud\CloudMonitoring\Resource\Check, OpenCloud\CloudMonitoring\Resource\CheckType, OpenCloud\CloudMonitoring\Resource\Entity, OpenCloud\CloudMonitoring\Resource\Metric, OpenCloud\CloudMonitoring\Resource\Notification, OpenCloud\CloudMonitoring\Resource\NotificationHistory, OpenCloud\Autoscale\Resource\GroupConfiguration, OpenCloud\CloudMonitoring\Resource\NotificationType, OpenCloud\CloudMonitoring\Resource\ReadOnlyResource, OpenCloud\CloudMonitoring\Resource\View, OpenCloud\CloudMonitoring\Resource\Zone, OpenCloud\Compute\Resource\Flavor, OpenCloud\Compute\Resource\Image, OpenCloud\Compute\Resource\Network, OpenCloud\Compute\Resource\Server, OpenCloud\Compute\Resource\VolumeAttachment, OpenCloud\Database\Resource\Instance, OpenCloud\Autoscale\Resource\LaunchConfiguration, OpenCloud\DNS\Resource\AsyncResponse, OpenCloud\DNS\Resource\Domain, OpenCloud\DNS\Resource\PtrRecord, OpenCloud\DNS\Resource\Record, OpenCloud\DNS\Resource\Subdomain, OpenCloud\Identity\Resource\Role, OpenCloud\Identity\Resource\Tenant, OpenCloud\Identity\Resource\Token, OpenCloud\Identity\Resource\User, OpenCloud\LoadBalancer\Resource\Access, OpenCloud\Autoscale\Resource\ScalingPolicy, OpenCloud\LoadBalancer\Resource\Algorithm, OpenCloud\LoadBalancer\Resource\AllowedDomain, OpenCloud\LoadBalancer\Resource\ConnectionLogging, OpenCloud\LoadBalancer\Resource\ConnectionThrottle, OpenCloud\LoadBalancer\Resource\ContentCaching, OpenCloud\LoadBalancer\Resource\ErrorPage, OpenCloud\LoadBalancer\Resource\HealthMonitor, OpenCloud\LoadBalancer\Resource\Metadata, OpenCloud\LoadBalancer\Resource\NodeEvent, OpenCloud\LoadBalancer\Resource\NonIdUriResource, OpenCloud\Autoscale\Resource\Webhook, OpenCloud\LoadBalancer\Resource\Protocol, OpenCloud\LoadBalancer\Resource\ReadOnlyResource, OpenCloud\LoadBalancer\Resource\SessionPersistence, OpenCloud\LoadBalancer\Resource\SSLTermination, OpenCloud\LoadBalancer\Resource\Stats, OpenCloud\LoadBalancer\Resource\UsageRecord, OpenCloud\LoadBalancer\Resource\VirtualIp, OpenCloud\Orchestration\Resource, OpenCloud\Orchestration\Stack, OpenCloud\Queues\Resource\Claim, OpenCloud\CloudMonitoring\Resource\Agent, OpenCloud\Queues\Resource\Message, OpenCloud\CloudMonitoring\Resource\AgentConnection, OpenCloud\CloudMonitoring\Resource\AgentHost, OpenCloud\CloudMonitoring\Resource\AgentHostInfo
Abstract
Namespace: OpenCloud\Common\Resource
Located at OpenCloud/Common/Resource/PersistentResource.php

Methods summary
`public Guzzle\Http\Message\Response` | # `create( array $params = array() )` Create a new resource Create a new resource #### Parameters $params `array` $params #### Returns `Guzzle\Http\Message\Response`
`public Guzzle\Http\Message\Response` | # `update( array $params = array() )` Update a resource Update a resource #### Parameters $params `array` $params #### Returns `Guzzle\Http\Message\Response`
`public Guzzle\Http\Message\Response` | # `delete( )` Delete this resource Delete this resource #### Returns `Guzzle\Http\Message\Response`
`public Guzzle\Http\Message\Response` | # `refresh( null $id = null, null $url = null )` Refresh the state of a resource Refresh the state of a resource #### Parameters $id `null` $id $url `null` $url #### Returns `Guzzle\Http\Message\Response` #### Throws ``OpenCloud\Common\Exceptions\IdRequiredError``
`public` | # `refreshFromLocationUrl( mixed $url )` Given a `location` URL, refresh this resource Given a `location` URL, refresh this resource #### Parameters $url `mixed` $url
`public` | # `waitFor( null $state = null, null $timeout = null, null $callback = null, null $interval = null )` A method to repeatedly poll the API resource, waiting for an eventual state change A method to repeatedly poll the API resource, waiting for an eventual state change #### Parameters $state `null` $state The expected state of the resource $timeout `null` $timeout The maximum timeout to wait $callback `null` $callback The callback to use to check the state $interval `null` $interval How long between each refresh request
`protected object` | # `createJson( )` Provides JSON for create request body Provides JSON for create request body #### Returns `object` #### Throws ``RuntimeException``
`protected string` | # `getAlias( string $key )` Returns the alias configured for the given key. If no alias exists it returns the original key. Returns the alias configured for the given key. If no alias exists it returns the original key. #### Parameters $key `string` $key #### Returns `string`
`protected` | # `updateJson( mixed $params = array() )` Provides JSON for update request body Provides JSON for update request body
`protected` | # `noCreate( )` #### Throws ``OpenCloud\Common\Exceptions\CreateError``
`protected` | # `noDelete( )` #### Throws ``OpenCloud\Common\Exceptions\DeleteError``
`protected` | # `noUpdate( )` #### Throws ``OpenCloud\Common\Exceptions\UpdateError``
`public boolean` | # `checkExtension( mixed $alias )` Check whether an extension is valid Check whether an extension is valid #### Parameters $alias `mixed` $alias The extension name #### Returns `boolean` #### Throws ``OpenCloud\Common\Exceptions\UnsupportedExtensionError``

Methods inherited from OpenCloud\Common\Resource\BaseResource
`__construct(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), primaryKeyField(), resourceName(), setMetadata(), setParent(), setService()`

Methods inherited from OpenCloud\Common\Base
`__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Properties inherited from OpenCloud\Common\Resource\BaseResource
`$metadata, $parent, $service`

Properties inherited from OpenCloud\Common\Base
`$aliases`