From 86f9d02351b98a487147cadcbb3fc9de5d878e17 Mon Sep 17 00:00:00 2001 From: Avi Weit Date: Fri, 24 Apr 2015 14:35:22 +0000 Subject: [PATCH] [LIBCLOUD-702] Add tests for Softlayer loadbalancer driver --- .../softlayer/ex_place_balancer_order.py | 2 +- ..._SoftLayer_Account_getAdcLoadBalancers.xml | 802 +++ ...__SoftLayer_Billing_Item_cancelService.xml | 8 + ...yer_Location_Datacenter_getDatacenters.xml | 683 +++ ...ller_LoadBalancer_Service_deleteObject.xml | 8 + ...adBalancer_VirtualIpAddress_editObject.xml | 8 + ...lancer_VirtualIpAddress_getBillingItem.xml | 147 + ...oadBalancer_VirtualIpAddress_getObject.xml | 803 +++ ...etwork_Subnet_IpAddress_getByIpAddress.xml | 148 + ...v3__SoftLayer_Product_Order_placeOrder.xml | 709 +++ ...v3__SoftLayer_Product_Package_getItems.xml | 5448 +++++++++++++++++ libcloud/test/loadbalancer/test_softlayer.py | 190 + 12 files changed, 8955 insertions(+), 1 deletion(-) create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Account_getAdcLoadBalancers.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Billing_Item_cancelService.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Location_Datacenter_getDatacenters.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_Service_deleteObject.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_editObject.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getBillingItem.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getObject.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Subnet_IpAddress_getByIpAddress.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Order_placeOrder.xml create mode 100644 libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Package_getItems.xml create mode 100644 libcloud/test/loadbalancer/test_softlayer.py diff --git a/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py b/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py index 60cd42d97b..ad921993d9 100644 --- a/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py +++ b/docs/examples/loadbalancer/softlayer/ex_place_balancer_order.py @@ -21,4 +21,4 @@ driver.ex_place_balancer_order(lb_package, NodeLocation(DATACENTER, None, None, None)) -print('Successfully submitted oder request, from package' % (lb_package)) +print('Successfully submitted oder request, from package %s' % (lb_package)) diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Account_getAdcLoadBalancers.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Account_getAdcLoadBalancers.xml new file mode 100644 index 0000000000..3b29fc18c2 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Account_getAdcLoadBalancers.xml @@ -0,0 +1,802 @@ + + + + + + + + + + accountId + + 411826 + + + + connectionLimit + + 50 + + + + connectionLimitUnits + + connections/second + + + + dedicatedFlag + + 0 + + + + id + + 76185 + + + + ipAddressId + + 7303289 + + + + securityCertificateId + + + + + + sslActiveFlag + + 0 + + + + sslEnabledFlag + + 0 + + + + highAvailabilityFlag + + 0 + + + + ipAddress + + + + id + + 7303289 + + + + ipAddress + + 108.168.157.130 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 1 + + + + note + + Load balancer VIP + + + + subnetId + + 406030 + + + + + + + loadBalancerHardware + + + + + + + accountId + + 1 + + + + bareMetalInstanceFlag + + 0 + + + + domain + + softlayer.com + + + + fullyQualifiedDomainName + + lb04.dal05.softlayer.com + + + + hardwareStatusId + + 5 + + + + hostname + + lb04.dal05 + + + + id + + 178860 + + + + notes + + + + + + provisionDate + + + + + + serviceProviderId + + 1 + + + + serviceProviderResourceId + + 178860 + + + + datacenter + + + + id + + 138124 + + + + longName + + Dallas 5 + + + + name + + dal05 + + + + statusId + + 2 + + + + + + + + + + + + + virtualServers + + + + + + + allocation + + 100 + + + + id + + 132193 + + + + port + + 80 + + + + routingMethodId + + + + + + virtualIpAddressId + + 76185 + + + + serviceGroups + + + + + + + id + + 131113 + + + + routingMethodId + + 10 + + + + routingTypeId + + 2 + + + + timeout + + + + + + routingMethod + + + + id + + 10 + + + + keyname + + ROUND_ROBIN + + + + name + + Round Robin + + + + + + + routingType + + + + id + + 2 + + + + keyname + + HTTP + + + + name + + HTTP + + + + + + + services + + + + + + + enabled + + 1 + + + + id + + 221145 + + + + ipAddressId + + 33499201 + + + + notes + + inst-test-276a.example.com + + + + port + + 8080 + + + + status + + DOWN + + + + ipAddress + + + + id + + 33499201 + + + + ipAddress + + 75.126.161.106 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 0 + + + + subnetId + + 22958 + + + + subnet + + + + broadcastAddress + + 75.126.161.111 + + + + cidr + + 29 + + + + gateway + + 75.126.161.105 + + + + id + + 22958 + + + + isCustomerOwned + + 0 + + + + isCustomerRoutable + + 0 + + + + modifyDate + + 2015-04-19T03:04:09+02:00 + + + + netmask + + 255.255.255.248 + + + + networkIdentifier + + 75.126.161.104 + + + + networkVlanId + + 815621 + + + + sortOrder + + 4 + + + + subnetType + + PRIMARY + + + + totalIpAddresses + + 8 + + + + usableIpAddressCount + + 5 + + + + version + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + accountId + + 411826 + + + + connectionLimit + + 50 + + + + connectionLimitUnits + + connections/second + + + + dedicatedFlag + + 0 + + + + id + + 76265 + + + + ipAddressId + + 25808370 + + + + securityCertificateId + + + + + + sslActiveFlag + + 0 + + + + sslEnabledFlag + + 0 + + + + highAvailabilityFlag + + 0 + + + + ipAddress + + + + id + + 25808370 + + + + ipAddress + + 159.8.117.72 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 1 + + + + note + + Load balancer VIP + + + + subnetId + + 717366 + + + + + + + loadBalancerHardware + + + + + + + accountId + + 1 + + + + bareMetalInstanceFlag + + 0 + + + + domain + + softlayer.com + + + + fullyQualifiedDomainName + + lb01.par01.softlayer.com + + + + hardwareStatusId + + 5 + + + + hostname + + lb01.par01 + + + + id + + 390016 + + + + notes + + + + + + provisionDate + + + + + + serviceProviderId + + 1 + + + + serviceProviderResourceId + + 390016 + + + + datacenter + + + + id + + 449500 + + + + longName + + Paris 1 + + + + name + + par01 + + + + statusId + + 2 + + + + + + + + + + + + + virtualServers + + + + + + + + + + + + + diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Billing_Item_cancelService.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Billing_Item_cancelService.xml new file mode 100644 index 0000000000..082b69e2d5 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Billing_Item_cancelService.xml @@ -0,0 +1,8 @@ + + + + + 1 + + + \ No newline at end of file diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Location_Datacenter_getDatacenters.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Location_Datacenter_getDatacenters.xml new file mode 100644 index 0000000000..dfbb9a8804 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Location_Datacenter_getDatacenters.xml @@ -0,0 +1,683 @@ + + + + + + + + + + id + + 265592 + + + + longName + + Amsterdam 1 + + + + name + + ams01 + + + + statusId + + 2 + + + + + + + + id + + 814994 + + + + longName + + Amsterdam 3 + + + + name + + ams03 + + + + statusId + + 2 + + + + + + + + id + + 3 + + + + longName + + Dallas 1 + + + + name + + dal01 + + + + statusId + + 2 + + + + + + + + id + + 154770 + + + + longName + + Dallas 2 + + + + name + + dal02 + + + + statusId + + 2 + + + + + + + + id + + 167092 + + + + longName + + Dallas 4 + + + + name + + dal04 + + + + statusId + + 2 + + + + + + + + id + + 138124 + + + + longName + + Dallas 5 + + + + name + + dal05 + + + + statusId + + 2 + + + + + + + + id + + 154820 + + + + longName + + Dallas 6 + + + + name + + dal06 + + + + statusId + + 2 + + + + + + + + id + + 142776 + + + + longName + + Dallas 7 + + + + name + + dal07 + + + + statusId + + 2 + + + + + + + + id + + 449494 + + + + longName + + Dallas 9 + + + + name + + dal09 + + + + statusId + + 2 + + + + + + + + id + + 449506 + + + + longName + + Frankfurt 2 + + + + name + + fra02 + + + + statusId + + 2 + + + + + + + + id + + 352494 + + + + longName + + Hong Kong 2 + + + + name + + hkg02 + + + + statusId + + 2 + + + + + + + + id + + 142775 + + + + longName + + Houston 2 + + + + name + + hou02 + + + + statusId + + 2 + + + + + + + + id + + 358694 + + + + longName + + London 2 + + + + name + + lon02 + + + + statusId + + 2 + + + + + + + + id + + 449596 + + + + longName + + Melbourne 1 + + + + name + + mel01 + + + + statusId + + 2 + + + + + + + + id + + 449600 + + + + longName + + Mexico 1 + + + + name + + mex01 + + + + statusId + + 2 + + + + + + + + id + + 449610 + + + + longName + + Montreal 1 + + + + name + + mon01 + + + + statusId + + 2 + + + + + + + + id + + 449500 + + + + longName + + Paris 1 + + + + name + + par01 + + + + statusId + + 2 + + + + + + + + id + + 168642 + + + + longName + + San Jose 1 + + + + name + + sjc01 + + + + statusId + + 2 + + + + + + + + id + + 18171 + + + + longName + + Seattle + + + + name + + sea01 + + + + statusId + + 2 + + + + + + + + id + + 224092 + + + + longName + + Singapore 1 + + + + name + + sng01 + + + + statusId + + 2 + + + + + + + + id + + 449612 + + + + longName + + Sydney 1 + + + + name + + syd01 + + + + statusId + + 2 + + + + + + + + id + + 449604 + + + + longName + + Tokyo 2 + + + + name + + tok02 + + + + statusId + + 2 + + + + + + + + id + + 448994 + + + + longName + + Toronto 1 + + + + name + + tor01 + + + + statusId + + 2 + + + + + + + + id + + 37473 + + + + longName + + Washington 1 + + + + name + + wdc01 + + + + statusId + + 2 + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_Service_deleteObject.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_Service_deleteObject.xml new file mode 100644 index 0000000000..5dca3779f2 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_Service_deleteObject.xml @@ -0,0 +1,8 @@ + + + + + 1 + + + diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_editObject.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_editObject.xml new file mode 100644 index 0000000000..5dca3779f2 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_editObject.xml @@ -0,0 +1,8 @@ + + + + + 1 + + + diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getBillingItem.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getBillingItem.xml new file mode 100644 index 0000000000..08356d3739 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getBillingItem.xml @@ -0,0 +1,147 @@ + + + + + + + allowCancellationFlag + + 1 + + + + cancellationDate + + + + + + categoryCode + + proxy_load_balancer + + + + createDate + + 2015-04-24T15:19:21+02:00 + + + + cycleStartDate + + 2015-04-24T15:19:21+02:00 + + + + description + + Load Balancer 50 connections + + + + id + + 50844215 + + + + laborFee + + 0 + + + + laborFeeTaxRate + + 0 + + + + lastBillDate + + 2015-04-24T15:19:21+02:00 + + + + modifyDate + + 2015-04-24T15:19:23+02:00 + + + + nextBillDate + + 2015-05-01T07:00:00+02:00 + + + + notes + + 1.2.3.4 + + + + oneTimeFee + + 0 + + + + oneTimeFeeTaxRate + + 0 + + + + orderItemId + + 65021573 + + + + parentId + + + + + + recurringFee + + 29 + + + + recurringFeeTaxRate + + 0 + + + + recurringMonths + + 1 + + + + serviceProviderId + + 1 + + + + setupFee + + 0 + + + + setupFeeTaxRate + + 0 + + + + + + \ No newline at end of file diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getObject.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getObject.xml new file mode 100644 index 0000000000..b39fafca82 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getObject.xml @@ -0,0 +1,803 @@ + + + + + + + accountId + + 411826 + + + + connectionLimit + + 50 + + + + connectionLimitUnits + + connections/second + + + + dedicatedFlag + + 0 + + + + id + + 76185 + + + + ipAddressId + + 7303289 + + + + securityCertificateId + + + + + + sslActiveFlag + + 0 + + + + sslEnabledFlag + + 0 + + + + highAvailabilityFlag + + 0 + + + + managedResourceFlag + + 0 + + + + virtualServers + + + + + + + allocation + + 100 + + + + id + + 132193 + + + + port + + 80 + + + + routingMethodId + + + + + + virtualIpAddressId + + 76185 + + + + serviceGroups + + + + + + + id + + 131113 + + + + routingMethodId + + 10 + + + + routingTypeId + + 2 + + + + timeout + + + + + + services + + + + + + + enabled + + 1 + + + + id + + 226227 + + + + ipAddressId + + 29341260 + + + + port + + 8000 + + + + status + + UP + + + + groupReferences + + + + + + + serviceGroupId + + 131113 + + + + serviceId + + 226227 + + + + weight + + 1 + + + + + + + + + + ipAddress + + + + id + + 29341260 + + + + ipAddress + + 10.126.5.34 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 0 + + + + subnetId + + 730826 + + + + subnet + + + + broadcastAddress + + 10.126.5.63 + + + + cidr + + 26 + + + + gateway + + 10.126.5.1 + + + + id + + 730826 + + + + isCustomerOwned + + 0 + + + + isCustomerRoutable + + 0 + + + + modifyDate + + 2015-04-19T03:14:26+02:00 + + + + netmask + + 255.255.255.192 + + + + networkIdentifier + + 10.126.5.0 + + + + networkVlanId + + 728518 + + + + sortOrder + + 4 + + + + subnetType + + PRIMARY + + + + totalIpAddresses + + 64 + + + + usableIpAddressCount + + 61 + + + + version + + 4 + + + + + + + + + + + + + + enabled + + 1 + + + + id + + 226229 + + + + ipAddressId + + 29341262 + + + + port + + 8080 + + + + status + + UP + + + + groupReferences + + + + + + + serviceGroupId + + 131113 + + + + serviceId + + 226229 + + + + weight + + 1 + + + + + + + + + + ipAddress + + + + id + + 29341262 + + + + ipAddress + + 10.126.5.35 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 0 + + + + subnetId + + 730826 + + + + subnet + + + + broadcastAddress + + 10.126.5.63 + + + + cidr + + 26 + + + + gateway + + 10.126.5.1 + + + + id + + 730826 + + + + isCustomerOwned + + 0 + + + + isCustomerRoutable + + 0 + + + + modifyDate + + 2015-04-19T03:14:26+02:00 + + + + netmask + + 255.255.255.192 + + + + networkIdentifier + + 10.126.5.0 + + + + networkVlanId + + 728518 + + + + sortOrder + + 4 + + + + subnetType + + PRIMARY + + + + totalIpAddresses + + 64 + + + + usableIpAddressCount + + 61 + + + + version + + 4 + + + + + + + + + + + + + + enabled + + 1 + + + + id + + 221145 + + + + ipAddressId + + 33499201 + + + + notes + + inst-test-276a.example.com + + + + port + + 8080 + + + + status + + UP + + + + groupReferences + + + + + + + serviceGroupId + + 131113 + + + + serviceId + + 221145 + + + + weight + + 1 + + + + + + + + + + ipAddress + + + + id + + 33499201 + + + + ipAddress + + 75.75.75.75 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 0 + + + + subnetId + + 22958 + + + + subnet + + + + broadcastAddress + + 75.75.75.75 + + + + cidr + + 29 + + + + gateway + + 75.75.75.75 + + + + id + + 22958 + + + + isCustomerOwned + + 0 + + + + isCustomerRoutable + + 0 + + + + modifyDate + + 2015-04-19T03:04:09+02:00 + + + + netmask + + 255.255.255.248 + + + + networkIdentifier + + 75.75.75.75 + + + + networkVlanId + + 815621 + + + + sortOrder + + 4 + + + + subnetType + + PRIMARY + + + + totalIpAddresses + + 8 + + + + usableIpAddressCount + + 5 + + + + version + + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Subnet_IpAddress_getByIpAddress.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Subnet_IpAddress_getByIpAddress.xml new file mode 100644 index 0000000000..3ae4871d9d --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Network_Subnet_IpAddress_getByIpAddress.xml @@ -0,0 +1,148 @@ + + + + + + + id + + 29341260 + + + + ipAddress + + 10.126.5.34 + + + + isBroadcast + + 0 + + + + isGateway + + 0 + + + + isNetwork + + 0 + + + + isReserved + + 0 + + + + subnetId + + 730826 + + + + subnet + + + + broadcastAddress + + 10.126.5.63 + + + + cidr + + 26 + + + + gateway + + 10.126.5.1 + + + + id + + 730826 + + + + isCustomerOwned + + 0 + + + + isCustomerRoutable + + 0 + + + + modifyDate + + 2015-04-19T03:14:26+02:00 + + + + netmask + + 255.255.255.192 + + + + networkIdentifier + + 10.126.5.0 + + + + networkVlanId + + 728518 + + + + sortOrder + + 4 + + + + subnetType + + PRIMARY + + + + totalIpAddresses + + 64 + + + + usableIpAddressCount + + 61 + + + + version + + 4 + + + + + + + + + diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Order_placeOrder.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Order_placeOrder.xml new file mode 100644 index 0000000000..3cc4b9cc1d --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Order_placeOrder.xml @@ -0,0 +1,709 @@ + + + + + + + orderDate + + 2015-04-24T15:19:20+02:00 + + + + orderId + + 4320271 + + + + orderDetails + + + + bigDataOrderFlag + + 0 + + + + billingOrderItemId + + + + + + containerSplHash + + 00000000 + + + + currencyShortName + + USD + + + + extendedHardwareTesting + + + + + + imageTemplateId + + + + + + isManagedOrder + + 0 + + + + location + + 265592 + + + + message + + + + + + packageId + + 0 + + + + paymentType + + ADD_TO_BALANCE + + + + postTaxRecurring + + 29 + + + + postTaxRecurringHourly + + 0 + + + + postTaxRecurringMonthly + + 29 + + + + postTaxSetup + + 0 + + + + preTaxRecurring + + 29 + + + + preTaxRecurringHourly + + 0 + + + + preTaxRecurringMonthly + + 29 + + + + preTaxSetup + + 0 + + + + presetId + + + + + + primaryDiskPartitionId + + + + + + privateCloudOrderFlag + + 0 + + + + proratedInitialCharge + + 6.77 + + + + proratedOrderTotal + + 6.77 + + + + quantity + + 1 + + + + resourceGroupId + + + + + + resourceGroupTemplateId + + + + + + sendQuoteEmailFlag + + + + + + serverCoreCount + + + + + + sourceVirtualGuestId + + + + + + stepId + + + + + + taxCacheHash + + b94c43e22aeaedb3dc4 + + + + taxCompletedFlag + + 1 + + + + totalRecurringTax + + 0 + + + + totalSetupTax + + 0 + + + + useHourlyPricing + + 0 + + + + billingInformation + + + + billingAddressLine1 + + University + + + + billingCity + + Haifa + + + + billingCountryCode + + IL + + + + billingEmail + + someone@com + + + + billingNameCompany + + IBM + + + + billingNameFirst + + Foo + + + + billingNameLast + + Bar + + + + billingPhoneVoice + + 972-4-44444 + + + + billingPostalCode + + 0000 + + + + billingState + + OT + + + + cardExpirationMonth + + + + + + cardExpirationYear + + + + + + taxExempt + + 0 + + + + + + + itemCategoryQuestionAnswers + + + + + + + + locationObject + + + + id + + 265592 + + + + longName + + Amsterdam 1 + + + + name + + ams01 + + + + + + + prices + + + + + + + id + + 33021 + + + + itemId + + 565 + + + + laborFee + + 0 + + + + oneTimeFee + + 0 + + + + recurringFee + + 29 + + + + setupFee + + 0 + + + + categories + + + + + + + categoryCode + + proxy_load_balancer + + + + id + + 55 + + + + name + + Proxy Load Balancer + + + + + + + + + + item + + + + capacity + + 50 + + + + description + + Load Balancer 50 connections + + + + id + + 565 + + + + keyName + + LOAD_BALANCER_50_CONNECTIONS + + + + units + + Connections/Second + + + + bundle + + + + + + + + + + + + + + + + + properties + + + + + + + + sshKeys + + + + + + + + storageGroups + + + + + + + + + + + placedOrder + + + + accountId + + 411826 + + + + id + + 4320271 + + + + orderQuoteId + + + + + + orderTypeId + + 4 + + + + presaleEventId + + + + + + status + + PENDING_AUTO_APPROVAL + + + + userRecordId + + 315282 + + + + account + + + + brandId + + 30130 + + + + companyName + + IBM + + + + id + + 411826 + + + + + + + items + + + + + + + categoryCode + + proxy_load_balancer + + + + description + + Load Balancer 50 connections + + + + id + + 65021573 + + + + itemId + + 565 + + + + itemPriceId + + 33021 + + + + laborFee + + 0 + + + + oneTimeFee + + 0 + + + + parentId + + + + + + promoCodeId + + + + + + recurringFee + + 29 + + + + setupFee + + 0 + + + + children + + + + + + + + + + + + + + userRecord + + + + accountId + + 00000 + + + + firstName + + Foo + + + + id + + 00000 + + + + lastName + + Foo + + + + username + + foo + + + + + + + + + + + + diff --git a/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Package_getItems.xml b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Package_getItems.xml new file mode 100644 index 0000000000..751f180d75 --- /dev/null +++ b/libcloud/test/loadbalancer/fixtures/softlayer/v3__SoftLayer_Product_Package_getItems.xml @@ -0,0 +1,5448 @@ + + + + + + + + + + capacity + + 0 + + + + description + + Citrix VDC + + + + id + + 1148 + + + + itemTaxCategoryId + + 166 + + + + keyName + + CITRIX_VDC + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 24912 + + + + itemId + + 1148 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 65000 + + + + description + + Load Balancer (Dedicated, with SSL offload) - 15,000 Connections + + + + id + + 4136 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_DEDICATED_WITH_SSL_OFFLOAD_15000_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 25314 + + + + itemId + + 4136 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 849 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 200 + + + + description + + Citrix NetScaler VPX 10.5 200Mbps Platinum + + + + id + + 5916 + + + + itemTaxCategoryId + + 166 + + + + keyName + + CITRIX_NETSCALER_VPX_10_5_200MBPS_PLATINUM + + + + softwareDescriptionId + + 1378 + + + + units + + Mbps + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 44970 + + + + itemId + + 5916 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 899 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 64 + + + + description + + /64 Block Static Public IPv6 Addresses + + + + id + + 784 + + + + itemTaxCategoryId + + 166 + + + + keyName + + 64_BLOCK_STATIC_PUBLIC_IPV6_ADDRESSES + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + hourlyRecurringFee + + .007 + + + + id + + 26340 + + + + itemId + + 784 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 0 + + + + sort + + 10 + + + + + + + + + + + + + + capacity + + 4 + + + + description + + .info - 4 year + + + + id + + 4007 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_INFO_4_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 26584 + + + + itemId + + 4007 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 38.48 + + + + sort + + 3 + + + + + + + + + + + + + + capacity + + 50 + + + + description + + Load Balancer 50 connections + + + + id + + 565 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_50_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + Connections/Second + + + + upgradeItemId + + 567 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 33021 + + + + itemId + + 565 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 29 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + + capacity + + 0 + + + + description + + Reseller Domain Credit + + + + id + + 4065 + + + + itemTaxCategoryId + + 162 + + + + keyName + + RESELLER_DOMAIN_CREDIT + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 27728 + + + + itemId + + 4065 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 0 + + + + sort + + 10 + + + + + + + + + + + + + + capacity + + 250 + + + + description + + CDN 250 GB Bandwidth + + + + id + + 892 + + + + itemTaxCategoryId + + 166 + + + + keyName + + CDN_250_GB_BANDWIDTH + + + + softwareDescriptionId + + + + + + units + + GB + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 27770 + + + + itemId + + 892 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 20 + + + + setupFee + + 0 + + + + sort + + 10 + + + + + + + + + + + + + + capacity + + 3 + + + + description + + .biz - 3 year + + + + id + + 3995 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_BIZ_3_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 29940 + + + + itemId + + 3995 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 33 + + + + sort + + 2 + + + + + + + + + + + + + + capacity + + 0 + + + + description + + Dedicated Rack (Half) + + + + id + + 1302 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DEDICATED_RACK_HALF + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 31299 + + + + itemId + + 1302 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 1100 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 1000 + + + + description + + Load Balancer 1,000 connections + + + + id + + 566 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_1000_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + Connections/Second + + + + upgradeItemId + + 571 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 31322 + + + + itemId + + 566 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 499 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 5 + + + + description + + .info - 5 year + + + + id + + 4023 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_INFO_5_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 31340 + + + + itemId + + 4023 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 48.1 + + + + sort + + 4 + + + + + + + + + + + + + + capacity + + 7 + + + + description + + .us - 7 year + + + + id + + 3999 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_US_7_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 32381 + + + + itemId + + 3999 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 57.33 + + + + sort + + 6 + + + + + + + + + + + + + + capacity + + 0 + + + + description + + Windows 2008 Datacenter w/ Unlimited Virtuals (2 Proc License) + + + + id + + 791 + + + + itemTaxCategoryId + + 166 + + + + keyName + + VIRTUAL_OS_WINDOWS_2008_DATACENTER_W_UNLIMITED_VIRTUALS_2_PROC_LICENSE + + + + softwareDescriptionId + + 723 + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 32695 + + + + itemId + + 791 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 127.5 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 250 + + + + description + + Load Balancer 250 VIP Connections + + + + id + + 1106 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_250_VIP_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + Connections/Second + + + + upgradeItemId + + 1105 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 33908 + + + + itemId + + 1106 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 29 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 1500 + + + + description + + 1500GB EVault Disk to Disk Enterprise Backup + + + + id + + 4185 + + + + itemTaxCategoryId + + 166 + + + + keyName + + EVAULT_1500_GB + + + + softwareDescriptionId + + 159 + + + + units + + GIGABYTE + + + + upgradeItemId + + 955 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 34594 + + + + itemId + + 4185 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 543.75 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 65000 + + + + description + + Dedicated Load Balancer with High Availability and SSL - 15,000 Connections + + + + id + + 4512 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DEDICATED_LOAD_BALANCER_WITH_HIGH_AVAILABILITY_AND_SSL_15000_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 36019 + + + + itemId + + 4512 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 1698 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 10 + + + + description + + Citrix NetScaler VPX 10.5 10Mbps Platinum + + + + id + + 5912 + + + + itemTaxCategoryId + + 166 + + + + keyName + + CITRIX_NETSCALER_VPX_10_5_10MBPS_PLATINUM + + + + softwareDescriptionId + + 1374 + + + + units + + Mbps + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 44950 + + + + itemId + + 5912 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 459 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 0 + + + + description + + EVault Plugin - VMWare ESX + + + + id + + 1087 + + + + itemTaxCategoryId + + 166 + + + + keyName + + EVAULT_PLUGIN_VMWARE_ESX + + + + softwareDescriptionId + + 635 + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 23040 + + + + itemId + + 1087 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 8.5 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 8 + + + + description + + 8 Static Public IP Addresses + + + + id + + 583 + + + + itemTaxCategoryId + + 166 + + + + keyName + + 8_STATIC_PUBLIC_IP_ADDRESSES + + + + softwareDescriptionId + + + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + hourlyRecurringFee + + 0 + + + + id + + 36692 + + + + itemId + + 583 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + currentPriceFlag + + + + + + id + + 29583 + + + + itemId + + 583 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 8 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + currentPriceFlag + + + + + + id + + 31207 + + + + itemId + + 583 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 8 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + currentPriceFlag + + + + + + hourlyRecurringFee + + .007 + + + + id + + 23392 + + + + itemId + + 583 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 2000 + + + + description + + Load Balancer 2,000 connections + + + + id + + 617 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_2000_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + Connections/Second + + + + upgradeItemId + + 618 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 23794 + + + + itemId + + 617 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 999 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 3 + + + + description + + .us - 3 year + + + + id + + 4011 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_US_3_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 24083 + + + + itemId + + 4011 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 24.57 + + + + sort + + 2 + + + + + + + + + + + + + + capacity + + 2 + + + + description + + FortiGate Security Appliance (High Availability) + + + + id + + 4338 + + + + itemTaxCategoryId + + 166 + + + + keyName + + FORTIGATE_SECURITY_APPLIANCE_HIGH_AVAILABILITY + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 24741 + + + + itemId + + 4338 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 1699 + + + + setupFee + + 0 + + + + sort + + 1 + + + + + + + + + + + + + + capacity + + 100000 + + + + description + + Advanced Package + + + + id + + 3859 + + + + itemTaxCategoryId + + 166 + + + + keyName + + NETWORK_MESSAGE_DELIVERY_ADVANCED_PACKAGE + + + + longDescription + + <ul> <li>Overage - $0.00085</li> <li>Bounce Tracking</li> <li>Unsub Tracking</li> <li>Click Tracking</li> <li>Open Tracking</li> <li>Dedicated IP</li> </ul> + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 24995 + + + + itemId + + 3859 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 36 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 0 + + + + description + + Global IPv6 + + + + id + + 4187 + + + + itemTaxCategoryId + + 166 + + + + keyName + + GLOBAL_IPV6 + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 25282 + + + + itemId + + 4187 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 20 + + + + setupFee + + 0 + + + + sort + + 10 + + + + + + + + + + + + + + capacity + + 0 + + + + description + + CDN Pay as You Go Bandwidth + + + + id + + 891 + + + + itemTaxCategoryId + + 166 + + + + keyName + + CDN_PAY_AS_YOU_GO_BANDWIDTH + + + + softwareDescriptionId + + + + + + units + + GB + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 25482 + + + + itemId + + 891 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 0 + + + + sort + + 5 + + + + + + + + + + + + + + capacity + + 2 + + + + description + + .net - 2 year + + + + id + + 4001 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_NET_2_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 25495 + + + + itemId + + 4001 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 22 + + + + sort + + 1 + + + + + + + + + + + + + + capacity + + 1 + + + + description + + QuickSSL Premium - 1 year + + + + id + + 1293 + + + + itemTaxCategoryId + + 166 + + + + keyName + + SSL_CERTIFICATE_QUICKSSL_PREMIUM_1_YEAR + + + + longDescription + + <h3>GeoTrust QuickSSL&reg; Premium SSL</h3> <p> GeoTrust QuickSSL Premium Certificates are convenient and economical entry-level SSL Certificates. These certificates enable up to 256-bit encryption (depending on your client's browser capability and the cipher suite installed on your Web server) and are issued through an automated process that usually results in certificates being issued within minutes of being ordered. This process verifies that a certificate purchaser has appropriate administrative rights to a Web server's domain. </p> <h3>Features and Benefits</h3> <ul> <li>Domain-level authentication</li> <li>Up to 256-bit encryption</li> <li>True Site Seal embedded with a date/time stamp</li> <li>Issuance, often within minutes</li> <li>Unlimited, free self-service reissues</li> </ul> + + + + softwareDescriptionId + + + + + + units + + DV + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 25847 + + + + itemId + + 1293 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 79 + + + + sort + + 3 + + + + + + + + + + + + + + capacity + + 2 + + + + description + + Hardware Firewall (High Availability) + + + + id + + 3896 + + + + itemTaxCategoryId + + 166 + + + + keyName + + HARDWARE_FIREWALL_HIGH_AVAILABILITY + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 26005 + + + + itemId + + 3896 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 1398 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 3 + + + + description + + .org - 3 year + + + + id + + 4002 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_ORG_3_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 26323 + + + + itemId + + 4002 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 30 + + + + sort + + 2 + + + + + + + + + + + + + + capacity + + 64 + + + + description + + /64 Block Portable Public IPv6 Addresses + + + + id + + 785 + + + + itemTaxCategoryId + + 166 + + + + keyName + + 64_BLOCK_PORTABLE_PUBLIC_IPV6_ADDRESSES + + + + softwareDescriptionId + + + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 28502 + + + + itemId + + 785 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 10 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 2500 + + + + description + + Load Balancer 2,500 VIP Connections + + + + id + + 1103 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_2500_VIP_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + Connections/Second + + + + upgradeItemId + + 1102 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 30681 + + + + itemId + + 1103 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 299 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 500 + + + + description + + Load Balancer 500 VIP Connections + + + + id + + 1105 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_500_VIP_CONNECTIONS + + + + softwareDescriptionId + + + + + + units + + Connections/Second + + + + upgradeItemId + + 1104 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 33416 + + + + itemId + + 1105 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 49 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 0 + + + + description + + Windows 2008 Datacenter w/ Unlimited Virtuals (4 Proc License) + + + + id + + 792 + + + + itemTaxCategoryId + + 166 + + + + keyName + + VIRTUAL_OS_WINDOWS_2008_DATACENTER_W_UNLIMITED_VIRTUALS_4_PROC_LICENSE + + + + softwareDescriptionId + + 723 + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 34006 + + + + itemId + + 792 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 255 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 1500 + + + + description + + Load Balancer 1,500 connections + + + + id + + 616 + + + + itemTaxCategoryId + + 166 + + + + keyName + + LOAD_BALANCER_1500_CONNECTIONS + + + + softwareDescriptionId + + + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 30815 + + + + itemId + + 616 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 749 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 2 + + + + description + + .com - 2 year + + + + id + + 4013 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_COM_2_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 31127 + + + + itemId + + 4013 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 19.88 + + + + sort + + 1 + + + + + + + + + + + + + + capacity + + 10 + + + + description + + .net - 10 year + + + + id + + 4032 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_NET_10_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 31647 + + + + itemId + + 4032 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 110 + + + + sort + + 9 + + + + + + + + + + + + + + description + + Hardware Firewall (Dedicated) + + + + id + + 1329 + + + + itemTaxCategoryId + + 166 + + + + keyName + + HARDWARE_FIREWALL_DEDICATED + + + + softwareDescriptionId + + + + + + units + + dedicated + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 33373 + + + + itemId + + 1329 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 699 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 2 + + + + description + + .org - 2 year + + + + id + + 3993 + + + + itemTaxCategoryId + + 166 + + + + keyName + + DOMAIN_ORG_2_YEAR + + + + softwareDescriptionId + + + + + + units + + N/A + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 22693 + + + + itemId + + 3993 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 20 + + + + sort + + 1 + + + + + + + + + + + + + + capacity + + 8 + + + + description + + 8 Portable Private IP Addresses + + + + id + + 3903 + + + + itemTaxCategoryId + + 166 + + + + keyName + + 8_PORTABLE_PRIVATE_IP_ADDRESSES + + + + softwareDescriptionId + + + + + + units + + IPs + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 23104 + + + + itemId + + 3903 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 0 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 1000 + + + + description + + 1000GB EVault Disk to Disk Enterprise Backup + + + + id + + 563 + + + + itemTaxCategoryId + + 166 + + + + keyName + + EVAULT_1000_GB + + + + softwareDescriptionId + + 159 + + + + units + + GIGABYTE + + + + upgradeItemId + + 4185 + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 28124 + + + + itemId + + 563 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 362.5 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + capacity + + 1000 + + + + description + + Citrix NetScaler VPX 10.5 1000Mbps Standard + + + + id + + 5910 + + + + itemTaxCategoryId + + 166 + + + + keyName + + CITRIX_NETSCALER_VPX_10_5_1000MBPS_STANDARD + + + + softwareDescriptionId + + 1380 + + + + units + + Mbps + + + + upgradeItemId + + + + + + prices + + + + + + + currentPriceFlag + + + + + + id + + 44938 + + + + itemId + + 5910 + + + + laborFee + + 0 + + + + onSaleFlag + + + + + + oneTimeFee + + 0 + + + + quantity + + + + + + recurringFee + + 999 + + + + setupFee + + 0 + + + + sort + + 0 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libcloud/test/loadbalancer/test_softlayer.py b/libcloud/test/loadbalancer/test_softlayer.py new file mode 100644 index 0000000000..90499bee17 --- /dev/null +++ b/libcloud/test/loadbalancer/test_softlayer.py @@ -0,0 +1,190 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys +import unittest + +from libcloud.utils.py3 import httplib +from libcloud.utils.py3 import xmlrpclib + +from libcloud.compute.base import NodeLocation +from libcloud.loadbalancer.base import Member, Algorithm +from libcloud.loadbalancer.drivers.softlayer import SoftlayerLBDriver +from libcloud.loadbalancer.types import State + +from libcloud.test import MockHttpTestCase +from libcloud.test.secrets import SOFTLAYER_PARAMS +from libcloud.test.file_fixtures import LoadBalancerFileFixtures + + +class SoftlayerLBTests(unittest.TestCase): + def setUp(self): + + SoftlayerLBDriver.connectionCls.conn_classes = (SoftLayerMockHttp, + SoftLayerMockHttp) + SoftLayerMockHttp.type = None + + self.driver = SoftlayerLBDriver(*SOFTLAYER_PARAMS) + + def test_list_protocols(self): + protocols = self.driver.list_protocols() + + self.assertEqual(len(protocols), 6) + self.assertTrue('tcp' in protocols) + self.assertTrue('http' in protocols) + + def test_list_balancers(self): + balancers = self.driver.list_balancers() + + self.assertEqual(len(balancers), 2) + self.assertEqual(balancers[0].id, '76185') + self.assertEqual(balancers[0].extra['datacenter'], 'dal05') + self.assertEqual(balancers[0].extra['connection_limit'], 50) + self.assertEqual(balancers[1].id, '76265') + self.assertEqual(balancers[1].extra['datacenter'], 'par01') + self.assertEqual(balancers[1].extra['connection_limit'], 50) + + def test_get_balancer(self): + balancer = self.driver.get_balancer(balancer_id='76185') + + self.assertEqual(balancer.id, '76185') + self.assertEqual(balancer.state, State.UNKNOWN) + self.assertEqual(balancer.extra['datacenter'], 'dal05') + self.assertEqual(balancer.extra['protocol'], 'http') + self.assertEqual(balancer.extra['algorithm'], Algorithm.ROUND_ROBIN) + + def test_balancer_list_members(self): + balancer = self.driver.get_balancer(balancer_id='76185') + members = balancer.list_members() + + self.assertEqual(len(members), 3) + self.assertEqual(members[0].balancer, balancer) + self.assertEqual(members[0].id, '226227') + self.assertEqual(members[0].ip, '10.126.5.34') + self.assertEqual(members[1].balancer, balancer) + self.assertEqual(members[1].id, '226229') + self.assertEqual(members[1].ip, '10.126.5.35') + + def test_balancer_attach_member(self): + balancer = self.driver.get_balancer(balancer_id='76185') + member = balancer.attach_member(Member(None, ip='10.126.5.34', + port=8000)) + + self.assertEqual(member.id, '226227') + self.assertEqual(member.ip, '10.126.5.34') + self.assertEqual(member.port, 8000) + + def test_balancer_detach_member(self): + balancer = self.driver.get_balancer(balancer_id='76265') + member = Member('226227', None, None) + + self.assertTrue(balancer.detach_member(member)) + + def test_destroy_balancer(self): + balancer = self.driver.get_balancer(balancer_id='76185') + + self.assertTrue(self.driver.destroy_balancer(balancer)) + + def test_ex_list_balancer_packages(self): + packages = self.driver.ex_list_balancer_packages() + self.assertEqual(len(packages), 9) + + def test_ex_place_balancer_order(self): + packages = self.driver.ex_list_balancer_packages() + lb_package = [p for p in packages if p.capacity == 50][0] + + self.assertTrue(self.driver.ex_place_balancer_order( + lb_package, NodeLocation('dal05', None, None, None))) + + +class SoftLayerMockHttp(MockHttpTestCase): + fixtures = LoadBalancerFileFixtures('softlayer') + + def _get_method_name(self, type, use_param, qs, path): + return "_xmlrpc" + + def _xmlrpc(self, method, url, body, headers): + params, meth_name = xmlrpclib.loads(body) + url = url.replace("/", "_") + meth_name = "%s_%s" % (url, meth_name) + return getattr(self, meth_name)(method, url, body, headers) + + def _xmlrpc_v3_SoftLayer_Account_getAdcLoadBalancers( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Account_getAdcLoadBalancers.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Billing_Item_cancelService(self, method, url, + body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Billing_Item_cancelService.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Location_Datacenter_getDatacenters( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Location_Datacenter_getDatacenters.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_Service_deleteObject( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Network_Application_Delivery_Controller_' + 'LoadBalancer_Service_deleteObject.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_editObject( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Network_Application_Delivery_Controller_' + 'LoadBalancer_VirtualIpAddress_editObject.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getBillingItem( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Network_Application_Delivery_Controller_' + 'LoadBalancer_VirtualIpAddress_getBillingItem.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress_getObject( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Network_Application_Delivery_Controller_' + 'LoadBalancer_VirtualIpAddress_getObject.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Network_Subnet_IpAddress_getByIpAddress( + self, method, url, body, headers): + body = self.fixtures.load( + 'v3__SoftLayer_Network_Subnet_IpAddress_getByIpAddress.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Product_Order_placeOrder(self, method, url, body, + headers): + body = self.fixtures.load( + 'v3__SoftLayer_Product_Order_placeOrder.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + def _xmlrpc_v3_SoftLayer_Product_Package_getItems(self, method, url, body, + headers): + body = self.fixtures.load( + 'v3__SoftLayer_Product_Package_getItems.xml') + return (httplib.OK, body, {}, httplib.responses[httplib.OK]) + + +if __name__ == "__main__": + sys.exit(unittest.main())