Documentation

Service extends CatalogService

Cloud Monitoring service.

Tags
link
http://docs.rackspace.com/cm/api/v1.0/cm-devguide/content/index.html

Table of Contents

DEFAULT_NAME  = 'cloudMonitoring'
DEFAULT_TYPE  = 'rax:monitor'
DEFAULT_URL_TYPE  = 'publicURL'
PATCH_CONTENT_TYPE  = OpenCloudCommonConstantsMime::JSON_PATCH
SUPPORTED_VERSION  = null
$aliases  : array<string|int, mixed>
The aliases configure for the properties of the instance.
$client  : Client
$endpoint  : Endpoint
$namespaces  : array<string|int, mixed>
$regionless  : bool
$resources  : array<string|int, mixed>
$logger  : LoggerInterface
The logger instance
$name  : string
$properties  : array<string|int, mixed>
Holds all the properties added by overloading.
$region  : string
$type  : string
$urlType  : string
__call()  : mixed
Intercept non-existent method calls for dynamic getter/setter functionality.
__construct()  : mixed
Creates a service object, based off the specified client.
checkJsonError()  : mixed
Checks the most recent JSON operation for errors.
collection()  : mixed
createEntity()  : mixed
createNotification()  : mixed
Create a new notification.
createNotificationPlan()  : mixed
Create a new notification plan.
generateUuid()  : mixed
getAgent()  : Agent
Get an agent.
getAgentHost()  : mixed
getAgents()  : mixed
getAgentTargets()  : mixed
getAgentToken()  : mixed
getAgentTokens()  : mixed
getBaseUrl()  : Url
Get the base URL for this service, based on the set URL type.
getChangelog()  : object|false
Get a changelog - either a general one or one catered for a particular entity.
getCheckType()  : CheckType
Get a particular check type.
getCheckTypes()  : Collection
Get a collection of possible check types.
getClient()  : Client
getEndpoint()  : Endpoint
getEntities()  : Collection
Return a collection of Entities.
getEntity()  : Entity
Get either an empty object, or a populated one that exists on the API.
getExtensions()  : array<string|int, mixed>
Returns the /extensions for the service
getInstance()  : static
getLogger()  : LoggerInterface
Returns the Logger object.
getMonitoringZone()  : Zone
Get a particular monitoring zone.
getMonitoringZones()  : Collection
Get a collection of monitoring zones.
getName()  : string
getNamespaces()  : array<string|int, mixed>
Returns a list of supported namespaces
getNotification()  : Notification
Get a particular notification.
getNotificationPlan()  : NotificationPlan
Get a particular notification plan.
getNotificationPlans()  : Collection
Get a collection of notification plans.
getNotifications()  : Collection
Get a collection of Notifications.
getNotificationType()  : NotificationType
Get a particular notification type.
getNotificationTypes()  : Collection
Get a collection of notification types.
getRegion()  : string
getResources()  : array<string|int, mixed>
Get all associated resources for this service.
getType()  : string
getUrl()  : Url
Returns the URL for the Service
getUrlType()  : string
getViews()  : object|false
hasLogger()  : bool
limits()  : array<string|int, mixed>
Returns the limits for the service
makeResourceIteratorOptions()  : mixed
name()  : mixed
namespaces()  : mixed
populate()  : mixed
Populates the current object based on an unknown data type.
region()  : mixed
resource()  : object
Factory method for instantiating resource objects.
resourceList()  : PaginatedIterator
Factory method for instantiating a resource collection.
setClient()  : mixed
setEndpoint()  : mixed
setLogger()  : $this
Sets the logger.
stripNamespace()  : mixed
testNotification()  : mixed
Test the parameters of a notification before creating it.
toCamel()  : mixed
Convert a string to camelCase format.
toUnderscores()  : mixed
Convert string to underscore format.
url()  : mixed
getCurrentNamespace()  : type
Internal method for accessing child namespace from parent scope.
getJsonHeader()  : mixed
getPatchHeaders()  : mixed
getProperty()  : mixed
Grab value out of the data array.
propertyExists()  : bool
Basic check to see whether property exists.
resolveResourceClass()  : string
Resolves FQCN for local resource.
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
findEndpoint()  : Endpoint
Extracts the appropriate endpoint from the service catalog based on the name and type of a service, and sets for further use.
getMetaUrl()  : stdClass
Constructs a specified URL from the subresource
isAccessible()  : bool
Does the property exist in the object variable list (i.e. does it have public or protected visibility?)

