PublicImage
extends Image
in package
Class that represents a Glance Image. In more general terms, a virtual machine image is a single file which contains a virtual disk that has an installed bootable operating system. In the Cloud Images API, an image is represented by a JSON-encoded data structure (the image schema) and its raw binary data (the image file).
Table of Contents
- PATCH_CONTENT_TYPE = OpenCloudCommonConstantsMime::JSON_PATCH
- $aliases : array<string|int, mixed>
- The aliases configure for the properties of the instance.
- $data : array<string|int, mixed>
- $id : string
- $json_collection_name : mixed
- $json_name : mixed
- $metadata : Metadata
- $parent : BaseResource
- $service : ServiceInterface
- $url_resource : mixed
- $logger : LoggerInterface
- The logger instance
- $properties : array<string|int, mixed>
- Holds all the properties added by overloading.
- __call() : mixed
- Intercept non-existent method calls for dynamic getter/setter functionality.
- __construct() : mixed
- addTag() : Response
- Add a tag to this image
- checkJsonError() : mixed
- Checks the most recent JSON operation for errors.
- createMember() : Response
- Add a member to this image
- delete() : Response
- Delete this resource
- deleteMember() : Response
- Delete a member from this image
- deleteTag() : Response
- Delete a tag from this image
- findLink() : bool
- Find a resource link based on a type
- generateUuid() : mixed
- getClient() : ClientInterface
- Convenience method to return the service's client
- getData() : array<string|int, mixed>
- getId() : string
- getInstance() : static
- getLogger() : LoggerInterface
- Returns the Logger object.
- getMember() : mixed
- Get a member belonging to this image
- getMetadata() : Metadata
- getParent() : mixed
- getPatchHeaders() : mixed
- getService() : ServiceInterface
- getUrl() : mixed
- Get this resource's URL
- hasLogger() : bool
- jsonCollectionElement() : string
- Returns the nested keys that could (rarely) prefix collection items. For example:
- jsonCollectionName() : string
- Returns the top-level key for collection responses
- jsonName() : mixed
- Returns the top-level key for the returned response JSON document
- listMembers() : mixed
- List the members of this image
- makeResourceIteratorOptions() : mixed
- member() : mixed
- Iterator use only
- offsetExists() : bool
- Checks to see whether a particular offset key exists.
- offsetGet() : mixed|null
- Get the value for a particular offset key.
- offsetSet() : mixed
- Sets a value to a particular offset.
- offsetUnset() : mixed
- Unset a particular key.
- parseResponse() : mixed
- Parse a HTTP response for the required content
- populate() : mixed
- Populates the current object based on an unknown data type.
- refresh() : Response
- Refresh this resource
- resourceName() : mixed
- Returns the URI path for this resource
- setData() : mixed
- setId() : mixed
- setLogger() : $this
- Sets the logger.
- setMetadata() : $this
- setParent() : self
- setService() : PersistentObject
- stripNamespace() : mixed
- toCamel() : mixed
- Convert a string to camelCase format.
- toUnderscores() : mixed
- Convert string to underscore format.
- update() : Response
- Update this resource
- url() : mixed
- getJsonHeader() : mixed
- getProperty() : mixed
- Grab value out of the data array.
- primaryKeyField() : string
- Returns the primary key field for the object
- propertyExists() : bool
- Basic check to see whether property exists.
- setProperty() : mixed
- We can set a property under three conditions:
- checkAttributePrefix() : bool
- Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
- isAccessible() : bool
- Does the property exist in the object variable list (i.e. does it have public or protected visibility?)
Constants
PATCH_CONTENT_TYPE
public
mixed
PATCH_CONTENT_TYPE
= OpenCloudCommonConstantsMime::JSON_PATCH
Properties
$aliases
The aliases configure for the properties of the instance.
protected
array<string|int, mixed>
$aliases
= array()
$data
protected
array<string|int, mixed>
$data
= array()
The internal elements of this model
$id
protected
string
$id
The ID of this resource
$json_collection_name
protected
static mixed
$json_collection_name
= 'images'
$json_name
protected
static mixed
$json_name
= ''
$metadata
protected
Metadata
$metadata
$parent
protected
BaseResource
$parent
$service
protected
ServiceInterface
$service
$url_resource
protected
static mixed
$url_resource
= 'images'
$logger
The logger instance
private
LoggerInterface
$logger
$properties
Holds all the properties added by overloading.
private
array<string|int, mixed>
$properties
= array()
Methods
__call()
Intercept non-existent method calls for dynamic getter/setter functionality.
public
__call( $method, $args) : mixed
Parameters
Tags
Return values
mixed —__construct()
public
__construct(ServiceInterface $service[, $data = null ]) : mixed
Parameters
- $service : ServiceInterface
-
The service that this resource belongs to
- $data : = null
-
$data
Return values
mixed —addTag()
Add a tag to this image
public
addTag(string $tag) : Response
Parameters
- $tag : string
Return values
Response —checkJsonError()
Checks the most recent JSON operation for errors.
public
static checkJsonError() : mixed
Tags
Return values
mixed —createMember()
Add a member to this image
public
createMember( $tenantId) : Response
Parameters
Return values
Response —delete()
Delete this resource
public
delete() : Response
Return values
Response —deleteMember()
Delete a member from this image
public
deleteMember( $tenantId) : Response
Parameters
Return values
Response —deleteTag()
Delete a tag from this image
public
deleteTag( $tag) : Response
Parameters
Return values
Response —findLink()
Find a resource link based on a type
public
findLink([string $type = 'self' ]) : bool
Parameters
- $type : string = 'self'
Return values
bool —generateUuid()
public
static generateUuid() : mixed
Return values
mixed —getClient()
Convenience method to return the service's client
public
getClient() : ClientInterface
Return values
ClientInterface —getData()
public
getData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getId()
public
getId() : string
Return values
string —getInstance()
public
static getInstance() : static
Return values
static —getLogger()
Returns the Logger object.
public
getLogger() : LoggerInterface
Return values
LoggerInterface —getMember()
Get a member belonging to this image
public
getMember( $memberId) : mixed
Parameters
Return values
mixed —getMetadata()
public
getMetadata() : Metadata
Return values
Metadata —getParent()
public
getParent() : mixed
Return values
mixed —getPatchHeaders()
public
static getPatchHeaders() : mixed
Return values
mixed —getService()
public
getService() : ServiceInterface
Tags
Return values
ServiceInterface —getUrl()
Get this resource's URL
public
getUrl([null $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
- $path : null = null
-
URI path to add on
- $query : array<string|int, mixed> = array()
-
Query to add on
Return values
mixed —hasLogger()
public
hasLogger() : bool
Return values
bool —jsonCollectionElement()
Returns the nested keys that could (rarely) prefix collection items. For example:
public
static jsonCollectionElement() : string
{ "keypairs": [ { "keypair": { "fingerprint": "...", "name": "key1", "public_key": "..." } }, { "keypair": { "fingerprint": "...", "name": "key2", "public_key": "..." } } ] }
In the above example, "keypairs" would be the $json_collection_name and "keypair" would be the $json_collection_element
Return values
string —jsonCollectionName()
Returns the top-level key for collection responses
public
static jsonCollectionName() : string
Return values
string —jsonName()
Returns the top-level key for the returned response JSON document
public
static jsonName() : mixed
Tags
Return values
mixed —listMembers()
List the members of this image
public
listMembers([array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $params : array<string|int, mixed> = array()
Return values
mixed —makeResourceIteratorOptions()
public
makeResourceIteratorOptions(mixed $resource) : mixed
Parameters
- $resource : mixed
Return values
mixed —member()
Iterator use only
public
member( $data) : mixed
Parameters
Return values
mixed —offsetExists()
Checks to see whether a particular offset key exists.
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
bool —offsetGet()
Get the value for a particular offset key.
public
offsetGet(mixed $offset) : mixed|null
Parameters
- $offset : mixed
Return values
mixed|null —offsetSet()
Sets a value to a particular offset.
public
offsetSet(mixed $offset, mixed $value) : mixed
Parameters
- $offset : mixed
- $value : mixed
Return values
mixed —offsetUnset()
Unset a particular key.
public
offsetUnset(mixed $offset) : mixed
Parameters
- $offset : mixed
Return values
mixed —parseResponse()
Parse a HTTP response for the required content
public
parseResponse(Response $response) : mixed
Parameters
- $response : Response
Return values
mixed —populate()
Populates the current object based on an unknown data type.
public
populate(mixed $info[, mixed $setObjects = true ]) : mixed
Parameters
- $info : mixed
- $setObjects : mixed = true
Tags
Return values
mixed —refresh()
Refresh this resource
public
refresh() : Response
Return values
Response —resourceName()
Returns the URI path for this resource
public
static resourceName() : mixed
Tags
Return values
mixed —setData()
public
setData(array<string|int, mixed> $data) : mixed
Parameters
- $data : array<string|int, mixed>
Return values
mixed —setId()
public
setId( $id) : mixed
Parameters
Return values
mixed —setLogger()
Sets the logger.
public
setLogger([LoggerInterface $logger = null ]) : $this
Parameters
- $logger : LoggerInterface = null
Return values
$this —setMetadata()
public
setMetadata(mixed $data) : $this
Parameters
- $data : mixed
Return values
$this —setParent()
public
setParent(BaseResource $parent) : self
Parameters
- $parent : BaseResource
Return values
self —setService()
public
setService(ServiceInterface $service) : PersistentObject
Parameters
- $service : ServiceInterface
Return values
PersistentObject —stripNamespace()
public
stripNamespace(mixed $namespace) : mixed
Parameters
- $namespace : mixed
Return values
mixed —toCamel()
Convert a string to camelCase format.
public
toCamel( $string[, bool $capitalise = true ]) : mixed
Parameters
Return values
mixed —toUnderscores()
Convert string to underscore format.
public
toUnderscores( $string) : mixed
Parameters
Return values
mixed —update()
Update this resource
public
update(array<string|int, mixed> $params[, Schema $schema = null ]) : Response
Parameters
- $params : array<string|int, mixed>
- $schema : Schema = null
Tags
Return values
Response —url()
public
url([mixed $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
- $path : mixed = null
- $query : array<string|int, mixed> = array()
Tags
Return values
mixed —getJsonHeader()
protected
static getJsonHeader() : mixed
Return values
mixed —getProperty()
Grab value out of the data array.
protected
getProperty(string $property) : mixed
Parameters
- $property : string
Return values
mixed —primaryKeyField()
Returns the primary key field for the object
protected
primaryKeyField() : string
Return values
string —propertyExists()
Basic check to see whether property exists.
protected
propertyExists(string $property[, bool $allowRetry = true ]) : bool
Parameters
- $property : string
-
The property name being investigated.
- $allowRetry : bool = true
-
If set to TRUE, the check will try to format the name in underscores because there are sometimes discrepancies between camelCaseNames and underscore_names.
Return values
bool —setProperty()
We can set a property under three conditions:
protected
setProperty(mixed $property, mixed $value) : mixed
- If it has a concrete setter: setProperty()
- If the property exists
- If the property name's prefix is in an approved list
Parameters
- $property : mixed
- $value : mixed
Return values
mixed —checkAttributePrefix()
Checks the attribute $property and only permits it if the prefix is in the specified $prefixes array
private
checkAttributePrefix(string $property) : bool
This is to support extension namespaces in some services.
Parameters
- $property : string
-
the name of the attribute
Return values
bool —isAccessible()
Does the property exist in the object variable list (i.e. does it have public or protected visibility?)
private
isAccessible( $property) : bool