LinMin Bare Metal Provisioning 6.2 User's Guide

Provisioning Example Generator

Hide Navigation Pane

Provisioning Example Generator

Previous topic Next topic No expanding text in this topic  

Provisioning Example Generator

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function Mail us feedback on this topic!  

 

Use the API Provisioning Example Generator to generate sample code to simplify the integration of LinMin Bare Metal Provisioning into your application.

 

The Example Generator produces 2 code samples showing how to call the LBMP API from your application for each possible type of LBMP function supported by the API (e.g., read, update, delete, etc.):

Invoking the API through a browser
Invoking the API through a wget call from a Linux system

 

The Example Generator also produces 3 code samples showing how the LBMP API will reply to your application:

XML with UTF-8-encoded values
Name-value pairs with values in quotes and UTF-8 encoding
URL-encoded GET string (values with special characters must be URL encoded)

 

 

Before beginning to generate examples with the Generator, be sure you have obtained an Action APID within the past 5 minutes.

 

Also, make sure that you have created at least one Provisioning Template using the GUI beforehand.

 

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

 

 

 

Then, complete the form (entering the Action APID and no user name or password), and specify the Return Format of your choice and the desired action to be taken by the LinMin Server. In this case, we adding a server and will have it provisioned with an Ubuntu Template:

API_Prov_Gen_add_role_with_Ubuntu

 

 

 

 

Sample code generated for your application to call the LinMin Server API:

 

HTTP call:

http://192.168.0.200/tftpboot/www/lbmp-API.php?actiontype=provision&user_supplied_id=Cloud_14315&mac_address=00%3A0e%3A0c%3Abc%3A40%3Acb&apid=a511f64e432800e0b014b73cae630750&control_file_template=Ubuntu+10.04+x86_64+Cloud+Server&node_name=Cloud_14315&node_domain=cloud1.cloudmaster.com&node_ip_address=10.2.28.49&node_subnet_mask=255.255.255.0&node_nameserver=187.31.49.72&node_default_gateway=10.2.28.1&node_time_zone=Etc%2FGMT-8&enable_provisioning_flag=nextbootonly&rtn_format=XML&action=add

 

wget call:

tmpfile=tempwget.txt; wget -qO $tmpfile --post-data 'actiontype=provision&user_supplied_id=Cloud_14315&mac_address=00%3A0e%3A0c%3Abc%3A40%3Acb&apid=048868af3b45ecde0ba08655abdc4d48&control_file_template=Ubuntu+10.04+x86_64+Cloud+Server&node_name=Cloud_14315&node_domain=cloud1.cloudmaster.com&node_ip_address=10.2.28.49&node_subnet_mask=255.255.255.0&node_nameserver=187.31.49.72&node_default_gateway=10.2.28.1&node_time_zone=Etc%2FGMT-8&enable_provisioning_flag=nextbootonly&rtn_format=XML&action=add' http://192.168.0.200/tftpboot/www/lbmp-API.php; cat $tmpfile; rm -f $tmpfile

 

 

 

Sample code generated for the LinMin Server API to return to your application:

 

XML with UTF-8 encoded values (our selection):

<?xml version="1.0" encoding="utf-8" ?>

<LinMinBareMetalAPI>

<actiontype>provision</actiontype>

<apid>a511f64e432800e0b014b73cae630750</apid>

<rtn_format>XML</rtn_format>

<action>add</action>

<authorizedTime>2010-07-08_18:51:01</authorizedTime>

<actionResults>OK</actionResults>

<actionResultsMsg>Successful:add : </actionResultsMsg>

<user_supplied_id>Cloud_14315</user_supplied_id>

<mac_address>00:0e:0c:bc:40:cb</mac_address>

<control_file_template>Ubuntu 10.04 x86_64 Cloud Server</control_file_template>

<node_name>Cloud_14315</node_name>

<node_domain>cloud1.cloudmaster.com</node_domain>

<node_ip_address>10.2.28.49</node_ip_address>

<node_subnet_mask>255.255.255.0</node_subnet_mask>

<node_nameserver>187.31.49.72</node_nameserver>

<node_default_gateway>10.2.28.1</node_default_gateway>

<node_time_zone>Etc/GMT-8</node_time_zone>

<enable_provisioning_flag>nextbootonly</enable_provisioning_flag>

</LinMinBareMetalAPI>

 

Now you have the syntax for how to call the LinMin Server API and for how the LinMin Server API will respond to your application.

 

 

Other Provisioning API actions include:

API_Prov_Gen_Enable_ReturnCode_Action

 

Next Boot Actions for each system:

Ignore (boot from local disk, never re-provision)
Provision on the next netboot, then ignore future provisioning requests
Install Live Ubuntu into the RAM of the client system
Always Provision (each time the client does a netboot)

 

API functions:

Read (information on an existing system, given the MAC address or Nickname)
Update (information on an existing system, given the MAC address or Nickname)
Add (a system and create a Provisioning Role in the database)
Delete (a system, given MAC or Nickname)
List Roles: return list and information on all systems
List Templates: returns the list of all existing Provisioning Templates

 

GUI Interaction:

It is very easy to see if your API call had the intended effect on systems by looking at the LinMin Server GUI (refresh pages after you have made API calls).

 

Please read all about MAC-Specific Provisioning in general as well as for each operating system you will be provisioning to provide you with the best information while integrating LinMin Bare Metal Provisioning into your application.

 

API Log can be found at:

/usr/local/linmin/lbmp-API.log