Constants

DEFAULT_NAME

public mixed DEFAULT_NAME = 'cloudMonitoring'

DEFAULT_TYPE

public mixed DEFAULT_TYPE = 'rax:monitor'

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()

$namespaces

protected array<string|int, mixed> $namespaces = array()

Namespaces for this service.

$regionless

protected bool $regionless = true

Indicates whether a service is "regionless" or not. Defaults to FALSE because nearly all services are region-specific.

$resources

protected array<string|int, mixed> $resources = array('Agent', 'AgentConnection', 'AgentHost', 'AgentHostInfo', 'AgentTarget', 'AgentToken', 'Alarm', 'Changelog', 'Check', 'CheckType', 'Entity', 'Metric', 'Notification', 'NotificationHistory', 'NotificationPlan', 'NotificationType', 'View', 'Zone')

CloudMonitoring resources.

$name

private string $name

The name of this service, as set in Catalog.

$properties

Holds all the properties added by overloading.

private array<string|int, mixed> $properties = array()

$region

private string $region

The chosen region(s) for this service.

$type

private string $type

The type of this service, as set in Catalog.

$urlType

private string $urlType

Either 'publicURL' or 'internalURL'.

Methods

__call()

Intercept non-existent method calls for dynamic getter/setter functionality.

public __call( $method,  $args) : mixed
Parameters
$method :
$args :
Tags
throws
RuntimeException
Return values
mixed

__construct()

Creates a service object, based off the specified client.

public __construct(Client $client[, string $type = null ][, string $name = null ][, string $region = null ][, string $urlType = null ]) : mixed

The service's URL is defined in the client's serviceCatalog; it uses the $type, $name, $region, and $urlType to find the proper endpoint and set it. If it cannot find a URL in the service catalog that matches the criteria, then an exception is thrown.

Parameters
$client : Client

Client object

$type : string = null

Service type (e.g. 'compute')

$name : string = null

Service name (e.g. 'cloudServersOpenStack')

$region : string = null

Service region (e.g. 'DFW', 'ORD', 'IAD', 'LON', 'SYD' or 'HKG')

$urlType : string = null

Either 'publicURL' or 'internalURL'

Return values
mixed

checkJsonError()

Checks the most recent JSON operation for errors.

public static checkJsonError() : mixed
Tags
throws
JsonError
codeCoverageIgnore
Return values
mixed

collection()

public collection(mixed $class[, mixed $url = null ][, mixed $parent = null ][, mixed $data = null ]) : mixed
Parameters
$class : mixed
$url : mixed = null
$parent : mixed = null
$data : mixed = null
Tags
codeCoverageIgnore
Return values
mixed

createEntity()

