Using sensuctl check info check_name --format
I can export check definition in either JSON or YAML format.
I can import it back from YAML but not from JSON format.
Example:
$ sensuctl check info my_test
=== my_test
Name: my_test
Interval: 120
Command: exit 0
Cron:
Timeout: 0
TTL: 0
Subscriptions: Sensu_backend
Handlers: rfdefault
Runtime Assets: rf-base, sensu-ruby-runtime
Hooks:
Publish?: true
Stdin?: false
Proxy Entity Name:
Namespace: prod
Metric Format:
Metric Handlers:
.
$ sensuctl check info my_test --format yaml > /tmp/c.yaml
$ sensuctl check info my_test --format json > /tmp/c.json
$ sensuctl check delete my_test
? Are you sure you would like to delete resource 'my_test'? Yes
Deleted
Problem:
sensuctl can’t import definition back from JSON file.
sensuctl create -f file.JSON
fails with error:
$ sensuctl create -f /tmp/c.json
resource 0: error parsing spec: type could not be found: ""
Error: in /tmp/c.json: some resources couldn't be parsed
.
$ sensuctl create -f /tmp/c.yaml
$
is successffully completed without error.
Check definition:
$ sensuctl check info my_test
=== my_test
Name: my_test
Interval: 120
Command: exit 0
Cron:
Timeout: 0
TTL: 0
Subscriptions: Sensu_backend
Handlers: default
Runtime Assets: base, sensu-ruby-runtime
Hooks:
Publish?: true
Stdin?: false
Proxy Entity Name:
Namespace: prod
Metric Format:
Metric Handlers:
Is this a bug in sensuctl, or I’m just using it wrong ?