megam_api 0.15 → 0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -10
- data/lib/megam/api.rb +34 -20
- data/lib/megam/api/csars.rb +50 -0
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/builder/delete_node.rb +1 -1
- data/lib/megam/builder/make_node.rb +1 -1
- data/lib/megam/core/app_request.rb +1 -1
- data/lib/megam/core/app_request_collection.rb +1 -1
- data/lib/megam/core/appdefns.rb +1 -1
- data/lib/megam/core/appdefns_collection.rb +1 -1
- data/lib/megam/core/bolt_request.rb +1 -1
- data/lib/megam/core/bolt_request_collection.rb +1 -1
- data/lib/megam/core/boltdefns.rb +1 -1
- data/lib/megam/core/boltdefns_collection.rb +1 -1
- data/lib/megam/core/cloudinstruction.rb +1 -1
- data/lib/megam/core/cloudinstruction_collection.rb +1 -1
- data/lib/megam/core/cloudinstruction_group.rb +1 -1
- data/lib/megam/core/cloudtemplate.rb +1 -1
- data/lib/megam/core/cloudtemplate_collection.rb +1 -1
- data/lib/megam/core/cloudtool.rb +1 -1
- data/lib/megam/core/cloudtool_collection.rb +1 -1
- data/lib/megam/core/cloudtoolsetting.rb +1 -1
- data/lib/megam/core/cloudtoolsetting_collection.rb +1 -1
- data/lib/megam/core/config.rb +3 -3
- data/lib/megam/core/csar.rb +165 -0
- data/lib/megam/core/csar_collection.rb +148 -0
- data/lib/megam/core/json_compat.rb +12 -3
- data/lib/megam/core/konipai.rb +57 -0
- data/lib/megam/core/marketplace.rb +20 -20
- data/lib/megam/core/marketplace_addon.rb +8 -8
- data/lib/megam/core/marketplace_addon_collection.rb +1 -1
- data/lib/megam/core/marketplace_collection.rb +1 -1
- data/lib/megam/core/node.rb +1 -1
- data/lib/megam/core/node_collection.rb +1 -1
- data/lib/megam/core/predef.rb +1 -1
- data/lib/megam/core/predef_collection.rb +1 -1
- data/lib/megam/core/predefcloud.rb +1 -1
- data/lib/megam/core/predefcloud_collection.rb +1 -1
- data/lib/megam/core/request.rb +1 -1
- data/lib/megam/core/request_collection.rb +1 -1
- data/lib/megam/core/server_api.rb +4 -5
- data/lib/megam/core/sshkey.rb +1 -1
- data/lib/megam/core/sshkey_collection.rb +1 -1
- data/megam_api.gemspec +7 -7
- data/test/test_cloudtoolsettings.rb +3 -3
- data/test/test_csars.rb +21 -0
- data/test/test_helper.rb +1 -1
- data/test/test_marketplaces.rb +8 -8
- data/test/test_nodes.rb +4 -4
- data/test/test_predefclouds.rb +4 -4
- data/test/test_requests.rb +1 -1
- data/test/test_sshkeys.rb +1 -1
- metadata +19 -13
data/lib/megam/core/node.rb
CHANGED
data/lib/megam/core/predef.rb
CHANGED
data/lib/megam/core/request.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright:: Copyright (c) 2012,
|
1
|
+
# Copyright:: Copyright (c) 2012, 2014 Megam Systems
|
2
2
|
# License:: Apache License, Version 2.0
|
3
3
|
#
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
@@ -18,7 +18,7 @@ module Megam
|
|
18
18
|
# Basic HTTP client, with support for adding features via middleware
|
19
19
|
class ServerAPI
|
20
20
|
|
21
|
-
|
21
|
+
|
22
22
|
attr_reader :email
|
23
23
|
attr_reader :api_key
|
24
24
|
|
@@ -29,7 +29,7 @@ module Megam
|
|
29
29
|
# HTTP GET request to http://api.megam.co/nodes using the email, api_key
|
30
30
|
def initialize(email=nil, api_key=nil)
|
31
31
|
@email = email
|
32
|
-
@api_key = api_key
|
32
|
+
@api_key = api_key
|
33
33
|
end
|
34
34
|
|
35
35
|
# Build a megam api client
|
@@ -40,9 +40,8 @@ module Megam
|
|
40
40
|
options = { :email =>email || Megam::Config[:email], :api_key => api_key || Megam::Config[:api_key]}
|
41
41
|
Megam::API.new(options)
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
|
45
45
|
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
data/lib/megam/core/sshkey.rb
CHANGED
data/megam_api.gemspec
CHANGED
@@ -7,20 +7,20 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Megam::API::VERSION
|
8
8
|
s.authors = ["Kishorekumar Neelamegam, Thomas Alrin, Subash Sethurajan, Rajthilak"]
|
9
9
|
s.email = ["nkishore@megam.co.in","alrin@megam.co.in","subash.avc@gmail.com", "rajthilak@megam.co.in"]
|
10
|
-
s.homepage = "http://github.com/
|
10
|
+
s.homepage = "http://github.com/megamsys/megam_api"
|
11
11
|
s.license = "Apache V2"
|
12
|
-
|
13
|
-
s.summary = %q{Ruby Client for the Megam
|
14
|
-
s.description = %q{Ruby Client for the Megam
|
12
|
+
s.extra_rdoc_files = ["README.md", "LICENSE" ]
|
13
|
+
s.summary = %q{Ruby Client for the Megam}
|
14
|
+
s.description = %q{Ruby Client for the Megam. Performs REST calls to Megam Gateway - http://github.com/megamsys/megam_play.git}
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
|
-
s.add_runtime_dependency 'excon', '~> 0.
|
19
|
+
s.add_runtime_dependency 'excon', '~> 0.39'
|
20
20
|
s.add_runtime_dependency 'highline', '~> 1.6'
|
21
21
|
s.add_runtime_dependency 'yajl-ruby', '~> 1.2'
|
22
22
|
s.add_runtime_dependency 'mixlib-config', '~> 2.1'
|
23
23
|
s.add_runtime_dependency 'mixlib-log', '~> 1.6'
|
24
|
-
s.add_development_dependency 'minitest', '~> 5.
|
25
|
-
s.add_development_dependency 'rake', '~> 10.
|
24
|
+
s.add_development_dependency 'minitest', '~> 5.4'
|
25
|
+
s.add_development_dependency 'rake', '~> 10.3'
|
26
26
|
end
|
@@ -6,8 +6,8 @@ class TestApps < MiniTest::Unit::TestCase
|
|
6
6
|
tmp_hash = { :cloud_type => "chef",
|
7
7
|
:repo_name => "test_chef",
|
8
8
|
:repo => "https://github.com",
|
9
|
-
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudrecipes/
|
10
|
-
:conf_location => "
|
9
|
+
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudrecipes/megam@mypaas.io/chef",
|
10
|
+
:conf_location => "megam@mypaas.io/chef/chef-repo/.chef/knife.rb"
|
11
11
|
}
|
12
12
|
|
13
13
|
response = megams.post_cloudtoolsetting(tmp_hash)
|
@@ -19,7 +19,7 @@ class TestApps < MiniTest::Unit::TestCase
|
|
19
19
|
tmp_hash = { :cloud_type => "chef",
|
20
20
|
:repo_name => "test_chef",
|
21
21
|
:repo => "https://github.com",
|
22
|
-
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
22
|
+
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default"
|
23
23
|
}
|
24
24
|
response = megams.post_cloudtoolsetting(tmp_hash)
|
25
25
|
assert_equal(201, response.status)
|
data/test/test_csars.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestApps < MiniTest::Unit::TestCase
|
4
|
+
|
5
|
+
def test_get_csars
|
6
|
+
response = megams.get_csars
|
7
|
+
assert_equal(200, response.status)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_get_csar
|
11
|
+
response = megams.get_csar("CSI1116385673159507968")
|
12
|
+
assert_equal(200, response.status)
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
def test_get_csar_not_found
|
17
|
+
assert_raises(Megam::API::Errors::NotFound) do
|
18
|
+
megams.get_csar("stupid.megam.co")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/test/test_helper.rb
CHANGED
data/test/test_marketplaces.rb
CHANGED
@@ -3,12 +3,12 @@ require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
|
3
3
|
class TestMarketplaces < MiniTest::Unit::TestCase
|
4
4
|
=begin
|
5
5
|
def test_post_marketplace
|
6
|
-
tmp_hash = {
|
6
|
+
tmp_hash = {
|
7
7
|
"name" => "sample",
|
8
8
|
"appdetails" => {"logo" => "logo", "category"=> "catagroy", "description"=> "description"},
|
9
9
|
"features" => {"feature1" => "feature1","feature2" => "feature2","feature3" => "feature3","feature4" => "feature4"},
|
10
|
-
"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"},
|
10
|
+
"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
12
|
"attach" => "attach",
|
13
13
|
"predefnode" => "predefnode",
|
14
14
|
"approved" => "approved" }
|
@@ -16,7 +16,7 @@ def test_post_marketplace
|
|
16
16
|
response = megams.post_marketplaceapp(tmp_hash)
|
17
17
|
assert_equal(201, response.status)
|
18
18
|
end
|
19
|
-
=end
|
19
|
+
=end
|
20
20
|
=begin
|
21
21
|
def test_post_node2
|
22
22
|
tmp_hash = {
|
@@ -35,11 +35,11 @@ def test_post_marketplace
|
|
35
35
|
end
|
36
36
|
=end
|
37
37
|
#=begin
|
38
|
-
def
|
38
|
+
def test_get_marketplace
|
39
39
|
response = megams.get_marketplaceapp("34-Trac")
|
40
40
|
assert_equal(200, response.status)
|
41
41
|
end
|
42
|
-
#=end
|
42
|
+
#=end
|
43
43
|
=begin
|
44
44
|
def test_get_node1
|
45
45
|
response = megams.get_node("night.megam.co")
|
@@ -72,7 +72,7 @@ def test_post_marketplace
|
|
72
72
|
"ssh_key" => "megam_ec2",
|
73
73
|
"identity_file" => "~/.ssh/megam_ec2.pem",
|
74
74
|
"ssh_user" => "",
|
75
|
-
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
75
|
+
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
76
76
|
"sshpub_location" => "",
|
77
77
|
"zone" => "",
|
78
78
|
"region" => "region"
|
@@ -97,5 +97,5 @@ def test_post_marketplace
|
|
97
97
|
response = megams.post_request(tmp_hash)
|
98
98
|
assert_equal(201, response.status)
|
99
99
|
end
|
100
|
-
=end
|
100
|
+
=end
|
101
101
|
end
|
data/test/test_nodes.rb
CHANGED
@@ -22,8 +22,8 @@ class TestApps < MiniTest::Unit::TestCase
|
|
22
22
|
"ssh_key" => "megam_ec2",
|
23
23
|
"identity_file" => "~/.ssh/megam_ec2.pem",
|
24
24
|
"ssh_user" => "ubuntu",
|
25
|
-
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
26
|
-
"sshpub_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
25
|
+
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
26
|
+
"sshpub_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
27
27
|
"zone" => "",
|
28
28
|
"region" => "region"
|
29
29
|
}
|
@@ -31,7 +31,7 @@ class TestApps < MiniTest::Unit::TestCase
|
|
31
31
|
"cloudtool" => {
|
32
32
|
"chef" => {
|
33
33
|
"command" => "knife",
|
34
|
-
"plugin" => "ec2 server create -c
|
34
|
+
"plugin" => "ec2 server create -c megam@mypaas.io/default", #ec2 server delete or create
|
35
35
|
"run_list" => "role[opendj]",
|
36
36
|
"name" => "-N TestOverAll"
|
37
37
|
}
|
@@ -111,7 +111,7 @@ class TestApps < MiniTest::Unit::TestCase
|
|
111
111
|
"ssh_key" => "megam_ec2",
|
112
112
|
"identity_file" => "~/.ssh/megam_ec2.pem",
|
113
113
|
"ssh_user" => "",
|
114
|
-
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
114
|
+
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
115
115
|
"sshpub_location" => "",
|
116
116
|
"zone" => "",
|
117
117
|
"region" => "region"
|
data/test/test_predefclouds.rb
CHANGED
@@ -14,8 +14,8 @@ class TestApps < MiniTest::Unit::TestCase
|
|
14
14
|
:ssh_key => "megam_ec2",
|
15
15
|
:identity_file => "~/.ssh/megam_ec2.pem",
|
16
16
|
:ssh_user => "ubuntu",
|
17
|
-
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
18
|
-
:sshpub_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
17
|
+
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
18
|
+
:sshpub_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
19
19
|
:zone => "",
|
20
20
|
:region => "southeast"
|
21
21
|
},
|
@@ -39,8 +39,8 @@ class TestApps < MiniTest::Unit::TestCase
|
|
39
39
|
:ssh_key => "boo_flightssh",
|
40
40
|
:identity_file => "https://boering.dropbox.closedloc/aorc.pem",
|
41
41
|
:ssh_user => "ubuntu",
|
42
|
-
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
43
|
-
:sshpub_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
42
|
+
:vault_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
43
|
+
:sshpub_location => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
44
44
|
:zone => "",
|
45
45
|
:region => ""
|
46
46
|
},
|
data/test/test_requests.rb
CHANGED
@@ -38,7 +38,7 @@ class TestApps < MiniTest::Unit::TestCase
|
|
38
38
|
"ssh_key" => "megam_ec2",
|
39
39
|
"identity_file" => "~/.ssh/megam_ec2.pem",
|
40
40
|
"ssh_user" => "",
|
41
|
-
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
41
|
+
"vault_location" => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default",
|
42
42
|
"sshpub_location" => "",
|
43
43
|
"zone" => "",
|
44
44
|
"region" => ""
|
data/test/test_sshkeys.rb
CHANGED
@@ -2,7 +2,7 @@ require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
|
2
2
|
|
3
3
|
class TestApps < MiniTest::Unit::TestCase
|
4
4
|
def test_post_sshkey2
|
5
|
-
tmp_hash = { :name => "test_sample", :path => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/
|
5
|
+
tmp_hash = { :name => "test_sample", :path => "https://s3-ap-southeast-1.amazonaws.com/cloudkeys/megam@mypaas.io/default" }
|
6
6
|
response = megams.post_sshkey(tmp_hash)
|
7
7
|
assert_equal(201, response.status)
|
8
8
|
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.16'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kishorekumar Neelamegam, Thomas Alrin, Subash Sethurajan, Rajthilak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.39'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.39'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: highline
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,30 +86,29 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '5.
|
89
|
+
version: '5.4'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '5.
|
96
|
+
version: '5.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '10.
|
103
|
+
version: '10.3'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '10.
|
111
|
-
description: Ruby Client for the Megam
|
112
|
-
http://github.com/indykish/megam_play.git
|
110
|
+
version: '10.3'
|
111
|
+
description: Ruby Client for the Megam. Performs REST calls to Megam Gateway - http://github.com/megamsys/megam_play.git
|
113
112
|
email:
|
114
113
|
- nkishore@megam.co.in
|
115
114
|
- alrin@megam.co.in
|
@@ -117,7 +116,9 @@ email:
|
|
117
116
|
- rajthilak@megam.co.in
|
118
117
|
executables: []
|
119
118
|
extensions: []
|
120
|
-
extra_rdoc_files:
|
119
|
+
extra_rdoc_files:
|
120
|
+
- README.md
|
121
|
+
- LICENSE
|
121
122
|
files:
|
122
123
|
- ".gitignore"
|
123
124
|
- ".project"
|
@@ -135,6 +136,7 @@ files:
|
|
135
136
|
- lib/megam/api/boltdefns.rb
|
136
137
|
- lib/megam/api/cloud_tool_settings.rb
|
137
138
|
- lib/megam/api/cloud_tools.rb
|
139
|
+
- lib/megam/api/csars.rb
|
138
140
|
- lib/megam/api/errors.rb
|
139
141
|
- lib/megam/api/login.rb
|
140
142
|
- lib/megam/api/logs.rb
|
@@ -168,8 +170,11 @@ files:
|
|
168
170
|
- lib/megam/core/cloudtoolsetting.rb
|
169
171
|
- lib/megam/core/cloudtoolsetting_collection.rb
|
170
172
|
- lib/megam/core/config.rb
|
173
|
+
- lib/megam/core/csar.rb
|
174
|
+
- lib/megam/core/csar_collection.rb
|
171
175
|
- lib/megam/core/error.rb
|
172
176
|
- lib/megam/core/json_compat.rb
|
177
|
+
- lib/megam/core/konipai.rb
|
173
178
|
- lib/megam/core/log.rb
|
174
179
|
- lib/megam/core/marketplace.rb
|
175
180
|
- lib/megam/core/marketplace_addon.rb
|
@@ -199,6 +204,7 @@ files:
|
|
199
204
|
- test/test_boltreqs.rb
|
200
205
|
- test/test_cloudtools.rb
|
201
206
|
- test/test_cloudtoolsettings.rb
|
207
|
+
- test/test_csars.rb
|
202
208
|
- test/test_helper.rb
|
203
209
|
- test/test_login.rb
|
204
210
|
- test/test_logs.rb
|
@@ -209,7 +215,7 @@ files:
|
|
209
215
|
- test/test_predefs.rb
|
210
216
|
- test/test_requests.rb
|
211
217
|
- test/test_sshkeys.rb
|
212
|
-
homepage: http://github.com/
|
218
|
+
homepage: http://github.com/megamsys/megam_api
|
213
219
|
licenses:
|
214
220
|
- Apache V2
|
215
221
|
metadata: {}
|
@@ -232,5 +238,5 @@ rubyforge_project:
|
|
232
238
|
rubygems_version: 2.2.2
|
233
239
|
signing_key:
|
234
240
|
specification_version: 4
|
235
|
-
summary: Ruby Client for the Megam
|
241
|
+
summary: Ruby Client for the Megam
|
236
242
|
test_files: []
|