softlayer / softlayer-api-php-client Goto Github PK
View Code? Open in Web Editor NEWA set of PHP libraries that assist in calling the SoftLayer API.
Home Page: http://sldn.softlayer.com/
License: BSD 3-Clause "New" or "Revised" License
A set of PHP libraries that assist in calling the SoftLayer API.
Home Page: http://sldn.softlayer.com/
License: BSD 3-Clause "New" or "Revised" License
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
SOAP-ENV:Header
ns1:X-RateLimit-Purge-Paths-Limit-Burst20000</ns1:X-RateLimit-Purge-Paths-Limit-Burst><<<<<<<<<<<<<<
ns1:X-RateLimit-Purge-Paths-Limit-Per-Second20</ns1:X-RateLimit-Purge-Paths-Limit-Per-Second>
ns1:X-RateLimit-Purge-Paths-Remaining19998</ns1:X-RateLimit-Purge-Paths-Remaining>
</SOAP-ENV:Header>
SOAP-ENV:Body
ns1:createPurgeGroupResponse
1583391443
680060382882299
1583391443
newtest2
<option xsi:type="
If I run the following code (where 62928835 is a valid billing item):
$object = \SoftLayer\SoapClient::getClient('SoftLayer_Billing_Item', 62928835, $apiUsername, $apiKey);
$result = $object->getObject();
print_r($result);
I can see [resourceTableId] => 315440 in the result. However, if I add an ObjectMask which includes resourceTableId:
$objectMask = "mask[resourceTableId]"
$object->setObjectMask($objectMask);
I get the following error:
Fatal error: Uncaught SoapFault exception: [SoftLayer_Exception_WebService_ObjectMask] Property 'resourceTableId' not valid for 'SoftLayer_Billing_Item'. in /Users/bradd/Documents/SoftLayer_Scripts/vendor/softlayer/softlayer-api-php-client/src/SoapClient.php:200
I can use the object mask in a REST call successfully (using a valid Billing Item ID).
https://api.softlayer.com/rest/v3/SoftLayer_Billing_Item/62928835/getObject.json?resultLimit=0,2&objectMask=resourceTableId
add in functionality to output soap headers when making a call to SL
Should adhere to PSR-1 and PSR-2. Adherance to PSR-0 would also be good, but will likely require substantial updating to accomplish.
v2.0.0 now only supports php8+, so we should make use of the language features.
https://www.php.net/manual/en/language.types.declarations.php
Semantic versioning should be adopted for the release process in order to ease dependency management.
This means v1.0
must be converted to v1.0.0
while v1.01
will become v1.0.1
.
https://github.com/softlayer/softlayer-api-php-client/blob/master/src/SoapClient.php#L385
That was likely caught in a search/replace, but it needs to be SoftLayer_ObjectMask
This breaks setting an object mask with a string format
$otherMask = "mask[location[longName]]";
SoftLayer_Product_Package::getCategories is not retrieving data for some packages when using SoftLayer_XmlrpcClient
Example:
package to use: 263
========= php script =============
getCategories(); print_r($categories); } catch(Exception $e) { echo "Unable to get categories: " . $e -> getMessage(); } ========= php script ============= Note: We are able to get categories using SoftLayer_SoapClient and REST.I recently developed a script to monitor all of our virtual servers on the IBM SoftLayer infrastructure.
The script relies on their public API, specifically on the SoftLayer_Metric_Tracking_Object
service and its getSummaryData
method; it all worked correctly for the last few months, but now the script gets nothing but empty responses.
I have checked that the API access itself happens correctly, in fact the script is able to query the virtual servers data (CPU, RAM size, ecc.), however the call to get the summary of metric data always fails with no error, just an empty array being returned.
As an example, here are the parameters used in one such call:
startDateTime = "2017-04-06T07:22:48+02:00"
endDateTime = "2017-04-06T10:22:48+02:00"
validTypes = array(3) {
[0]=>
object(stdClass)#283 (2) {
["keyName"]=>
string(12) "MEMORY_USAGE"
["summaryType"]=>
string(7) "average"
}
[1]=>
object(stdClass)#282 (2) {
["keyName"]=>
string(4) "CPU0"
["summaryType"]=>
string(7) "average"
}
[2]=>
object(stdClass)#281 (2) {
["keyName"]=>
string(4) "CPU1"
["summaryType"]=>
string(7) "average"
}
}
summaryPeriod = 3600
After initial deployment I did not change the script, which now stopped working, and I'd like to know why it did, more specifically if it is perhaps called with, as of now, wrong parameters.
There're following methods on SoftLayer_B
cancelService
cancelServiceOnAnniversaryDate
cancelItem -> with option to cancel immediately or cancel on anniversary date
For Storage types of product, (e.g Endurance Storage), only cancelService() methods can be used. API gives an error when using cancelServiceOnAnniversaryDate or cancelItem
Can you please provide the API to allow cancel storage product on anniversary date?
Thanks.
I use the SoftLayer API to let user to cancel product. We have use case which let the customer to cancel the the item on anniversary date, then the provider can void the customer anniversary cancellation order and cancel the server immediately. For hourly bare-metal server, I use call
SoftLayer_Billing_Item.
My test example is $orderId =8623619; billingId = 103903285 hourly baremetal server
I can see a ticket 28899623 is generated then void with step 1 and step 2.
The step 3 call gives an error "There was an error querying the SoftLayer API: A cancellation ticket already exists for this server. Please refer to ticket 28899623.
Please refer SoftLayer ticket # 28969957 for more information and sample php file.
Thanks.
According to git example:
$objectMask = new \SoftLayer\ObjectMask();
$objectMask->updates;
$objectMask->assignedUser;
$objectMask->attachedHardware->datacenter;
$client->setObjectMask($objectMask);
The following exception is displayed:
Fatal error: Class 'SoftLayer\ObjectMask' not found in ...
It works fine doing the following change:
$objectMask = new \SoftLayer\Common\ObjectMask();
Please add another branch/tag with support of PHP 8.2.
Currently, many deprecation notices and exceptions are thrown.
Currently the unit tests actually try to get the WSDL from api.softlayer.com, and try to make actual API calls during the tests.
To fix that we need to do the following:
SoftLayer_Billing_Item.voidCancelService() generates exception for various type of products
anniversary date. Once more, in order to cancel these type of cancellations you would need to contact us
or our sales team."
API: Cannot void cancellation for this service through the API.".
The "SoftLayer_Billing_Item-> cancellationDate attribute value is set to empty even after these exceptions, then allows to call cancelService() to be make.
Can you please fix the API to not have any exception when call voidCancelService() to void the previous anniversary cancellation ?
Please also see SoftLayer internal ticket # 28969547 with sample php file used.
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.