jelastic 0.1.0.pre.dev
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.ruby-version +0 -0
- data/.travis.yml +19 -0
- data/Gemfile +8 -0
- data/LICENSE +21 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/jelastic.gemspec +24 -0
- data/lib/jelastic.rb +5 -0
- data/lib/jelastic/client.rb +42 -0
- data/lib/jelastic/docker_node.rb +42 -0
- data/lib/jelastic/environment.rb +65 -0
- data/lib/jelastic/node.rb +21 -0
- data/lib/jelastic/request.rb +59 -0
- data/lib/jelastic/request_error.rb +11 -0
- data/lib/jelastic/rest/api.rb +13 -0
- data/lib/jelastic/rest/authentication.rb +13 -0
- data/lib/jelastic/rest/control.rb +71 -0
- data/lib/jelastic/rest/utils.rb +25 -0
- data/lib/jelastic/serializers/base.rb +26 -0
- data/lib/jelastic/serializers/environment.rb +66 -0
- data/lib/jelastic/user.rb +12 -0
- data/lib/jelastic/version.rb +3 -0
- metadata +112 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5a413768a9c65ef58447d01896f530d0120fb874
|
4
|
+
data.tar.gz: 124c1ba1b47f2bbde453b4c1ecb8ca967eb8b522
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bf284546c3136ff877027164a90954c15504bfdfd7a6e4fb5812d50db764f2caf5fe64263c19073a5c004f65248c86b830d6018e4482bbb01ea3d6532b642004
|
7
|
+
data.tar.gz: 96f52671ef279a82aa35d16c3533f9969f57ac3f163af2c854bc773cb224f3a0c86a14355447c5539f695d306c1253d22e21165f7ceb46f260164f570e1bd7e1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
File without changes
|
data/.travis.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
rvm:
|
4
|
+
- 2.1
|
5
|
+
- 2.2
|
6
|
+
- jruby-9.1.1.0
|
7
|
+
- jruby-head
|
8
|
+
- rbx-2
|
9
|
+
- ruby-head
|
10
|
+
|
11
|
+
sudo: false
|
12
|
+
|
13
|
+
bundler_args: --retry=3 --jobs=3
|
14
|
+
|
15
|
+
env:
|
16
|
+
global:
|
17
|
+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
|
18
|
+
|
19
|
+
before_install: gem install bundler -v 1.12.5
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 Visuality
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Jelastic
|
2
|
+
[![Build Status](https://travis-ci.org/visualitypl/jelastic.svg?branch=master)](https://travis-ci.org/visualitypl/jelastic) [![Code Climate](https://codeclimate.com/github/visualitypl/jelastic/badges/gpa.svg)](https://codeclimate.com/github/visualitypl/jelastic) [![Coverage Status](https://coveralls.io/repos/github/visualitypl/jelastic/badge.svg?branch=master)](https://coveralls.io/github/visualitypl/jelastic?branch=master)
|
3
|
+
|
4
|
+
A Ruby wrapper for Jelastic API.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'jelastic'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install jelastic
|
21
|
+
|
22
|
+
## Configuration
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
client = Jelastic::Client.new do |config|
|
26
|
+
config.login = 'LOGIN'
|
27
|
+
config.password = 'PASSWORD'
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
TODO: Write usage instructions here
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/visualitypl/jelastic.
|
38
|
+
|
39
|
+
## Copyright
|
40
|
+
Copyright (c) 2016 Visuality.
|
41
|
+
See [LICENSE][] for details.
|
42
|
+
|
43
|
+
[license]: LICENSE
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "jelastic"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/jelastic.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jelastic/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'jelastic'
|
8
|
+
spec.version = Jelastic::VERSION
|
9
|
+
spec.license = 'MIT'
|
10
|
+
spec.authors = ['Marcin Prokop']
|
11
|
+
spec.email = ['m.prokop@visuality.pl']
|
12
|
+
|
13
|
+
spec.summary = %q{Ruby wrapper for Jelastic API}
|
14
|
+
spec.homepage = 'https://github.com/visualitypl/jelastic'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = 'exe'
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.12'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
24
|
+
end
|
data/lib/jelastic.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'jelastic/rest/api'
|
2
|
+
require 'jelastic/user'
|
3
|
+
require 'forwardable'
|
4
|
+
|
5
|
+
module Jelastic
|
6
|
+
class Client
|
7
|
+
include REST::API
|
8
|
+
extend Forwardable
|
9
|
+
|
10
|
+
attr_accessor :login, :password
|
11
|
+
attr_reader :user
|
12
|
+
|
13
|
+
def_delegator :user, :session
|
14
|
+
|
15
|
+
def initialize(params = {})
|
16
|
+
params.each do |key, value|
|
17
|
+
instance_variable_set("@#{key}", value)
|
18
|
+
end
|
19
|
+
|
20
|
+
yield(self) if block_given?
|
21
|
+
end
|
22
|
+
|
23
|
+
def authenticated?
|
24
|
+
!user.nil?
|
25
|
+
end
|
26
|
+
|
27
|
+
def authenticate
|
28
|
+
@user = User.new(signin)
|
29
|
+
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
def logout
|
34
|
+
if authenticated?
|
35
|
+
signout
|
36
|
+
@user = nil
|
37
|
+
end
|
38
|
+
|
39
|
+
nil
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Jelastic
|
2
|
+
class DockerNode < Node
|
3
|
+
attr_accessor :cmd, :image, :links, :envs
|
4
|
+
attr_reader :registry, :group
|
5
|
+
|
6
|
+
DockerRegistry = Struct.new(:user, :password, :url)
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@type = 'docker'
|
10
|
+
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def as_application_server
|
15
|
+
@group = 'cp'
|
16
|
+
end
|
17
|
+
|
18
|
+
def as_load_balancer
|
19
|
+
@group = 'bl'
|
20
|
+
end
|
21
|
+
|
22
|
+
def as_no_sql_database
|
23
|
+
@group = 'nosqldb'
|
24
|
+
end
|
25
|
+
|
26
|
+
def as_sql_database
|
27
|
+
@group = 'sqldb'
|
28
|
+
end
|
29
|
+
|
30
|
+
def as_cache
|
31
|
+
@group = 'cache'
|
32
|
+
end
|
33
|
+
|
34
|
+
def as_extra_layer
|
35
|
+
@group = nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def set_registry(user, password, url = nil)
|
39
|
+
@registry = DockerRegistry.new(user, password, url)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'jelastic/node'
|
2
|
+
require 'jelastic/docker_node'
|
3
|
+
require 'securerandom'
|
4
|
+
|
5
|
+
module Jelastic
|
6
|
+
class Environment
|
7
|
+
attr_accessor :action_key, :region, :engine, :display_name,
|
8
|
+
:ssl, :short_domain, :nodes, :ssl, :high_availability
|
9
|
+
attr_reader :client, :response
|
10
|
+
|
11
|
+
class << self
|
12
|
+
private :new
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.create(client, **params)
|
16
|
+
environment = allocate
|
17
|
+
environment.nodes = []
|
18
|
+
|
19
|
+
yield(environment)
|
20
|
+
|
21
|
+
environment.action_key ||= SecureRandom.hex
|
22
|
+
|
23
|
+
serialized_env = Serializers::Environment.new(environment).serialize
|
24
|
+
|
25
|
+
response = client.create_environment(serialized_env)
|
26
|
+
environment.instance_variable_set('@response', response)
|
27
|
+
|
28
|
+
environment
|
29
|
+
end
|
30
|
+
|
31
|
+
def add_node
|
32
|
+
node = Node.new
|
33
|
+
nodes << node
|
34
|
+
|
35
|
+
yield(node)
|
36
|
+
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
|
40
|
+
def add_docker_node
|
41
|
+
node = DockerNode.new
|
42
|
+
nodes << node
|
43
|
+
|
44
|
+
yield(node)
|
45
|
+
|
46
|
+
nil
|
47
|
+
end
|
48
|
+
|
49
|
+
def with_high_availability
|
50
|
+
@high_availability = true
|
51
|
+
end
|
52
|
+
|
53
|
+
def high_availability?
|
54
|
+
high_availability
|
55
|
+
end
|
56
|
+
|
57
|
+
def with_ssl
|
58
|
+
@ssl = true
|
59
|
+
end
|
60
|
+
|
61
|
+
def ssl?
|
62
|
+
ssl
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Jelastic
|
2
|
+
class Node
|
3
|
+
attr_accessor :count, :fixed_cloudlets, :flexible_cloudlets, :display_name, :type
|
4
|
+
|
5
|
+
def initialize
|
6
|
+
yield(self) if block_given?
|
7
|
+
end
|
8
|
+
|
9
|
+
def with_public_ip
|
10
|
+
@public_ip = true
|
11
|
+
end
|
12
|
+
|
13
|
+
def public_ip?
|
14
|
+
@public_ip
|
15
|
+
end
|
16
|
+
|
17
|
+
def docker?
|
18
|
+
@type == 'docker'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'json'
|
3
|
+
require 'jelastic/request_error'
|
4
|
+
|
5
|
+
module Jelastic
|
6
|
+
class Request
|
7
|
+
API_URL = 'https://app.jelastic.dogado.eu/1.0/'.freeze
|
8
|
+
TIMEOUT = 300
|
9
|
+
|
10
|
+
attr_reader :client, :path, :params
|
11
|
+
|
12
|
+
def initialize(client, path = [], params = {})
|
13
|
+
@client = client
|
14
|
+
@path = build_uri_path(path)
|
15
|
+
@params = if client.authenticated?
|
16
|
+
params.merge(
|
17
|
+
session: client.session,
|
18
|
+
)
|
19
|
+
else
|
20
|
+
params.merge(
|
21
|
+
login: client.login,
|
22
|
+
password: client.password
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def send
|
28
|
+
uri = URI.join(API_URL, path)
|
29
|
+
req = Net::HTTP::Post.new(uri.path)
|
30
|
+
req.set_form_data(params)
|
31
|
+
|
32
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
33
|
+
http.use_ssl = true
|
34
|
+
http.read_timeout = TIMEOUT
|
35
|
+
|
36
|
+
res = http.request(req)
|
37
|
+
out = JSON.parse(res.body)
|
38
|
+
|
39
|
+
unless out['result'].zero?
|
40
|
+
raise RequestError.new(out['error'], out)
|
41
|
+
else
|
42
|
+
out
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def build_uri_path(path)
|
49
|
+
path.map do |item|
|
50
|
+
new_path = item
|
51
|
+
|
52
|
+
new_path[0] = '' if new_path[0] == '/'
|
53
|
+
new_path[-1] = '' if new_path[-1] == '/'
|
54
|
+
|
55
|
+
new_path
|
56
|
+
end.join('/')
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Jelastic
|
2
|
+
module REST
|
3
|
+
module Authentication
|
4
|
+
def signin
|
5
|
+
send_request_with_system_appid('users/authentication/rest/signin')
|
6
|
+
end
|
7
|
+
|
8
|
+
def signout
|
9
|
+
send_request_with_system_appid('users/authentication/rest/signout')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
module Jelastic
|
2
|
+
module REST
|
3
|
+
module Control
|
4
|
+
def create_environment(params = {})
|
5
|
+
params = to_json(params, :env)
|
6
|
+
params = to_json(params, :nodes)
|
7
|
+
|
8
|
+
send_request_with_system_appid('environment/control/rest/createenvironment', params)
|
9
|
+
end
|
10
|
+
|
11
|
+
def delete_environment(env_name)
|
12
|
+
send_request(
|
13
|
+
'environment/control/rest/deleteenv',
|
14
|
+
{ envname: env_name, password: self.password }
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def add_docker_volume(env_name:, node_id:, path:)
|
19
|
+
send_request(
|
20
|
+
'environment/control/rest/adddockervolume',
|
21
|
+
{ envname: env_name, nodeId: node_id, path: path }
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
def add_docker_volume_by_group(env_name:, group_id:, path:)
|
26
|
+
send_request(
|
27
|
+
'environment/control/rest/adddockervolumebygroup',
|
28
|
+
{ envname: env_name, groupId: group_id, path: path }
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def set_docker_env_vars(env_name:, node_id:, envs:)
|
33
|
+
data = to_json(params, :envs)
|
34
|
+
|
35
|
+
send_request(
|
36
|
+
'environment/control/rest/setdockerenvvars',
|
37
|
+
{ envname: env_name, nodeId: node_id, data: data }
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
def get_docker_env_vars(env_name:, node_id:)
|
42
|
+
send_request(
|
43
|
+
'environment/control/rest/getdockerenvvars',
|
44
|
+
{ envname: env_name, nodeId: node_id }
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_environment(env_name)
|
49
|
+
send_request('environment/control/rest/getenvinfo', { envname: env_name })
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_environments
|
53
|
+
send_request_with_system_appid('environment/control/rest/getenvs')
|
54
|
+
end
|
55
|
+
|
56
|
+
def redeploy_containers_by_group(env_name:, node_group:, tag:, sequential: false, use_existing_volumes: false)
|
57
|
+
send_request(
|
58
|
+
'environment/control/rest/redeploycontainersbygroup',
|
59
|
+
{ envname: env_name, nodeGroup: node_group, tag: tag, sequential: sequential, useExistingVolumes: use_existing_volumes }
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
def redeploy_container_by_id(env_name:, node_id:, tag:, use_existing_volumes: false)
|
64
|
+
send_request(
|
65
|
+
'environment/control/rest/redeploycontainerbyid',
|
66
|
+
{ envname: env_name, nodeId: node_id, tag: tag, useExistingVolumes: use_existing_volumes }
|
67
|
+
)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'jelastic/request.rb'
|
2
|
+
require 'yaml'
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Jelastic
|
6
|
+
module REST
|
7
|
+
SYSTEM_APPID = '1dd8d191d38fff45e62564fcf67fdcd6'
|
8
|
+
|
9
|
+
module Utils
|
10
|
+
def send_request(path, params = {})
|
11
|
+
Request.new(self, [path], params).send
|
12
|
+
end
|
13
|
+
|
14
|
+
def send_request_with_system_appid(path, params = {})
|
15
|
+
send_request(path, params.merge(appid: SYSTEM_APPID))
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_json(data, key)
|
19
|
+
new_data = data.clone
|
20
|
+
new_data[key] = new_data[key].to_json
|
21
|
+
new_data
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Jelastic
|
2
|
+
module Serializers
|
3
|
+
class Base
|
4
|
+
private
|
5
|
+
|
6
|
+
def clean(hash = {})
|
7
|
+
new_hash = {}
|
8
|
+
|
9
|
+
hash.each do |key, value|
|
10
|
+
if value.respond_to?(:to_hash) && value.length > 0
|
11
|
+
new_hash[key] = clean(value)
|
12
|
+
elsif value.respond_to?(:to_ary) && value[0].respond_to?(:to_hash)
|
13
|
+
new_hash[key] = []
|
14
|
+
value.each do |v|
|
15
|
+
new_hash[key] << clean(v)
|
16
|
+
end
|
17
|
+
elsif !value.nil?
|
18
|
+
new_hash[key] = value
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
new_hash
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Jelastic
|
2
|
+
module Serializers
|
3
|
+
class Environment < Base
|
4
|
+
attr_reader :environment
|
5
|
+
|
6
|
+
def initialize(environment)
|
7
|
+
@environment = environment
|
8
|
+
end
|
9
|
+
|
10
|
+
def serialize
|
11
|
+
hash = {
|
12
|
+
actionkey: environment.action_key,
|
13
|
+
env: env_hash,
|
14
|
+
nodes: []
|
15
|
+
}
|
16
|
+
|
17
|
+
environment.nodes.each do |node|
|
18
|
+
if node.docker?
|
19
|
+
hash[:nodes] << docker_node_hash(node)
|
20
|
+
else
|
21
|
+
hash[:nodes] << node_hash(node)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
clean(hash)
|
26
|
+
end
|
27
|
+
|
28
|
+
def env_hash
|
29
|
+
{
|
30
|
+
region: environment.region,
|
31
|
+
ishaenabled: environment.high_availability?,
|
32
|
+
engine: environment.engine,
|
33
|
+
displayName: environment.display_name,
|
34
|
+
sslstate: environment.ssl?,
|
35
|
+
shortdomain: environment.short_domain
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
def node_hash(node)
|
40
|
+
{
|
41
|
+
extip: node.public_ip?,
|
42
|
+
count: node.count,
|
43
|
+
fixedCloudlets: node.fixed_cloudlets,
|
44
|
+
flexibleCloudlets: node.flexible_cloudlets,
|
45
|
+
displayName: node.display_name,
|
46
|
+
nodeType: node.type
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def docker_node_hash(node)
|
51
|
+
node_hash(node).merge(
|
52
|
+
{
|
53
|
+
docker: {
|
54
|
+
cmd: node.cmd,
|
55
|
+
image: node.image,
|
56
|
+
links: node.links,
|
57
|
+
env: node.envs,
|
58
|
+
registry: node.registry.to_h,
|
59
|
+
nodeGroup: node.group
|
60
|
+
}
|
61
|
+
}
|
62
|
+
)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Jelastic
|
2
|
+
class User
|
3
|
+
attr_reader :uid, :email, :session, :status
|
4
|
+
|
5
|
+
def initialize(params = {})
|
6
|
+
@uid = params.fetch('uid')
|
7
|
+
@email = params.fetch('email')
|
8
|
+
@session = params.fetch('session')
|
9
|
+
@status = params.fetch('status')
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jelastic
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.pre.dev
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Marcin Prokop
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-08-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.12'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.12'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.5'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- m.prokop@visuality.pl
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".ruby-version"
|
65
|
+
- ".travis.yml"
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- bin/console
|
71
|
+
- bin/setup
|
72
|
+
- jelastic.gemspec
|
73
|
+
- lib/jelastic.rb
|
74
|
+
- lib/jelastic/client.rb
|
75
|
+
- lib/jelastic/docker_node.rb
|
76
|
+
- lib/jelastic/environment.rb
|
77
|
+
- lib/jelastic/node.rb
|
78
|
+
- lib/jelastic/request.rb
|
79
|
+
- lib/jelastic/request_error.rb
|
80
|
+
- lib/jelastic/rest/api.rb
|
81
|
+
- lib/jelastic/rest/authentication.rb
|
82
|
+
- lib/jelastic/rest/control.rb
|
83
|
+
- lib/jelastic/rest/utils.rb
|
84
|
+
- lib/jelastic/serializers/base.rb
|
85
|
+
- lib/jelastic/serializers/environment.rb
|
86
|
+
- lib/jelastic/user.rb
|
87
|
+
- lib/jelastic/version.rb
|
88
|
+
homepage: https://github.com/visualitypl/jelastic
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.3.1
|
106
|
+
requirements: []
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.5.1
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: Ruby wrapper for Jelastic API
|
112
|
+
test_files: []
|