Sha256: b25bb81ae70ac2bf7809329c1591ccde045460b72910946da0ca112dfa9b3b9d

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#
require 'fog/core'
require 'fog/json'
require 'time'

module Fog
  module Softlayer
    extend Fog::Provider

    API_URL = 'api.softlayer.com/rest/v3' unless defined? API_URL

    service(:compute, 'Compute')

    def self.mock_account_id
      Fog.mocking? and @sl_account_id ||= Fog::Mock.random_numbers(7)
    end

    def self.mock_vm_id
      Fog::Mock.random_numbers(7)
    end

    def self.mock_global_identifier
      Fog::UUID.uuid
    end

    def self.valid_request?(required, passed)
      required.all? {|k| k = k.to_sym; passed.key?(k) and !passed[k].nil?}
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-softlayer-0.0.5 lib/fog/softlayer/core.rb