Module: NAbleRails

Defined in:
lib/n_able_rails.rb,
lib/n_able_rails/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/n_able_rails.rb', line 5

def password
  @password
end

#usernameObject

Returns the value of attribute username.



5
6
7
# File 'lib/n_able_rails.rb', line 5

def username
  @username
end

Class Method Details

.device_asset_info_export2Object



53
54
55
# File 'lib/n_able_rails.rb', line 53

def self.device_asset_info_export2()
  @client.call(:device_asset_info_export2, message: { Version: "0.0", Username: @username, Password: @password })
end

.device_asset_info_export2ById(device_id) ⇒ Object



47
48
49
50
51
# File 'lib/n_able_rails.rb', line 47

def self.device_asset_info_export2ById(device_id)
  @client.call(:device_asset_info_export2, message: { Version: "0.0", Username: @username, Password: @password, Settings:
                                                      { Setting:{Key: 'TargetByDeviceID', Value: {Value: device_id} } }
                                                    } )
end

.device_status(device_id) ⇒ Object



57
58
59
60
61
# File 'lib/n_able_rails.rb', line 57

def self.device_status(device_id)
  @client.call(:device_get_status, message: { Username: @username, Password: @password, Settings:
                                        { Setting:{key: "deviceID", value: device_id} }
                                            } )
end

.get_device_info(device_id) ⇒ Object



33
34
35
36
37
# File 'lib/n_able_rails.rb', line 33

def self.get_device_info(device_id)
  @client.call(:device_get, message: { Username: @username, Password: @password, Settings:
                              { Setting:{key: "deviceID", value: device_id} }
                                     } )
end

.initialize(sas_url, username, password) ⇒ Object

Initialize required params to begin calls



8
9
10
11
12
13
14
# File 'lib/n_able_rails.rb', line 8

def self.initialize(sas_url, username, password)
  @username = username
  @password = password

  # create a client for the service
  @client = Savon.client(wsdl: "#{sas_url}/dms/services/ServerEI?wsdl")
end

.list_customersObject



43
44
45
# File 'lib/n_able_rails.rb', line 43

def self.list_customers
  @client.call(:customer_list, message: { Username: @username, Password: @password, Settings: {  } })
end

.list_device_property(device_id) ⇒ Object



39
40
41
# File 'lib/n_able_rails.rb', line 39

def self.list_device_property(device_id)
  @client.call(:device_property_list, message: { Username: @username, Password: @password, DeviceIDs: { DeviceID: device_id}, DeviceNames:{}, FilterIDs:{}, FilterNames:{}, ReverseOrder: false })
end

.list_devices(customer_id) ⇒ Object



26
27
28
29
30
31
# File 'lib/n_able_rails.rb', line 26

def self.list_devices(customer_id)
  @client.call(:device_list, message: { Username: @username, Password: @password, Settings:
                                        { "@xsi:type" => "impl:ArrayOf_tns1_T_KeyPair", "@env:arrayType" => "impl:T_KeyPair[]",
                                        Setting:{key: "customerID", value: customer_id} }
                                      })
end

.operationsObject

List all available operations for the api.



17
18
19
# File 'lib/n_able_rails.rb', line 17

def self.operations
  @client.operations
end

.version_infoObject

Sanity Check to see if you can hit the server.



22
23
24
# File 'lib/n_able_rails.rb', line 22

def self.version_info
  @client.call(:version_info_get)
end