Class: Fog::Rackspace::AutoScale::Webhooks

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/rackspace/models/auto_scale/webhooks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#groupObject

Returns the value of attribute group.



10
11
12
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 10

def group
  @group
end

#policyObject

Returns the value of attribute policy.



11
12
13
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 11

def policy
  @policy
end

Instance Method Details

#allFog::Rackspace::AutoScale::Policies

Returns list of autoscale webhooks

Returns:

Raises:

  • (Fog::Rackspace::AutoScale:::NotFound)
    • HTTP 404

  • (Fog::Rackspace::AutoScale:::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::AutoScale:::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::AutoScale:::ServiceError)


21
22
23
24
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 21

def all
  data = service.list_webhooks(group.id, policy.id).body['webhooks']
  load(data)
end

#create(attributes = {}) ⇒ Fog::Rackspace::AutoScale::Webhook

Create a webhook

Returns:

Raises:

  • (Fog::Rackspace::AutoScale:::NotFound)
    • HTTP 404

  • (Fog::Rackspace::AutoScale:::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::AutoScale:::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::AutoScale:::ServiceError)


52
53
54
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 52

def create(attributes = {})
  super(attributes)
end

#get(webhook_id) ⇒ Fog::Rackspace::AutoScale::Webhook

Returns an individual webhook

Returns:

Raises:

  • (Fog::Rackspace::AutoScale:::NotFound)
    • HTTP 404

  • (Fog::Rackspace::AutoScale:::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::AutoScale:::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::AutoScale:::ServiceError)

See Also:



37
38
39
40
41
42
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 37

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



56
57
58
# File 'lib/fog/rackspace/models/auto_scale/webhooks.rb', line 56

def new(attributes = {})
  super({:group => group, :policy => policy}.merge(attributes))
end