Go Back   SoftLayer Customer Forums > SoftLayer Developer Network > General Discussion
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2012, 01:49 PM
adampeterson adampeterson is offline
n00b
 
Join Date: Sep 2011
Posts: 7
adampeterson is an unknown quantity at this point
Default Trying to get IP addresses & username/pw for new CCI's

Using C#, I've gotten my code to create my CCI instances. Now I'm trying to retrieve the IP addresses, username, and passwords for each instance.

I'm assuming there's no simple way to get this from the placeOrder call, as I didn't see anything there that would do it.

So now my working assumption is that I've got to use getVirtualGuests to loop through all the guests running. By rolling in an object mask for the 'networkHardware' I've been able to retrieve the Primary IP address and Backend IP address. I'm at a loss as to where to look for the CCI's username/password though. I've tried skimming through getSoftwareComponents but didn't see anything there.

So my question is, Is there a simple way to retrieve this info from my initial placeOrder call? If not, in C#, how do I navigate through this API to find those three things I'm looking for?

Thanks,
Adam
Reply With Quote
  #2  
Old 04-20-2012, 03:11 PM
gbock's Avatar
gbock gbock is offline
CRB
 
Join Date: Jul 2007
Location: Dallas
Posts: 472
gbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond reputegbock has a reputation beyond repute
Default

Some of this information isn't available until later in the provisioning process so your best bet would be to grab it after the provision of the cci is complete.

The username password should be under the software component for the OS, and it should also be available via the operatingSystem key as a relational property.


http://sldn.softlayer.com/reference/...peratingSystem


http://sldn.softlayer.com/reference/...peratingSystem
Reply With Quote
  #3  
Old 04-23-2012, 09:10 AM
adampeterson adampeterson is offline
n00b
 
Join Date: Sep 2011
Posts: 7
adampeterson is an unknown quantity at this point
Default

Thanks for the links, I'm able to grab the info I'm after now.

Is this really the best way to do this? It really seems odd/non-intuitive to me that I can't query against some sort of result set from my order.

1) place the order for the CCI's I want
2) sleep for "some" time (probably minimum of 10 minutes?)
3) query all the CCI's running and rolling in an object mask to retrieve the Hardware object to grab the IP addresses
4) for each CCI that matches the system name I created earlier, create another object mask to roll in the Component_OperatingSystem & Component_Password

Just to clarify what I'm doing: Got a process that needs to kick off occasionally and will create 5-20 CCI's to do some number crunching. Once the images are running, I'm connecting to them and feeding them the data I need processed.

Thanks again,
Adam
Reply With Quote
  #4  
Old 04-23-2012, 10:54 AM
SLE_pjackson's Avatar
SLE_pjackson SLE_pjackson is offline
Dev Community Advocate
 
Join Date: Nov 2010
Posts: 152
SLE_pjackson is an unknown quantity at this point
Default

Quote:
Originally Posted by adampeterson View Post
Thanks for the links, I'm able to grab the info I'm after now.

Is this really the best way to do this? It really seems odd/non-intuitive to me that I can't query against some sort of result set from my order.

1) place the order for the CCI's I want
2) sleep for "some" time (probably minimum of 10 minutes?)
3) query all the CCI's running and rolling in an object mask to retrieve the Hardware object to grab the IP addresses
4) for each CCI that matches the system name I created earlier, create another object mask to roll in the Component_OperatingSystem & Component_Password

Just to clarify what I'm doing: Got a process that needs to kick off occasionally and will create 5-20 CCI's to do some number crunching. Once the images are running, I'm connecting to them and feeding them the data I need processed.

Thanks again,
Adam
Adam,

The return value for placeOrder is a SoftLayer_Container_Product_Order_Receipt which when combined with an objectMask can be used to gain information about the CCIs/servers purchased.

You can use an objectMask of...
Code:
placedOrder->items->billingItem->provisionTransaction->[guest/hardware]
... to gain access to the ordered instances or servers. This can be appended with any of the relational properties found in SoftLayer_Hardware_Server or SoftLayer_Virtual_Guest respectively including OS/password information with
Code:
->operatingSystem->passwords->password
It is also possible to pull information about the current status of the trasnaction through SoftLayer_Provisioning_Version1_Transaction_Status.
__________________
-Phil
Development Community Advocate
http://sldn.softlayer.com/
https://gist.github.com/underscorephil
irc://freenode.net/#softlayer
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump