softlayer / softlayer-api-perl-client

A set of Perl libraries that assist in calling the SoftLayer API.
Other
11 stars 5 forks source link

Unable to successfully call SoftLayer_Virtual_Guest/createObject #3

Open Buhrietoe opened 9 years ago

Buhrietoe commented 9 years ago

Using the following guest definition and createObject call results in an HTTP 500 Internal Error:

my $client = SoftLayer::API::SOAP->new('SoftLayer_Virtual_Guest', undef, $api_username, $api_key); my $myGuest = { hostname => 'sl-test', domain => 'softlayer.com', startCpus => 1, maxMemory => 1024, hourlyBillingFlag => 1, localDiskFlag => 1, operatingSystemReferenceCode => 'CENTOS_6_64', datacenter => { name => "SJC01", } }; my $orderRet = $client->createObject($myGuest);

allmightyspiff commented 9 years ago

To create a Virtual_Guest with the perl client, you are going to need to bless it into the slapi::SoftLayer_Virtual_Guest class.

bless($myGuest,'slapi:SoftLayer_Virtual_Guest');
my $orderRet = $client->createObject($myGuest);