From 7ba162b18ad747828b879401b333bd127945d0fa Mon Sep 17 00:00:00 2001 From: "R.I.Pienaar" Date: Fri, 17 Jul 2020 12:06:04 +0200 Subject: [PATCH] (#628) copy scout ddl files Signed-off-by: R.I.Pienaar --- lib/mcollective/agent/scout.ddl | 169 +++++++++++++++++++++++++++ lib/mcollective/agent/scout.json | 193 +++++++++++++++++++++++++++++++ module/choria/data/plugin.yaml | 2 + 3 files changed, 364 insertions(+) create mode 100644 lib/mcollective/agent/scout.ddl create mode 100644 lib/mcollective/agent/scout.json diff --git a/lib/mcollective/agent/scout.ddl b/lib/mcollective/agent/scout.ddl new file mode 100644 index 0000000..b52c8bb --- /dev/null +++ b/lib/mcollective/agent/scout.ddl @@ -0,0 +1,169 @@ +metadata :name => "scout", + :description => "Choria Scout Management API", + :author => "R.I.Pienaar ", + :license => "Apache-2.0", + :version => "0.0.1", + :url => "https://choria.io", + :provider => "golang", + :timeout => 5 + + +action "checks", :description => "Obtain a list of checks and their current status" do + display :ok + + + + output :checks, + :description => "Details about each check", + :type => "array", + :display_as => "Checks" + +end + +action "resume", :description => "Resume active checking of one or more checks" do + display :failed + + input :checks, + :prompt => "Checks", + :description => "Check to resume, empty means all", + :type => :array, + :optional => true + + + + + output :failed, + :description => "List of checks that could not be resumed", + :type => "array", + :display_as => "Failed" + + output :skipped, + :description => "List of checks that was skipped", + :type => "array", + :display_as => "Skipped" + + output :transitioned, + :description => "List of checks that were resumed", + :type => "array", + :display_as => "Triggered" + +end + +action "maintenance", :description => "Pause checking of one or more checks" do + display :failed + + input :checks, + :prompt => "Checks", + :description => "Check to pause, empty means all", + :type => :array, + :optional => true + + + + + output :failed, + :description => "List of checks that could not be paused", + :type => "array", + :display_as => "Failed" + + output :skipped, + :description => "List of checks that was skipped", + :type => "array", + :display_as => "Skipped" + + output :transitioned, + :description => "List of checks that were paused", + :type => "array", + :display_as => "Triggered" + +end + +action "goss_validate", :description => "Performs a Goss validation using a specific file" do + display :always + + input :file, + :prompt => "Goss File", + :description => "Path to the Goss validation specification", + :type => :string, + :validation => '.+', + :maxlength => 256, + :optional => false + + + input :vars, + :prompt => "Vars File", + :description => "Path to a file to use as template variables", + :type => :string, + :validation => '.+', + :maxlength => 256, + :optional => true + + + + + output :failures, + :description => "The number of tests that failed", + :type => "integer", + :display_as => "Failed Tests" + + output :results, + :description => "The full test results", + :type => "array", + :display_as => "Results" + + output :runtime, + :description => "The time it took to run the tests, in seconds", + :type => "integer", + :display_as => "Runtime" + + output :success, + :description => "Indicates if the test passed", + :type => "string", + :display_as => "Success" + + output :summary, + :description => "A human friendly test result", + :type => "string", + :display_as => "Summary" + + output :tests, + :description => "The number of tests that were run", + :type => "integer", + :display_as => "Tests" + + summarize do + aggregate summary(:tests) + aggregate summary(:failures) + aggregate summary(:success) + end +end + +action "trigger", :description => "Force an immediate check of one or more checks" do + display :failed + + input :checks, + :prompt => "Checks", + :description => "Check to trigger, empty means all", + :type => :array, + :optional => true + + + + + output :failed, + :description => "List of checks that could not be triggered", + :type => "array", + :display_as => "Failed" + + output :skipped, + :description => "List of checks that was skipped", + :type => "array", + :display_as => "Skipped" + + output :transitioned, + :description => "List of checks that were triggered", + :type => "array", + :display_as => "Triggered" + +end + diff --git a/lib/mcollective/agent/scout.json b/lib/mcollective/agent/scout.json new file mode 100644 index 0000000..e3248e6 --- /dev/null +++ b/lib/mcollective/agent/scout.json @@ -0,0 +1,193 @@ +{ + "$schema": "https://choria.io/schemas/mcorpc/ddl/v1/agent.json", + "metadata": { + "license": "Apache-2.0", + "author": "R.I.Pienaar ", + "timeout": 5, + "name": "scout", + "version": "0.0.1", + "url": "https://choria.io", + "description": "Choria Scout Management API", + "provider": "golang" + }, + "actions": [ + { + "action": "checks", + "display": "ok", + "description": "Obtain a list of checks and their current status", + "input": {}, + "output": { + "checks": { + "description": "Details about each check", + "type": "array", + "display_as": "Checks" + } + } + }, + { + "action": "resume", + "input": { + "checks": { + "prompt": "Checks", + "description": "Check to resume, empty means all", + "type": "array", + "optional": true + } + }, + "output": { + "failed": { + "description": "List of checks that could not be resumed", + "display_as": "Failed", + "type": "array" + }, + "transitioned": { + "description": "List of checks that were resumed", + "display_as": "Triggered", + "type": "array" + }, + "skipped": { + "description": "List of checks that was skipped", + "display_as": "Skipped", + "type": "array" + } + }, + "display": "failed", + "description": "Resume active checking of one or more checks" + }, + { + "action": "maintenance", + "input": { + "checks": { + "prompt": "Checks", + "description": "Check to pause, empty means all", + "type": "array", + "optional": true + } + }, + "output": { + "failed": { + "description": "List of checks that could not be paused", + "display_as": "Failed", + "type": "array" + }, + "transitioned": { + "description": "List of checks that were paused", + "display_as": "Triggered", + "type": "array" + }, + "skipped": { + "description": "List of checks that was skipped", + "display_as": "Skipped", + "type": "array" + } + }, + "display": "failed", + "description": "Pause checking of one or more checks" + }, + { + "action": "goss_validate", + "description": "Performs a Goss validation using a specific file", + "display": "always", + "aggregate": [ + { + "function": "summary", + "args": [ + "tests" + ] + }, + { + "function": "summary", + "args": [ + "failures" + ] + }, + { + "function": "summary", + "args": [ + "success" + ] + } + ], + "input": { + "file": { + "prompt": "Goss File", + "description": "Path to the Goss validation specification", + "type": "string", + "maxlength": 256, + "validation": ".+", + "optional": false + }, + "vars": { + "prompt": "Vars File", + "description": "Path to a file to use as template variables", + "type": "string", + "maxlength": 256, + "validation": ".+", + "optional": true + } + }, + "output": { + "tests": { + "description": "The number of tests that were run", + "display_as": "Tests", + "type": "integer" + }, + "failures": { + "description": "The number of tests that failed", + "display_as": "Failed Tests", + "type": "integer" + }, + "runtime": { + "description": "The time it took to run the tests, in seconds", + "display_as": "Runtime", + "type": "integer" + }, + "success": { + "description": "Indicates if the test passed", + "display_as": "Success", + "type": "string" + }, + "summary": { + "description": "A human friendly test result", + "display_as": "Summary", + "type": "string" + }, + "results": { + "description": "The full test results", + "display_as": "Results", + "type": "array" + } + } + }, + { + "action": "trigger", + "input": { + "checks": { + "prompt": "Checks", + "description": "Check to trigger, empty means all", + "type": "array", + "optional": true + } + }, + "output": { + "failed": { + "description": "List of checks that could not be triggered", + "display_as": "Failed", + "type": "array" + }, + "transitioned": { + "description": "List of checks that were triggered", + "display_as": "Triggered", + "type": "array" + }, + "skipped": { + "description": "List of checks that was skipped", + "display_as": "Skipped", + "type": "array" + } + }, + "display": "failed", + "description": "Force an immediate check of one or more checks" + } + ] +} diff --git a/module/choria/data/plugin.yaml b/module/choria/data/plugin.yaml index ed74300..a1df8a7 100644 --- a/module/choria/data/plugin.yaml +++ b/module/choria/data/plugin.yaml @@ -56,6 +56,8 @@ mcollective_choria::common_directories: - util/choria mcollective_choria::common_files: - application/federation.rb + - agent/scout.ddl + - agent/scout.json - agent/rpcutil.ddl - agent/rpcutil.json - agent/choria_util.ddl