choria-mcorpc-support 2.21.1 → 2.23.1

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mcollective.rb +1 -2
  3. data/lib/mcollective/agent/bolt_tasks.ddl +253 -0
  4. data/lib/mcollective/agent/bolt_tasks.json +365 -0
  5. data/lib/mcollective/agent/bolt_tasks.rb +178 -0
  6. data/lib/mcollective/agent/choria_util.ddl +152 -0
  7. data/lib/mcollective/agent/choria_util.json +244 -0
  8. data/lib/mcollective/agent/rpcutil.ddl +8 -4
  9. data/lib/mcollective/agent/rpcutil.json +333 -0
  10. data/lib/mcollective/agent/scout.ddl +169 -0
  11. data/lib/mcollective/agent/scout.json +224 -0
  12. data/lib/mcollective/agents.rb +7 -6
  13. data/lib/mcollective/aggregate.rb +4 -4
  14. data/lib/mcollective/aggregate/average.rb +2 -2
  15. data/lib/mcollective/aggregate/base.rb +2 -2
  16. data/lib/mcollective/aggregate/result.rb +3 -3
  17. data/lib/mcollective/aggregate/result/collection_result.rb +2 -2
  18. data/lib/mcollective/aggregate/result/numeric_result.rb +2 -2
  19. data/lib/mcollective/aggregate/sum.rb +2 -2
  20. data/lib/mcollective/aggregate/summary.rb +3 -4
  21. data/lib/mcollective/application.rb +57 -21
  22. data/lib/mcollective/application/choria.rb +189 -0
  23. data/lib/mcollective/application/completion.rb +6 -6
  24. data/lib/mcollective/application/facts.rb +11 -11
  25. data/lib/mcollective/application/federation.rb +237 -0
  26. data/lib/mcollective/application/find.rb +4 -4
  27. data/lib/mcollective/application/help.rb +3 -3
  28. data/lib/mcollective/application/inventory.rb +3 -341
  29. data/lib/mcollective/application/ping.rb +5 -51
  30. data/lib/mcollective/application/playbook.rb +207 -0
  31. data/lib/mcollective/application/plugin.rb +106 -106
  32. data/lib/mcollective/application/rpc.rb +3 -108
  33. data/lib/mcollective/application/tasks.rb +425 -0
  34. data/lib/mcollective/applications.rb +11 -10
  35. data/lib/mcollective/audit/choria.rb +33 -0
  36. data/lib/mcollective/cache.rb +2 -4
  37. data/lib/mcollective/client.rb +11 -10
  38. data/lib/mcollective/config.rb +21 -34
  39. data/lib/mcollective/connector/base.rb +2 -1
  40. data/lib/mcollective/connector/nats.ddl +9 -0
  41. data/lib/mcollective/connector/nats.rb +450 -0
  42. data/lib/mcollective/data.rb +8 -3
  43. data/lib/mcollective/data/agent_data.rb +1 -1
  44. data/lib/mcollective/data/base.rb +6 -5
  45. data/lib/mcollective/data/bolt_task_data.ddl +90 -0
  46. data/lib/mcollective/data/bolt_task_data.rb +32 -0
  47. data/lib/mcollective/data/collective_data.rb +1 -1
  48. data/lib/mcollective/data/fact_data.rb +6 -6
  49. data/lib/mcollective/data/fstat_data.rb +2 -4
  50. data/lib/mcollective/data/result.rb +7 -2
  51. data/lib/mcollective/ddl/agentddl.rb +5 -17
  52. data/lib/mcollective/ddl/base.rb +10 -13
  53. data/lib/mcollective/discovery.rb +24 -39
  54. data/lib/mcollective/discovery/choria.ddl +11 -0
  55. data/lib/mcollective/discovery/choria.rb +223 -0
  56. data/lib/mcollective/discovery/flatfile.rb +7 -8
  57. data/lib/mcollective/discovery/mc.rb +2 -2
  58. data/lib/mcollective/discovery/stdin.rb +17 -18
  59. data/lib/mcollective/exceptions.rb +13 -0
  60. data/lib/mcollective/facts/base.rb +9 -9
  61. data/lib/mcollective/facts/yaml_facts.rb +12 -12
  62. data/lib/mcollective/generators.rb +3 -3
  63. data/lib/mcollective/generators/agent_generator.rb +3 -4
  64. data/lib/mcollective/generators/base.rb +14 -15
  65. data/lib/mcollective/generators/data_generator.rb +5 -6
  66. data/lib/mcollective/log.rb +2 -2
  67. data/lib/mcollective/logger/base.rb +3 -2
  68. data/lib/mcollective/logger/console_logger.rb +10 -10
  69. data/lib/mcollective/logger/file_logger.rb +7 -7
  70. data/lib/mcollective/logger/syslog_logger.rb +11 -15
  71. data/lib/mcollective/message.rb +8 -39
  72. data/lib/mcollective/monkey_patches.rb +2 -4
  73. data/lib/mcollective/optionparser.rb +2 -1
  74. data/lib/mcollective/pluginmanager.rb +3 -5
  75. data/lib/mcollective/pluginpackager.rb +1 -3
  76. data/lib/mcollective/pluginpackager/agent_definition.rb +3 -8
  77. data/lib/mcollective/pluginpackager/forge_packager.rb +7 -9
  78. data/lib/mcollective/pluginpackager/standard_definition.rb +1 -2
  79. data/lib/mcollective/registration/base.rb +18 -16
  80. data/lib/mcollective/rpc.rb +2 -4
  81. data/lib/mcollective/rpc/actionrunner.rb +16 -18
  82. data/lib/mcollective/rpc/agent.rb +26 -43
  83. data/lib/mcollective/rpc/audit.rb +1 -0
  84. data/lib/mcollective/rpc/client.rb +67 -85
  85. data/lib/mcollective/rpc/helpers.rb +55 -62
  86. data/lib/mcollective/rpc/progress.rb +2 -2
  87. data/lib/mcollective/rpc/reply.rb +17 -19
  88. data/lib/mcollective/rpc/request.rb +7 -5
  89. data/lib/mcollective/rpc/result.rb +6 -8
  90. data/lib/mcollective/rpc/stats.rb +49 -58
  91. data/lib/mcollective/security/base.rb +13 -56
  92. data/lib/mcollective/security/choria.rb +765 -0
  93. data/lib/mcollective/shell.rb +9 -4
  94. data/lib/mcollective/signer/base.rb +28 -0
  95. data/lib/mcollective/signer/choria.rb +185 -0
  96. data/lib/mcollective/ssl.rb +8 -6
  97. data/lib/mcollective/util.rb +58 -55
  98. data/lib/mcollective/util/bolt_support.rb +176 -0
  99. data/lib/mcollective/util/bolt_support/plan_runner.rb +167 -0
  100. data/lib/mcollective/util/bolt_support/task_result.rb +94 -0
  101. data/lib/mcollective/util/bolt_support/task_results.rb +128 -0
  102. data/lib/mcollective/util/choria.rb +946 -0
  103. data/lib/mcollective/util/indifferent_hash.rb +12 -0
  104. data/lib/mcollective/util/natswrapper.rb +242 -0
  105. data/lib/mcollective/util/playbook.rb +435 -0
  106. data/lib/mcollective/util/playbook/data_stores.rb +201 -0
  107. data/lib/mcollective/util/playbook/data_stores/base.rb +99 -0
  108. data/lib/mcollective/util/playbook/data_stores/consul_data_store.rb +88 -0
  109. data/lib/mcollective/util/playbook/data_stores/environment_data_store.rb +33 -0
  110. data/lib/mcollective/util/playbook/data_stores/etcd_data_store.rb +42 -0
  111. data/lib/mcollective/util/playbook/data_stores/file_data_store.rb +106 -0
  112. data/lib/mcollective/util/playbook/data_stores/shell_data_store.rb +103 -0
  113. data/lib/mcollective/util/playbook/inputs.rb +265 -0
  114. data/lib/mcollective/util/playbook/nodes.rb +207 -0
  115. data/lib/mcollective/util/playbook/nodes/mcollective_nodes.rb +86 -0
  116. data/lib/mcollective/util/playbook/nodes/pql_nodes.rb +40 -0
  117. data/lib/mcollective/util/playbook/nodes/shell_nodes.rb +55 -0
  118. data/lib/mcollective/util/playbook/nodes/terraform_nodes.rb +65 -0
  119. data/lib/mcollective/util/playbook/nodes/yaml_nodes.rb +47 -0
  120. data/lib/mcollective/util/playbook/playbook_logger.rb +47 -0
  121. data/lib/mcollective/util/playbook/puppet_logger.rb +51 -0
  122. data/lib/mcollective/util/playbook/report.rb +152 -0
  123. data/lib/mcollective/util/playbook/task_result.rb +55 -0
  124. data/lib/mcollective/util/playbook/tasks.rb +196 -0
  125. data/lib/mcollective/util/playbook/tasks/base.rb +45 -0
  126. data/lib/mcollective/util/playbook/tasks/graphite_event_task.rb +64 -0
  127. data/lib/mcollective/util/playbook/tasks/mcollective_task.rb +356 -0
  128. data/lib/mcollective/util/playbook/tasks/shell_task.rb +93 -0
  129. data/lib/mcollective/util/playbook/tasks/slack_task.rb +105 -0
  130. data/lib/mcollective/util/playbook/tasks/webhook_task.rb +136 -0
  131. data/lib/mcollective/util/playbook/template_util.rb +98 -0
  132. data/lib/mcollective/util/playbook/uses.rb +169 -0
  133. data/lib/mcollective/util/tasks_support.rb +751 -0
  134. data/lib/mcollective/util/tasks_support/cli.rb +260 -0
  135. data/lib/mcollective/util/tasks_support/default_formatter.rb +138 -0
  136. data/lib/mcollective/util/tasks_support/json_formatter.rb +108 -0
  137. data/lib/mcollective/validator.rb +6 -1
  138. data/lib/mcollective/validator/bolt_task_name_validator.ddl +7 -0
  139. data/lib/mcollective/validator/bolt_task_name_validator.rb +11 -0
  140. data/lib/mcollective/validator/length_validator.rb +1 -3
  141. metadata +65 -6
  142. data/lib/mcollective/application/describe_filter.rb +0 -87
  143. data/lib/mcollective/matcher.rb +0 -220
  144. data/lib/mcollective/matcher/parser.rb +0 -128
  145. data/lib/mcollective/matcher/scanner.rb +0 -241
