Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
(#628) copy scout ddl files
Browse files Browse the repository at this point in the history
Signed-off-by: R.I.Pienaar <rip@devco.net>
  • Loading branch information
ripienaar committed Jul 17, 2020
1 parent 2f01a8b commit 7ba162b
Show file tree
Hide file tree
Showing 3 changed files with 364 additions and 0 deletions.
169 changes: 169 additions & 0 deletions lib/mcollective/agent/scout.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
metadata :name => "scout",
:description => "Choria Scout Management API",
:author => "R.I.Pienaar <rip@devco.net>",
: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

193 changes: 193 additions & 0 deletions lib/mcollective/agent/scout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
{
"$schema": "https://choria.io/schemas/mcorpc/ddl/v1/agent.json",
"metadata": {
"license": "Apache-2.0",
"author": "R.I.Pienaar <rip@devco.net>",
"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"
}
]
}
2 changes: 2 additions & 0 deletions module/choria/data/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7ba162b

Please sign in to comment.