orizuru 0.1.3 → 0.1.4

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: 952e4ef524ca5d49b35317f5ac290750ddff9bb3
4
- data.tar.gz: cf0e5d0e223d29eb0db6b84334d41ee0aea5e3b2
3
+ metadata.gz: 64486b93794ae7c3ff02cea29863fd53a01679bf
4
+ data.tar.gz: bae94d4bcaf59524e08c40eeac1d90d711f6e2cf
5
5
  SHA512:
6
- metadata.gz: 963c7f2f1b3bc45fd4d49b1a671bb27bc49110555afabb3d50cb836d853d3a825afa8803b9a84515ec8550216fc8b53a2c64dde6050814f864a183e0add03640
7
- data.tar.gz: 2ca9f763d44d80d6ad632f8202fbe0a6a4049c73cc6c8237b540441b11c0a56debd8ab391dbf100bbdae63ce353ebc84e922cd80ecb42ea29c4cba3738cb51b2
6
+ metadata.gz: 1564df3ff154aeca1e89bf43c3351e49e4d94d88c740160035cd87216190d4888ed058d57fb7d75ea9316590f3b87a1dcb534b80ebf3463ecdf5aef4943f1bce
7
+ data.tar.gz: a17041a866a171ec0a05d8273aac457b940f1bcfebf9552219e925660a07aaa1a89422a7358b9bec680e34c6ffc6f8d8f7ec57dbc66710a723c11d0fefea5140
data/lib/example.rb CHANGED
@@ -2,9 +2,15 @@ require 'Orizuru'
2
2
  client = Orizuru.create('http://192.168.50.4:8080', 'a99b101ccea0d8327831c4a12472c7cc8fbb425389772afc56862307277ef9b3')
3
3
 
4
4
  client.apps.each do |app|
5
- p app.name
6
- p app.repository
5
+ app.name
6
+ app.repository
7
7
  app.units.each do |unit|
8
- p unit.id
8
+ unit.id
9
9
  end
10
10
  end
11
+
12
+
13
+ app = client.app 'tsuru-dashboard'
14
+ app.name
15
+
16
+ app.restart
data/lib/orizuru.rb CHANGED
@@ -17,7 +17,7 @@ module Orizuru
17
17
  end
18
18
 
19
19
  conn.authorization :Bearer, token
20
- conn.response :json
20
+ # conn.response :json
21
21
 
22
22
  Orizuru::Client.new(conn)
23
23
  end
data/lib/orizuru/app.rb CHANGED
@@ -2,8 +2,15 @@ module Orizuru
2
2
  class App
3
3
  attr_reader :name, :ip, :cname, :repository, :units
4
4
 
5
- def initialize(name, ip, cname, repository, units)
5
+ def initialize(connection, name, ip, cname, repository, units)
6
+ @connection = connection
6
7
  @name, @ip, @cname, @repository, @units = name, ip, cname, repository, units
7
8
  end
9
+
10
+ def restart
11
+ units.each do |unit|
12
+ @connection.post '/apps/%s/restart' % @name
13
+ end
14
+ end
8
15
  end
9
16
  end
@@ -23,13 +23,15 @@ module Orizuru
23
23
  # @return [Orizuru::App]
24
24
  def app(app_name)
25
25
  app = (@connection.get '/apps/%s' % app_name).body
26
+ p app
26
27
 
27
28
  units = []
28
29
  app['units'].each do |unit|
29
- units.push Unit.new(unit['ID'], unit['Name'], unit['Status'])
30
+ units.push Unit.new(unit['ID'], unit['Name'], unit['Status'], unit['ProcessName'])
30
31
  end
31
32
 
32
- App.new(app['name'],
33
+ App.new(@connection,
34
+ app['name'],
33
35
  app['ip'],
34
36
  app['cname'],
35
37
  app['repository'],
data/lib/orizuru/unit.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  module Orizuru
2
2
  class Unit
3
- attr_reader :id, :name, :status
3
+ attr_reader :id, :name, :status, :processName
4
4
 
5
- def initialize(id, name, status)
6
- @id, @name, @status = id, name, status
5
+ def initialize(id, name, status, processName)
6
+ @id, @name, @status, @processName = id, name, status, processName
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Orizuru
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orizuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mori Reo