sfpagent 0.1.6 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sfpagent might be problematic. Click here for more details.
- data/README.md +9 -9
- data/VERSION +1 -1
- data/bin/sfpagent +5 -3
- data/lib/sfpagent/agent.rb +252 -153
- data/lib/sfpagent/bsig.rb +301 -12
- data/lib/sfpagent/module.rb +7 -3
- data/lib/sfpagent/runtime.rb +113 -89
- data/lib/sfpagent/sfplanner.rb +85 -0
- data/lib/sfpagent.rb +1 -0
- data/sfpagent.gemspec +1 -1
- metadata +5 -4
data/README.md
CHANGED
@@ -4,20 +4,20 @@ SFP Agent for Ruby
|
|
4
4
|
- [Version](https://github.com/herry13/sfpagent/blob/master/VERSION)
|
5
5
|
- License: [BSD License](https://github.com/herry13/sfpagent/blob/master/LICENSE)
|
6
6
|
|
7
|
-
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/sfpagent.png)](http://badge.fury.io/rb/sfpagent)
|
8
8
|
|
9
|
-
|
10
|
-
|
9
|
+
A Ruby script and library of SFP agent. The agent could be accessed through HTTP RESTful API.
|
10
|
+
|
11
|
+
With this agent, you could get the state and deploy configuration of particular software components.
|
12
|
+
Each configuration should be specified in [SFP language](https://github.com/herry13/sfp).
|
11
13
|
Every software component could have a set of methods which could be called through HTTP request.
|
12
14
|
|
13
15
|
|
14
16
|
Requirements
|
15
17
|
------------
|
16
18
|
- Ruby (>= 1.8.7)
|
17
|
-
-
|
19
|
+
- Ruby Gems
|
18
20
|
- sfp (>= 0.3.0)
|
19
|
-
- antlr3
|
20
|
-
- json
|
21
21
|
|
22
22
|
|
23
23
|
To install
|
@@ -48,9 +48,9 @@ Cached directory keeps all agent's local data such as:
|
|
48
48
|
- model file
|
49
49
|
- installed modules
|
50
50
|
|
51
|
-
In default, the agent will use (and created if not exist):
|
52
|
-
-
|
53
|
-
-
|
51
|
+
In default, the agent will use (and created if not exist) the following directory as _cached directory_:
|
52
|
+
- **~/.sfpagent**, when the daemon is running with non-root user,
|
53
|
+
- **/var/sfpagent**, when the daemon is running with root user.
|
54
54
|
|
55
55
|
|
56
56
|
HTTP RESTful API
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.9
|
data/bin/sfpagent
CHANGED
@@ -18,11 +18,11 @@ EOS
|
|
18
18
|
opt :stop, "Stop the daemon agent."
|
19
19
|
opt :restart, "Restart the daemon agent."
|
20
20
|
opt :status, "Print the status of the daemon agent."
|
21
|
+
opt :port, "Port number of the daemon agent should listen to.", :short => '-p', :default => Sfp::Agent::DefaultPort
|
21
22
|
opt :state, "Given a model, print the state of all modules. (Note: [model-file] should be specified.)"
|
22
23
|
opt :execute, "Given a model, execute a plan in given file. (Note: [model-file] should be specified.)"
|
23
|
-
opt :pretty, "Print the result in a pretty JSON format."
|
24
|
-
opt :
|
25
|
-
opt :daemon, "Start the agent as a daemon.", :default => true
|
24
|
+
opt :pretty, "Print the result in a pretty JSON format.", :short => '-r'
|
25
|
+
#opt :daemon, "Start the agent as a daemon.", :default => true
|
26
26
|
opt :ssl, "Set the agent to use HTTPS instead of HTTP.", :default => false
|
27
27
|
opt :certfile, "Certificate file for HTTPS.", :default => ''
|
28
28
|
opt :keyfile, "Private key file for HTTPS.", :default => ''
|
@@ -40,12 +40,14 @@ model_file = ARGV[0].to_s
|
|
40
40
|
plan_file = ARGV[1].to_s
|
41
41
|
|
42
42
|
if opts[:start]
|
43
|
+
opts[:daemon] = true
|
43
44
|
Sfp::Agent.start(opts)
|
44
45
|
|
45
46
|
elsif opts[:stop]
|
46
47
|
Sfp::Agent.stop
|
47
48
|
|
48
49
|
elsif opts[:restart]
|
50
|
+
opts[:daemon] = true
|
49
51
|
Sfp::Agent.stop
|
50
52
|
Sfp::Agent.start(opts)
|
51
53
|
|