Skip to content

Commit 8f49115

Browse files
author
The SoftLayer Developer Network
committed
Merge pull request #5 from SLphil/master
XML-RPC string object mask
2 parents 01d7df9 + 6b78d01 commit 8f49115

File tree

6 files changed

+23
-25
lines changed

6 files changed

+23
-25
lines changed

README.textile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ h2. Usage
2828

2929
These examples use the SoftLayer_SoapClient class. If you wish to use the XML-RPC API then replace mentions of SoapClient.class.php with XmlrpcClient.class.php and SoftLayer_SoapClient with SoftLayer_XmlrpcClient.
3030

31-
Here's a simple usage example that retrieves account information by calling the "getObject()":http://sldn.softlayer.com/wiki/index.php/SoftLayer_Account::getObject method in the "SoftLayer_Account":http://sldn.softlayer.com/wiki/index.php/SoftLayer_Account service:
31+
Here's a simple usage example that retrieves account information by calling the "getObject()":http://sldn.softlayer.com/reference/services/SoftLayer_Account/getObject method in the "SoftLayer_Account":http://sldn.softlayer.com/reference/services/SoftLayer_Account service:
3232

3333
<pre><code>
3434
<?php

SoftLayer/Common/ObjectMask.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* making your SoftLayer API calls.
5555
*
5656
* For more on object mask usage in the SoftLayer API please see
57-
* http://sldn.softlayer.com/wiki/index.php/Using_Object_Masks_in_the_SoftLayer_API .
57+
* http://sldn.softlayer.com/article/Using_Object_Masks_in_the_SoftLayer_API .
5858
*
5959
* The most up to date version of this library can be found on the SoftLayer
6060
* github public repositories: http://github.com/softlayer/ . Please post to
@@ -64,7 +64,7 @@
6464
*
6565
* @author SoftLayer Technologies, Inc. <[email protected]>
6666
* @copyright Copyright (c) 2009 - 2010, Softlayer Technologies, Inc
67-
* @license http://sldn.softlayer.com/wiki/index.php/License
67+
* @license http://sldn.softlayer.com/article/License
6868
* @see SoftLayer_SoapClient::setObjectMask()
6969
* @see SoftLayer_XmlrpcClient::setObjectMask()
7070
*/

SoftLayer/SoapClient.class.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
*
5858
* @author SoftLayer Technologies, Inc. <[email protected]>
5959
* @copyright Copyright (c) 2009 - 2010, Softlayer Technologies, Inc
60-
* @license http://sldn.softlayer.com/wiki/index.php/License
61-
* @link http://sldn.softlayer.com/wiki/index.php/The_SoftLayer_API The SoftLayer API
60+
* @license http://sldn.softlayer.com/article/License
61+
* @link http://sldn.softlayer.com/article/The_SoftLayer_API The SoftLayer API
6262
* @see SoftLayer_SoapClient_AsynchronousAction
6363
*/
6464
class Softlayer_SoapClient extends SoapClient
@@ -129,7 +129,7 @@ class Softlayer_SoapClient extends SoapClient
129129
/**
130130
* The name of the SoftLayer API service you wish to query.
131131
*
132-
* @link http://sldn.softlayer.com/wiki/index.php/Category:API_Services A list of SoftLayer API services
132+
* @link http://sldn.softlayer.com/reference/services A list of SoftLayer API services
133133
* @var string
134134
*/
135135
protected $_serviceName;
@@ -356,7 +356,7 @@ public function setAuthentication($username, $apiKey)
356356
* 1234 in the SoftLayer_Hardware_Server Service instructs the API to act on
357357
* server record 1234 in your method calls.
358358
*
359-
* @link http://sldn.softlayer.com/wiki/index.php/Using_Initialization_Parameters_in_the_SoftLayer_API Using Initialization Parameters in the SoftLayer API
359+
* @link http://sldn.softlayer.com/article/Using_Initialization_Parameters_in_the_SoftLayer_API Using Initialization Parameters in the SoftLayer API
360360
* @param int $id The ID number of the SoftLayer API object you wish to instantiate.
361361
* @return SoftLayer_SoapClient
362362
*/
@@ -409,8 +409,7 @@ public function setObjectMask($mask)
409409
* support a way to limit the number of results retrieved from the SoftLayer
410410
* API in a way akin to an SQL LIMIT statement.
411411
*
412-
* @link http://sldn.softlayer.com/wiki/index.php/Using_Result_Limits_in_the_SoftLayer_API Using Result Limits in the SoftLayer API
413-
* @link http://sldn.softlayer.com/wiki/index.php/Category:API_methods_that_can_use_result_limits API methods that can use result limits
412+
* @link http://sldn.softlayer.com/article/Using_Result_Limits_in_the_SoftLayer_API Using Result Limits in the SoftLayer API
414413
* @param int $limit The number of results to limit your SoftLayer API call to.
415414
* @param int $offset An optional offset to begin your SoftLayer API call's returned result set at.
416415
* @return SoftLayer_SoapClient

