snap-collector-mock2

command
v0.11.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

snap Collector Plugin Structure


Mock plugins are for testing purposes and not meant as examples.

Plugin binary

./main.go

Collector Implementation

./collector/collector.go

JSON RPC examples (using curl)

If calling a GO based plugin you will want to ensure that the plugin is started in JSON RPC mode. This is done by setting the plugins meta data field RPCType to plugin.JSONRPC.

You can start a plugin manually for testing by increasing the ping timeout duration. The timeout will be reset each time you call into the plugin.

./snap-collector-mock2 '{"NoDaemon": false, "PingTimeoutDuration": 1000000000000}'
GetConfigPolicy
curl -d '{"method": "Collector.GetConfigPolicy", "params": [], "id": 1}' http://127.0.0.1:<REPLACE WITH PORT> | python -m "json.tool"
GetMetricTypes
curl -d '{"method": "Collector.GetMetricTypes", "params": [], "id": 1}' http://127.0.0.1:<REPLACE WITH PORT>
CollectMetrics
curl -X POST -H "Content-Type: application/json" -d '{"method": "Collector.CollectMetrics", "params": [[{"namespace": ["intel","mock", "bar"]},{"namespace": ["intel","mock","foo"], "config": {"table": {"password": {"Value": "asdf"}}}}]], "id": 1}' http://127.0.0.1:<REPLACE WITH PORT> | python -m "json.tool"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL