Class: Fog::Rackspace::AutoScale::Webhooks
- Inherits:
-
Collection
- Object
- Array
- Collection
- Fog::Rackspace::AutoScale::Webhooks
- Defined in:
- lib/fog/rackspace/models/auto_scale/webhooks.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
Returns the value of attribute group.
-
#policy ⇒ Object
Returns the value of attribute policy.
Attributes inherited from Collection
Instance Method Summary collapse
-
#all ⇒ Fog::Rackspace::AutoScale::Policies
Returns list of autoscale webhooks.
-
#create(attributes = {}) ⇒ Fog::Rackspace::AutoScale::Webhook
Create a webhook.
-
#get(webhook_id) ⇒ Fog::Rackspace::AutoScale::Webhook
Returns an individual webhook.
- #new(attributes = {}) ⇒ Object
Methods inherited from Collection
#clear, #destroy, #initialize, #inspect, #load, model, #model, #reload, #table, #to_json
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Attribute Details
#group ⇒ Object
Returns the value of attribute group.
11 12 13 |
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 11 def group @group end |
#policy ⇒ Object
Returns the value of attribute policy.
12 13 14 |
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 12 def policy @policy end |
Instance Method Details
#all ⇒ Fog::Rackspace::AutoScale::Policies
Returns list of autoscale webhooks
22 23 24 25 |
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 22 def all data = service.list_webhooks(group.id, policy.id).body['webhooks'] load(data) end |
#create(attributes = {}) ⇒ Fog::Rackspace::AutoScale::Webhook
Create a webhook
53 54 55 |
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 53 def create(attributes = {}) super(attributes) end |
#get(webhook_id) ⇒ Fog::Rackspace::AutoScale::Webhook
Returns an individual webhook
38 39 40 41 42 43 |
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 38 def get(webhook_id) data = service.get_webhook(group.id, policy.id, webhook_id).body['webhook'] new(data) rescue Fog::Rackspace::AutoScale::NotFound nil end |
#new(attributes = {}) ⇒ Object
57 58 59 |
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 57 def new(attributes = {}) super({:group => group, :policy => policy}.merge(attributes)) end |