如何使用SoftLayer API获取EVault插件列表?

时间:2016-01-07 23:02:43

标签: ibm-cloud-infrastructure

我使用什么SoftLayer API来获取我拥有的EVault插件列表? 它可以是我拥有的所有EVault插件,也可以是与特定EVault或特定主机关联的所有插件。

我需要一个包含每个细节的列表 或者获取一个列表,然后找到一种从列表中获取每个细节的方法。

也许我错过了,但我没有看到来自SoftLayer_Network_Storage_Backup_Evault的任何有用的API,或者没有看到任何包含单词"插件"的SoftLayer服务API。

2 个答案:

答案 0 :(得分:0)

您可以使用“SoftLayer_Product_Package :: getCategories”获取Evault插件项目。

参考:

  

http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getCategories

例如:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/0/getCategories?objectMask=mask[id,categoryCode,groups[prices[id,item]]]

Method: GET

Where: 
The package used for Evault is 0
The “categoryCode” that we are interested in: "categoryCode": "evault_plugin"

结果将是这样的:

{
"categoryCode": "evault_plugin"
"id": 57
"groups": [1]
0:  {
"itemCategoryId": 57
"packageId": 0
"sort": 0
"prices": [30]
0:  {
"id": 11111
"item": {
"description": "EVault Plugin - Sharepoint"
"id": 111
"itemTaxCategoryId": 166
"keyName": "EVAULT_PLUGIN_SHAREPOINT"
"softwareDescriptionId": 175
"upgradeItemId": null
}-
}-
1:  {
"id": 22222
"item": {
"description": "EVault Plugin - Oracle"
"id": 222
"itemTaxCategoryId": 166
"keyName": "EVAULT_PLUGIN_ORACLE"
"softwareDescriptionId": 177
"upgradeItemId": null
}-
}-
2:  {
"id": 33333
"item": {
"description": "EVault Plugin - Open TXN Manager"
"id": 333
"itemTaxCategoryId": 166
"keyName": "EVAULT_PLUGIN_OPEN_TXN_MANAGER"
"softwareDescriptionId": 176
"upgradeItemId": null
}-
}
….

答案 1 :(得分:0)

试试这个:

<?php

require_once ('/SoapClient.class.php');

$username = 'set me';
$key = 'set me';

$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $username, $key);

$objectMask = new SoftLayer_ObjectMask();
$objectMask->evaultNetworkStorage->pluginBillingItems;
$objectMask->evaultNetworkStorage->pluginBillingItems->item;
$accountClient->setObjectMask($objectMask);

# Getting the billing items
$result = $accountClient->getEvaultNetworkStorage();

print_r($result);