Sha256: 9ee750e1025543bf2fcb31b85b631497dd0eec65d47b246cece7c5a3bc393924
Contents?: true
Size: 1.31 KB
Versions: 53
Compression:
Stored size: 1.31 KB
Contents
module Fog module Compute class CloudSigma class Real def create_subscription(data) create_request("subscriptions/", data) end end class Mock def create_subscription(data) if data[:period] != '1 month' || data[:start_time] || data[:end_time] raise Fog::Errors::MockNotImplemented.new('Currently only mocks for subscriptions with period 1 month from now are implemented as mock') end id = Fog::Mock.random_numbers(3).to_i defaults = {'id' => id, 'start_time' => DateTime.now, 'end_time' => DateTime.now + 30 * 24 * 60 *60, 'auto_renew' => false, 'amount' => 1.0} if data[:resource] == 'vlan' vlan_uuid = self.class.random_uuid self.data[:vlans][vlan_uuid] = {'uuid' => vlan_uuid, 'subscription' => {'id' => id}, 'servers' => [], 'meta' => {}, 'tags' => []} defaults['subscribed_object'] = vlan_uuid end mock_create(:subscriptions, 200, data, id, defaults) end end end end end
Version data entries
53 entries across 53 versions & 3 rubygems