#2 agent api disclosure

#2 agent api disclosure

#%RAML 0.8
baseUri: http://{apiHost}
title: shoehorn
version: VERSION
mediaType:  application/json
baseUriParameters:
  apiHost:
    enum: ["dev-shoehorn.herokuapp.com","staging-shoehorn-backend.herokuapp.com","localhost:9000"]
resourceTypes:
  - collection:
      get:
        description: retrieves a list of <<resourceName>>s (all of them if no 'q' is present as query param)
        queryParameters:
          q: &q
            required: false
            description: optional query as a json expression
            example: ../<<resourceName>>s?q={"foo":true, "bar":2014}

      post:
        description: creates a new resource
        body:
          application/json:
            example: <<postexample>>
        responses:
            201:
              description: Created
              headers:
                Location:
                  description: the url of the newly created <<resourceName>>
                  example: http://{apiHost}/<<resourceName>>s/53ecbedd1700004c00d115b1
                Shoehorn-resource-id:
                  description: the id of the newly created <<resourceName>>
                  example: 53ecbedd1700004c00d115b1

  - collection-item:
      get:
        description: fetches the resource with the given id
        responses: &standardResponses
          200:
            description: OK
            body:
              application/json:
                example: <<getexample>>
          404:
            description: NOTFOUND
      put:
        description: updates an existing resource by the given id
        body:
          application/json:
            example: <<postexample>>
        responses:
          200:
            description: OK
          400:
            description: TODO
      delete:
        description: deletes the resource with the given id

/catalogs:
  type:
    collection:
      resourceName: catalog
      postexample: !include catalog.json

  /{id}:
    type:
      collection-item:
        getexample: !include catalog.json
        postexample: !include catalog.json
/products:
  type:
    collection:
      resourceName: product
      postexample: !include product.json
  get:
    queryParameters:
      q: *q
      catalogs:
        description: |
          json array of catalog ids.

          will return those products that are part of any of the given catalogs
        example: .../products?catalogs=["1","2","3"]

  /{id}:
    type:
      collection-item:
        getexample: !include product.json
        postexample: !include product.json
/warehouses:
  type:
    collection:
      resourceName: warehouse
      postexample: !include warehouse.json
  /{id}:
    type:
      collection-item:
        getexample: !include warehouse.json
        postexample: !include warehouse.json

 /agents:
   type:
     collection:
       resourceName: agent
       postexample: !include agent.json
   /{id}:
     type:
       collection-item:
         getexample: !include agent.json
         postexample: !include agent.json


added missing description in RAML

added missing description in RAML

#%RAML 0.8
---
title: RPooli API
baseUri: ${baseUri}/api/{version}
version: v1
mediaType:  application/json

documentation:
  - title: RPooli API
    content: |
      <pre>
       ___ ___          _ _
      | _ \ _ \___  ___| (_)
      |   /  _/ _ \/ _ \ | |
      |_|_\_| \___/\___/_|_|
      </pre>
      _A pool of R nodes, exposed over RMI and managed over HTTP_

schemas:
 - pool.json:         !include schema/pool.json
 - node.json:         !include schema/node.json
 - nodes.json:        !include schema/nodes.json

traits:
 - async-resource:
     usage: Apply this to any method that needs to be asynchronous

/pool:
  description: Manage the pool of RServi nodes
  get:
    description: Retrieve information about the pool
    responses:
      200:
        body:
          application/json:
            schema: pool.json

/nodes:
  description: Manage the RServi nodes
  get:
    description: Retrieve the list of nodes
    responses:
      200:
        body:
          schema: nodes.json
  /{nodeId}:
    description: Manage a single RServi node
    uriParameters:
      nodeId:
        type: string
        required: true
    get:
      description: Retrieve a single node
      responses:
        200:
          body:
            schema: node.json
        404:
          description: The node ID doesn't exist
    delete:
      description: Evict a node
      queryParameters:
        kill:
          type: boolean
          required: false
          default: false
      responses:
        204:
          description: The node has been evicted
    /console:
      description: Control the debug console
      post:
        description: Enable the debug console
        responses:
          204:
            description: The debug console is active
      delete:
        description: The debug console is inactive
        responses:
          204:
            description: The command has been successfully executed.
  /test:
    description: Simulate client actions
    post:
      description: Acquire a node from the pool
      responses:
        204:
          description: A node has been acquired
    delete:
      description: Release all the acquired nodes to the pool
      responses:
        204:
          description: All acquired nodes have been released

#%RAML 0.8
---
title: RPooli API
baseUri: ${baseUri}/api/{version}
version: v1
mediaType:  application/json

documentation:
  - title: RPooli API
    content: |
      <pre>
       ___ ___          _ _
      | _ \ _ \___  ___| (_)
      |   /  _/ _ \/ _ \ | |
      |_|_\_| \___/\___/_|_|
      </pre>
      _A pool of R nodes, exposed over RMI and managed over HTTP_

schemas:
 - pool.json:         !include schema/pool.json
 - node.json:         !include schema/node.json
 - nodes.json:        !include schema/nodes.json

traits:
 - async-resource:
     usage: Apply this to any method that needs to be asynchronous

/pool:
  description: Manage the pool of RServi nodes
  get:
    description: Retrieve information about the pool
    responses:
      200:
        body:
          application/json:
            schema: pool.json

/nodes:
  description: Manage the RServi nodes
  get:
    description: Retrieve the list of nodes
    responses:
      200:
        body:
          schema: nodes.json
  /{nodeId}:
    uriParameters:
      nodeId:
        type: string
        required: true
    get:
      description: Retrieve a single node
      responses:
        200:
          body:
            schema: node.json
        404:
          description: The node ID doesn't exist
    delete:
      description: Evict a node
      queryParameters:
        kill:
          type: boolean
          required: false
          default: false
      responses:
        204:
          description: The node has been evicted
    /console:
      description: Control the debug console
      post:
        description: Enable the debug console
        responses:
          204:
            description: The debug console is active
      delete:
        description: The debug console is inactive
        responses:
          204:
            description: The command has been successfully executed.
  /test:
    description: Simulate client actions
    post:
      description: Acquire a node from the pool
      responses:
        204:
          description: A node has been acquired
    delete:
      description: Release all the acquired nodes to the pool
      responses:
        204:
          description: All acquired nodes have been released