@@ -0,0 +1,178 @@
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
+ "run_as" => request[:run_as]
42
+ }
43
+
44
+ unless tasks.cached?(task["files"])
45
+ msg = "Task %s is not available or does not match the specification" % task["task"]
46
+ reply[:stdout] = make_error(msg, "choria/invalid_cache", {}).to_json
47
+ reply.fail!(msg, 5)
48
+ end
49
+
50
+ status = nil
51
+
52
+ # Wait for near the timeout and on timeout give up and fetch the
53
+ # status so users can get good replies that include how things are
54
+ # near timeout
55
+ begin
56
+ Timeout.timeout(timeout - 2) do
57
+ status = tasks.run_task_command(reply[:task_id], task, true, request.caller)
58
+ end
59
+ rescue Timeout::Error
60
+ status = tasks.task_status(reply[:task_id])
61
+ ensure
62
+ reply_task_status(status) if status
63
+ end
64
+ end
65
+
66
+ action "run_no_wait" do
67
+ tasks = support_factory
68
+
69
+ unless tasks.tasks_compatible?
70
+ msg = "Cannot execute Bolt tasks as the node does not meet the minimum compatability requirements"
71
+ reply[:stdout] = make_error(msg, "choria/not_compatible", {}).to_json
72
+ reply.fail!(msg, 5)
73
+ end
74
+
75
+ reply[:task_id] = request.uniqid
76
+
77
+ task = {
78
+ "task" => request[:task],
79
+ "input_method" => request[:input_method],
80
+ "input" => request[:input],
81
+ "files" => JSON.parse(request[:files]),
82
+ "run_as" => request[:run_as]
83
+ }
84
+
85
+ status = tasks.run_task_command(reply[:task_id], task, false, request.caller)
86
+
87
+ unless status["wrapper_spawned"]
88
+ msg = "Could not spawn task %s: %s" % [request[:task], status["wrapper_error"]]
89
+ reply[:stdout] = make_error(msg, "choria/wrapper_failed", "error" => status["wrapper_error"]).to_json
90
+ reply.fail!(msg, 5)
91
+ end
92
+ end
93
+
94
+ action "task_status" do
95
+ tasks = support_factory
96
+
97
+ unless tasks.task_ran?(request[:task_id])
98
+ msg = "Task %s have not been run" % request[:task_id]
99
+ reply[:stdout] = make_error(msg, "choria/unknown_task", "taskid" => request[:task_id]).to_json
100
+ reply.fail!(msg, 3)
101
+ end
102
+
103
+ begin
104
+ status = tasks.task_status(request[:task_id])
105
+ rescue
106
+ reply[:stdout] = make_error($!.to_s, "choria/status_failed", "taskid" => request[:task_id]).to_json
107
+ reply.fail!($!.to_s, 5)
108
+ end
109
+
110
+ if caller_only_status? && request.caller != status["caller"]
111
+ reply[:stdout] = make_error($!.to_s, "choria/not_own_request", "taskid" => request[:task_id]).to_json
112
+ reply.fail!($!.to_s, 5)
113
+ end
114
+
115
+ reply_task_status(status)
116
+
117
+ reply.fail!("Could not spawn task %s: %s" % [request[:task], status["wrapper_error"]]) if reply.statuscode == 0 && !status["wrapper_spawned"]
118
+ end
119
+
120
+ def caller_only_status?
121
+ Util.str_to_bool(@config.pluginconf.fetch("choria.tasks.own_status_only", "true"))
122
+ end
123
+
124
+ def make_error(msg, kind, detail)
125
+ {
126
+ "_error" => {
127
+ "msg" => msg,
128
+ "kind" => kind,
129
+ "details" => detail
130
+ }
131
+ }
132
+ end
133
+
134
+ def support_factory
135
+ Util::Choria.new.tasks_support
136
+ end
137
+
138
+ # Performs an additional authorization and audit using the task name as action
139
+ def before_processing_hook(msg, connection)
140
+ original_action = request.action
141
+ task = request[:task]
142
+
143
+ begin
144
+ if ["run_and_wait", "run_no_wait"].include?(original_action) && task
145
+ request.action = task
146
+
147
+ begin
148
+ authorization_hook(request) if respond_to?("authorization_hook")
149
+ rescue
150
+ raise(RPCAborted, "You are not authorized to run Bolt Task %s" % task)
151
+ end
152
+
153
+ audit_request(request, connection)
154
+ end
155
+ ensure
156
+ request.action = original_action
157
+ end
158
+ end
159
+
160
+ def reply_task_status(status)
161
+ reply[:exitcode] = status["exitcode"]
162
+ reply[:stdout] = status["stdout"].to_json
163
+ reply[:stderr] = status["stderr"]
164
+ reply[:completed] = status["completed"]
165
+ reply[:runtime] = status["runtime"]
166
+ reply[:start_time] = status["start_time"].to_i
167
+ reply[:task] = status["task"]
168
+ reply[:callerid] = status["caller"]
169
+
170
+ if status["stdout"]["_error"]
171
+ reply.fail("%s: %s" % [status["stdout"]["_error"]["kind"], status["stdout"]["_error"]["msg"]])
172
+ elsif support_factory.task_failed?(status)
173
+ reply.fail("Task failed without any error details", 1)
174
+ end
175
+ end
176
+ end
177
+ end
178
+ 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
+ }