LinMin Bare Metal Provisioning 6.2 User's Guide

Imaging Example Generator

Hide Navigation Pane

Imaging Example Generator

Previous topic Next topic No expanding text in this topic  

Imaging 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 LinMin Server 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 LinMin Server 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.

 

The API Imaging Example generator can be accessed with your browser to:

http://192.168.0.200/tftpboot/www/lbmp-API_imaging_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 backed up:

API_Image_Gen_add_system_backup_w2k8

 

 

Sample code generated for your application to call the API:

 

HTTP call:

http://192.168.0.200/tftpboot/www/lbmp-API.php?actiontype=image&user_supplied_id=Cloud_0932&mac_address=00%3A0e%3A0c%3Abc%3A3e%3Aa9&apid=c7713cb78af1851658994d57260a70e4&file_name=System_Type_6_WindowsServer2008R2_Cloud_Server&boot_drive=sda&enable_provisioning_flag=backup&rtn_format=NQV&action=add

 

wget call:

tmpfile=tempwget.txt; wget -qO $tmpfile --post-data 'actiontype=image&user_supplied_id=Cloud_0932&mac_address=00%3A0e%3A0c%3Abc%3A3e%3Aa9&apid=c7713cb78af1851658994d57260a70e4&file_name=System_Type_6_WindowsServer2008R2_Cloud_Server&boot_drive=sda&enable_provisioning_flag=backup&rtn_format=NQV&action=add' http://192.168.0.200/tftpboot/www/lbmp-API.php; cat $tmpfile; rm -f $tmpfile

 

 

 

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

 

 

Name-value pairs with values in quotes and UTF-8 encoding (our selection):

actiontype="image"

apid="c7713cb78af1851658994d57260a70e4"

rtn_format="NQV"

action="add"

authorizedTime="2010-07-08_19:03:52"

actionResults="OK"

actionResultsMsg="Successful:add : "

user_supplied_id="Cloud_0932"

mac_address="00:0e:0c:bc:3e:a9"

file_name="System_Type_6_WindowsServer2008R2_Cloud_Server"

boot_drive="sda"

enable_provisioning_flag="backup"

 

 

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

 

 

Other Imaging API actions include:

API_Image_Gen_Enable_ReturnCode_Action

 

 

Next Boot Actions for each system:

Backup
Restore (or clone to a different system with identical hardware)
No Imaging Action (reset a system previously set to Backup or Restore)

 

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 a MAC address or Nickname)
List Roles: return list and information on all systems
List Backup Directories: returns all backup directory names in the LinMin Server's default imaging directory

 

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 Imaging: Backup, Restore and Clone to provide you with the best information while integrating LinMin Bare Metal Provisioning into your application.

 

The API Log can be found at:

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