megam_api 0.43 → 0.44

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eebcad90954af1dae6376ace92b915a35f81261d
4
- data.tar.gz: a8bb083480de64a1d065b05a65d00217ed133e94
3
+ metadata.gz: 9878e6043a2b15cad23ce5f5910b02dd2d0f153d
4
+ data.tar.gz: f1ac9270a97ac5043d8b0ea4e869742eac68d914
5
5
  SHA512:
6
- metadata.gz: e20ad0b6ec7dfec6c8ff75d09542e3e248c3465f56f6cb985bf873325535d8c5e178898f1cb63746ef0f9ae64cc23cb76293a5282275c08f29e47afa2a22c5f9
7
- data.tar.gz: a7f4fb0c29ff96796ffde4f4b70de1500de753dad418cf0a61a29475b8f3b0e374b7438b977437732646b16ccdf869994e0400fe797e94d75f189aac4932920b
6
+ metadata.gz: 7e335d1d1a744da8114f5d4e395ab1f3c2bedf75b281a035373d202ffef01141b0cfdb760e1e7db2d3abfcfa3d9c13cc4f1d98e30914675421ac5d047c48f444
7
+ data.tar.gz: 9e48acecc7a03c5566df08aba20773574ac8d3848093ea4b420c30ab57af16f548518c5c05e9792d2a0588ef42b51b84ac7ef888cf49bc221ed7c7110e576329
@@ -19,12 +19,12 @@ module Megam
19
19
  :expects => 200,
20
20
  :method => :get,
21
21
  :body => @options[:body]
22
- )
22
+ )
23
23
  end
24
24
 
25
- def post_marketplaceapp(new_node)
25
+ def post_marketplaceapp(catitem)
26
26
  @options = {:path => '/marketplaces/content',
27
- :body => Megam::JSONCompat.to_json(new_node)}.merge(@options)
27
+ :body => Megam::JSONCompat.to_json(catitem)}.merge(@options)
28
28
 
