Module: Asca::Tools

Defined in:
lib/asca/tools/log.rb,
lib/asca/tools/token.rb,
lib/asca/tools/tools.rb,
lib/asca/tools/configuration.rb

Defined Under Namespace

Classes: Configuration, Log, Token

Class Method Summary collapse

Class Method Details

.register_device(options = {}) ⇒ Object

register a new device and update corresponding profiles



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/asca/tools/tools.rb', line 7

def self.register_device(options = {})
    device_info = options[:device_info]
    profile_names = options[:profile_names]
    if !device_info || !profile_names
        Asca::Tools::Log.error('Wrong parameters for register device')
        return
    end

    Asca::REST::Provisioning::Devices.register_new_device :udid => device_info[:udid], :name => device_info[:name]

    profile_names.each { |profile_name|
        Asca::REST::Provisioning::Profiles.update_profile :name => profile_name
    }
end