Class ServerMetadata
This class handles specialized metadata for OpenStack Server objects
(metadata items can be managed individually or in aggregate).
Server metadata is a weird beast in that it has resource representations and
HTTP calls to set the entire server metadata as well as individual items.
-
OpenCloud\Common\Base
-
OpenCloud\Common\Metadata
implements
Countable
-
OpenCloud\Compute\Resource\ServerMetadata
Methods summary
public
|
#
__construct( OpenCloud\Compute\Resource\Server $parent, string $key = null )
Contructs a Metadata object associated with a Server or Image object
Contructs a Metadata object associated with a Server or Image object
Parameters
- $parent
object $parent either a Server or an Image object
- $key
string $key the (optional) key for the metadata item
Throws
MetadataError
|
public
|
|
public
|
|
public
string
|
#
getUrl( string $path = null, array $query = array() )
Returns the URL of the metadata (key or block)
Returns the URL of the metadata (key or block)
Parameters
- $path
string $subresource not used; required for strict compatibility
- $query
Returns
string
Throws
ServerUrlerror
|
public
|
#
create( )
Sets a new metadata value or block
Sets a new metadata value or block
Note that, if you're setting a block, the block specified will entirely
replace the existing block.
Throws
MetadataCreateError
Api
|
public
|
#
update( )
Updates a metadata key or block
Updates a metadata key or block
Throws
MetadataUpdateError
Api
|
public
|
#
delete( )
Deletes a metadata key or block
Deletes a metadata key or block
Throws
MetadataDeleteError
Api
|
public
|
#
__set( string $key, string $value )
This setter overrides the base one, since the metadata key can be
anything
This setter overrides the base one, since the metadata key can be
anything
Parameters
- $key
string $property
- $value
string $value
Overrides
|
Methods inherited from OpenCloud\Common\Base
__call(),
checkJsonError(),
generateUuid(),
getInstance(),
getJsonHeader(),
getLogger(),
makeResourceIteratorOptions(),
populate(),
setLogger(),
stripNamespace(),
toCamel(),
toUnderscores()
|
Properties summary
protected
mixed
|
$key
|
|
|