29
29
  request(
30
30
  :expects => 201,
@@ -35,8 +35,8 @@ module Megam
35
35
 
36
36
  #Yet to be tested
37
37
  # DELETE /marketplacess/:node_id
38
- def delete_marketplaceapp(node_id)
39
- @options = {:path => '/marketplaces/#{node_id}',
38
+ def delete_marketplaceapp(catitem_id)
39
+ @options = {:path => '/marketplaces/#{catitem_id}',
40
40
  :body => ""}.merge(@options)
41
41
 
42
42
  request(
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "0.43"
3
+ VERSION = "0.44"
4
4
  end
5
5
  end
@@ -20,14 +20,12 @@ module Megam
20
20
  def initialize(email=nil, api_key=nil)
21
21
  @id = nil
22
22
  @name = nil
23
- @appdetails = {}
24
- @features={}
23
+ @catalog = {}
25
24
  @plans=nil
26
- @applinks={}
27
- @attach =nil
28
- @predefnode=nil
25
+ @cattype =nil
26
+ @predef =nil
29
27
  @some_msg = {}
30
- @approved = nil
28
+ @status = nil
31
29
  @created_at = nil
32
30
  super(email, api_key)
33
31
  end
@@ -45,11 +43,11 @@ module Megam
45
43
  end
46
44
  end
47
45
 
48
- def appdetails(arg=nil)
46
+ def catalog(arg=nil)
49
47
  if arg != nil
50
- @appdetails = arg
48
+ @catalog = arg
51
49
  else
52
- @appdetails
50
+ @catalog
53
51
  end
54
52
  end
55
53
 
@@ -61,13 +59,6 @@ module Megam
61
59
  end
62
60
  end
63
61
 
64
- def features(arg=nil)
65
- if arg != nil
66
- @features = arg
67
- else
68
- @features
69
- end
70
- end
71
62
 
72
63
  def plans(arg=nil)
73
64
  if arg != nil
@@ -77,35 +68,28 @@ module Megam
77
68
  end
78
69
  end
79
70
 
80
- def applinks(arg=nil)
81
- if arg != nil
82
- @applinks = arg
83
- else
84
- @applinks
85
- end
86
- end
87
71
 
88
- def predefnode(arg=nil)
72
+ def predef(arg=nil)
89
73
  if arg != nil
90
- @predefnode = arg
74
+ @predef = arg
91
75
  else
92
- @predefnode
76
+ @predef
93
77
  end
94
78
  end
95
79
 
96
- def attach(arg=nil)
80
+ def cattype(arg=nil)
97
81
  if arg != nil
98
- @attach = arg
82
+ @cattype = arg
99
83
  else
100
- @attach
84
+ @cattype
101
85
  end
102
86
  end
103
87
 
104
- def approved(arg=nil)
88
+ def status(arg=nil)
105
89
  if arg != nil
106
- @approved = arg
90
+ @status = arg
107
91
  else
108
- @approved
92
+ @status
109
93
  end
110
94
  end
111
95
 
@@ -1,101 +1,28 @@
1
1
  require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
2
2
 
3
3
  class TestMarketplaces < MiniTest::Unit::TestCase
4
- =begin
5
- def test_post_marketplace
4
+
5
+ def test_post_marketplace
6
6
  tmp_hash = {
7
- "name" => "sample",
8
- "appdetails" => {"logo" => "logo", "category"=> "catagroy", "description"=> "description"},
9
- "features" => {"feature1" => "feature1","feature2" => "feature2","feature3" => "feature3","feature4" => "feature4"},
7
+ "name" => "34-Trac",
8
+ "catalog" => {"logo" => "logo", "category"=> "catagroy", "description"=> "description"},
10
9
  "plans" => [{"price"=> "30", "description"=> "description", "plantype"=> "paid", "version"=> "0.1", "source"=> "source"}],
11
- "applinks" => {"free_support"=> "String", "paid_support"=> "String", "home_link"=> "String", "info_link"=> "String", "content_link"=> "String", "wiki_link"=> "String", "source_link"=> "String"},
12
- "attach" => "attach",
13
- "predefnode" => "predefnode",
14
- "approved" => "approved" }
10
+ "cattype" => "DEW",
11
+ "predefnode" => "java",
12
+ "status" => "ACTIVE" }
15
13
 
16
14
  response = megams.post_marketplaceapp(tmp_hash)
17
15
  assert_equal(201, response.status)
18
16
  end
19
- =end
20
- =begin
21
- def test_post_node2
22
- tmp_hash = {
23
- "node_name" => "sundown.megam.co",
24
- "command" => "commands2",
25
- "predefs" => {"name" => "rails", "scm" => "https://github.com/awesome.git",
26
- "db" => "postgres@postgresql2.megam.com/morning.megam.co", "war" => "http://s3pub.com/0.1/orion.war", "queue" => "rabbit@queue1"}
27
- }
28
- response = megams.post_node(tmp_hash)
29
- assert_equal(201, response.status)
30
- end
31
17
 
32
18
  def test_get_marketplaces
33
19
  response = megams.get_marketplaceapps
34
20
  assert_equal(200, response.status)
35
21
  end
36
- =end
37
- #=begin
38
- def test_get_marketplace
39
- response = megams.get_marketplaceapp("34-Trac")
40
- assert_equal(200, response.status)
41
- end
42
- #=end
43
- =begin
44
- def test_get_node1
45
- response = megams.get_node("night.megam.co")
46
- assert_equal(200, response.status)
47
- end
48
22
 
49
- def test_get_node_not_found
50
- assert_raises(Megam::API::Errors::NotFound) do
51
- megams.get_node("stupid.megam.co")
52
- end
23
+ def test_get_marketplace
24
+ response = megams.get_marketplaceapp("34-Trac")
25
+ assert_equal(200, response.status)
53
26
  end
54
27
 
55
- def test_delete_node1
56
-
57
- @com = {
58
- "systemprovider" => {
59
- "provider" => {
60
- "prov" => "chef"
61
- }
62
- },
63
- "compute" => {
64
- "cctype" => "ec2",
65
- "cc" => {
66
- "groups" => "",
67
- "image" => "",
68
- "flavor" => "",
69
- "tenant_id" => ""
70
- },
71
- "access" => {
72
- "ssh_key" => "megam_ec2",
73
- "identity_file" => "~/.ssh/megam_ec2.pem",
74
- "ssh_user" => "",
75
- "vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
76
- "sshpub_location" => "",
77
- "zone" => "",
78
- "region" => "region"
79
- }
80
- },
81
- "cloudtool" => {
82
- "chef" => {
83
- "command" => "knife",
84
- "plugin" => "ec2 server delete", #ec2 server delete or create
85
- "run_list" => "",
86
- "name" => ""
87
- }
88
- }
89
- }
90
-
91
- tmp_hash = {
92
- "node_name" => "black1.megam.co",
93
- "req_type" => "delete", #CREATE OR DELETE
94
- "command" => @com
95
- }
96
-
97
- response = megams.post_request(tmp_hash)
98
- assert_equal(201, response.status)
99
- end
100
- =end
101
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.43'
4
+ version: '0.44'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2015-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon