megam_api 0.93 → 0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/lib/megam/api.rb +18 -4
- data/lib/megam/api/accounts.rb +19 -4
- data/lib/megam/api/assemblies.rb +15 -0
- data/lib/megam/api/assembly.rb +15 -1
- data/lib/megam/api/availableunits.rb +15 -0
- data/lib/megam/api/balances.rb +16 -1
- data/lib/megam/api/billedhistories.rb +15 -0
- data/lib/megam/api/billings.rb +15 -0
- data/lib/megam/api/components.rb +15 -0
- data/lib/megam/api/credithistories.rb +15 -0
- data/lib/megam/api/csars.rb +16 -1
- data/lib/megam/api/discounts.rb +15 -0
- data/lib/megam/api/domains.rb +32 -22
- data/lib/megam/api/errors.rb +15 -0
- data/lib/megam/api/invoices.rb +15 -0
- data/lib/megam/api/login.rb +15 -0
- data/lib/megam/api/marketplaces.rb +15 -0
- data/lib/megam/api/organizations.rb +31 -17
- data/lib/megam/api/promos.rb +18 -3
- data/lib/megam/api/requests.rb +15 -0
- data/lib/megam/api/sensors.rb +15 -0
- data/lib/megam/api/sshkeys.rb +15 -0
- data/lib/megam/api/subscriptions.rb +15 -0
- data/lib/megam/api/version.rb +16 -1
- data/lib/megam/core/account.rb +1 -1
- data/lib/megam/core/assemblies.rb +1 -1
- data/lib/megam/core/assemblies_collection.rb +1 -1
- data/lib/megam/core/assembly.rb +1 -1
- data/lib/megam/core/assembly_collection.rb +1 -1
- data/lib/megam/core/auth.rb +1 -1
- data/lib/megam/core/availableunits.rb +1 -1
- data/lib/megam/core/availableunits_collection.rb +1 -1
- data/lib/megam/core/balances.rb +4 -5
- data/lib/megam/core/balances_collection.rb +1 -1
- data/lib/megam/core/billedhistories.rb +4 -5
- data/lib/megam/core/billedhistories_collection.rb +1 -1
- data/lib/megam/core/billings.rb +4 -4
- data/lib/megam/core/billings_collection.rb +1 -1
- data/lib/megam/core/components.rb +1 -1
- data/lib/megam/core/components_collection.rb +1 -1
- data/lib/megam/core/config.rb +1 -1
- data/lib/megam/core/credithistories.rb +1 -1
- data/lib/megam/core/credithistories_collection.rb +1 -1
- data/lib/megam/core/csar.rb +1 -1
- data/lib/megam/core/csar_collection.rb +1 -1
- data/lib/megam/core/discounts.rb +1 -1
- data/lib/megam/core/discounts_collection.rb +1 -1
- data/lib/megam/core/domain_collection.rb +144 -0
- data/lib/megam/core/domains.rb +76 -85
- data/lib/megam/core/error.rb +1 -1
- data/lib/megam/core/invoices.rb +1 -1
- data/lib/megam/core/invoices_collection.rb +1 -1
- data/lib/megam/core/json_compat.rb +3 -0
- data/lib/megam/core/konipai.rb +1 -1
- data/lib/megam/core/marketplace.rb +1 -1
- data/lib/megam/core/marketplace_collection.rb +1 -1
- data/lib/megam/core/organizations.rb +1 -3
- data/lib/megam/core/organizations_collection.rb +1 -1
- data/lib/megam/core/promos.rb +1 -1
- data/lib/megam/core/request.rb +1 -1
- data/lib/megam/core/request_collection.rb +1 -1
- data/lib/megam/core/sensors.rb +1 -1
- data/lib/megam/core/sensors_collection.rb +1 -1
- data/lib/megam/core/server_api.rb +1 -1
- data/lib/megam/core/sshkey.rb +1 -1
- data/lib/megam/core/sshkey_collection.rb +1 -1
- data/lib/megam/core/subscriptions.rb +1 -1
- data/lib/megam/core/subscriptions_collection.rb +1 -1
- data/lib/megam/mixins/assemblies.rb +15 -0
- data/lib/megam/mixins/assembly.rb +16 -0
- data/lib/megam/mixins/common_deployable.rb +15 -0
- data/lib/megam/mixins/components.rb +15 -0
- data/lib/megam/mixins/megam_attributes.rb +15 -0
- data/lib/megam/mixins/outputs.rb +15 -0
- data/lib/megam/mixins/policies.rb +15 -0
- data/lib/megam_api.rb +15 -0
- data/megam_api.gemspec +6 -6
- data/test/test_accounts.rb +46 -9
- data/test/test_assemblies.rb +7 -7
- data/test/test_assembly.rb +4 -4
- data/test/test_availableunits.rb +3 -4
- data/test/test_balances.rb +9 -10
- data/test/test_billedhistories.rb +4 -4
- data/test/test_billings.rb +1 -2
- data/test/test_components.rb +4 -4
- data/test/test_credithistories.rb +3 -4
- data/test/test_csars.rb +2 -1
- data/test/test_discounts.rb +4 -5
- data/test/test_domains.rb +8 -7
- data/test/test_invoices.rb +2 -2
- data/test/test_marketplaces.rb +4 -4
- data/test/test_organizations.rb +3 -3
- data/test/test_requests.rb +1 -1
- data/test/test_sshkeys.rb +15 -14
- metadata +41 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e8a0f42ca3b125e4c15c17b28b6678fe2283f93
|
|
4
|
+
data.tar.gz: fa7609f6ac9427fd2ffe8d117237ebb53fc9671d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce7978f9c336ae585c443cd7edc00085a55425727192d9844d2e785ab0992f07efdb6a107903a47c4b433fa3fb42c1d944b0e0f6a0f3154f9e6c461bf89d9a0a
|
|
7
|
+
data.tar.gz: 9401e01eef3c64befc83a9a14a4285361870c2afa0c9964b9afafc154be6e24b5005d2e6ca3909a62b047944a609cbad98b9714918d58d40dc6fdea5432fd92c
|
data/.travis.yml
CHANGED
data/lib/megam/api.rb
CHANGED
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
require 'base64'
|
|
2
17
|
require 'time'
|
|
3
18
|
require 'excon'
|
|
4
19
|
require 'uri'
|
|
5
20
|
require 'zlib'
|
|
6
21
|
require 'openssl'
|
|
7
|
-
# open it up when needed. This will be needed when a new customer onboarded via pug.
|
|
8
|
-
require 'securerandom'
|
|
9
22
|
|
|
10
23
|
__LIB_DIR__ = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
|
11
24
|
$LOAD_PATH.unshift(__LIB_DIR__) unless $LOAD_PATH.include?(__LIB_DIR__)
|
|
@@ -59,6 +72,7 @@ require 'megam/core/marketplace_collection'
|
|
|
59
72
|
require 'megam/core/organizations'
|
|
60
73
|
require 'megam/core/organizations_collection'
|
|
61
74
|
require 'megam/core/domains'
|
|
75
|
+
require 'megam/core/domain_collection'
|
|
62
76
|
require 'megam/core/assemblies'
|
|
63
77
|
require 'megam/core/assemblies_collection'
|
|
64
78
|
require 'megam/core/csar'
|
|
@@ -187,7 +201,7 @@ module Megam
|
|
|
187
201
|
Megam::Log.debug("#{response.body}")
|
|
188
202
|
|
|
189
203
|
begin
|
|
190
|
-
unless response.headers[X_Megam_OTTAI]
|
|
204
|
+
unless response.headers[X_Megam_OTTAI]
|
|
191
205
|
response.body = Megam::JSONCompat.from_json(response.body.chomp)
|
|
192
206
|
Megam::Log.debug('RESPONSE: Ruby Object')
|
|
193
207
|
else
|
|
@@ -251,7 +265,7 @@ module Megam
|
|
|
251
265
|
data = "#{current_date}" + "\n" + "#{cmd_parms[:path]}" + "\n" + "#{body_base64}"
|
|
252
266
|
|
|
253
267
|
digest = OpenSSL::Digest.new('sha1')
|
|
254
|
-
movingFactor = data.rstrip!
|
|
268
|
+
movingFactor = data.rstrip!
|
|
255
269
|
if !(@password.nil?)
|
|
256
270
|
hash = OpenSSL::HMAC.hexdigest(digest, Base64.strict_decode64(@password), movingFactor)
|
|
257
271
|
else
|
data/lib/megam/api/accounts.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
# GET /accounts
|
|
@@ -25,19 +40,19 @@ module Megam
|
|
|
25
40
|
:body => @options[:body]
|
|
26
41
|
)
|
|
27
42
|
end
|
|
28
|
-
|
|
43
|
+
|
|
29
44
|
def update_accounts(update_account)
|
|
30
45
|
@options = {:path => '/accounts/update',
|
|
31
46
|
:body => Megam::JSONCompat.to_json(update_account)}.merge(@options)
|
|
32
|
-
|
|
47
|
+
|
|
33
48
|
request(
|
|
34
|
-
:expects => 201,
|
|
49
|
+
:expects => 201,
|
|
35
50
|
:method => :post,
|
|
36
51
|
:body => @options[:body]
|
|
37
52
|
)
|
|
38
53
|
end
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
|
|
41
56
|
|
|
42
57
|
end
|
|
43
58
|
end
|
data/lib/megam/api/assemblies.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
# GET /nodes
|
data/lib/megam/api/assembly.rb
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
2
16
|
module Megam
|
|
3
17
|
class API
|
|
4
18
|
def get_one_assembly(asm_id)
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_availableunits
|
data/lib/megam/api/balances.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_balances
|
|
@@ -30,7 +45,7 @@ module Megam
|
|
|
30
45
|
:body => @options[:body]
|
|
31
46
|
)
|
|
32
47
|
end
|
|
33
|
-
|
|
48
|
+
|
|
34
49
|
def update_balance(new_balance)
|
|
35
50
|
@options = {:path => '/balances/update',
|
|
36
51
|
:body => Megam::JSONCompat.to_json(new_balance)}.merge(@options)
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_billedhistories
|
data/lib/megam/api/billings.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_billings
|
data/lib/megam/api/components.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_components(comp_id)
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_credithistories
|
data/lib/megam/api/csars.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
|
|
@@ -32,7 +47,7 @@ module Megam
|
|
|
32
47
|
:body => @options[:body]
|
|
33
48
|
)
|
|
34
49
|
end
|
|
35
|
-
|
|
50
|
+
|
|
36
51
|
def push_csar(id)
|
|
37
52
|
@options = {:path => "/csars/push/#{id}",:body => ""}.merge(@options)
|
|
38
53
|
|
data/lib/megam/api/discounts.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_discounts
|
data/lib/megam/api/domains.rb
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
|
|
4
|
-
def get_domains(name)
|
|
5
19
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
end
|
|
20
|
+
def get_domains
|
|
21
|
+
@options = {:path => "/domains", :body => ''}.merge(@options)
|
|
22
|
+
request(
|
|
23
|
+
:expects => 200,
|
|
24
|
+
:method => :get,
|
|
25
|
+
:body => @options[:body]
|
|
26
|
+
)
|
|
27
|
+
end
|
|
15
28
|
|
|
16
29
|
|
|
17
|
-
def post_domains(new_domain)
|
|
18
|
-
|
|
30
|
+
def post_domains(new_domain)
|
|
19
31
|
@options = {:path => '/domains/content',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
end
|
|
29
|
-
end
|
|
32
|
+
:body => Megam::JSONCompat.to_json(new_domain)}.merge(@options)
|
|
33
|
+
request(
|
|
34
|
+
:expects => 201,
|
|
35
|
+
:method => :post,
|
|
36
|
+
:body => @options[:body]
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
end
|
|
30
40
|
end
|
data/lib/megam/api/errors.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
module Errors
|
data/lib/megam/api/invoices.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def get_invoices
|
data/lib/megam/api/login.rb
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Copyright:: Copyright (c) 2013-2016 Megam Systems
|
|
2
|
+
# License:: Apache License, Version 2.0
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
1
16
|
module Megam
|
|
2
17
|
class API
|
|
3
18
|
def post_auth
|