megam_api 0.43 → 0.44
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/lib/megam/api/marketplaces.rb +5 -5
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/core/marketplace.rb +16 -32
- data/test/test_marketplaces.rb +10 -83
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9878e6043a2b15cad23ce5f5910b02dd2d0f153d
|
4
|
+
data.tar.gz: f1ac9270a97ac5043d8b0ea4e869742eac68d914
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
25
|
+
def post_marketplaceapp(catitem)
|
26
26
|
@options = {:path => '/marketplaces/content',
|
27
|
-
:body => Megam::JSONCompat.to_json(
|
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(
|
39
|
-
@options = {:path => '/marketplaces/#{
|
38
|
+
def delete_marketplaceapp(catitem_id)
|
39
|
+
@options = {:path => '/marketplaces/#{catitem_id}',
|
40
40
|
:body => ""}.merge(@options)
|
41
41
|
|
42
42
|
request(
|
data/lib/megam/api/version.rb
CHANGED
@@ -20,14 +20,12 @@ module Megam
|
|
20
20
|
def initialize(email=nil, api_key=nil)
|
21
21
|
@id = nil
|
22
22
|
@name = nil
|
23
|
-
@
|
24
|
-
@features={}
|
23
|
+
@catalog = {}
|
25
24
|
@plans=nil
|
26
|
-
@
|
27
|
-
@
|
28
|
-
@predefnode=nil
|
25
|
+
@cattype =nil
|
26
|
+
@predef =nil
|
29
27
|
@some_msg = {}
|
30
|
-
@
|
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
|
46
|
+
def catalog(arg=nil)
|
49
47
|
if arg != nil
|
50
|
-
@
|
48
|
+
@catalog = arg
|
51
49
|
else
|
52
|
-
@
|
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
|
72
|
+
def predef(arg=nil)
|
89
73
|
if arg != nil
|
90
|
-
@
|
74
|
+
@predef = arg
|
91
75
|
else
|
92
|
-
@
|
76
|
+
@predef
|
93
77
|
end
|
94
78
|
end
|
95
79
|
|
96
|
-
def
|
80
|
+
def cattype(arg=nil)
|
97
81
|
if arg != nil
|
98
|
-
@
|
82
|
+
@cattype = arg
|
99
83
|
else
|
100
|
-
@
|
84
|
+
@cattype
|
101
85
|
end
|
102
86
|
end
|
103
87
|
|
104
|
-
def
|
88
|
+
def status(arg=nil)
|
105
89
|
if arg != nil
|
106
|
-
@
|
90
|
+
@status = arg
|
107
91
|
else
|
108
|
-
@
|
92
|
+
@status
|
109
93
|
end
|
110
94
|
end
|
111
95
|
|
data/test/test_marketplaces.rb
CHANGED
@@ -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
|
-
|
5
|
-
def test_post_marketplace
|
4
|
+
|
5
|
+
def test_post_marketplace
|
6
6
|
tmp_hash = {
|
7
|
-
"name" => "
|
8
|
-
"
|
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
|
-
"
|
12
|
-
"
|
13
|
-
"
|
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
|
-
|
50
|
-
|
51
|
-
|
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.
|
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-
|
11
|
+
date: 2015-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|