swagger: '2.0'

info:
  version: "1.0.0"
  title: senic.nuimo_hub API
basePath: /-
paths:
  /:
    get:
      description: |
        The main entry point for all clients.
      responses:
        200:
          description: Returns all entry points and other information for bootstrapping clients.
          schema:
            title: General information about the application
            type: object
            properties:
              version:
                type: string
                description: |
                  The version deployed, use this when referencing behaviour in tickets etc.

swagger: '2.0'
info:
  version: "1.0.0"
  title: senic.nuimo_hub API
basePath: /-
produces:
  - application/json
paths:
  /:
    get:
      description: |
        The main entry point for all clients.
      responses:
        200:
          description: Returns all entry points and other information for bootstrapping clients.
          schema:
            title: General information about the application
            type: object
            properties:
              version:
                type: string
                description: |
                  The version deployed, use this when referencing behaviour in tickets etc.
  /setup:
    /wifi:
      get:
        description: |
          Clients can fetch a list of wireless networks, that the hub knows of.
          This resource is updated periodically, so (until we have some push
          mechanism) clients are encouraged to poll this regularly, to present
          users with an updated view, as often their desired network won't be visible
          straight away.
        responses:
          200:
            description: |
              Returns the list of known wireless networks, along with the device that the
              network was found with
            example:
             application/json: |-
                {
                  "Bonack-Gast": {"device": "wlan1"}, 
                  "nordwind": {"device": "wlan0"}, 
                  "BG-Meetingroom 2.4": {"device": "wlan1"}
                }
      post:
        description: |
          When a user selects a network, clients should query the user for its password
          and then POST this information to this resource
        produces:
          - "application/json"
        parameters: 
					- name: ssid
						in: body
						description: The SSID of the network to join
						required: true
						type: string
					- name: password
						in: body
						description: |
							The password of the network to join.
              XXX Either we make sure, we can deliver this only via
              https or we should give the clients a public key with
              which they must encrypt the password.
              Otherwise we force hub users to expose their wifi password
              on an unsecured wifi network with a guessable name!
						required: true
						type: string
					- name: device
						in: body
						description: |
              The name of the device that this network was found on.
              This should correspond to the value given above.
						required: true
						type: string
        responses:
          200:
            description: |
              The network was successfully joined. Clients should connect to it (again)
              as well and visit the URL given in the response.
            example: |-
              { "continue_to": "http://192.168.0.42/-/setup/bluetooth" }


Document the resources for bootstrapping the wifi
Document the resources for bootstrapping the wifi
