.. _SystemIntegration_HandlingZones: ####### Zones ####### Get zone state for a specific zone ********************************** Returns the current occupancy state and count of a specific zone. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **zoneName**: name of the zone as defined in ALIOT .. http:get:: https://{hostIp}:7081/zonecounting/zone/{zoneName}/state **Example request**: .. sourcecode:: http GET /zonecounting/zone/Zone0/state HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "Zone0": { "OccupancyState": 0, "Capacity": 50, "Occupancy": 0 } } :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json array zonestate: See :ref:`Parking and parking zones ` for more info. Reset the occupancy of a specific zone ************************************** Resets the occupancy of a zone. This will reset the occupancy of a specific parking zone. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **zoneName**: name of the zone as defined in ALIOT .. http:put:: https://{hostIp}:7081/zonecounting/zone/{zoneName}/reset-occupancy **Example request**: .. sourcecode:: http PUT /zonecounting/zone/Zone0/reset-occupancy HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) Update the occupancy of a specific zone *************************************** Updates the occupancy of a zone. This will set the occupancy count of a specific parking zone to a new value. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **zoneName**: name of the zone as defined in ALIOT * **newOccupancy**: new occupancy value .. http:put:: https://{hostIp}:7081/zonecounting/zone/{zoneName}/update-occupancy?newOccupancy={newOccupancy} **Example request**: .. sourcecode:: http PUT /zonecounting/zone/Zone0/update-occupancy?newOccupancy=50 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) Update the occupancy state of a specific zone ********************************************* Updates the occupancy state of a specific parking zone. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **zoneName**: name of the parking as defined in ALIOT * **occupancyState**: (integer) See :ref:`Occupancy state ` for possible values. .. http:put:: https://{hostIp}:7081/zonecounting/zone/{zoneName}/update-state?newState={occupancyState} **Example request**: .. sourcecode:: http PUT /zonecounting/zone/Zone0/update-state?newState=2 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) Increase the occupancy of a specific zone ***************************************** Increases the occupancy of a zone. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **zoneName**: name of the zone as defined in ALIOT * **increaseAmount**: amount to increase current occupancy with .. http:post:: https://{hostIp}:7081/zonecounting/zone/{zoneName}/increase-occupancy?amount={increaseAmount} **Example request**: .. sourcecode:: http POST /zonecounting/zone/Zone0/increase-occupancy?amount=2 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) Decrease the occupancy of a specific zone ***************************************** Decreases the occupancy of a zone. See :ref:`parking and parking zones ` for more info. **URL parameters** * **hostIp**: ip address of the API host. * **zoneName**: name of the zone as defined in ALIOT * **decreaseAmount**: amount to decrease current occupancy with .. http:post:: https://{hostIp}:7081/zonecounting/zone/{zoneName}/decrease-occupancy?amount={decreaseAmount} **Example request**: .. sourcecode:: http POST /zonecounting/zone/Zone0/decrease-occupancy?amount=2 HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 :statuscode 200: OK :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request)