Obtain 5-minute Action APIDs
Now that you have obtained an Authorization APID, before performing any functions with the LinMin Server API you must request an Action APID that grants you access to the LinMin Server API for 5 minutes.
There are several ways to obtain a 5-minute Action APID:
| • | Using an HTTP call (for production use) |
| • | Using wget (for production use) |
| • | Using the Provisioning Example Generator (for development and testing use) |
| • | Using the Imaging Example Generator (for development and testing use) |
| • |
In the examples below, the LinMin Server API is on a server with IP address 192.168.0.200
Obtain an Action APID using an HTTP call (for production use)
Note the Authorization APID, user name and password embedded in this URL to obtain the Action APID:
The Action APID is presented to you in XML form (in this case, with a "view source" in a browser): <?xml version="1.0" encoding="utf-8" ?> <LinMinBareMetalAPI> <actiontype>image</actiontype> <apid>ca5f3ffdaf125e1163e6af75c7ebc418</apid> <rtn_format>XML</rtn_format> <action>authorize</action> <authorizedTime>2010-07-08_17:40:16</authorizedTime> <actionResults>OK</actionResults> <actionResultsMsg>Successful:authorize : </actionResultsMsg> <user_supplied_id></user_supplied_id> </LinMinBareMetalAPI>
The Action APID is also presented in unstructured form (browser example without "view source"): image ca5f3ffdaf125e1163e6af75c7ebc418 XML authorize 2010-07-08_17:40:16 OK Successful:authorize :
|
Obtain an Action APID using wget (for product use)
Here is an example of the wget command your application can use to call the LinMin Server API to request the Action APID: tmpfile=tempwget.txt; wget -qO $tmpfile --post-data 'actiontype=image&apid=048868af3b45ecde0ba08655abdc4d48&rtn_format=NQV&action=authorize' http://192.168.0.200/tftpboot/www/lbmp-API.php; cat $tmpfile; rm -f $tmpfile
|
Obtain an Action APID using the Provisioning Example Generator (for development and testing use)
The API Provisioning Example generator can be accessed with your browser to: http://192.168.0.200/tftpboot/www/lbmp-API_provisioning_example_generator.php
Enter the Authorization APID, user name and password:
Select your preferred return code format, then click "Authorize" and "Submit"
The browser returns a page containing 4 elements:
1) HTTP string your application can use to call the LinMin Server API to request the Authorization:
2) The wget command your application can use to call the LinMin Server API to request the Action APID: tmpfile=tempwget.txt; wget -qO $tmpfile --post-data 'actiontype=provision&apid=048868af3b45ecde0ba08655abdc4d48&rtn_format=XML&action=authorize' http://192.168.0.200/tftpboot/www/lbmp-API.php; cat $tmpfile; rm -f $tmpfile
3) XML code (in this case, as it was the selection made) containing the Action APID: .<?xml version="1.0" encoding="utf-8" ?> <LinMinBareMetalAPI> <actiontype>provision</actiontype> <apid>eee458fed04f6a7e9e6e5b888b3213b9</apid> <rtn_format>XML</rtn_format> <action>authorize</action> <authorizedTime>2010-07-08_18:02:33</authorizedTime> <actionResults>OK</actionResults> <actionResultsMsg>Successful:authorize : </actionResultsMsg> <user_supplied_id></user_supplied_id> </LinMinBareMetalAPI>
4) A link back to the Generator: Continue and return to the example generator form: http://192.168.0.200/tftpboot/www/lbmp-API_provisioning_example_generator.php
If you click the link, it will perform the same as if you cut and pasted the Action APID in to the Generator:
With the Action APID entered (no user name or password needed), you are now ready to complete the Generator form and perform a Provisioning action as described in Provisioning Example Generator Topic. |
Obtain an Action APID using the Imaging Example Generator (for development and testing use)
The API Provisioning Example generator can be accessed with your browser to: http://192.168.0.200/tftpboot/www/lbmp-API_imaging_example_generator.php
Enter the Authorization APID, user name and password:
Select your preferred return code format, then click "Authorize" and "Submit":
The browser returns a page containing 4 elements:
1) HTTP string your application can use to call the LinMin Server API to request the Authorization:
2) The wget command your application can use to call the LinMin Server API to request the Action APID: tmpfile=tempwget.txt; wget -qO $tmpfile --post-data 'actiontype=image&apid=048868af3b45ecde0ba08655abdc4d48&rtn_format=NQV&action=authorize' http://192.168.0.200/tftpboot/www/lbmp-API.php; cat $tmpfile; rm -f $tmpfile
3) Name-value pairs with values in quotes and UTF-8 encoding (in this case, as it was the selection made) containing the Action APID: .actiontype="image" apid="3ef604c3d3a1ec95d92f6b41951670ba" rtn_format="NQV" action="authorize" authorizedTime="2010-07-08_18:33:55" actionResults="OK" actionResultsMsg="Successful:authorize : " user_supplied_id=""
4) A link back to the Generator: Continue and return to the example generator form: http://192.168.0.200/tftpboot/www/lbmp-API_imaging_example_generator.php
If you click the link, it will perform the same as if you cut and pasted the Action APID in to the Generator:
With the Action APID entered (no user name or password needed), you are now ready to complete the Generator form and perform a Provisioning action as described in Imaging Example Generator Topic. |
You can now call the API for the next 5 minutes with your newly generated "Action APID".
Reauthorization:
To reauthorize access to the LinMin Server Server API following the mechanisms described above:
| • | Submit your Authorization APID, username and password any time and obtain a new Action APID |