public createEntity(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>
Return values
mixed

createNotification()

Create a new notification.

public createNotification(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>
Return values
mixed

createNotificationPlan()

Create a new notification plan.

public createNotificationPlan(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>
Return values
mixed

generateUuid()

public static generateUuid() : mixed
Return values
mixed

getAgent()

Get an agent.

public getAgent([string|null $id = null ]) : Agent
Parameters
$id : string|null = null
Return values
Agent

getAgentHost()

public getAgentHost([mixed $agentId = null ]) : mixed
Parameters
$agentId : mixed = null
Return values
mixed

getAgents()

public getAgents() : mixed
Return values
mixed

getAgentTargets()

public getAgentTargets() : mixed
Return values
mixed

getAgentToken()

public getAgentToken([mixed $id = null ]) : mixed
Parameters
$id : mixed = null
Return values
mixed

getAgentTokens()

public getAgentTokens() : mixed
Return values
mixed

getChangelog()

Get a changelog - either a general one or one catered for a particular entity.

public getChangelog([string|null $data = null ]) : object|false
Parameters
$data : string|null = null
Return values
object|false

getCheckType()

Get a particular check type.

public getCheckType([null $id = null ]) : CheckType
Parameters
$id : null = null
Return values
CheckType

getEntity()

Get either an empty object, or a populated one that exists on the API.

public getEntity([null $id = null ]) : Entity
Parameters
$id : null = null
Return values
Entity

getExtensions()

Returns the /extensions for the service

public getExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>

of objects

getInstance()

public static getInstance() : static
Return values
static

getMonitoringZone()

Get a particular monitoring zone.

public getMonitoringZone([null $id = null ]) : Zone
Parameters
$id : null = null
Return values
Zone

getNamespaces()

Returns a list of supported namespaces

public getNamespaces() : array<string|int, mixed>
Return values
array<string|int, mixed>

getNotification()

Get a particular notification.

public getNotification([null $id = null ]) : Notification
Parameters
$id : null = null
Return values
Notification

getRegion()

public getRegion() : string
Return values
string

getResources()

Get all associated resources for this service.

public getResources() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

getUrl()

Returns the URL for the Service

public getUrl([string $path = null ][, array<string|int, mixed> $query = array() ]) : Url
Parameters
$path : string = null

URL path segment

$query : array<string|int, mixed> = array()

Array of query pairs

Return values
Url

getUrlType()

public getUrlType() : string
Return values
string

getViews()

public getViews() : object|false
Return values
object|false

hasLogger()

public hasLogger() : bool
Return values
bool

limits()

Returns the limits for the service

public limits() : array<string|int, mixed>
Return values
array<string|int, mixed>

of limits

makeResourceIteratorOptions()

public makeResourceIteratorOptions(mixed $resource) : mixed
Parameters
$resource : mixed
Return values
mixed

name()

public name() : mixed
Tags
deprecated
Return values
mixed

namespaces()

public namespaces() : mixed
Tags
deprecated
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
throws
InvalidArgumentError
Return values
mixed

region()

public region() : mixed
Tags
deprecated
Return values
mixed

resource()

Factory method for instantiating resource objects.

public resource(string $resourceName[, mixed $info = null ][, mixed $parent = null ]) : object
Parameters
$resourceName : string
$info : mixed = null

(default: null)

$parent : mixed = null

The parent object

Return values
object

resourceList()

Factory method for instantiating a resource collection.

public resourceList(string $resourceName[, string|null $url = null ][, string|null $parent = null ]) : PaginatedIterator
Parameters
$resourceName : string
$url : string|null = null
$parent : string|null = null
Return values
PaginatedIterator

stripNamespace()

public stripNamespace(mixed $namespace) : mixed
Parameters
$namespace : mixed
Return values
mixed

testNotification()

Test the parameters of a notification before creating it.

public testNotification(array<string|int, mixed> $params) : mixed
Parameters
$params : array<string|int, mixed>
Return values
mixed

toCamel()

Convert a string to camelCase format.

public toCamel( $string[, bool $capitalise = true ]) : mixed
Parameters
$string :
$capitalise : bool = true

Optional flag which allows for word capitalization.

Return values
mixed

toUnderscores()

Convert string to underscore format.

public toUnderscores( $string) : mixed
Parameters
$string :
Return values
mixed

url()

public url([mixed $path = null ][, array<string|int, mixed> $query = array() ]) : mixed
Parameters
$path : mixed = null
$query : array<string|int, mixed> = array()
Tags
deprecated
Return values
mixed

getCurrentNamespace()

Internal method for accessing child namespace from parent scope.

protected getCurrentNamespace() : type
Return values
type

getJsonHeader()

protected static getJsonHeader() : mixed
Return values
mixed

getPatchHeaders()

protected static getPatchHeaders() : mixed
Return values
mixed

getProperty()

Grab value out of the data array.

protected getProperty(string $property) : mixed
Parameters
$property : string
Return values
mixed

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

resolveResourceClass()

Resolves FQCN for local resource.

protected resolveResourceClass( $resourceName) : string
Parameters
$resourceName :
Tags
throws
UnrecognizedServiceError
Return values
string

setProperty()

We can set a property under three conditions:

protected setProperty(mixed $property, mixed $value) : mixed
  1. If it has a concrete setter: setProperty()
  2. If the property exists
  3. 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

findEndpoint()

Extracts the appropriate endpoint from the service catalog based on the name and type of a service, and sets for further use.

private findEndpoint() : Endpoint
Tags
throws
EndpointError
Return values
Endpoint

getMetaUrl()

Constructs a specified URL from the subresource

private getMetaUrl(string $resource) : stdClass

Given a subresource (e.g., "extensions"), this constructs the proper URL and retrieves the resource.

Parameters
$resource : string

The resource requested; should NOT have slashes at the beginning or end

Return values
stdClass

object

isAccessible()

Does the property exist in the object variable list (i.e. does it have public or protected visibility?)

private isAccessible( $property) : bool
Parameters
$property :
Return values
bool

Search results