Class: Fog::Compute::CloudSigma::Subscription
Instance Method Summary
collapse
model_attribute, model_attribute_array
Instance Method Details
#create ⇒ Object
28
29
30
31
32
33
34
35
|
# File 'lib/fog/cloudsigma/models/subscription.rb', line 28
def create
requires :resource, :amount
data = attributes
response = service.create_subscription(data)
new_attributes = response.body['objects'].first
merge_attributes(new_attributes)
end
|
#extend(period = nil, end_time = nil) ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/fog/cloudsigma/models/subscription.rb', line 37
def extend(period=nil, end_time=nil)
requires :identity
data = {}
if period
data[:period] = period
elsif end_time
data[:end_time] = end_time
end
response = service.extend_subscription(identity, data)
self.class.new(response.body)
end
|
#save ⇒ Object
24
25
26
|
# File 'lib/fog/cloudsigma/models/subscription.rb', line 24
def save
create
end
|