iPXE discussion forum
iPXE HTTP GET - Printable Version

+- iPXE discussion forum (https://forum.ipxe.org)
+-- Forum: iPXE user forums (/forumdisplay.php?fid=1)
+--- Forum: General (/forumdisplay.php?fid=2)
+--- Thread: iPXE HTTP GET (/showthread.php?tid=7657)



iPXE HTTP GET - sdlewis - 2015-03-24 15:39

Hi

Can or are their plans for iPXE to support an HTTP get, we have a web service where we pass the UUID to it and it will return either blank of a value. Depending on the value returned alters the way the end client will boot.

I've been through the commands it doesn't look like i'm in luck.

Thanks

Simon


RE: iPXE HTTP GET - NiKiZe - 2015-03-24 15:43

The default HTTP mode in iPXE is GET

Example with loots of parameters.
cpuid --ext 29 && set arch amd64 || set arch x86
set menu-url ${boot-url}/pxe.php?mac=${netX/mac:hexhyp}&bus=${netX/busid:hexhyp}&chip=${netX/chip:uristring}&ip=${netX/ip}&next-server=${next-server}&arch=${arch}&platform=${platform:uristring}

imgfetch -a ${menu-url}&mlog&error=${errno}&class=${user-class:uristring}&manuf=${manufacturer:uristring}&prod=${product:uristring}&sn=${serial:uristring}&boardsn=${board-serial:uristring}&asset=${asset:uristring}&uuid=${uuid:uristring}&ver=${version:uristring} ||
imgfree ||

chain -ar ${menu-url}&boot&hostname=${hostname:uristring} | shell


RE: iPXE HTTP GET - sdlewis - 2015-03-24 15:50

Thanks for the reply, the critical thing I should have mentioned is that it would be connecting to a Windows webservice that would return the value. We don't use php in our Bank.


RE: iPXE HTTP GET - NiKiZe - 2015-03-24 16:01

PHP was just an example, you can use .NET as an replacement, it doesn't change the principle.

How do you expect the URL to look, or what kind of code do you have that should consume the information on server side? I assume the server is returning an ipxe script?


RE: iPXE HTTP GET - sdlewis - 2015-03-24 16:04

Hi

For example we would call http://servername:4011/0123456789abcdef0123456789abcdee

and it returns

WDSServerName\Setup\English\Windows\x64\i386\templates\startrom.0


RE: iPXE HTTP GET - NiKiZe - 2015-03-24 16:08

(2015-03-24 16:04)sdlewis Wrote:  For example we would call http://servername:4011/0123456789abcdef0123456789abcdee

and it returns
WDSServerName\Setup\English\Windows\x64\i386\templates\startrom.0

Then you will have to create an intermediate service that transforms the returned value into a script so what is returned is in total
Code:
#!ipxe
chain WDSServerName\Setup\English\Windows\x64\i386\templates\startrom.0
You might have to change the slashes as well.