megam_api 1.52.2 → 1.52.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b2ea5c73edfa904feb67a7421d440a3a9861ebf
4
- data.tar.gz: 631d53cde48a7e687c419b806760dfda2fb8650b
3
+ metadata.gz: 830b38a9240417f9d912948d49179841e4e7e0a1
4
+ data.tar.gz: 0b1aed8ffbe960e4ca38c51dd34a7fdb502ab4fb
5
5
  SHA512:
6
- metadata.gz: 6da36555070aaff7e7a96ea0865f1dbb31b0df6702a60530b17cad6b8cd240f8910fbbc73eb8b5ee7b2b7bb9b64afb5375efebdb4afcbd5316a3a5b51c94df3c
7
- data.tar.gz: 25c872e5cf053f6c673e99ad1ca725c55b6b4bbf2e9ec5a8e8174a9cdba338a11870ea5452424cfea3ffaee460b729f06027d01d0ca7da9c147195c0867927be
6
+ metadata.gz: 7a1fe6d673b4999dcb6b253aed536c66dbd4608da7d6ffcdd840ad80c57adde4c4c9c34f57234d356e59ba0cccc5613c4a0a6b7088bc1b72644e30a9c51d90cc
7
+ data.tar.gz: 87f614bf7d268f1e145aa0a397d5620211d995f19bf1a953263a60fc24f5c5e6c299044f64653c2d95844cfb0cd0e147409832d643af6ea84ddf7d16dcaf5182
@@ -1,46 +1,57 @@
1
1
  module Megam
2
- class API
3
- # GET /nodes
4
- def list_backups
5
- @options = {:path => "/backups",:body => ""}.merge(@options)
6
-
7
- request(
8
- :expects => 200,
9
- :method => :get,
10
- :body => @options[:body]
11
- )
12
- end
2
+ class API
3
+ # GET /nodes
4
+ def list_backups
5
+ @options = {:path => "/backups",:body => ""}.merge(@options)
13
6
 
14
- def get_backups(asm_id)
15
- @options = {:path => "/backups/#{asm_id}",:body => ""}.merge(@options)
7
+ request(
8
+ :expects => 200,
9
+ :method => :get,
10
+ :body => @options[:body]
11
+ )
12
+ end
16
13
 
17
- request(
18
- :expects => 200,
19
- :method => :get,
20
- :body => @options[:body]
21
- )
22
- end
23
- def post_backups(new_sps)
24
- @options = {:path => '/backups/content',
25
- :body => Megam::JSONCompat.to_json(new_sps)}.merge(@options)
26
-
27
- request(
28
- :expects => 201,
29
- :method => :post,
30
- :body => @options[:body]
31
- )
32
- end
14
+ def get_backups(asm_id)
15
+ @options = {:path => "/backups/#{asm_id}",:body => ""}.merge(@options)
33
16
 
34
- def update_backups(update_sps)
35
- @options = {:path => '/backups/update',
36
- :body => Megam::JSONCompat.to_json(update_sps)}.merge(@options)
17
+ request(
18
+ :expects => 200,
19
+ :method => :get,
20
+ :body => @options[:body]
21
+ )
22
+ end
37
23
 
38
- request(
39
- :expects => 201,
40
- :method => :post,
41
- :body => @options[:body]
42
- )
43
- end
24
+ def get_one_backup(backup_id)
25
+ @options = {:path => "/backups/show/#{backup_id}",:body => ""}.merge(@options)
26
+
27
+ request(
28
+ :expects => 200,
29
+ :method => :get,
30
+ :body => @options[:body]
31
+ )
32
+ end
44
33
 
45
- end
34
+ def post_backups(new_sps)
35
+ @options = {:path => '/backups/content',
36
+ :body => Megam::JSONCompat.to_json(new_sps)}.merge(@options)
37
+
38
+ request(
39
+ :expects => 201,
40
+ :method => :post,
41
+ :body => @options[:body]
42
+ )
43
+ end
44
+
45
+ def update_backups(update_sps)
46
+ @options = {:path => '/backups/update',
47
+ :body => Megam::JSONCompat.to_json(update_sps)}.merge(@options)
48
+
49
+ request(
50
+ :expects => 201,
51
+ :method => :post,
52
+ :body => @options[:body]
53
+ )
54
+ end
55
+
56
+ end
46
57
  end
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "1.52.2"
3
+ VERSION = "1.52.3"
4
4
  end
5
5
  end
@@ -148,7 +148,7 @@ module Megam
148
148
 
149
149
  def for_json
150
150
  result = {
151
- "id" => id,
151
+ "id" => id,
152
152
  "account_id" => account_id,
153
153
  "asm_id" => asm_id,
154
154
  "org_id" => org_id,
@@ -219,15 +219,20 @@ module Megam
219
219
  megam_rest.post_backups(to_hash)
220
220
  end
221
221
 
222
+ def self.listall(params)
223
+ sps = self.new(params)
224
+ sps.megam_rest.list_backups
225
+ end
226
+
222
227
  # Load a account by email_p
223
- def self.show(o)
228
+ def self.list(o)
224
229
  sps = self.new(o)
225
230
  sps.megam_rest.get_backups(o[:id])
226
231
  end
227
232
 
228
- def self.list(params)
229
- sps = self.new(params)
230
- sps.megam_rest.list_backups
233
+ def self.show(o)
234
+ sps = self.new(o)
235
+ sps.megam_rest.get_one_backup(o[:id])
231
236
  end
232
237
 
233
238
  def update
@@ -36,7 +36,7 @@ module Megam
36
36
 
37
37
  attr_reader :domain, :keypairoption, :root_password, :sshkey, :provider, :cpu, :ram, :hdd,
38
38
  :version, :display_name, :password, :region, :flavor_id, :storage_hddtype,
39
- :public_ipv4, :private_ipv4, :public_ipv6, :private_ipv6, :bitnami_username, :bitnami_password, :root_username, :backup, :backup_name, :quota_ids,:app_username, :app_password, :user_launch_patternname, :flavor_id
39
+ :public_ipv4, :private_ipv4, :public_ipv6, :private_ipv6, :bitnami_username, :bitnami_password, :root_username, :backup, :backup_name, :backup_id, :quota_ids,:app_username, :app_password, :user_launch_patternname, :flavor_id
40
40
 
41
41
  ATTRIBUTES = [
42
42
  :domain,
@@ -61,6 +61,7 @@ module Megam
61
61
  :root_username,
62
62
  :backup,
63
63
  :backup_name,
64
+ :backup_id,
64
65
  :quota_ids,
65
66
  :user_launch_patternname,]
66
67
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.52.2
4
+ version: 1.52.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Ranjitha R, Vinodhini V, Rathish VBR, Rajesh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-01 00:00:00.000000000 Z
12
+ date: 2017-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon