Coder Social home page Coder Social logo

softlayer / softlayer-api-php-client Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 22.0 119 KB

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

PHP 100.00%

softlayer-api-php-client's People

Contributors

allmightyspiff avatar dustinmoorman avatar enygma avatar jgulledge avatar juice10 avatar phansys avatar underscorephil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

softlayer-api-php-client's Issues

how to get soap header infor by this API ?

<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="

SoftLayer_Billing_Item object mask failing for resourceTableId in SOAP/PHP

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

SoftLayer_Product_Package::getCategories is not retrieving data for some packages when using SoftLayer_XmlrpcClient

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.

Softlayer metric tracking object stopped returning summary data

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.

No SoftLayer API to cancel storage type of products on anniversary date

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.

SoftLayer API Error using cancelItem immediately for hourly baremetal server

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.

    1. cancelItem ( false, false, "No longer needed", "No longer needed, was testing server" ) //cancel on anniversary date,
    1. voidCancelService() to void previous cancellatoin
    1. cancelItem ( true, false, "No longer needed", "No longer needed, was testing server" ) to cancel immediately.

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.

The "\SoftLayer\ObjectMask" class doesn't exist to create an object mask

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();

PHP 8.2 is not supported

Please add another branch/tag with support of PHP 8.2.

Currently, many deprecation notices and exceptions are thrown.

Update unit tests to not actually make API calls

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:

  1. Setup SoapClient to have a property for the Soap Client itself, which we can overload in the tests.
  2. Have a fixture for the WSDL or something for the fake soap client to use.

SoftLayer API Error in voidCancelService

SoftLayer_Billing_Item.voidCancelService() generates exception for various type of products

  • For virtual server/baremetal server, it gives error "The ticket was closed automatically as the cancellation was approved and set to cancel on the

anniversary date. Once more, in order to cancel these type of cancellations you would need to contact us

or our sales team."

  • for network product such as IP SecVPN, it gives error such as "There was an error querying the SoftLayer

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.