Overview

Namespaces

  • OpenCloud
    • Autoscale
      • Resource
    • CloudMonitoring
      • Exception
      • Resource
    • Common
      • Collection
      • Constants
      • Exceptions
      • Http
        • Message
      • Identity
      • Log
      • Service
    • Compute
      • Constants
      • Exception
      • Resource
    • Database
      • Resource
    • DNS
      • Resource
    • LoadBalancer
      • Resource
    • ObjectStore
      • Constants
      • Exception
      • Resource
      • Upload
    • Orchestration
    • Queues
      • Exception
      • Resource
    • Volume
      • Resource
  • PHP

Classes

  • AbstractResource
  • Agent
  • AgentConnection
  • AgentHost
  • AgentHostInfo
  • AgentTarget
  • AgentToken
  • Alarm
  • Changelog
  • Check
  • CheckType
  • Entity
  • Metric
  • Notification
  • NotificationHistory
  • NotificationPlan
  • NotificationType
  • ReadonlyResource
  • View
  • Zone
  • Overview
  • Namespace
  • Class
  • Tree
  • Download

Class NotificationPlan

Represents an object that can be retrieved, created, updated and deleted.

This class abstracts much of the common functionality between:
* Nova servers; * Swift containers and objects; * DBAAS instances; * Cinder volumes; * and various other objects that: * have a URL; * can be created, updated, deleted, or retrieved; * use a standard JSON format with a top-level element followed by a child object with attributes.

In general, you can create a persistent object class by subclassing this class and defining some protected, static variables:
* $url_resource - the sub-resource value in the URL of the parent. For example, if the parent URL is http://something/parent, then setting this value to "another" would result in a URL for the persistent object of http://something/parent/another.
* $json_name - the top-level JSON object name. For example, if the persistent object is represented by {"foo": {"attr":value, ...}}, then set $json_name to "foo".
* $json_collection_name - optional; this value is the name of a collection of the persistent objects. If not provided, it defaults to json_name with an appended "s" (e.g., if json_name is "foo", then json_collection_name would be "foos"). Set this value if the collection name doesn't follow this pattern.
* $json_collection_element - the common pattern for a collection is: {"collection": [{"attr":"value",...}, {"attr":"value",...}, ...]} That is, each element of the array is a \stdClass object containing the object's attributes. In rare instances, the objects in the array are named, and json_collection_element contains the name of the collection objects. For example, in this JSON response: {"allowedDomain":[{"allowedDomain":{"name":"foo"}}]}, json_collection_element would be set to "allowedDomain".

The PersistentObject class supports the standard CRUD methods; if these are not needed (i.e. not supported by the service), the subclass should redefine these to call the noCreate, noUpdate, or noDelete methods, which will trigger an appropriate exception. For example, if an object cannot be created:
function create($params = array()) { $this->noCreate(); }

OpenCloud\Common\Base
Extended by OpenCloud\Common\PersistentObject
Extended by OpenCloud\CloudMonitoring\Resource\AbstractResource
Extended by OpenCloud\CloudMonitoring\Resource\NotificationPlan
Namespace: OpenCloud\CloudMonitoring\Resource
Located at OpenCloud/CloudMonitoring/Resource/NotificationPlan.php
Methods inherited from OpenCloud\CloudMonitoring\Resource\AbstractResource
createJson(), listAll(), test(), testParams(), updateJson()
Methods inherited from OpenCloud\Common\PersistentObject
__construct(), action(), checkExtension(), create(), createUrl(), delete(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), id(), jsonCollectionElement(), jsonCollectionName(), jsonName(), name(), noCreate(), noDelete(), noUpdate(), parseResponse(), primaryKeyField(), refresh(), refreshFromLocationUrl(), region(), resourceName(), setMetadata(), setParent(), setService(), status(), update(), url(), waitFor()
Methods inherited from OpenCloud\Common\Base
__call(), checkJsonError(), generateUuid(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()
Properties summary
protected static boolean $json_name false
#
protected static string $json_collection_name 'values'
#
protected static string $url_resource 'notification_plans'
#
protected static array $requiredKeys array( 'label' )
#
protected static array $emptyObject array( 'label', 'critical_state', 'ok_state', 'warning_state' )
#
Properties inherited from OpenCloud\Common\PersistentObject
$metadata
PHP OpenCloud API API documentation generated by ApiGen 2.8.0