choria-mcorpc-support 2.23.3 → 2.24.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.
Files changed (59) hide show
  1. checksums.yaml +5 -5
  2. data/lib/mcollective.rb +3 -3
  3. data/lib/mcollective/agent/choria_provision.ddl +214 -0
  4. data/lib/mcollective/agent/choria_provision.json +272 -0
  5. data/lib/mcollective/agent/choria_util.ddl +226 -107
  6. data/lib/mcollective/agent/choria_util.json +125 -25
  7. data/lib/mcollective/agent/rpcutil.ddl +242 -183
  8. data/lib/mcollective/agent/rpcutil.json +53 -57
  9. data/lib/mcollective/agent/scout.ddl +1 -1
  10. data/lib/mcollective/agent/scout.json +108 -136
  11. data/lib/mcollective/application/find.rb +1 -1
  12. data/lib/mcollective/application/plugin.rb +8 -173
  13. data/lib/mcollective/client.rb +1 -1
  14. data/lib/mcollective/config.rb +145 -103
  15. data/lib/mcollective/ddl.rb +0 -1
  16. data/lib/mcollective/discovery.rb +11 -63
  17. data/lib/mcollective/discovery/broadcast.ddl +11 -0
  18. data/lib/mcollective/discovery/choria.ddl +6 -4
  19. data/lib/mcollective/discovery/delegate.ddl +13 -0
  20. data/lib/mcollective/discovery/delegate.rb +72 -0
  21. data/lib/mcollective/discovery/external.ddl +13 -0
  22. data/lib/mcollective/discovery/file.ddl +13 -0
  23. data/lib/mcollective/discovery/flatfile.ddl +7 -5
  24. data/lib/mcollective/discovery/inventory.ddl +13 -0
  25. data/lib/mcollective/discovery/mc.ddl +3 -3
  26. data/lib/mcollective/log.rb +1 -2
  27. data/lib/mcollective/optionparser.rb +1 -1
  28. data/lib/mcollective/pluginpackager/forge_packager.rb +1 -1
  29. data/lib/mcollective/rpc/client.rb +4 -2
  30. data/lib/mcollective/util.rb +2 -4
  31. data/lib/mcollective/util/choria.rb +14 -8
  32. data/lib/mcollective/util/tasks_support.rb +15 -2
  33. metadata +11 -29
  34. data/lib/mcollective/data.rb +0 -96
  35. data/lib/mcollective/data/agent_data.ddl +0 -22
  36. data/lib/mcollective/data/agent_data.rb +0 -17
  37. data/lib/mcollective/data/base.rb +0 -68
  38. data/lib/mcollective/data/bolt_task_data.ddl +0 -90
  39. data/lib/mcollective/data/bolt_task_data.rb +0 -32
  40. data/lib/mcollective/data/collective_data.ddl +0 -20
  41. data/lib/mcollective/data/collective_data.rb +0 -9
  42. data/lib/mcollective/data/fact_data.ddl +0 -28
  43. data/lib/mcollective/data/fact_data.rb +0 -55
  44. data/lib/mcollective/data/fstat_data.ddl +0 -89
  45. data/lib/mcollective/data/fstat_data.rb +0 -54
  46. data/lib/mcollective/data/result.rb +0 -50
  47. data/lib/mcollective/ddl/dataddl.rb +0 -56
  48. data/lib/mcollective/discovery/choria.rb +0 -223
  49. data/lib/mcollective/discovery/flatfile.rb +0 -47
  50. data/lib/mcollective/discovery/stdin.ddl +0 -11
  51. data/lib/mcollective/discovery/stdin.rb +0 -67
  52. data/lib/mcollective/generators.rb +0 -7
  53. data/lib/mcollective/generators/agent_generator.rb +0 -50
  54. data/lib/mcollective/generators/base.rb +0 -45
  55. data/lib/mcollective/generators/data_generator.rb +0 -50
  56. data/lib/mcollective/generators/templates/action_snippet.erb +0 -13
  57. data/lib/mcollective/generators/templates/data_input_snippet.erb +0 -7
  58. data/lib/mcollective/generators/templates/ddl.erb +0 -8
  59. data/lib/mcollective/generators/templates/plugin.erb +0 -7
@@ -1,152 +1,271 @@
1
- metadata :name => "choria_util",
2
- :description => "Choria Utilities",
3
- :author => "R.I.Pienaar <rip@devco.net>",
4
- :license => "Apache-2.0",
5
- :version => "0.19.0",
6
- :url => "https://choria.io",
7
- :timeout => 2
1
+ metadata :name => "choria_util",
2
+ :description => "Choria Utilities",
3
+ :author => "R.I.Pienaar <rip@devco.net>",
4
+ :license => "Apache-2.0",
5
+ :version => "0.22.0",
6
+ :url => "https://choria.io",
7
+ :timeout => 2
8
8
 
9
- requires :mcollective => "2.9.0"
10
9
 
11
- action "machine_transition", :description => "Attempts to force a transition in a hosted Choria Autonomous Agent" do
10
+ action "info", :description => "Choria related information from the running Daemon and Middleware" do
11
+ display :failed
12
+
13
+
14
+
15
+ output :choria_version,
16
+ :description => "Choria version",
17
+ :type => "string",
18
+ :display_as => "Choria Version"
19
+
20
+ output :client_flavour,
21
+ :description => "Middleware client library flavour",
22
+ :type => "string",
23
+ :display_as => "Middleware Client Flavour"
24
+
25
+ output :client_options,
26
+ :description => "Active Middleware client options",
27
+ :type => "hash",
28
+ :display_as => "Middleware Client Options"
29
+
30
+ output :client_stats,
31
+ :description => "Middleware client statistics",
32
+ :type => "hash",
33
+ :display_as => "Middleware Client Stats"
34
+
35
+ output :client_version,
36
+ :description => "Middleware client library version",
37
+ :type => "string",
38
+ :display_as => "Middleware Client Library Version"
39
+
40
+ output :connected_server,
41
+ :description => "Connected middleware server",
42
+ :type => "string",
43
+ :display_as => "Connected Broker"
44
+
45
+ output :connector,
46
+ :description => "Connector plugin",
47
+ :type => "string",
48
+ :display_as => "Connector"
49
+
50
+ output :connector_tls,
51
+ :description => "If the connector is running with TLS security enabled",
52
+ :type => "boolean",
53
+ :display_as => "Connector TLS"
54
+
55
+ output :facter_command,
56
+ :description => "Command used for Facter",
57
+ :type => "string",
58
+ :display_as => "Facter"
59
+
60
+ output :facter_domain,
61
+ :description => "Facter domain",
62
+ :type => "string",
63
+ :display_as => "Facter Domain"
64
+
65
+ output :middleware_servers,
66
+ :description => "Middleware Servers configured or discovered",
67
+ :type => "array",
68
+ :display_as => "Middleware"
69
+
70
+ output :path,
71
+ :description => "Active OS PATH",
72
+ :type => "string",
73
+ :display_as => "Path"
74
+
75
+ output :secure_protocol,
76
+ :description => "If the protocol is running with PKI security enabled",
77
+ :type => "boolean",
78
+ :display_as => "Protocol Secure"
79
+
80
+ output :security,
81
+ :description => "Security Provider plugin",
82
+ :type => "string",
83
+ :display_as => "Security Provider"
84
+
85
+ output :srv_domain,
86
+ :description => "Configured SRV domain",
87
+ :type => "string",
88
+ :display_as => "SRV Domain"
89
+
90
+ output :using_srv,
91
+ :description => "Indicates if SRV records are considered",
92
+ :type => "boolean",
93
+ :display_as => "SRV Used"
94
+
95
+ summarize do
96
+ aggregate summary(:choria_version)
97
+ aggregate summary(:client_version)
98
+ aggregate summary(:client_flavour)
99
+ aggregate summary(:connected_server)
100
+ aggregate summary(:srv_domain)
101
+ aggregate summary(:using_srv)
102
+ aggregate summary(:secure_protocol)
103
+ aggregate summary(:connector_tls)
104
+ end
105
+ end
106
+
107
+ action "machine_state", :description => "Retrieves the current state of a specific Choria Autonomous Agent" do
108
+ display :ok
109
+
12
110
  input :instance,
13
- :prompt => "Instance ID",
111
+ :prompt => "Instance ID",
14
112
  :description => "Machine Instance ID",
15
- :type => :string,
16
- :validation => '^.+-.+-.+-.+-.+$',
17
- :maxlength => 36,
18
- :optional => true
113
+ :type => :string,
114
+ :validation => '^.+-.+-.+-.+-.+$',
115
+ :maxlength => 36,
116
+ :optional => true
19
117
 
20
- input :version,
21
- :prompt => "Version",
22
- :description => "Machine Version",
23
- :type => :string,
24
- :validation => '^\d+\.\d+\.\d+$',
25
- :maxlength => 20,
26
- :optional => true
27
118
 
28
119
  input :name,
29
- :prompt => "Name",
120
+ :prompt => "Name",
30
121
  :description => "Machine Name",
31
- :type => :string,
32
- :validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
33
- :maxlength => 128,
34
- :optional => true
122
+ :type => :string,
123
+ :validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
124
+ :maxlength => 128,
125
+ :optional => true
126
+
35
127
 
36
128
  input :path,
37
- :prompt => "Path",
129
+ :prompt => "Path",
38
130
  :description => "Machine Path",
39
- :type => :string,
40
- :validation => '.+',
41
- :maxlength => 512,
42
- :optional => true
131
+ :type => :string,
132
+ :validation => '.+',
133
+ :maxlength => 512,
134
+ :optional => true
43
135
 
44
- input :transition,
45
- :prompt => "Transition Name",
46
- :description => "The transition event to send to the machine",
47
- :type => :string,
48
- :validation => '^[a-zA-Z][a-zA-Z0-9_-]+$',
49
- :maxlength => 128,
50
- :optional => false
51
136
 
52
- output :success,
53
- :description => "Indicates if the transition was successfully accepted",
54
- :display_as => "Accepted"
137
+
138
+
139
+ output :available_transitions,
140
+ :description => "The list of available transitions this autonomous agent can make",
141
+ :type => "array",
142
+ :display_as => "Available Transitions"
143
+
144
+ output :current_state,
145
+ :description => "The Choria Scout specific state for Scout checks",
146
+ :display_as => "Scout State"
147
+
148
+ output :id,
149
+ :description => "The unique running ID of the autonomous agent",
150
+ :type => "string",
151
+ :display_as => "ID"
152
+
153
+ output :name,
154
+ :description => "The name of the autonomous agent",
155
+ :type => "string",
156
+ :display_as => "Name"
157
+
158
+ output :path,
159
+ :description => "The location on disk where the autonomous agent is stored",
160
+ :type => "string",
161
+ :display_as => "Path"
162
+
163
+ output :scout,
164
+ :description => "True when this autonomous agent represents a Choria Scout Check",
165
+ :type => "boolean",
166
+ :display_as => "Scout Check"
167
+
168
+ output :start_time,
169
+ :description => "The time the autonomous agent was started in unix seconds",
170
+ :type => "string",
171
+ :display_as => "Started"
172
+
173
+ output :state,
174
+ :description => "The current state the agent is in",
175
+ :type => "string",
176
+ :display_as => "State"
177
+
178
+ output :version,
179
+ :description => "The version of the autonomous agent",
180
+ :type => "string",
181
+ :display_as => "Version"
182
+
183
+ summarize do
184
+ aggregate summary(:state)
185
+ aggregate summary(:name)
186
+ aggregate summary(:version)
187
+ end
55
188
  end
56
189
 
57
190
  action "machine_states", :description => "States of the hosted Choria Autonomous Agents" do
58
191
  display :always
59
192
 
60
- output :machine_names,
61
- :description => "List of running machine names",
62
- :display_as => "Machine Names"
193
+
63
194
 
64
195
  output :machine_ids,
65
196
  :description => "List of running machine IDs",
66
- :display_as => "Machine IDs"
197
+ :type => "array",
198
+ :display_as => "Machine IDs"
199
+
200
+ output :machine_names,
201
+ :description => "List of running machine names",
202
+ :type => "array",
203
+ :display_as => "Machine Names"
67
204
 
68
205
  output :states,
69
206
  :description => "Hash map of machine statusses indexed by machine ID",
70
- :display_as => "Machine States"
207
+ :type => "hash",
208
+ :display_as => "Machine States"
71
209
 
72
210
  summarize do
73
211
  aggregate summary(:machine_names)
74
212
  end
75
213
  end
76
214
 
77
- action "info", :description => "Choria related information from the running Daemon and Middleware" do
78
- output :security,
79
- :description => "Security Provider plugin",
80
- :display_as => "Security Provider"
81
-
82
- output :secure_protocol,
83
- :description => "If the protocol is running with PKI security enabled",
84
- :display_as => "Protocol Secure"
215
+ action "machine_transition", :description => "Attempts to force a transition in a hosted Choria Autonomous Agent" do
216
+ display :failed
85
217
 
86
- output :connector,
87
- :description => "Connector plugin",
88
- :display_as => "Connector"
218
+ input :instance,
219
+ :prompt => "Instance ID",
220
+ :description => "Machine Instance ID",
221
+ :type => :string,
222
+ :validation => '^.+-.+-.+-.+-.+$',
223
+ :maxlength => 36,
224
+ :optional => true
89
225
 
90
- output :connector_tls,
91
- :description => "If the connector is running with TLS security enabled",
92
- :display_as => "Connector TLS"
93
226
 
94
- output :path,
95
- :description => "Active OS PATH",
96
- :display_as => "Path"
227
+ input :name,
228
+ :prompt => "Name",
229
+ :description => "Machine Name",
230
+ :type => :string,
231
+ :validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
232
+ :maxlength => 128,
233
+ :optional => true
97
234
 
98
- output :choria_version,
99
- :description => "Choria version",
100
- :display_as => "Choria Version"
101
235
 
102
- output :client_version,
103
- :description => "Middleware client library version",
104
- :display_as => "Middleware Client Library Version"
236
+ input :path,
237
+ :prompt => "Path",
238
+ :description => "Machine Path",
239
+ :type => :string,
240
+ :validation => '.+',
241
+ :maxlength => 512,
242
+ :optional => true
105
243
 
106
- output :client_flavour,
107
- :description => "Middleware client gem flavour",
108
- :display_as => "Middleware Client Flavour"
109
244
 
110
- output :client_options,
111
- :description => "Active Middleware client gem options",
112
- :display_as => "Middleware Client Options"
113
-
114
- output :connected_server,
115
- :description => "Connected middleware server",
116
- :display_as => "Connected Broker"
245
+ input :transition,
246
+ :prompt => "Transition Name",
247
+ :description => "The transition event to send to the machine",
248
+ :type => :string,
249
+ :validation => '^[a-zA-Z][a-zA-Z0-9_-]+$',
250
+ :maxlength => 128,
251
+ :optional => false
117
252
 
118
- output :client_stats,
119
- :description => "Middleware client gem statistics",
120
- :display_as => "Middleware Client Stats"
121
253
 
122
- output :facter_domain,
123
- :description => "Facter domain",
124
- :display_as => "Facter Domain"
254
+ input :version,
255
+ :prompt => "Version",
256
+ :description => "Machine Version",
257
+ :type => :string,
258
+ :validation => '^\d+\.\d+\.\d+$',
259
+ :maxlength => 20,
260
+ :optional => true
125
261
 
126
- output :facter_command,
127
- :description => "Command used for Facter",
128
- :display_as => "Facter"
129
262
 
130
- output :srv_domain,
131
- :description => "Configured SRV domain",
132
- :display_as => "SRV Domain"
133
263
 
134
- output :using_srv,
135
- :description => "Indicates if SRV records are considered",
136
- :display_as => "SRV Used"
137
264
 
138
- output :middleware_servers,
139
- :description => "Middleware Servers configured or discovered",
140
- :display_as => "Middleware"
265
+ output :success,
266
+ :description => "Indicates if the transition was successfully accepted",
267
+ :type => "boolean",
268
+ :display_as => "Accepted"
141
269
 
142
- summarize do
143
- aggregate summary(:choria_version)
144
- aggregate summary(:client_version)
145
- aggregate summary(:client_flavour)
146
- aggregate summary(:connected_server)
147
- aggregate summary(:srv_domain)
148
- aggregate summary(:using_srv)
149
- aggregate summary(:secure_protocol)
150
- aggregate summary(:connector_tls)
151
- end
152
270
  end
271
+
@@ -5,7 +5,7 @@
5
5
  "description": "Choria Utilities",
6
6
  "author": "R.I.Pienaar <rip@devco.net>",
7
7
  "license": "Apache-2.0",
8
- "version": "0.19.0",
8
+ "version": "0.22.0",
9
9
  "url": "https://choria.io",
10
10
  "timeout": 2
11
11
  },
@@ -18,82 +18,82 @@
18
18
  "security": {
19
19
  "description": "Security Provider plugin",
20
20
  "display_as": "Security Provider",
21
- "default": null
21
+ "type": "string"
22
22
  },
23
23
  "secure_protocol": {
24
24
  "description": "If the protocol is running with PKI security enabled",
25
25
  "display_as": "Protocol Secure",
26
- "default": null
26
+ "type": "boolean"
27
27
  },
28
28
  "connector": {
29
29
  "description": "Connector plugin",
30
30
  "display_as": "Connector",
31
- "default": null
31
+ "type": "string"
32
32
  },
33
33
  "connector_tls": {
34
34
  "description": "If the connector is running with TLS security enabled",
35
35
  "display_as": "Connector TLS",
36
- "default": null
36
+ "type": "boolean"
37
37
  },
38
38
  "path": {
39
39
  "description": "Active OS PATH",
40
40
  "display_as": "Path",
41
- "default": null
41
+ "type": "string"
42
42
  },
43
43
  "choria_version": {
44
44
  "description": "Choria version",
45
45
  "display_as": "Choria Version",
46
- "default": null
46
+ "type": "string"
47
47
  },
48
48
  "client_version": {
49
49
  "description": "Middleware client library version",
50
50
  "display_as": "Middleware Client Library Version",
51
- "default": null
51
+ "type": "string"
52
52
  },
53
53
  "client_flavour": {
54
- "description": "Middleware client gem flavour",
54
+ "description": "Middleware client library flavour",
55
55
  "display_as": "Middleware Client Flavour",
56
- "default": null
56
+ "type": "string"
57
57
  },
58
58
  "client_options": {
59
- "description": "Active Middleware client gem options",
59
+ "description": "Active Middleware client options",
60
60
  "display_as": "Middleware Client Options",
61
- "default": null
61
+ "type": "hash"
62
62
  },
63
63
  "connected_server": {
64
64
  "description": "Connected middleware server",
65
65
  "display_as": "Connected Broker",
66
- "default": null
66
+ "type": "string"
67
67
  },
68
68
  "client_stats": {
69
- "description": "Middleware client gem statistics",
69
+ "description": "Middleware client statistics",
70
70
  "display_as": "Middleware Client Stats",
71
- "default": null
71
+ "type": "hash"
72
72
  },
73
73
  "facter_domain": {
74
74
  "description": "Facter domain",
75
75
  "display_as": "Facter Domain",
76
- "default": null
76
+ "type": "string"
77
77
  },
78
78
  "facter_command": {
79
79
  "description": "Command used for Facter",
80
80
  "display_as": "Facter",
81
- "default": null
81
+ "type": "string"
82
82
  },
83
83
  "srv_domain": {
84
84
  "description": "Configured SRV domain",
85
85
  "display_as": "SRV Domain",
86
- "default": null
86
+ "type": "string"
87
87
  },
88
88
  "using_srv": {
89
89
  "description": "Indicates if SRV records are considered",
90
90
  "display_as": "SRV Used",
91
- "default": null
91
+ "type": "boolean"
92
92
  },
93
93
  "middleware_servers": {
94
94
  "description": "Middleware Servers configured or discovered",
95
95
  "display_as": "Middleware",
96
- "default": null
96
+ "type": "array"
97
97
  }
98
98
  },
99
99
  "display": "failed",
@@ -149,6 +149,106 @@
149
149
  }
150
150
  ]
151
151
  },
152
+ {
153
+ "action": "machine_state",
154
+ "description": "Retrieves the current state of a specific Choria Autonomous Agent",
155
+ "display": "ok",
156
+ "input": {
157
+ "instance": {
158
+ "prompt": "Instance ID",
159
+ "description": "Machine Instance ID",
160
+ "type": "string",
161
+ "default": null,
162
+ "optional": true,
163
+ "validation": "^.+-.+-.+-.+-.+$",
164
+ "maxlength": 36
165
+ },
166
+ "name": {
167
+ "prompt": "Name",
168
+ "description": "Machine Name",
169
+ "type": "string",
170
+ "default": null,
171
+ "optional": true,
172
+ "validation": "^[a-zA-Z][a-zA-Z0-9_-]+",
173
+ "maxlength": 128
174
+ },
175
+ "path": {
176
+ "prompt": "Path",
177
+ "description": "Machine Path",
178
+ "type": "string",
179
+ "default": null,
180
+ "optional": true,
181
+ "validation": ".+",
182
+ "maxlength": 512
183
+ }
184
+ },
185
+ "aggregate": [
186
+ {
187
+ "function": "summary",
188
+ "args": [
189
+ "state"
190
+ ]
191
+ },
192
+ {
193
+ "function": "summary",
194
+ "args": [
195
+ "name"
196
+ ]
197
+ },
198
+ {
199
+ "function": "summary",
200
+ "args": [
201
+ "version"
202
+ ]
203
+ }
204
+ ],
205
+ "output": {
206
+ "name": {
207
+ "type": "string",
208
+ "description": "The name of the autonomous agent",
209
+ "display_as": "Name"
210
+ },
211
+ "version": {
212
+ "type": "string",
213
+ "description": "The version of the autonomous agent",
214
+ "display_as": "Version"
215
+ },
216
+ "state": {
217
+ "type": "string",
218
+ "description": "The current state the agent is in",
219
+ "display_as": "State"
220
+ },
221
+ "path": {
222
+ "type": "string",
223
+ "description": "The location on disk where the autonomous agent is stored",
224
+ "display_as": "Path"
225
+ },
226
+ "id": {
227
+ "type": "string",
228
+ "description": "The unique running ID of the autonomous agent",
229
+ "display_as": "ID"
230
+ },
231
+ "start_time": {
232
+ "type": "string",
233
+ "description": "The time the autonomous agent was started in unix seconds",
234
+ "display_as": "Started"
235
+ },
236
+ "available_transitions": {
237
+ "type": "array",
238
+ "description": "The list of available transitions this autonomous agent can make",
239
+ "display_as": "Available Transitions"
240
+ },
241
+ "scout": {
242
+ "type": "boolean",
243
+ "description": "True when this autonomous agent represents a Choria Scout Check",
244
+ "display_as": "Scout Check"
245
+ },
246
+ "current_state": {
247
+ "description": "The Choria Scout specific state for Scout checks",
248
+ "display_as": "Scout State"
249
+ }
250
+ }
251
+ },
152
252
  {
153
253
  "action": "machine_states",
154
254
  "input": {
@@ -157,17 +257,17 @@
157
257
  "machine_names": {
158
258
  "description": "List of running machine names",
159
259
  "display_as": "Machine Names",
160
- "default": null
260
+ "type": "array"
161
261
  },
162
262
  "machine_ids": {
163
263
  "description": "List of running machine IDs",
164
264
  "display_as": "Machine IDs",
165
- "default": null
265
+ "type": "array"
166
266
  },
167
267
  "states": {
168
268
  "description": "Hash map of machine statusses indexed by machine ID",
169
269
  "display_as": "Machine States",
170
- "default": null
270
+ "type": "hash"
171
271
  }
172
272
  },
173
273
  "display": "always",
@@ -234,11 +334,11 @@
234
334
  "success": {
235
335
  "description": "Indicates if the transition was successfully accepted",
236
336
  "display_as": "Accepted",
237
- "default": null
337
+ "type": "boolean"
238
338
  }
239
339
  },
240
340
  "display": "failed",
241
341
  "description": "Attempts to force a transition in a hosted Choria Autonomous Agent"
242
342
  }
243
343
  ]
244
- }
344
+ }