Monitoring, Management & Location Tracking

Retrieve floorplans from ALE
Q:

Is there an easy way to pull/retrieve maps/floorplans from ALE via a web/restapi call?



A:

This is very easy to do with the RESTAPI for both ALE 1.3 and 2.0.

As you are aware, maps in ALE are associated to a Floor, which is part of a Building, which in turn is part of a campus.

To query the list of campuses, buildings, and floors, you use the RESTAPI calls:

ALE 1.3

 http://<serverip>:8080/api/v1/campus
 http://<serverip>:8080/api/v1/building
 http://<serverip>:8080/api/v1/floor

For ALE 2.0, the recommend way to access the RESTAPI is through https (tcp/443) even though http on port 8080 is still supported (with a change of ACL/iptables). Also, ALE 2.0 restapi requires authentication. If you access it with a program (curl/wget/script), you need to send userid/password. And you might need to ignore cert check.

 https://<serverip>/api/v1/campus
 https://<serverip>/api/v1/building
 https://<serverip>/api/v1/floor

The URL for downloading the image is in one of the attributes of the ‘floor’ call.

For example, in ALE 1.3, here’s the output for one of the ‘floor’:

 {  
    "Floor_result":[  
       {  
          "msg":{  
             "building_id":"7F015652A1904D1C80B5B8CE986ABA6D",
             "floor_id":"228ADC3C16AC4CFB8DE36DC27B179AA2",
             "floor_img_length":103.48,
             "floor_img_path":"/images/plan/img_228adc3c-16ac-4cfb-8de3-6dc27b179aa2.jpg",
             "floor_img_width":274.8,
             "floor_latitude":0,
             "floor_longitude":0,
             "floor_name":"29/F",
             "grid_size":3,
             "units":"ft"
          },
          "ts":1444892312
       }
    ]
 }

As you can see, the dimensions of the floor as well as the unit are part of the attributes. The unit correspond to how it is set-up in AirWave. In the above case, the floor size is: X=274.8 feet and Y=.103.48.

The URL for downloading the image is:

 http://<serverip>/images/plan/img_228adc3c-16ac-4cfb-8de3-6dc27b179aa2.jpg

Note that this if on Port 80 instead of 8080.

The (X,Y) co-ordinates are calculated as feet/meter from the TOP LEFT corner. There is a nice picture explicitly explaining this in the ALE 2.0 API User Guide.

Note that in some older version of ALE (maybe 1.2), the ‘unit’ attribute is not part of the output. It is assumed to be in ‘feet’. ALE 1.x only works properly if AirWave is set to use imperial (i.e. ‘feet’) as the unit.

It’s slightly different in ALE 2.0.

 {  
    "Floor_result":[  
       {  
          "msg":{  
             "building_id":"7F3AFCAA234930E08C26BDFE04BB5854",
             "floor_id":"981D8E2E6E8B3E79B53A65E91B5408CA",
             "floor_img_length":31.993227,
             "floor_img_path":"/download/images/2-Aruba%20Networks%20Hong%20Kong.jpg",
             "floor_img_width":84.95598,
             "floor_latitude":22.280224,
             "floor_level":29,
             "floor_longitude":114.18656,
             "floor_name":"Aruba Networks Hong Kong",
             "units":"m"
          },
          "ts":1444385272
       }
    ]
 }

The ‘unit’ is part of the attributes. And I believe that it doesn’t need to correspond to how it’s set in AirWave. It can be set independently in ALE. (But will need to confirm that it works properly if the two units are different).

The URL to download the image is also slightly different. In ALE 2.0, the preferred way to retrieve anything is via ‘https’ (tcp/443). So the URL for downloading the image is:

  https://<serverip>/download/images/2-Aruba%20Networks%20Hong%20Kong.jpg
Version History
Revision #:
2 of 2
Last update:
‎02-02-2016 12:12 AM
Updated by:
 
Labels (1)
Contributors
Search Airheads
Showing results for 
Search instead for 
Did you mean: 
Is this a frequent problem?

Request an official Aruba knowledge base article to be written by our experts.