choria-mcorpc-support 2.20.8 → 2.23.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcollective.rb +1 -1
- data/lib/mcollective/agent/bolt_tasks.ddl +235 -0
- data/lib/mcollective/agent/bolt_tasks.json +347 -0
- data/lib/mcollective/agent/bolt_tasks.rb +176 -0
- data/lib/mcollective/agent/choria_util.ddl +152 -0
- data/lib/mcollective/agent/choria_util.json +244 -0
- data/lib/mcollective/agent/rpcutil.ddl +7 -3
- data/lib/mcollective/agent/rpcutil.json +333 -0
- data/lib/mcollective/agent/scout.ddl +169 -0
- data/lib/mcollective/agent/scout.json +224 -0
- data/lib/mcollective/agents.rb +7 -6
- data/lib/mcollective/aggregate.rb +4 -4
- data/lib/mcollective/aggregate/average.rb +2 -2
- data/lib/mcollective/aggregate/base.rb +2 -2
- data/lib/mcollective/aggregate/result.rb +3 -3
- data/lib/mcollective/aggregate/result/collection_result.rb +2 -2
- data/lib/mcollective/aggregate/result/numeric_result.rb +2 -2
- data/lib/mcollective/aggregate/sum.rb +2 -2
- data/lib/mcollective/aggregate/summary.rb +3 -4
- data/lib/mcollective/application.rb +57 -21
- data/lib/mcollective/application/choria.rb +249 -0
- data/lib/mcollective/application/completion.rb +6 -6
- data/lib/mcollective/application/describe_filter.rb +20 -20
- data/lib/mcollective/application/facts.rb +19 -11
- data/lib/mcollective/application/federation.rb +239 -0
- data/lib/mcollective/application/find.rb +4 -4
- data/lib/mcollective/application/help.rb +3 -3
- data/lib/mcollective/application/inventory.rb +3 -341
- data/lib/mcollective/application/ping.rb +3 -77
- data/lib/mcollective/application/playbook.rb +207 -0
- data/lib/mcollective/application/plugin.rb +106 -106
- data/lib/mcollective/application/rpc.rb +3 -108
- data/lib/mcollective/application/tasks.rb +416 -0
- data/lib/mcollective/applications.rb +11 -10
- data/lib/mcollective/audit/choria.rb +33 -0
- data/lib/mcollective/cache.rb +2 -4
- data/lib/mcollective/client.rb +11 -10
- data/lib/mcollective/config.rb +21 -34
- data/lib/mcollective/connector/base.rb +2 -1
- data/lib/mcollective/connector/nats.ddl +9 -0
- data/lib/mcollective/connector/nats.rb +450 -0
- data/lib/mcollective/data.rb +8 -3
- data/lib/mcollective/data/agent_data.rb +1 -1
- data/lib/mcollective/data/base.rb +6 -5
- data/lib/mcollective/data/bolt_task_data.ddl +90 -0
- data/lib/mcollective/data/bolt_task_data.rb +32 -0
- data/lib/mcollective/data/collective_data.rb +1 -1
- data/lib/mcollective/data/fact_data.rb +6 -6
- data/lib/mcollective/data/fstat_data.rb +2 -4
- data/lib/mcollective/data/result.rb +7 -2
- data/lib/mcollective/ddl/agentddl.rb +5 -17
- data/lib/mcollective/ddl/base.rb +11 -14
- data/lib/mcollective/discovery.rb +12 -26
- data/lib/mcollective/discovery/choria.ddl +11 -0
- data/lib/mcollective/discovery/choria.rb +223 -0
- data/lib/mcollective/discovery/flatfile.rb +7 -8
- data/lib/mcollective/discovery/mc.rb +2 -2
- data/lib/mcollective/discovery/stdin.rb +17 -18
- data/lib/mcollective/exceptions.rb +13 -0
- data/lib/mcollective/facts/base.rb +9 -9
- data/lib/mcollective/facts/yaml_facts.rb +12 -12
- data/lib/mcollective/generators.rb +3 -3
- data/lib/mcollective/generators/agent_generator.rb +3 -4
- data/lib/mcollective/generators/base.rb +14 -15
- data/lib/mcollective/generators/data_generator.rb +5 -6
- data/lib/mcollective/log.rb +2 -2
- data/lib/mcollective/logger/base.rb +3 -2
- data/lib/mcollective/logger/console_logger.rb +10 -10
- data/lib/mcollective/logger/file_logger.rb +7 -7
- data/lib/mcollective/logger/syslog_logger.rb +11 -15
- data/lib/mcollective/matcher.rb +14 -14
- data/lib/mcollective/matcher/parser.rb +31 -41
- data/lib/mcollective/matcher/scanner.rb +69 -74
- data/lib/mcollective/message.rb +10 -17
- data/lib/mcollective/monkey_patches.rb +2 -4
- data/lib/mcollective/optionparser.rb +1 -0
- data/lib/mcollective/pluginmanager.rb +3 -5
- data/lib/mcollective/pluginpackager.rb +1 -3
- data/lib/mcollective/pluginpackager/agent_definition.rb +10 -11
- data/lib/mcollective/pluginpackager/forge_packager.rb +7 -9
- data/lib/mcollective/pluginpackager/standard_definition.rb +1 -2
- data/lib/mcollective/registration/base.rb +18 -16
- data/lib/mcollective/rpc.rb +2 -4
- data/lib/mcollective/rpc/actionrunner.rb +16 -18
- data/lib/mcollective/rpc/agent.rb +26 -43
- data/lib/mcollective/rpc/audit.rb +1 -0
- data/lib/mcollective/rpc/client.rb +67 -85
- data/lib/mcollective/rpc/helpers.rb +55 -62
- data/lib/mcollective/rpc/progress.rb +2 -2
- data/lib/mcollective/rpc/reply.rb +17 -19
- data/lib/mcollective/rpc/request.rb +7 -5
- data/lib/mcollective/rpc/result.rb +6 -8
- data/lib/mcollective/rpc/stats.rb +49 -58
- data/lib/mcollective/security/base.rb +29 -36
- data/lib/mcollective/security/choria.rb +765 -0
- data/lib/mcollective/shell.rb +9 -4
- data/lib/mcollective/signer/base.rb +28 -0
- data/lib/mcollective/signer/choria.rb +185 -0
- data/lib/mcollective/ssl.rb +8 -6
- data/lib/mcollective/util.rb +58 -55
- data/lib/mcollective/util/bolt_support.rb +176 -0
- data/lib/mcollective/util/bolt_support/plan_runner.rb +167 -0
- data/lib/mcollective/util/bolt_support/task_result.rb +94 -0
- data/lib/mcollective/util/bolt_support/task_results.rb +128 -0
- data/lib/mcollective/util/choria.rb +1103 -0
- data/lib/mcollective/util/indifferent_hash.rb +12 -0
- data/lib/mcollective/util/natswrapper.rb +242 -0
- data/lib/mcollective/util/playbook.rb +435 -0
- data/lib/mcollective/util/playbook/data_stores.rb +201 -0
- data/lib/mcollective/util/playbook/data_stores/base.rb +99 -0
- data/lib/mcollective/util/playbook/data_stores/consul_data_store.rb +88 -0
- data/lib/mcollective/util/playbook/data_stores/environment_data_store.rb +33 -0
- data/lib/mcollective/util/playbook/data_stores/etcd_data_store.rb +42 -0
- data/lib/mcollective/util/playbook/data_stores/file_data_store.rb +106 -0
- data/lib/mcollective/util/playbook/data_stores/shell_data_store.rb +103 -0
- data/lib/mcollective/util/playbook/inputs.rb +265 -0
- data/lib/mcollective/util/playbook/nodes.rb +207 -0
- data/lib/mcollective/util/playbook/nodes/mcollective_nodes.rb +86 -0
- data/lib/mcollective/util/playbook/nodes/pql_nodes.rb +40 -0
- data/lib/mcollective/util/playbook/nodes/shell_nodes.rb +55 -0
- data/lib/mcollective/util/playbook/nodes/terraform_nodes.rb +65 -0
- data/lib/mcollective/util/playbook/nodes/yaml_nodes.rb +47 -0
- data/lib/mcollective/util/playbook/playbook_logger.rb +47 -0
- data/lib/mcollective/util/playbook/puppet_logger.rb +51 -0
- data/lib/mcollective/util/playbook/report.rb +152 -0
- data/lib/mcollective/util/playbook/task_result.rb +55 -0
- data/lib/mcollective/util/playbook/tasks.rb +196 -0
- data/lib/mcollective/util/playbook/tasks/base.rb +45 -0
- data/lib/mcollective/util/playbook/tasks/graphite_event_task.rb +64 -0
- data/lib/mcollective/util/playbook/tasks/mcollective_task.rb +356 -0
- data/lib/mcollective/util/playbook/tasks/shell_task.rb +93 -0
- data/lib/mcollective/util/playbook/tasks/slack_task.rb +105 -0
- data/lib/mcollective/util/playbook/tasks/webhook_task.rb +136 -0
- data/lib/mcollective/util/playbook/template_util.rb +98 -0
- data/lib/mcollective/util/playbook/uses.rb +169 -0
- data/lib/mcollective/util/tasks_support.rb +733 -0
- data/lib/mcollective/util/tasks_support/cli.rb +260 -0
- data/lib/mcollective/util/tasks_support/default_formatter.rb +138 -0
- data/lib/mcollective/util/tasks_support/json_formatter.rb +108 -0
- data/lib/mcollective/validator.rb +8 -3
- data/lib/mcollective/validator/bolt_task_name_validator.ddl +7 -0
- data/lib/mcollective/validator/bolt_task_name_validator.rb +11 -0
- data/lib/mcollective/validator/length_validator.rb +1 -3
- data/lib/mcollective/validator/typecheck_validator.rb +4 -0
- metadata +67 -4
@@ -0,0 +1,176 @@
|
|
1
|
+
require "mcollective/util/choria"
|
2
|
+
require "mcollective/util/tasks_support"
|
3
|
+
|
4
|
+
module MCollective
|
5
|
+
module Agent
|
6
|
+
class Bolt_tasks < RPC::Agent
|
7
|
+
action "download" do
|
8
|
+
reply[:downloads] = 0
|
9
|
+
|
10
|
+
tasks = support_factory
|
11
|
+
|
12
|
+
reply.fail!("Received empty or invalid task file specification", 4) unless request[:files]
|
13
|
+
|
14
|
+
files = JSON.parse(request[:files])
|
15
|
+
|
16
|
+
if tasks.cached?(files)
|
17
|
+
reply[:downloads] = 0
|
18
|
+
elsif tasks.download_files(files)
|
19
|
+
reply[:downloads] = files.size
|
20
|
+
else
|
21
|
+
reply.fail!("Could not download task %s files: %s" % [request[:task], $!.to_s], 1)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
action "run_and_wait" do
|
26
|
+
tasks = support_factory
|
27
|
+
|
28
|
+
unless tasks.tasks_compatible?
|
29
|
+
msg = "Cannot execute Bolt tasks as the node does not meet the minimum compatability requirements"
|
30
|
+
reply[:stdout] = make_error(msg, "choria/not_compatible", {}).to_json
|
31
|
+
reply.fail!(msg, 5)
|
32
|
+
end
|
33
|
+
|
34
|
+
reply[:task_id] = request.uniqid
|
35
|
+
|
36
|
+
task = {
|
37
|
+
"task" => request[:task],
|
38
|
+
"input_method" => request[:input_method],
|
39
|
+
"input" => request[:input],
|
40
|
+
"files" => JSON.parse(request[:files])
|
41
|
+
}
|
42
|
+
|
43
|
+
unless tasks.cached?(task["files"])
|
44
|
+
msg = "Task %s is not available or does not match the specification" % task["task"]
|
45
|
+
reply[:stdout] = make_error(msg, "choria/invalid_cache", {}).to_json
|
46
|
+
reply.fail!(msg, 5)
|
47
|
+
end
|
48
|
+
|
49
|
+
status = nil
|
50
|
+
|
51
|
+
# Wait for near the timeout and on timeout give up and fetch the
|
52
|
+
# status so users can get good replies that include how things are
|
53
|
+
# near timeout
|
54
|
+
begin
|
55
|
+
Timeout.timeout(timeout - 2) do
|
56
|
+
status = tasks.run_task_command(reply[:task_id], task, true, request.caller)
|
57
|
+
end
|
58
|
+
rescue Timeout::Error
|
59
|
+
status = tasks.task_status(reply[:task_id])
|
60
|
+
ensure
|
61
|
+
reply_task_status(status) if status
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
action "run_no_wait" do
|
66
|
+
tasks = support_factory
|
67
|
+
|
68
|
+
unless tasks.tasks_compatible?
|
69
|
+
msg = "Cannot execute Bolt tasks as the node does not meet the minimum compatability requirements"
|
70
|
+
reply[:stdout] = make_error(msg, "choria/not_compatible", {}).to_json
|
71
|
+
reply.fail!(msg, 5)
|
72
|
+
end
|
73
|
+
|
74
|
+
reply[:task_id] = request.uniqid
|
75
|
+
|
76
|
+
task = {
|
77
|
+
"task" => request[:task],
|
78
|
+
"input_method" => request[:input_method],
|
79
|
+
"input" => request[:input],
|
80
|
+
"files" => JSON.parse(request[:files])
|
81
|
+
}
|
82
|
+
|
83
|
+
status = tasks.run_task_command(reply[:task_id], task, false, request.caller)
|
84
|
+
|
85
|
+
unless status["wrapper_spawned"]
|
86
|
+
msg = "Could not spawn task %s: %s" % [request[:task], status["wrapper_error"]]
|
87
|
+
reply[:stdout] = make_error(msg, "choria/wrapper_failed", "error" => status["wrapper_error"]).to_json
|
88
|
+
reply.fail!(msg, 5)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
action "task_status" do
|
93
|
+
tasks = support_factory
|
94
|
+
|
95
|
+
unless tasks.task_ran?(request[:task_id])
|
96
|
+
msg = "Task %s have not been run" % request[:task_id]
|
97
|
+
reply[:stdout] = make_error(msg, "choria/unknown_task", "taskid" => request[:task_id]).to_json
|
98
|
+
reply.fail!(msg, 3)
|
99
|
+
end
|
100
|
+
|
101
|
+
begin
|
102
|
+
status = tasks.task_status(request[:task_id])
|
103
|
+
rescue
|
104
|
+
reply[:stdout] = make_error($!.to_s, "choria/status_failed", "taskid" => request[:task_id]).to_json
|
105
|
+
reply.fail!($!.to_s, 5)
|
106
|
+
end
|
107
|
+
|
108
|
+
if caller_only_status? && request.caller != status["caller"]
|
109
|
+
reply[:stdout] = make_error($!.to_s, "choria/not_own_request", "taskid" => request[:task_id]).to_json
|
110
|
+
reply.fail!($!.to_s, 5)
|
111
|
+
end
|
112
|
+
|
113
|
+
reply_task_status(status)
|
114
|
+
|
115
|
+
reply.fail!("Could not spawn task %s: %s" % [request[:task], status["wrapper_error"]]) if reply.statuscode == 0 && !status["wrapper_spawned"]
|
116
|
+
end
|
117
|
+
|
118
|
+
def caller_only_status?
|
119
|
+
Util.str_to_bool(@config.pluginconf.fetch("choria.tasks.own_status_only", "true"))
|
120
|
+
end
|
121
|
+
|
122
|
+
def make_error(msg, kind, detail)
|
123
|
+
{
|
124
|
+
"_error" => {
|
125
|
+
"msg" => msg,
|
126
|
+
"kind" => kind,
|
127
|
+
"details" => detail
|
128
|
+
}
|
129
|
+
}
|
130
|
+
end
|
131
|
+
|
132
|
+
def support_factory
|
133
|
+
Util::Choria.new.tasks_support
|
134
|
+
end
|
135
|
+
|
136
|
+
# Performs an additional authorization and audit using the task name as action
|
137
|
+
def before_processing_hook(msg, connection)
|
138
|
+
original_action = request.action
|
139
|
+
task = request[:task]
|
140
|
+
|
141
|
+
begin
|
142
|
+
if ["run_and_wait", "run_no_wait"].include?(original_action) && task
|
143
|
+
request.action = task
|
144
|
+
|
145
|
+
begin
|
146
|
+
authorization_hook(request) if respond_to?("authorization_hook")
|
147
|
+
rescue
|
148
|
+
raise(RPCAborted, "You are not authorized to run Bolt Task %s" % task)
|
149
|
+
end
|
150
|
+
|
151
|
+
audit_request(request, connection)
|
152
|
+
end
|
153
|
+
ensure
|
154
|
+
request.action = original_action
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
def reply_task_status(status)
|
159
|
+
reply[:exitcode] = status["exitcode"]
|
160
|
+
reply[:stdout] = status["stdout"].to_json
|
161
|
+
reply[:stderr] = status["stderr"]
|
162
|
+
reply[:completed] = status["completed"]
|
163
|
+
reply[:runtime] = status["runtime"]
|
164
|
+
reply[:start_time] = status["start_time"].to_i
|
165
|
+
reply[:task] = status["task"]
|
166
|
+
reply[:callerid] = status["caller"]
|
167
|
+
|
168
|
+
if status["stdout"]["_error"]
|
169
|
+
reply.fail("%s: %s" % [status["stdout"]["_error"]["kind"], status["stdout"]["_error"]["msg"]])
|
170
|
+
elsif support_factory.task_failed?(status)
|
171
|
+
reply.fail("Task failed without any error details", 1)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
@@ -0,0 +1,152 @@
|
|
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
|
8
|
+
|
9
|
+
requires :mcollective => "2.9.0"
|
10
|
+
|
11
|
+
action "machine_transition", :description => "Attempts to force a transition in a hosted Choria Autonomous Agent" do
|
12
|
+
input :instance,
|
13
|
+
:prompt => "Instance ID",
|
14
|
+
:description => "Machine Instance ID",
|
15
|
+
:type => :string,
|
16
|
+
:validation => '^.+-.+-.+-.+-.+$',
|
17
|
+
:maxlength => 36,
|
18
|
+
:optional => true
|
19
|
+
|
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
|
+
|
28
|
+
input :name,
|
29
|
+
:prompt => "Name",
|
30
|
+
:description => "Machine Name",
|
31
|
+
:type => :string,
|
32
|
+
:validation => '^[a-zA-Z][a-zA-Z0-9_-]+',
|
33
|
+
:maxlength => 128,
|
34
|
+
:optional => true
|
35
|
+
|
36
|
+
input :path,
|
37
|
+
:prompt => "Path",
|
38
|
+
:description => "Machine Path",
|
39
|
+
:type => :string,
|
40
|
+
:validation => '.+',
|
41
|
+
:maxlength => 512,
|
42
|
+
:optional => true
|
43
|
+
|
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
|
+
|
52
|
+
output :success,
|
53
|
+
:description => "Indicates if the transition was successfully accepted",
|
54
|
+
:display_as => "Accepted"
|
55
|
+
end
|
56
|
+
|
57
|
+
action "machine_states", :description => "States of the hosted Choria Autonomous Agents" do
|
58
|
+
display :always
|
59
|
+
|
60
|
+
output :machine_names,
|
61
|
+
:description => "List of running machine names",
|
62
|
+
:display_as => "Machine Names"
|
63
|
+
|
64
|
+
output :machine_ids,
|
65
|
+
:description => "List of running machine IDs",
|
66
|
+
:display_as => "Machine IDs"
|
67
|
+
|
68
|
+
output :states,
|
69
|
+
:description => "Hash map of machine statusses indexed by machine ID",
|
70
|
+
:display_as => "Machine States"
|
71
|
+
|
72
|
+
summarize do
|
73
|
+
aggregate summary(:machine_names)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
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"
|
85
|
+
|
86
|
+
output :connector,
|
87
|
+
:description => "Connector plugin",
|
88
|
+
:display_as => "Connector"
|
89
|
+
|
90
|
+
output :connector_tls,
|
91
|
+
:description => "If the connector is running with TLS security enabled",
|
92
|
+
:display_as => "Connector TLS"
|
93
|
+
|
94
|
+
output :path,
|
95
|
+
:description => "Active OS PATH",
|
96
|
+
:display_as => "Path"
|
97
|
+
|
98
|
+
output :choria_version,
|
99
|
+
:description => "Choria version",
|
100
|
+
:display_as => "Choria Version"
|
101
|
+
|
102
|
+
output :client_version,
|
103
|
+
:description => "Middleware client library version",
|
104
|
+
:display_as => "Middleware Client Library Version"
|
105
|
+
|
106
|
+
output :client_flavour,
|
107
|
+
:description => "Middleware client gem flavour",
|
108
|
+
:display_as => "Middleware Client Flavour"
|
109
|
+
|
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"
|
117
|
+
|
118
|
+
output :client_stats,
|
119
|
+
:description => "Middleware client gem statistics",
|
120
|
+
:display_as => "Middleware Client Stats"
|
121
|
+
|
122
|
+
output :facter_domain,
|
123
|
+
:description => "Facter domain",
|
124
|
+
:display_as => "Facter Domain"
|
125
|
+
|
126
|
+
output :facter_command,
|
127
|
+
:description => "Command used for Facter",
|
128
|
+
:display_as => "Facter"
|
129
|
+
|
130
|
+
output :srv_domain,
|
131
|
+
:description => "Configured SRV domain",
|
132
|
+
:display_as => "SRV Domain"
|
133
|
+
|
134
|
+
output :using_srv,
|
135
|
+
:description => "Indicates if SRV records are considered",
|
136
|
+
:display_as => "SRV Used"
|
137
|
+
|
138
|
+
output :middleware_servers,
|
139
|
+
:description => "Middleware Servers configured or discovered",
|
140
|
+
:display_as => "Middleware"
|
141
|
+
|
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
|
+
end
|
@@ -0,0 +1,244 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://choria.io/schemas/mcorpc/ddl/v1/agent.json",
|
3
|
+
"metadata": {
|
4
|
+
"name": "choria_util",
|
5
|
+
"description": "Choria Utilities",
|
6
|
+
"author": "R.I.Pienaar <rip@devco.net>",
|
7
|
+
"license": "Apache-2.0",
|
8
|
+
"version": "0.19.0",
|
9
|
+
"url": "https://choria.io",
|
10
|
+
"timeout": 2
|
11
|
+
},
|
12
|
+
"actions": [
|
13
|
+
{
|
14
|
+
"action": "info",
|
15
|
+
"input": {
|
16
|
+
},
|
17
|
+
"output": {
|
18
|
+
"security": {
|
19
|
+
"description": "Security Provider plugin",
|
20
|
+
"display_as": "Security Provider",
|
21
|
+
"default": null
|
22
|
+
},
|
23
|
+
"secure_protocol": {
|
24
|
+
"description": "If the protocol is running with PKI security enabled",
|
25
|
+
"display_as": "Protocol Secure",
|
26
|
+
"default": null
|
27
|
+
},
|
28
|
+
"connector": {
|
29
|
+
"description": "Connector plugin",
|
30
|
+
"display_as": "Connector",
|
31
|
+
"default": null
|
32
|
+
},
|
33
|
+
"connector_tls": {
|
34
|
+
"description": "If the connector is running with TLS security enabled",
|
35
|
+
"display_as": "Connector TLS",
|
36
|
+
"default": null
|
37
|
+
},
|
38
|
+
"path": {
|
39
|
+
"description": "Active OS PATH",
|
40
|
+
"display_as": "Path",
|
41
|
+
"default": null
|
42
|
+
},
|
43
|
+
"choria_version": {
|
44
|
+
"description": "Choria version",
|
45
|
+
"display_as": "Choria Version",
|
46
|
+
"default": null
|
47
|
+
},
|
48
|
+
"client_version": {
|
49
|
+
"description": "Middleware client library version",
|
50
|
+
"display_as": "Middleware Client Library Version",
|
51
|
+
"default": null
|
52
|
+
},
|
53
|
+
"client_flavour": {
|
54
|
+
"description": "Middleware client gem flavour",
|
55
|
+
"display_as": "Middleware Client Flavour",
|
56
|
+
"default": null
|
57
|
+
},
|
58
|
+
"client_options": {
|
59
|
+
"description": "Active Middleware client gem options",
|
60
|
+
"display_as": "Middleware Client Options",
|
61
|
+
"default": null
|
62
|
+
},
|
63
|
+
"connected_server": {
|
64
|
+
"description": "Connected middleware server",
|
65
|
+
"display_as": "Connected Broker",
|
66
|
+
"default": null
|
67
|
+
},
|
68
|
+
"client_stats": {
|
69
|
+
"description": "Middleware client gem statistics",
|
70
|
+
"display_as": "Middleware Client Stats",
|
71
|
+
"default": null
|
72
|
+
},
|
73
|
+
"facter_domain": {
|
74
|
+
"description": "Facter domain",
|
75
|
+
"display_as": "Facter Domain",
|
76
|
+
"default": null
|
77
|
+
},
|
78
|
+
"facter_command": {
|
79
|
+
"description": "Command used for Facter",
|
80
|
+
"display_as": "Facter",
|
81
|
+
"default": null
|
82
|
+
},
|
83
|
+
"srv_domain": {
|
84
|
+
"description": "Configured SRV domain",
|
85
|
+
"display_as": "SRV Domain",
|
86
|
+
"default": null
|
87
|
+
},
|
88
|
+
"using_srv": {
|
89
|
+
"description": "Indicates if SRV records are considered",
|
90
|
+
"display_as": "SRV Used",
|
91
|
+
"default": null
|
92
|
+
},
|
93
|
+
"middleware_servers": {
|
94
|
+
"description": "Middleware Servers configured or discovered",
|
95
|
+
"display_as": "Middleware",
|
96
|
+
"default": null
|
97
|
+
}
|
98
|
+
},
|
99
|
+
"display": "failed",
|
100
|
+
"description": "Choria related information from the running Daemon and Middleware",
|
101
|
+
"aggregate": [
|
102
|
+
{
|
103
|
+
"function": "summary",
|
104
|
+
"args": [
|
105
|
+
"choria_version"
|
106
|
+
]
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"function": "summary",
|
110
|
+
"args": [
|
111
|
+
"client_version"
|
112
|
+
]
|
113
|
+
},
|
114
|
+
{
|
115
|
+
"function": "summary",
|
116
|
+
"args": [
|
117
|
+
"client_flavour"
|
118
|
+
]
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"function": "summary",
|
122
|
+
"args": [
|
123
|
+
"connected_server"
|
124
|
+
]
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"function": "summary",
|
128
|
+
"args": [
|
129
|
+
"srv_domain"
|
130
|
+
]
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"function": "summary",
|
134
|
+
"args": [
|
135
|
+
"using_srv"
|
136
|
+
]
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"function": "summary",
|
140
|
+
"args": [
|
141
|
+
"secure_protocol"
|
142
|
+
]
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"function": "summary",
|
146
|
+
"args": [
|
147
|
+
"connector_tls"
|
148
|
+
]
|
149
|
+
}
|
150
|
+
]
|
151
|
+
},
|
152
|
+
{
|
153
|
+
"action": "machine_states",
|
154
|
+
"input": {
|
155
|
+
},
|
156
|
+
"output": {
|
157
|
+
"machine_names": {
|
158
|
+
"description": "List of running machine names",
|
159
|
+
"display_as": "Machine Names",
|
160
|
+
"default": null
|
161
|
+
},
|
162
|
+
"machine_ids": {
|
163
|
+
"description": "List of running machine IDs",
|
164
|
+
"display_as": "Machine IDs",
|
165
|
+
"default": null
|
166
|
+
},
|
167
|
+
"states": {
|
168
|
+
"description": "Hash map of machine statusses indexed by machine ID",
|
169
|
+
"display_as": "Machine States",
|
170
|
+
"default": null
|
171
|
+
}
|
172
|
+
},
|
173
|
+
"display": "always",
|
174
|
+
"description": "States of the hosted Choria Autonomous Agents",
|
175
|
+
"aggregate": [
|
176
|
+
{
|
177
|
+
"function": "summary",
|
178
|
+
"args": [
|
179
|
+
"machine_names"
|
180
|
+
]
|
181
|
+
}
|
182
|
+
]
|
183
|
+
},
|
184
|
+
{
|
185
|
+
"action": "machine_transition",
|
186
|
+
"input": {
|
187
|
+
"instance": {
|
188
|
+
"prompt": "Instance ID",
|
189
|
+
"description": "Machine Instance ID",
|
190
|
+
"type": "string",
|
191
|
+
"default": null,
|
192
|
+
"optional": true,
|
193
|
+
"validation": "^.+-.+-.+-.+-.+$",
|
194
|
+
"maxlength": 36
|
195
|
+
},
|
196
|
+
"version": {
|
197
|
+
"prompt": "Version",
|
198
|
+
"description": "Machine Version",
|
199
|
+
"type": "string",
|
200
|
+
"default": null,
|
201
|
+
"optional": true,
|
202
|
+
"validation": "^\\d+\\.\\d+\\.\\d+$",
|
203
|
+
"maxlength": 20
|
204
|
+
},
|
205
|
+
"name": {
|
206
|
+
"prompt": "Name",
|
207
|
+
"description": "Machine Name",
|
208
|
+
"type": "string",
|
209
|
+
"default": null,
|
210
|
+
"optional": true,
|
211
|
+
"validation": "^[a-zA-Z][a-zA-Z0-9_-]+",
|
212
|
+
"maxlength": 128
|
213
|
+
},
|
214
|
+
"path": {
|
215
|
+
"prompt": "Path",
|
216
|
+
"description": "Machine Path",
|
217
|
+
"type": "string",
|
218
|
+
"default": null,
|
219
|
+
"optional": true,
|
220
|
+
"validation": ".+",
|
221
|
+
"maxlength": 512
|
222
|
+
},
|
223
|
+
"transition": {
|
224
|
+
"prompt": "Transition Name",
|
225
|
+
"description": "The transition event to send to the machine",
|
226
|
+
"type": "string",
|
227
|
+
"default": null,
|
228
|
+
"optional": false,
|
229
|
+
"validation": "^[a-zA-Z][a-zA-Z0-9_-]+$",
|
230
|
+
"maxlength": 128
|
231
|
+
}
|
232
|
+
},
|
233
|
+
"output": {
|
234
|
+
"success": {
|
235
|
+
"description": "Indicates if the transition was successfully accepted",
|
236
|
+
"display_as": "Accepted",
|
237
|
+
"default": null
|
238
|
+
}
|
239
|
+
},
|
240
|
+
"display": "failed",
|
241
|
+
"description": "Attempts to force a transition in a hosted Choria Autonomous Agent"
|
242
|
+
}
|
243
|
+
]
|
244
|
+
}
|