diplomat 0.10.2 → 0.11.0

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: 1eb927df5c75548886b88a45edf78761bbdcadd4
4
- data.tar.gz: 238e8ccd42b9c2992df940a69138d266c80d2bfd
3
+ metadata.gz: 445d464dc2988296098c16f891bb2b46720f692c
4
+ data.tar.gz: a4ee11cee9896935714210c1c59e7ddeb61cf986
5
5
  SHA512:
6
- metadata.gz: c7e286e9d62286885cac0494de1200f1b72977b52ca18158b4dccbd89da9ba01177c6876ee8930f11a52937a3932b6720a46b60eabddbc2ac433855ea246d67c
7
- data.tar.gz: 16d0a2274eab52d10bd2fa6a2c4f805a541274fa17fccafe0de6b67344b7c8af2178007a2981f61c1f8567e95e2f782da02a5032d8f52a4f8788865f7ef570f0
6
+ metadata.gz: 1aed47485771894373cb7d45962d25462ac052943ae8a8be07c1b8e2cd44243f78c82f9872dff1036394da000f304391b0bebd26c6e4cf9cacb00f59e87f8b96
7
+ data.tar.gz: 7d81ef5a30156f58b43bb3668b40c2f8c0291f024d9146c50720d02d856b71541d2927c17027ccbf7e6740dafb2d5598b65ff947e7b45ab8aa9576d36425d930
data/README.md CHANGED
@@ -107,6 +107,16 @@ Or destroying a session:
107
107
  Diplomat::Session.destroy("fc5ca01a-c317-39ea-05e8-221da00d3a12")
108
108
  ```
109
109
 
110
+ Renew a session:
111
+ ```ruby
112
+ Diplomat::Session.renew(sessionid)
113
+ ```
114
+
115
+ List sessions:
116
+ ```ruby
117
+ Diplomat::Session.list.each {|session| puts "#{session["ID"]} #{session["Name"]}"}
118
+ ```
119
+
110
120
  ### Locks
111
121
 
112
122
  Acquire a lock:
@@ -3,7 +3,7 @@ require 'faraday'
3
3
  module Diplomat
4
4
  class Session < Diplomat::RestClient
5
5
 
6
- @access_methods = [ :create, :destroy ]
6
+ @access_methods = [ :create, :destroy, :list, :renew ]
7
7
 
8
8
  # Create a new session
9
9
  # @param value [Object] hash or json representation of the session arguments
@@ -28,5 +28,25 @@ module Diplomat
28
28
  end
29
29
  return raw.body
30
30
  end
31
+
32
+ # List sessions
33
+ # @return [Struct]
34
+ def list
35
+ raw = @conn.get do |req|
36
+ req.url "/v1/session/list/"
37
+ end
38
+ JSON.parse(raw.body)
39
+ end
40
+
41
+ # Renew session
42
+ # @param id [String] session id
43
+ # @return [Struct]
44
+
45
+ def renew id
46
+ raw = @conn.put do |req|
47
+ req.url = "/v1/session/renew/#{id}"
48
+ end
49
+ JSON.parse(raw.body)
50
+ end
31
51
  end
32
52
  end
@@ -1,3 +1,3 @@
1
1
  module Diplomat
2
- VERSION = "0.10.2"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: diplomat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hamelink
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-18 00:00:00.000000000 Z
11
+ date: 2015-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler