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 +4 -4
- data/README.md +10 -0
- data/lib/diplomat/session.rb +21 -1
- data/lib/diplomat/version.rb +1 -1
- 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: 445d464dc2988296098c16f891bb2b46720f692c
|
4
|
+
data.tar.gz: a4ee11cee9896935714210c1c59e7ddeb61cf986
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
data/lib/diplomat/session.rb
CHANGED
@@ -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
|
data/lib/diplomat/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|