nvx-sds 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +64 -0
- data/README +80 -0
- data/lib/nvx/sds/APIClasses/accountfeatureusage.rb +60 -0
- data/lib/nvx/sds/APIClasses/accountinfo.rb +30 -0
- data/lib/nvx/sds/APIClasses/accountlimit.rb +25 -0
- data/lib/nvx/sds/APIClasses/contactinfo.rb +74 -0
- data/lib/nvx/sds/APIClasses/fsfileattributes.rb +50 -0
- data/lib/nvx/sds/APIClasses/fsfolderattributes.rb +53 -0
- data/lib/nvx/sds/APIClasses/fsfolderlist.rb +70 -0
- data/lib/nvx/sds/APIClasses/metadatainfo.rb +26 -0
- data/lib/nvx/sds/APIClasses/responsecodes.rb +97 -0
- data/lib/nvx/sds/APIClasses/soapupload.rb +52 -0
- data/lib/nvx/sds/APIClasses/utilities.rb +97 -0
- data/lib/nvx/sds/SOAP/TransferClient.rb +68 -0
- data/lib/nvx/sds/SOAP/default.rb +80 -0
- data/lib/nvx/sds/SOAP/defaultDriver.rb +70 -0
- data/lib/nvx/sds/accountlogin.rb +68 -0
- data/lib/nvx/sds/apicommand.rb +251 -0
- data/lib/nvx/sds/apiparam.rb +33 -0
- data/lib/nvx/sds/countries.rb +257 -0
- data/lib/nvx/sds/folder.rb +236 -0
- data/lib/nvx/sds/hosteditem.rb +115 -0
- data/lib/nvx/sds/itembase.rb +53 -0
- data/lib/nvx/sds/masteraccount.rb +74 -0
- data/lib/nvx/sds/nvxfile.rb +173 -0
- data/lib/nvx/sds/session.rb +110 -0
- data/lib/nvx/sds/transport.rb +129 -0
- data/lib/nvx_sds.rb +19 -0
- data/tests/TestUpload.txt +9 -0
- data/tests/accountlogintest.rb +19 -0
- data/tests/apicommandtest.rb +186 -0
- data/tests/apiparamtest.rb +24 -0
- data/tests/countriestest.rb +20 -0
- data/tests/foldertest.rb +26 -0
- data/tests/fsfolderlisttest.rb +127 -0
- data/tests/masteraccounttest.rb +69 -0
- data/tests/sessiontest.rb +187 -0
- data/tests/testconfig.rb +14 -0
- data/tests/transporttest.rb +19 -0
- data/tests/unittests_gemtest.rb +17 -0
- data/tests/uploadtest.rb +22 -0
- metadata +102 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
# The SoapUpload file is used to upload a file to Nirvanix in parts using SOAP.
|
2
|
+
#
|
3
|
+
# == Usage
|
4
|
+
# session = Session.new("APP-KEY", "USERNAME", "APP NAME", "PASSWORD")
|
5
|
+
#
|
6
|
+
# SoapUpload.UploadFile("/path/RemoteFilename.txt","C:\\localfile.txt", session.account_login)
|
7
|
+
module NVX
|
8
|
+
module SDS
|
9
|
+
|
10
|
+
require 'transport'
|
11
|
+
require 'apicommand'
|
12
|
+
require 'apiparam'
|
13
|
+
require 'soap/defaultDriver'
|
14
|
+
require 'base64'
|
15
|
+
|
16
|
+
# The SoapTransfer class is used for upload. Since this method doesnt have a specific
|
17
|
+
# file size limit other than the 256gb max file size limit this method is used instead of
|
18
|
+
# the http upload which is limited to 2gb. This is due to the
|
19
|
+
class SoapUpload
|
20
|
+
|
21
|
+
# Uploads a file in parts at a using a buffer of 65k.
|
22
|
+
#
|
23
|
+
# == Usage
|
24
|
+
# session = Session.new("APP-KEY", "USERNAME", "APP NAME", "PASSWORD")
|
25
|
+
#
|
26
|
+
# SoapUpload.UploadFile("/path/RemoteFilename.txt","C:\\localfile.txt", session.account_login)
|
27
|
+
def SoapUpload.UploadFile(path, local_path, account_login)
|
28
|
+
# Get the Upload node passing in the total file size.
|
29
|
+
result = Transport.execute_command_post(APICommand.GetUploadNode, [APIParam.new("sizeBytes", "1000")], account_login)
|
30
|
+
|
31
|
+
# extract the upload token, host name and build a new transfer object.
|
32
|
+
upload_token = result.root.elements["//AccessToken"].get_text.value
|
33
|
+
node = result.root.elements["//IPAddress"].get_text.value
|
34
|
+
# set the URL based on the node that was returned from Nirvanix.
|
35
|
+
soap = NVX::SDS::SOAP::TransferSoap.new("http://#{node}/ws/transfer.asmx")
|
36
|
+
|
37
|
+
# Open the local file
|
38
|
+
file = File.open(local_path, "rb")
|
39
|
+
# Loop through the entire file uploading each file part.
|
40
|
+
while !file.eof?
|
41
|
+
# Send a 65k file part to Nirvanix using the upload token.
|
42
|
+
params = NVX::SDS::SOAP::AppendFile.new(upload_token, path, Base64.encode64(file.read(65536)), false)
|
43
|
+
soap.appendFile(params)
|
44
|
+
end
|
45
|
+
# Send an empty data with a True for last packet, this finalizes the upload and will
|
46
|
+
# make the file available for download.
|
47
|
+
params = NVX::SDS::SOAP::AppendFile.new(upload_token, path, nil, true)
|
48
|
+
soap.appendFile(params)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# = Overview
|
2
|
+
#
|
3
|
+
# The utilities file contains a utilites class that has several static methods for formatting and other routine operations
|
4
|
+
# such as getting download URLs and Getting and settign generic information that requires special formatting.
|
5
|
+
module NVX
|
6
|
+
module SDS
|
7
|
+
|
8
|
+
$:.unshift File.dirname(__FILE__)
|
9
|
+
require 'transport'
|
10
|
+
require 'apicommand'
|
11
|
+
require 'apiparam'
|
12
|
+
require 'accountinfo'
|
13
|
+
require 'accountlimit'
|
14
|
+
require 'accountfeatureusage'
|
15
|
+
|
16
|
+
# The utilites class has several static methods for formatting and other routine operations such as
|
17
|
+
# getting download URLs and Getting and settign generic information that requires special formatting.
|
18
|
+
class Utilities
|
19
|
+
# Gets a download url for either hosted or session based downloads. This will output a url in the format of
|
20
|
+
# http://downloadnode.nirvanix.com/sessiontoken/appname/username/path/file.txt or
|
21
|
+
# http://downloadnode.nirvanix.com/appname/username/path/file.txt
|
22
|
+
def Utilities.GetDownloadUrl(account_login, path, include_session = true)
|
23
|
+
doc = Transport.execute_command_post(APICommand.GetDownloadNodes, [APIParam.new("filePath", path)], account_login)
|
24
|
+
|
25
|
+
url = "http://" + doc.root.elements["//Response/DownloadNode"].get_text.value + "/"
|
26
|
+
url += account_login.session_token + "/" if include_session
|
27
|
+
url += account_login.app_name + "/" + account_login.username + "/"
|
28
|
+
url += path.to_s.split("/").last
|
29
|
+
return url
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns the account information in an accountInfo object.
|
33
|
+
def Utilities.GetAccountInfo(account_login, username)
|
34
|
+
doc = Transport.execute_command_post(APICommand.GetAccountInfo, [APIParam.new("username", username)], account_login)
|
35
|
+
return AccountInfo.new(doc)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Gets account limits extracting each limit and creating a new AccountLimit object to contain each.
|
39
|
+
def Utilities.GetAccountLimits(account_login, username)
|
40
|
+
doc = Transport.execute_command_post(APICommand.GetAccountLimits, [APIParam.new("username", username)], account_login)
|
41
|
+
|
42
|
+
accountlimits = Array.new
|
43
|
+
|
44
|
+
#if there is any metadata loop through
|
45
|
+
if doc.root.elements["//Response/Limits"]
|
46
|
+
doc.root.elements.each("//Response/Limits") do |limit|
|
47
|
+
#add to the array the type and value of each in the xml.
|
48
|
+
accountlimits << AccountLimit.new(limit.elements["Type"][0].to_s, limit.elements["Value"][0].to_s)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
return accountlimits
|
52
|
+
end
|
53
|
+
|
54
|
+
# Gets account usage extracting each usage type and creating a new AccountFeatureUsage object to contain each.
|
55
|
+
def Utilities.GetAccountUsage(account_login, username)
|
56
|
+
doc = Transport.execute_command_post(APICommand.GetAccountUsage, [APIParam.new("username", username)], account_login)
|
57
|
+
|
58
|
+
features = Array.new
|
59
|
+
|
60
|
+
#if there is any metadata loop through
|
61
|
+
if doc.root.elements["//Response/GetUsage"]
|
62
|
+
doc.root.elements.each("//Response/GetUsage") do |feature|
|
63
|
+
features << AccountFeatureUsage.new(feature)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
return features
|
68
|
+
end
|
69
|
+
|
70
|
+
# Sets the account info for a child or parent.
|
71
|
+
def Utilities.SetAccountInfo(account_login, username, first_name, last_name,
|
72
|
+
middle_initial, phone_number, email_address, email_format, address_line1, address_line2,
|
73
|
+
city, state, country, postal_code)
|
74
|
+
|
75
|
+
email_format = email_format.nil? ? "TEXT" : email_format
|
76
|
+
country = country.nil? ? "1" : country
|
77
|
+
|
78
|
+
params = Array.new
|
79
|
+
params << APIParam.new("username", username)
|
80
|
+
params << APIParam.new("emailFormat", email_format)
|
81
|
+
params << APIParam.new("firstName", first_name) if !first_name.nil?
|
82
|
+
params << APIParam.new("lastName", last_name) if !last_name.nil?
|
83
|
+
params << APIParam.new("middleInitial", middle_initial) if !middle_initial.nil?
|
84
|
+
params << APIParam.new("phoneNumber", phone_number) if !phone_number.nil?
|
85
|
+
params << APIParam.new("emailAddress", email_address) if !email_address.nil?
|
86
|
+
params << APIParam.new("addressLine1", address_line1) if !address_line1.nil?
|
87
|
+
params << APIParam.new("addressLine2", address_line2) if !address_line2.nil?
|
88
|
+
params << APIParam.new("city", city) if !city.nil?
|
89
|
+
params << APIParam.new("state", state) if !state.nil?
|
90
|
+
params << APIParam.new("country", country) if !country.nil?
|
91
|
+
params << APIParam.new("postalCode", postal_code) if !postal_code.nil?
|
92
|
+
|
93
|
+
Transport.execute_command_post(APICommand.SetAccountInfo, params, account_login)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# This file is generated by Soap2wsdl. It was left in the Gem intentionally
|
2
|
+
# to show example usage of the soap interfaces of the transfer namespace.
|
3
|
+
|
4
|
+
#!/usr/bin/env ruby
|
5
|
+
require 'defaultDriver.rb'
|
6
|
+
|
7
|
+
endpoint_url = ARGV.shift
|
8
|
+
obj = TransferSoap.new(endpoint_url)
|
9
|
+
|
10
|
+
# run ruby with -d to see SOAP wiredumps.
|
11
|
+
obj.wiredump_dev = STDERR if $DEBUG
|
12
|
+
|
13
|
+
# SYNOPSIS
|
14
|
+
# UploadFile(parameters)
|
15
|
+
#
|
16
|
+
# ARGS
|
17
|
+
# parameters UploadFile - {http://transfer.nirvanix.com/ws/Transfer}UploadFile
|
18
|
+
#
|
19
|
+
# RETURNS
|
20
|
+
# parameters UploadFileResponse - {http://transfer.nirvanix.com/ws/Transfer}UploadFileResponse
|
21
|
+
#
|
22
|
+
parameters = nil
|
23
|
+
puts obj.uploadFile(parameters)
|
24
|
+
|
25
|
+
# SYNOPSIS
|
26
|
+
# AppendFile(parameters)
|
27
|
+
#
|
28
|
+
# ARGS
|
29
|
+
# parameters AppendFile - {http://transfer.nirvanix.com/ws/Transfer}AppendFile
|
30
|
+
#
|
31
|
+
# RETURNS
|
32
|
+
# parameters AppendFileResponse - {http://transfer.nirvanix.com/ws/Transfer}AppendFileResponse
|
33
|
+
#
|
34
|
+
parameters = nil
|
35
|
+
puts obj.appendFile(parameters)
|
36
|
+
|
37
|
+
|
38
|
+
endpoint_url = ARGV.shift
|
39
|
+
obj = TransferSoap.new(endpoint_url)
|
40
|
+
|
41
|
+
# run ruby with -d to see SOAP wiredumps.
|
42
|
+
obj.wiredump_dev = STDERR if $DEBUG
|
43
|
+
|
44
|
+
# SYNOPSIS
|
45
|
+
# UploadFile(parameters)
|
46
|
+
#
|
47
|
+
# ARGS
|
48
|
+
# parameters UploadFile - {http://transfer.nirvanix.com/ws/Transfer}UploadFile
|
49
|
+
#
|
50
|
+
# RETURNS
|
51
|
+
# parameters UploadFileResponse - {http://transfer.nirvanix.com/ws/Transfer}UploadFileResponse
|
52
|
+
#
|
53
|
+
parameters = nil
|
54
|
+
puts obj.uploadFile(parameters)
|
55
|
+
|
56
|
+
# SYNOPSIS
|
57
|
+
# AppendFile(parameters)
|
58
|
+
#
|
59
|
+
# ARGS
|
60
|
+
# parameters AppendFile - {http://transfer.nirvanix.com/ws/Transfer}AppendFile
|
61
|
+
#
|
62
|
+
# RETURNS
|
63
|
+
# parameters AppendFileResponse - {http://transfer.nirvanix.com/ws/Transfer}AppendFileResponse
|
64
|
+
#
|
65
|
+
parameters = nil
|
66
|
+
puts obj.appendFile(parameters)
|
67
|
+
|
68
|
+
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# <b>This is a wrapper for the SOAP driver created with Soap2wsdl
|
2
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
3
|
+
# example.</b>
|
4
|
+
|
5
|
+
module NVX
|
6
|
+
module SDS
|
7
|
+
module SOAP
|
8
|
+
|
9
|
+
require 'xsd/qname'
|
10
|
+
|
11
|
+
# <b>This is a wrapper class for the SOAP driver created with Soap2wsdl
|
12
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
13
|
+
# example.</b>
|
14
|
+
class UploadFile
|
15
|
+
@@schema_type = "UploadFile"
|
16
|
+
@@schema_ns = "http://transfer.nirvanix.com/ws/Transfer"
|
17
|
+
@@schema_qualified = "true"
|
18
|
+
@@schema_element = [["uploadToken", "SOAP::SOAPString"], ["path", "SOAP::SOAPString"], ["fileData", "SOAP::SOAPBase64"]]
|
19
|
+
|
20
|
+
attr_accessor :uploadToken
|
21
|
+
attr_accessor :path
|
22
|
+
attr_accessor :fileData
|
23
|
+
|
24
|
+
def initialize(uploadToken = nil, path = nil, fileData = nil)
|
25
|
+
@uploadToken = uploadToken
|
26
|
+
@path = path
|
27
|
+
@fileData = fileData
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# <b>This is a wrapper class for the SOAP driver created with Soap2wsdl
|
32
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
33
|
+
# example.</b>
|
34
|
+
class UploadFileResponse
|
35
|
+
@@schema_type = "UploadFileResponse"
|
36
|
+
@@schema_ns = "http://transfer.nirvanix.com/ws/Transfer"
|
37
|
+
@@schema_qualified = "true"
|
38
|
+
@@schema_element = []
|
39
|
+
|
40
|
+
def initialize
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# <b>This is a wrapper class for the SOAP driver created with Soap2wsdl
|
45
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
46
|
+
# example.</b>
|
47
|
+
class AppendFile
|
48
|
+
@@schema_type = "AppendFile"
|
49
|
+
@@schema_ns = "http://transfer.nirvanix.com/ws/Transfer"
|
50
|
+
@@schema_qualified = "true"
|
51
|
+
@@schema_element = [["uploadToken", "SOAP::SOAPString"], ["path", "SOAP::SOAPString"], ["fileData", "SOAP::SOAPBase64"], ["endOfFile", "SOAP::SOAPBoolean"]]
|
52
|
+
|
53
|
+
attr_accessor :uploadToken
|
54
|
+
attr_accessor :path
|
55
|
+
attr_accessor :fileData
|
56
|
+
attr_accessor :endOfFile
|
57
|
+
|
58
|
+
def initialize(uploadToken = nil, path = nil, fileData = nil, endOfFile = nil)
|
59
|
+
@uploadToken = uploadToken
|
60
|
+
@path = path
|
61
|
+
@fileData = fileData
|
62
|
+
@endOfFile = endOfFile
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# <b>This is a wrapper class for the SOAP driver created with Soap2wsdl
|
67
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
68
|
+
# example.</b>
|
69
|
+
class AppendFileResponse
|
70
|
+
@@schema_type = "AppendFileResponse"
|
71
|
+
@@schema_ns = "http://transfer.nirvanix.com/ws/Transfer"
|
72
|
+
@@schema_qualified = "true"
|
73
|
+
@@schema_element = []
|
74
|
+
|
75
|
+
def initialize
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# <b>This is a wrapper for the SOAP driver created with Soap2wsdl
|
2
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
3
|
+
# example.</b>
|
4
|
+
|
5
|
+
module NVX
|
6
|
+
module SDS
|
7
|
+
module SOAP
|
8
|
+
|
9
|
+
$:.unshift File.dirname(__FILE__)
|
10
|
+
require 'default.rb'
|
11
|
+
|
12
|
+
require 'soap/rpc/driver'
|
13
|
+
|
14
|
+
# <b>This is a wrapper class for the SOAP driver created with Soap2wsdl
|
15
|
+
# Please see the documentation for SoapUpload for usage and an upload
|
16
|
+
# example.</b>
|
17
|
+
class TransferSoap < ::SOAP::RPC::Driver
|
18
|
+
protected
|
19
|
+
|
20
|
+
DefaultEndpointUrl = "http://node1.nirvanix.com/ws/transfer.asmx"
|
21
|
+
MappingRegistry = ::SOAP::Mapping::Registry.new
|
22
|
+
|
23
|
+
Methods = [
|
24
|
+
[ "http://transfer.nirvanix.com/ws/Transfer/UploadFile",
|
25
|
+
"uploadFile",
|
26
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://transfer.nirvanix.com/ws/Transfer", "UploadFile"], true],
|
27
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://transfer.nirvanix.com/ws/Transfer", "UploadFileResponse"], true] ],
|
28
|
+
{ :request_style => :document, :request_use => :literal,
|
29
|
+
:response_style => :document, :response_use => :literal }
|
30
|
+
],
|
31
|
+
[ "http://transfer.nirvanix.com/ws/Transfer/AppendFile",
|
32
|
+
"appendFile",
|
33
|
+
[ ["in", "parameters", ["::SOAP::SOAPElement", "http://transfer.nirvanix.com/ws/Transfer", "AppendFile"], true],
|
34
|
+
["out", "parameters", ["::SOAP::SOAPElement", "http://transfer.nirvanix.com/ws/Transfer", "AppendFileResponse"], true] ],
|
35
|
+
{ :request_style => :document, :request_use => :literal,
|
36
|
+
:response_style => :document, :response_use => :literal }
|
37
|
+
]
|
38
|
+
]
|
39
|
+
|
40
|
+
def initialize(endpoint_url = nil)
|
41
|
+
endpoint_url ||= DefaultEndpointUrl
|
42
|
+
super(endpoint_url, nil)
|
43
|
+
self.mapping_registry = MappingRegistry
|
44
|
+
init_methods
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def init_methods
|
50
|
+
Methods.each do |definitions|
|
51
|
+
opt = definitions.last
|
52
|
+
if opt[:request_style] == :document
|
53
|
+
add_document_operation(*definitions)
|
54
|
+
else
|
55
|
+
add_rpc_operation(*definitions)
|
56
|
+
qname = definitions[0]
|
57
|
+
name = definitions[2]
|
58
|
+
if qname.name != name and qname.name.capitalize == name.capitalize
|
59
|
+
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
|
60
|
+
__send__(name, *arg)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# = Overview
|
2
|
+
# The AccountLogin object is used to hold the session and application information
|
3
|
+
# for a specific account. The AccountLogin object is created from the session object.
|
4
|
+
# it is used to store the current user information.
|
5
|
+
|
6
|
+
module NVX
|
7
|
+
module SDS
|
8
|
+
$:.unshift File.dirname(__FILE__)
|
9
|
+
require 'transport'
|
10
|
+
require 'apicommand'
|
11
|
+
require 'apiparam'
|
12
|
+
|
13
|
+
# = Overview
|
14
|
+
# The AccountLogin object is used to hold the session and application information
|
15
|
+
# for a specific account. The AccountLogin object is created from the session object.
|
16
|
+
# it is used to store the current user information.
|
17
|
+
class AccountLogin
|
18
|
+
|
19
|
+
# The initialize method is used to set the parameters being passed by the
|
20
|
+
# session object.
|
21
|
+
def initialize(app_key, username, app_name, password = nil, session_token = nil)
|
22
|
+
@app_key, @username, @app_name = app_key, username, app_name
|
23
|
+
@password = password
|
24
|
+
@session_token = session_token
|
25
|
+
@impersonation = !session_token.nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
# Current session token for the current logged in user.
|
29
|
+
def session_token
|
30
|
+
@session_token
|
31
|
+
end
|
32
|
+
|
33
|
+
# Stores the currently logged in username
|
34
|
+
def username
|
35
|
+
@username
|
36
|
+
end
|
37
|
+
|
38
|
+
# Sets the username
|
39
|
+
def username=(username)
|
40
|
+
@username=username
|
41
|
+
end
|
42
|
+
|
43
|
+
# Gets the current application key.
|
44
|
+
def app_key
|
45
|
+
@app_key
|
46
|
+
end
|
47
|
+
|
48
|
+
# Gets the current application name.
|
49
|
+
def app_name
|
50
|
+
@app_name
|
51
|
+
end
|
52
|
+
|
53
|
+
# Convenient function to get the root of the current application.
|
54
|
+
def root_path
|
55
|
+
@root_path = "//" + @app_name + "/" + @username;
|
56
|
+
end
|
57
|
+
|
58
|
+
# The Login method signs the user in using the information passed in the initialize method.
|
59
|
+
def Login
|
60
|
+
if @impersonation
|
61
|
+
raise "This account is impersonated and cannot be logged in."
|
62
|
+
end
|
63
|
+
result = Transport.execute_command_post(APICommand.Login, [APIParam.new("appKey", @app_key), APIParam.new("username", @username), APIParam.new("password", @password)], nil)
|
64
|
+
@session_token = result.root.elements["SessionToken"].get_text.value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|