top
(readme.md)
<!--
http://www.apache.org/licenses/LICENSE-2.0.txt


Copyright 2015 Intel Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

snap REST API


Task Schema
===========

This is used in REST, and in a file format for the cli.

```yaml
---
version: 1
task:
  schedule:
    type: simple
    interval: 5s
  deadline: 5s
  config:
    /intel/mock:
    - key: password
      value: j3rr
  workflow:
    collect:
      metric_types:
      - namespace: /intel/mock/foo
      - namespace: /intel/mock/bar
      publish:
      - plugin:
          name: "influx"
          version: 2
      process:
      - plugin:
          name: "averager"
        publish:
        - plugin:
          name: "rabbitmq"
          version: 1
```

```json
{
  "version": 1,
  "task": {
    "schedule": {
      "type": "simple",
      "interval": "5s"
    },
    "deadline": "5s",
    "config": {
      "/intel/mock": [
        {
          "key": "password",
          "value": "j3rr"
        }
      ]
    },
    "workflow": {
      "collect": {
        "metric_types": [
          {
            "namespace": "/intel/mock/foo"
          },
          {
            "namespace": "/intel/mock/bar"
          }
        ],
        "publish": [
          {
            "plugin": {
              "name": "influx",
              "version": 2
            }
          }
        ],
        "process": [
          {
            "plugin": {
              "name": "averager"
            },
            "publish": [
              {
                "plugin": {
                  "name": "rabbitmq",
                  "version": 1
                }
              }
            ]
          }
        ]
      }
    }
  }
}
```

Imports 11 package(s)

  1. github.com/intelsdi-x/snap/core/serror
  2. github.com/intelsdi-x/snap/core/cdata
  3. github.com/intelsdi-x/snap/mgmt/rest/rbody
  4. github.com/codegangsta/negroni
  5. github.com/codegangsta/cli
  6. github.com/julienschmidt/httprouter
  7. github.com/Sirupsen/logrus
  8. github.com/intelsdi-x/snap/pkg/schedule
  9. github.com/intelsdi-x/snap/scheduler/wmap
  10. github.com/intelsdi-x/snap/mgmt/tribe/agreement
  11. github.com/intelsdi-x/snap/core

Test imports 5 package(s)

  1. github.com/intelsdi-x/snap/control
  2. github.com/intelsdi-x/snap/pkg/cfgfile
  3. github.com/intelsdi-x/snap/scheduler
  4. github.com/smartystreets/goconvey/convey
  5. github.com/intelsdi-x/snap/core/ctypes