SoftLayer/SoapClient/AsynchronousAction.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
*
109109
* @author SoftLayer Technologies, Inc. <[email protected]>
110110
* @copyright Copyright (c) 2009 - 2010, Softlayer Technologies, Inc
111-
* @license http://sldn.softlayer.com/wiki/index.php/License
111+
* @license http://sldn.softlayer.com/article/License
112112
* @see SoftLayer_SoapClient
113113
*/
114114
class SoftLayer_SoapClient_AsynchronousAction

SoftLayer/XmlrpcClient.class.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
*
5252
* @author SoftLayer Technologies, Inc. <[email protected]>
5353
* @copyright Copyright (c) 2009 - 2010, Softlayer Technologies, Inc
54-
* @license http://sldn.softlayer.com/wiki/index.php/License
55-
* @link http://sldn.softlayer.com/wiki/index.php/The_SoftLayer_API The SoftLayer API
54+
* @license http://sldn.softlayer.com/article/License
55+
* @link http://sldn.softlayer.com/article/The_SoftLayer_API The SoftLayer API
5656
*/
5757
class Softlayer_XmlrpcClient
5858
{
@@ -104,7 +104,7 @@ class Softlayer_XmlrpcClient
104104
/**
105105
* The name of the SoftLayer API service you wish to query.
106106
*
107-
* @link http://sldn.softlayer.com/wiki/index.php/Category:API_Services A list of SoftLayer API services
107+
* @link http://sldn.softlayer.com/reference/services A list of SoftLayer API services
108108
* @var string
109109
*/
110110
protected $_serviceName;
@@ -302,7 +302,7 @@ public function setAuthentication($username, $apiKey)
302302
* 1234 in the SoftLayer_Hardware_Server Service instructs the API to act on
303303
* server record 1234 in your method calls.
304304
*
305-
* @link http://sldn.softlayer.com/wiki/index.php/Using_Initialization_Parameters_in_the_SoftLayer_API Using Initialization Parameters in the SoftLayer API
305+
* @link http://sldn.softlayer.com/article/Using_Initialization_Parameters_in_the_SoftLayer_API Using Initialization Parameters in the SoftLayer API
306306
* @param int $id The ID number of the SoftLayer API object you wish to instantiate.
307307
* @return SoftLayer_XmlrpcClient
308308
*/
@@ -323,26 +323,26 @@ public function setInitParameter($id)
323323
* Set an object mask to a SoftLayer API call
324324
*
325325
* Use an object mask to retrieve data related your API call's result.
326-
* Object masks are skeleton objects that define nested relational
326+
* Object masks are skeleton objects or strings that define nested relational
327327
* properties to retrieve along with an object's local properties.
328328
*
329329
* @see SoftLayer_ObjectMask
330-
* @link http://sldn.softlayer.com/wiki/index.php/Using_Object_Masks_in_the_SoftLayer_API Using object masks in the SoftLayer API
331-
* @link http://sldn.softlayer.com/wiki/index.php/Category:API_methods_that_can_use_object_masks API methods that can use object masks
330+
* @link http://sldn.softlayer.com/article/Using-Object-Masks-SoftLayer-API Using object masks in the SoftLayer API
332331
* @param object $mask The object mask you wish to define
333-
* @return SoftLayer_XmlrpcClient
332+
* @return SoftLayer_SoapClient
334333
*/
335334
public function setObjectMask($mask)
336335
{
337336
if (!is_null($mask)) {
338-
if (!($mask instanceof SoftLayer_ObjectMask)) {
339-
throw new Exception('Please provide a SoftLayer_ObjectMask to define an object mask.');
337+
$header = 'SoftLayer_ObjectMask';
338+
339+
if ($mask instanceof SoftLayer_ObjectMask) {
340+
$header = sprintf('%sObjectMask', $this->_serviceName);
340341
}
341342

342343
$objectMask = new stdClass();
343344
$objectMask->mask = $mask;
344-
345-
$this->addHeader($this->_serviceName . 'ObjectMask', $objectMask);
345+
$this->addHeader($header, $objectMask);
346346
}
347347

348348
return $this;
@@ -355,8 +355,7 @@ public function setObjectMask($mask)
355355
* support a way to limit the number of results retrieved from the SoftLayer
356356
* API in a way akin to an SQL LIMIT statement.
357357
*
358-
* @link http://sldn.softlayer.com/wiki/index.php/Using_Result_Limits_in_the_SoftLayer_API Using Result Limits in the SoftLayer API
359-
* @link http://sldn.softlayer.com/wiki/index.php/Category:API_methods_that_can_use_result_limits API methods that can use result limits
358+
* @link http://sldn.softlayer.com/article/Using_Result_Limits_in_the_SoftLayer_API Using Result Limits in the SoftLayer API
360359
* @param int $limit The number of results to limit your SoftLayer API call to.
361360
* @param int $offset An optional offset to begin your SoftLayer API call's returned result set at.
362361
* @return SoftLayer_XmlrpcClient

example.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* so it's best to try your call and catch exceptions.
6666
*
6767
* This example calls the getObject() method in the SoftLayer_Account API
68-
* service. <http://sldn.softlayer.com/wiki/index.php/SoftLayer_Account::getObject>
68+
* service. <http://sldn.softlayer.com/reference/services/SoftLayer_Account/getObject>
6969
* It retrieves basic account information, and is a great way to test your API
7070
* account and connectivity.
7171
*/

0 commit comments

Comments
 (0)