Skip to content

Commit

Permalink
Added a section for querying the "plan" of compartments, zones, devic…
Browse files Browse the repository at this point in the history
…es, etc.

Reformatted how URLs are described and related to their relevant data structures.
  • Loading branch information
jonginter committed Apr 25, 2018
1 parent 2cd85aa commit 63fc893
Showing 1 changed file with 96 additions and 32 deletions.
128 changes: 96 additions & 32 deletions versions/0.0.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,34 +111,98 @@ Here is an example of a properly formatted timestamp…

```2018-01-25_04-56-05_UTC```

# Zones
## Controlling System
### URLS
#### Asking about all zones
http://[domain:port]/agroapi/[version]/zones/info
http://[domain:port]/agroapi/[version]/zones/location
#### Asking about one zone
http://[domain:port]/agroapi/[version]/zones/[zoneid]/info
http://[domain:port]/agroapi/[version]/zones/[zoneid]/location

### Data structures
#### Info
| Name | Description | Unit |
| --------- | ---------------------------------------------------------- | --------- |
| id | Unique id of the zone | uid |
| varieties | Array of crop variety IDs that are controlled by this zone | uid array |
| length | Length of the zone | cm |
| width | Width of the zone | cm |
| height | Height of the zone | cm |

#### Location
| Name | Description | Unit |
| ----------- | ------------------------------------------- | ---- |
| compartment | ID of the compartment containing this zone | uid |
| zone | ID of the zone containing this zone, if any | uid |
| x | x coordinate of this zone within its parent | cm |
| y | y coordinate of this zone within its parent | cm |
| z | z coordinate of this zone within its parent | cm |
# Plan

The relationship between the common concepts (facilities, compartments, zones, etc) is maintained as part of a Plan that can be interrogated. The following URLs MUST be supported by any service that wishes to be an authority about the Plan.

## Facilities
### All facilities
GET http://[domain:port]/agroapi/[version]/plan/facilities
Returns a facility ID array

### Single compartment
GET http://[domain:port]/agroapi/[version]/plan/facilities/[facilityid]/compartments
Returns a compartment ID array

GET http://[domain:port]/agroapi/[version]/plan/facilities/[facilityid]/zones
Returns a zone ID array

## Compartments
### All compartments
GET http://[domain:port]/agroapi/[version]/plan/compartments
Returns a compartment ID array

GET http://[domain:port]/agroapi/[version]/plan/compartments/info
Returns [Compartment Info] array

GET http://[domain:port]/agroapi/[version]/plan/compartments/location
Returns [Compartment Location] array

### Single compartment
GET http://[domain:port]/agroapi/[version]/plan/compartments/[compartmentid]/info
Returns [Compartment Info] array

GET http://[domain:port]/agroapi/[version]/plan/compartments/[compartmentid]/location
Returns [Compartment Location] array

GET http://[domain:port]/agroapi/[version]/plan/compartment/[compartmentid]/zones
Returns [Zone Info] array

### Data Structures
#### Compartment Info
| Name | Description | Unit |
| --------- | ---------------------------- | ---- |
| id | Unique id of the compartment | uid |
| length | Length of the compartment | cm |
| width | Width of the compartment | cm |
| height | Height of the compartment | cm |

#### Compartment Location
| Name | Description | Unit |
| ----------- | ---------------------------------------------------- | ---- |
| facility | ID of the facility that owns this compartment | uid |
| x | x coordinate of this compartment within the facility | cm |
| y | y coordinate of this compartment within the facility | cm |
| z | z coordinate of this compartment within the facility | cm |

## Zones
### All zones
GET http://[domain:port]/agroapi/[version]/plan/zones/info
Returns [Zone Info] array

GET http://[domain:port]/agroapi/[version]/plan/zones/location
Returns [Zone Location] array

### Single zone
GET http://[domain:port]/agroapi/[version]/plan/zones/[zoneid]/info
Returns [Zone Info]

GET http://[domain:port]/agroapi/[version]/plan/zones/[zoneid]/location
Returns [Zone Location]

GET http://[domain:port]/agroapi/[version]/plan/zones/[zoneid]/zones
Returns a zone ID array

GET http://[domain:port]/agroapi/[version]/plan/zones/[zoneid]/crops
Returns a crop variety ID

### Data Structures
#### Compartment Info
| Name | Description | Unit |
| --------- | --------------------- | ---- |
| id | Unique id of the zone | uid |
| length | Length of the zone | cm |
| width | Width of the zone | cm |
| height | Height of the zone | cm |

#### Zone Location
| Name | Description | Unit |
| ----------- | ----------------------------------------------------- | ---- |
| compartment | ID of the compartment that contains this zone | uid |
| zone | ID of the parent zone that contains this zone, if any | uid |
| x | x coordinate of this compartment within the facility | cm |
| y | y coordinate of this compartment within the facility | cm |
| z | z coordinate of this compartment within the facility | cm |

# Light
## Sensors
Expand All @@ -159,21 +223,21 @@ http://[domain:port]/agroapi/[version]/lights/sensors/zones/[zoneid]/location
http://[domain:port]/agroapi/[version]/lights/sensors/zones/[zoneid]/ppf
http://[domain:port]/agroapi/[version]/lights/sensors/zones/[zoneid]/ppfd
### Data structures
#### Info
#### Light Sensor Info
| Name | Description | Unit |
| ------- | ------------------------------------------ | ---- |
| id | unique id of the device | uid |
| make | Name of the company that makes this device | text |
| model | Model number of this device | text |
| version | Version number of this device | text |
#### Location
#### Light Sensor Location
| Name | Description | Unit |
| ---- | ------------------------------------------- | ---- |
| zone | ID of the zone containing this device | uid |
| x | x coordinate of this device within the zone | cm |
| y | y coordinate of this device within the zone | cm |
| z | z coordinate of this device within the zone | cm |
#### PPF Measurements
#### Light PPF
| Name | Description | Unit |
| -------- | ------------------------------- | ----- |
| red | Level of red spectrum light | PPF |
Expand All @@ -184,7 +248,7 @@ http://[domain:port]/agroapi/[version]/lights/sensors/zones/[zoneid]/ppfd
| par | Level of absorbable light | PPF |
| light | Level of all spectrums of light | PPF |

#### PPFD Measurements
#### Light PPFD
| Name | Description | Unit |
| -------- | ------------------------------- | ----- |
| red | Level of red spectrum light | PPFD |
Expand Down

0 comments on commit 63fc893

Please sign in to comment.