Repository: softlayer/softlayer-python
Pull request #1953 (2023-05-17 22:15:11)

Updated command - slcli report bandwidth
Issue: #1947 
![image](https://github.com/softlayer/softlayer-python/assets/43519769/162b847e-e8d8-42de-bb8b-2492271101c7)



Patch:
diff --git a/SoftLayer/CLI/account/billing_items.py b/SoftLayer/CLI/account/billing_items.py
index 0f16af2f..4ca7f4d7 100644
--- a/SoftLayer/CLI/account/billing_items.py
+++ b/SoftLayer/CLI/account/billing_items.py
@@ -10,24 +10,21 @@
 
 
 @click.command(cls=SLCommand)
-@click.option('--create', '-c', help='The date the billing item was created.')
-@click.option('--ordered', '-o', help='Name that ordered the item')
-@click.option('--category', '-C', help='Category name')
 @environment.pass_env
-def cli(env, create, category, ordered):
+def cli(env):
     """Lists billing items with some other useful information.
 
     Similiar to https://cloud.ibm.com/billing/billing-items
     """
 
     manager = AccountManager(env.client)
-    items = manager.get_account_billing_items(create, category)
-    table = item_table(items, ordered)
+    items = manager.get_account_billing_items()
+    table = item_table(items)
 
     env.fout(table)
 
 
-def item_table(items, ordered=None):
+def item_table(items):
     """Formats a table for billing items"""
     table = formatting.Table([
         "Id",
@@ -51,9 +48,7 @@ def item_table(items, ordered=None):
         if user:
             # ordered_by = "{} ({})".format(user.get('displayName'), utils.lookup(user, 'userStatus', 'name'))
             ordered_by = user.get('displayName')
-        if ordered:
-            if ordered != ordered_by:
-                continue
+
         table.add_row([
             item.get('id'),
             create_date,
diff --git a/SoftLayer/CLI/formatting.py b/SoftLayer/CLI/formatting.py
index e23eb527..38cafb31 100644
--- a/SoftLayer/CLI/formatting.py
+++ b/SoftLayer/CLI/formatting.py
@@ -111,6 +111,74 @@ def gb(gigabytes):  # pylint: disable=C0103
     return FormattedItem(int(float(gigabytes)) * 1024, "%dG" % int(float(gigabytes)))
 
 
+def convert_sizes(value, unit='GB', round_result=False):
+    """Converts a data storage value to an appropriate unit.
+
+    :param str value: The value to convert.
+    :param str unit: The unit of the value ('B', 'KB', 'MB', 'GB', 'TB').
+    :param bool round_result: rounded result
+    :return: The converted value and its unit.
+    """
+
+    if not value:
+        return '0.00 MB'
+
+    value = float(value)
+
+    if value == 0:
+        return "0.00 MB"
+
+    units = ['B', 'KB', 'MB', 'GB', 'TB']
+    if unit not in units:
+        return "Invalid unit. Must be one of 'B', 'KB', 'MB', 'GB', 'TB'"
+
+    unit_index = units.index(unit)
+
+    while value > 999 and unit_index < len(units) - 1:
+        value /= 1024
+        unit_index += 1
+
+    while value < 1 and unit_index > 0:
+        value *= 1024
+        unit_index -= 1
+
+    if round_result:
+        value = round(value / 5) * 5
+    return "{:.2f} {}".format(value, units[unit_index])
+
+
+def sum_sizes(size1, size2):
+    """Sums two data storage values.
+
+    :param str size1: The first value and its unit.
+    :param str size2: The second value and its unit.
+    :return: The sum of the values and its unit.
+    """
+    if size1 == '0.00 MB':
+        return size2
+    if size2 == '0.00 MB':
+        return size1
+
+    value1, unit1 = float(size1.split()[0]), size1.split()[1]
+    value2, unit2 = float(size2.split()[0]), size2.split()[1]
+
+    units = ['B', 'KB', 'MB', 'GB', 'TB']
+    if unit1 not in units or unit2 not in units:
+        return "Invalid unit in one of the sizes. Unit must be one of 'B', 'KB', 'MB', 'GB', 'TB'"
+
+    value1 *= (1024 ** units.index(unit1))
+    value2 *= (1024 ** units.index(unit2))
+
+    total_value = value1 + value2
+
+    total_unit = 'B'
+    while total_value > 999 and total_unit != 'TB':
+        total_value /= 1024
+        total_unit = units[units.index(total_unit) + 1]
+
+    return "{:.2f} {}".format(total_value, total_unit)
+
+
 def blank():
     """Returns a blank FormattedItem."""
     return FormattedItem(None, '-')
diff --git a/SoftLayer/CLI/order/cancelation.py b/SoftLayer/CLI/order/cancelation.py
deleted file mode 100644
index 6bade7ac..00000000
--- a/SoftLayer/CLI/order/cancelation.py
+++ /dev/null
@@ -1,30 +0,0 @@
-"""List all cancelation."""
-# :license: MIT, see LICENSE for more details.
-import click
-
-from SoftLayer.CLI.command import SLCommand as SLCommand
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import formatting
-from SoftLayer.managers import ordering
-from SoftLayer import utils
-
-
-@click.command(cls=SLCommand)
-@environment.pass_env
-def cli(env):
-    """List all account cancelations"""
-    table = formatting.Table([
-        'Case Number', 'Items', 'Created', 'Status', 'Requested by'])
-
-    manager = ordering.OrderingManager(env.client)
-    cancelations = manager.get_all_cancelation()
-
-    for item in cancelations:
-        table.add_row([item.get('ticketId'), item.get('itemCount'),
-                       utils.clean_time(item.get('createDate'),
-                                        in_format='%Y-%m-%dT%H:%M:%S', out_format='%Y-%m-%d %H:%M'),
-                       item['status']['name'],
-                       item['user']['firstName'] + ' ' + item['user']['lastName']
-                       ])
-
-    env.fout(table)
diff --git a/SoftLayer/CLI/report/bandwidth.py b/SoftLayer/CLI/report/bandwidth.py
index c207a718..b1a22007 100644
--- a/SoftLayer/CLI/report/bandwidth.py
+++ b/SoftLayer/CLI/report/bandwidth.py
@@ -1,8 +1,4 @@
-"""Metric Utilities"""
-import datetime
-import itertools
-import sys
-
+"""Bandwidth report for every pool/server."""
 import click
 
 from SoftLayer.CLI.command import SLCommand as SLCommand
@@ -11,246 +7,87 @@
 from SoftLayer import utils
 
 
-# pylint: disable=unused-argument
-def _validate_datetime(ctx, param, value):
-    try:
-        return datetime.datetime.strptime(value, "%Y-%m-%d")
-    except (ValueError, TypeError):
-        pass
-
-    try:
-        return datetime.datetime.strptime(value, "%Y-%m-%d %H:%M:%S")
-    except (ValueError, TypeError) as ex:
-        message = "not in the format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'"
-        raise click.BadParameter(message) from ex
-
-
-def _get_pooled_bandwidth(env, start, end):
-    call = env.client.call('Account', 'getVirtualDedicatedRacks',
-                           iter=True,
-                           mask='id,name,metricTrackingObjectId')
-    types = [
-        {'keyName': 'PUBLICIN',
-         'name': 'publicIn',
-         'summaryType': 'sum'},
-        {'keyName': 'PUBLICOUT',
-         'name': 'publicOut',
-         'summaryType': 'sum'},
-        {'keyName': 'PRIVATEIN',
-         'name': 'privateIn',
-         'summaryType': 'sum'},
-        {'keyName': 'PRIVATEOUT',
-         'name': 'privateOut',
-         'summaryType': 'sum'},
-    ]
-
-    with click.progressbar(list(call),
-                           label='Calculating for bandwidth pools',
-                           file=sys.stderr) as pools:
-        for pool in pools:
-            metric_tracking_id = pool.get('metricTrackingObjectId')
-
-            if metric_tracking_id is None:
-                continue
-
-            pool_detail = {
-                'id': pool.get('id'),
-                'type': 'pool',
-                'name': pool.get('name'),
-                'data': []
-            }
-            bw_data = env.client.call(
-                'Metric_Tracking_Object',
-                'getSummaryData',
-                start.strftime('%Y-%m-%d %H:%M:%S %Z'),
-                end.strftime('%Y-%m-%d %H:%M:%S %Z'),
-                types,
-                300,
-                id=metric_tracking_id,
-            )
-            pool_detail['data'] = bw_data
-
-            yield pool_detail
-
-
-def _get_hardware_bandwidth(env, start, end):
-    hw_call = env.client.call(
-        'Account', 'getHardware',
-        iter=True,
-        mask='id,hostname,metricTrackingObject.id,'
-             'virtualRack[id,bandwidthAllotmentTypeId,name]')
-    types = [
-        {'keyName': 'PUBLICIN',
-         'name': 'publicIn',
-         'summaryType': 'counter'},
-        {'keyName': 'PUBLICOUT',
-         'name': 'publicOut',
-         'summaryType': 'counter'},
-        {'keyName': 'PRIVATEIN',
-         'name': 'privateIn',
-         'summaryType': 'counter'},
-        {'keyName': 'PRIVATEOUT',
-         'name': 'privateOut',
-         'summaryType': 'counter'},
-    ]
-
-    with click.progressbar(list(hw_call),
-                           label='Calculating for hardware',
-                           file=sys.stderr) as hws:
-        for instance in hws:
-            if not utils.lookup(instance, 'metricTrackingObject', 'id'):
-                continue
-
-            pool_name = None
-            if utils.lookup(instance,
-                            'virtualRack',
-                            'bandwidthAllotmentTypeId') == 2:
-                pool_name = utils.lookup(instance, 'virtualRack', 'name')
-
-            yield {
-                'id': instance['id'],
-                'type': 'hardware',
-                'name': instance['hostname'],
-                'pool': pool_name,
-                'data': env.client.call(
-                    'Metric_Tracking_Object',
-                    'getSummaryData',
-                    start.strftime('%Y-%m-%d %H:%M:%S %Z'),
-                    end.strftime('%Y-%m-%d %H:%M:%S %Z'),
-                    types,
-                    3600,
-                    id=instance['metricTrackingObject']['id'],
-                ),
-            }
-
-
-def _get_virtual_bandwidth(env, start, end):
-    call = env.client.call(
-        'Account', 'getVirtualGuests',
-        iter=True,
-        mask='id,hostname,metricTrackingObjectId,'
-             'virtualRack[id,bandwidthAllotmentTypeId,name]')
-    types = [
-        {'keyName': 'PUBLICIN_NET_OCTET',
-         'name': 'publicIn_net_octet',
-         'summaryType': 'sum'},
-        {'keyName': 'PUBLICOUT_NET_OCTET',
-         'name': 'publicOut_net_octet',
-         'summaryType': 'sum'},
-        {'keyName': 'PRIVATEIN_NET_OCTET',
-         'name': 'privateIn_net_octet',
-         'summaryType': 'sum'},
-        {'keyName': 'PRIVATEOUT_NET_OCTET',
-         'name': 'privateOut_net_octet',
-         'summaryType': 'sum'},
-    ]
-
-    with click.progressbar(list(call),
-                           label='Calculating for virtual',
-                           file=sys.stderr) as vms:
-        for instance in vms:
-            metric_tracking_id = utils.lookup(instance,
-                                              'metricTrackingObjectId')
-
-            if metric_tracking_id is None:
-                continue
-
-            pool_name = None
-            if utils.lookup(instance,
-                            'virtualRack',
-                            'bandwidthAllotmentTypeId') == 2:
-                pool_name = utils.lookup(instance, 'virtualRack', 'name')
-
-            yield {
-                'id': instance['id'],
-                'type': 'virtual',
-                'name': instance['hostname'],
-                'pool': pool_name,
-                'data': env.client.call(
-                    'Metric_Tracking_Object',
-                    'getSummaryData',
-                    start.strftime('%Y-%m-%d %H:%M:%S %Z'),
-                    end.strftime('%Y-%m-%d %H:%M:%S %Z'),
-                    types,
-                    3600,
-                    id=metric_tracking_id,
-                ),
-            }
-
-
 @click.command(cls=SLCommand, short_help="Bandwidth report for every pool/server")
-@click.option('--start', callback=_validate_datetime,
-              default=(datetime.datetime.now() - datetime.timedelta(days=30)).strftime('%Y-%m-%d'),
-              help="datetime in the format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'")
-@click.option('--end', callback=_validate_datetime, default=datetime.datetime.now().strftime('%Y-%m-%d'),
-              help="datetime in the format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS'")
-@click.option('--sortby', help='Column to sort by', default='hostname', show_default=True)
-@click.option('--virtual', is_flag=True, default=False,
-              help='Show only the bandwidth summary for each virtual server')
-@click.option('--server', is_flag=True, default=False,
-              help='Show only the bandwidth summary for each hardware server')
-@click.option('--pool', is_flag=True, default=False,
-              help='Show only the bandwidth pool summary.')
 @environment.pass_env
-def cli(env, start, end, sortby, virtual, server, pool):
+def cli(env):
     """Bandwidth report for every pool/server.
 
     This reports on the total data transfered for each virtual sever, hardware
     server and bandwidth pool.
+    https://cloud.ibm.com/classic-bandwidth
     """
 
-    env.err('Generating bandwidth report for %s to %s' % (start, end))
-
     table = formatting.Table([
-        'type',
-        'hostname',
-        'public_in',
-        'public_out',
-        'private_in',
-        'private_out',
-        'pool',
+        'Id',
+        'Device name',
+        'Location',
+        'Allocation',
+        'Data in',
+        'Data out',
+        'Total usage',
+        'Pool',
+        'Tags',
     ])
-    table.sortby = sortby
 
-    def f_type(key, results):
-        "Filter metric data by type"
-        return (result['counter'] for result in results
-                if result['type'] == key)
+    mask = """mask[resource(SoftLayer_Hardware)[id,bandwidthAllocation,bandwidthAllotmentDetail[id,bandwidthAllotment
+    [id,bandwidthAllotmentTypeId,name]],billingItem[id,createDate,lastBillDate],datacenter[id,name],
+    fullyQualifiedDomainName,inboundPublicBandwidthUsage,outboundPublicBandwidthUsage,primaryIpAddress,tagReferences
+    [id,tag[id,name]]],resource(SoftLayer_Network_Application_Delivery_Controller)[id,billingItem[id,
+    bandwidthAllocation[id,amount],bandwidthAllotmentDetail[id,bandwidthAllotment[id,bandwidthAllotmentTypeId,name]]
+    ,createDate,lastBillDate],datacenter[id,name],name,outboundPublicBandwidthUsage,primaryIpAddress,tagReferences
+    [id,tag[id,name]]],resource(SoftLayer_Virtual_Guest)[id,bandwidthAllocation,bandwidthAllotmentDetail[id,
+    bandwidthAllotment[id,bandwidthAllotmentTypeId,name]],billingItem[id,createDate,lastBillDate],datacenter[id,name
+    ],fullyQualifiedDomainName,inboundPublicBandwidthUsage,outboundPublicBandwidthUsage,primaryIpAddress,
+    tagReferences[id,tag[id,name]]]]"""
+
+    search_string = """_objectType:SoftLayer_Hardware,SoftLayer_Virtual_Guest,
+    SoftLayer_Network_Application_Delivery_Controller _sort:[fullyQualifiedDomainName:asc]"""
+
+    servers = env.client.call(
+        'Search', 'advancedSearch',
+        search_string,
+        mask=mask,
+        iter=True
+    )
+
+    for server in servers:
+        resource = server.get('resource')
+
+        device_name = utils.lookup(resource, 'fullyQualifiedDomainName')
+        if not device_name:
+            device_name = utils.lookup(resource, 'name')
+
+        bandwidth_allocation = utils.lookup(resource, 'bandwidthAllocation')
+        if bandwidth_allocation != '0':
+            if bandwidth_allocation is not None:
+                bandwidth_allocation = formatting.convert_sizes(
+                    bandwidth_allocation, round_result=True)
+            else:
+                bandwidth_allocation = 'Unlimited'
+        else:
+            bandwidth_allocation = 'Pay-As-You-Go'
 
-    def _input_to_table(item):
-        "Input metric data to table"
-        pub_in = int(sum(f_type('publicIn_net_octet', item['data'])))
-        pub_out = int(sum(f_type('publicOut_net_octet', item['data'])))
-        pri_in = int(sum(f_type('privateIn_net_octet', item['data'])))
-        pri_out = int(sum(f_type('privateOut_net_octet', item['data'])))
-        table.add_row([
-            item['type'],
-            item['name'],
-            formatting.b_to_gb(pub_in),
-            formatting.b_to_gb(pub_out),
-            formatting.b_to_gb(pri_in),
-            formatting.b_to_gb(pri_out),
-            item.get('pool') or formatting.blank(),
-        ])
+        in_bandwidth_public = formatting.convert_sizes(utils.lookup(resource, 'inboundPublicBandwidthUsage'))
+
+        out_bandwidth_public = formatting.convert_sizes(utils.lookup(resource, 'outboundPublicBandwidthUsage'))
+
+        total_bandwidth_public = formatting.sum_sizes(in_bandwidth_public, out_bandwidth_public)
 
-    try:
-        if virtual:
-            for item in itertools.chain(_get_pooled_bandwidth(env, start, end),
-                                        _get_virtual_bandwidth(env, start, end)):
-                _input_to_table(item)
-        elif server:
-            for item in itertools.chain(_get_pooled_bandwidth(env, start, end),
-                                        _get_hardware_bandwidth(env, start, end)):
-                _input_to_table(item)
-        elif pool:
-            for item in _get_pooled_bandwidth(env, start, end):
-                _input_to_table(item)
+        if bandwidth_allocation != 'Unlimited' and bandwidth_allocation != 'Pay-As-You-Go':
+            pool = utils.lookup(resource, 'bandwidthAllotmentDetail', 'bandwidthAllotment', 'name')
         else:
-            for item in itertools.chain(_get_pooled_bandwidth(env, start, end),
-                                        _get_hardware_bandwidth(env, start, end),
-                                        _get_virtual_bandwidth(env, start, end)):
-                _input_to_table(item)
-    except KeyboardInterrupt:
-        env.err("Printing collected results and then aborting.")
+            pool = 'Not Applicable'
+
+        table.add_row([
+            utils.lookup(resource, 'id'),
+            device_name,
+            utils.lookup(resource, 'datacenter', 'name'),
+            bandwidth_allocation,
+            in_bandwidth_public,
+            out_bandwidth_public,
+            total_bandwidth_public,
+            pool,
+            formatting.tags(resource.get('tagReferences')),
+        ])
 
-    env.out(env.fmt(table))
+    env.fout(table)
diff --git a/SoftLayer/CLI/routes.py b/SoftLayer/CLI/routes.py
index 3922541f..8527c5ce 100644
--- a/SoftLayer/CLI/routes.py
+++ b/SoftLayer/CLI/routes.py
@@ -279,7 +279,6 @@
     ('order:quote-save', 'SoftLayer.CLI.order.quote_save:cli'),
     ('order:quote', 'SoftLayer.CLI.order.quote:cli'),
     ('order:lookup', 'SoftLayer.CLI.order.lookup:cli'),
-    ('order:cancelation', 'SoftLayer.CLI.order.cancelation:cli'),
 
     ('hardware', 'SoftLayer.CLI.hardware'),
     ('hardware:bandwidth', 'SoftLayer.CLI.hardware.bandwidth:cli'),
@@ -391,7 +390,6 @@
     ('user:remove-access', 'SoftLayer.CLI.user.remove_access:cli'),
     ('user:grant-access', 'SoftLayer.CLI.user.grant_access:cli'),
     ('user:vpn-password', 'SoftLayer.CLI.user.vpn_password:cli'),
-    ('user:apikey', 'SoftLayer.CLI.user.apikey:cli'),
 
     ('vlan', 'SoftLayer.CLI.vlan'),
     ('vlan:create', 'SoftLayer.CLI.vlan.create:cli'),
diff --git a/SoftLayer/CLI/user/apikey.py b/SoftLayer/CLI/user/apikey.py
deleted file mode 100644
index c94643d6..00000000
--- a/SoftLayer/CLI/user/apikey.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""Allows to create, remove or refresh user's API authentication key."""
-import click
-
-import SoftLayer
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import helpers
-
-
-@click.command(cls=SoftLayer.CLI.command.SLCommand, )
-@click.argument('identifier')
-@click.option('--add', is_flag=True, default=False,
-              help="Create an user's API authentication key.")
-@click.option('--remove', is_flag=True, default=False,
-              help="Remove an user's API authentication key.")
-@click.option('--refresh', is_flag=True, default=False,
-              help="Refresh an user's API authentication key.")
-@environment.pass_env
-def cli(env, identifier, add, remove, refresh):
-
-    """Allows to create, remove or refresh user's API authentication key.
-
-    Each user can only have a single API key.
-    """
-
-    options = {
-        '--add': add,
-        '--remove': remove,
-        '--refresh': refresh,
-    }
-
-    if not any(options.values()):
-        raise exceptions.CLIAbort(f'At least one option is required: [{",".join(options.keys())}]')
-
-    if sum(options.values()) > 1:
-        raise exceptions.CLIAbort(f'Can only specify one option of [{",".join(options.keys())}]')
-
-    mgr = SoftLayer.UserManager(env.client)
-    user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
-
-    if remove or refresh:
-        mgr.remove_api_authentication_key(user_id)
-        click.secho('Successfully removed API authentication key', fg='green')
-
-    if add or refresh:
-        api_authentication_key = mgr.add_api_authentication_key(user_id)
-        click.secho(f'Successfully added. New API Authentication Key: {api_authentication_key}', fg='green')
diff --git a/SoftLayer/fixtures/SoftLayer_Billing_Item_Cancellation_Request.py b/SoftLayer/fixtures/SoftLayer_Billing_Item_Cancellation_Request.py
deleted file mode 100644
index f5bdb59a..00000000
--- a/SoftLayer/fixtures/SoftLayer_Billing_Item_Cancellation_Request.py
+++ /dev/null
@@ -1,25 +0,0 @@
-getAllCancellationRequests = [
-    {"createDate": "2023-04-20T06:53:17-06:00",
-     "id": 123456,
-     "ticketId": 147258,
-     "itemCount": 1,
-     "items": [
-         {
-             "billingItemId": 369852,
-             "id": 147852369,
-             "billingItem": {
-                 "cancellationDate": "2023-05-03T22:59:59-06:00",
-                 "categoryCode": "server",
-             }
-         }
-     ],
-     "status": {
-         "id": 4,
-         "name": "Approved"
-     },
-     "user": {
-         "firstName": "CHRISTOPHER",
-         "id": 167758,
-         "lastName": "GALLO"
-     }
-     }]
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Storage.py b/SoftLayer/fixtures/SoftLayer_Network_Storage.py
index b6097c71..0854e6ba 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_Storage.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_Storage.py
@@ -257,9 +257,3 @@
 convertCloneDependentToIndependent = {
     'dependentDuplicate': 1
 }
-
-getDuplicateConversionStatus = {
-    'activeConversionStartTime': '2023-01-01',
-    'deDuplicateConversionPercentage': 50,
-    'volumeUsername': 'testUser'
-}
diff --git a/SoftLayer/fixtures/SoftLayer_User_Customer.py b/SoftLayer/fixtures/SoftLayer_User_Customer.py
index b53ea5e9..7bd3de7d 100644
--- a/SoftLayer/fixtures/SoftLayer_User_Customer.py
+++ b/SoftLayer/fixtures/SoftLayer_User_Customer.py
@@ -84,8 +84,7 @@
 removeBulkPortalPermission = True
 createObject = getObject
 editObject = True
-addApiAuthenticationKey = "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a"
-removeApiAuthenticationKey = True
+addApiAuthenticationKey = True
 updateVpnUser = True
 removeDedicatedHostAccess = True
 removeHardwareAccess = True
@@ -95,17 +94,6 @@
 addVirtualGuestAccess = True
 updateVpnPassword = True
 
-getApiAuthenticationKeys = [
-    {
-        "authenticationKey": "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a",
-        "id": 123456,
-        "timestampKey": 12121212,
-        "userId": 111111
-    }
-]
-
-getEmptyApiAuthenticationKeys = []
-
 getHardware = [{
         "domain": "testedit.com",
         "fullyQualifiedDomainName": "test.testedit.com",
diff --git a/SoftLayer/managers/account.py b/SoftLayer/managers/account.py
index 54080e65..a07312f9 100644
--- a/SoftLayer/managers/account.py
+++ b/SoftLayer/managers/account.py
@@ -203,7 +203,7 @@ def get_billing_items(self, identifier):
             limit=100
         )
 
-    def get_account_billing_items(self, create=None, category=None, mask=None):
+    def get_account_billing_items(self, mask=None):
         """Gets all the topLevelBillingItems currently active on the account
 
         :param string mask: Object Mask
@@ -226,13 +226,6 @@ def get_account_billing_items(self, create=None, category=None, mask=None):
             }
         }
 
-        if category:
-            object_filter = utils.dict_merge(object_filter,
-                                             {"allTopLevelBillingItems": {"categoryCode": {"operation": category}}})
-        if create:
-            object_filter = utils.dict_merge(object_filter,
-                                             {"allTopLevelBillingItems": {"createDate": {"operation": create}}})
-
         return self.client.call('Account', 'getAllTopLevelBillingItems',
                                 mask=mask, filter=object_filter, iter=True, limit=100)
 
diff --git a/SoftLayer/managers/ordering.py b/SoftLayer/managers/ordering.py
index e68c55b1..778d7bab 100644
--- a/SoftLayer/managers/ordering.py
+++ b/SoftLayer/managers/ordering.py
@@ -19,7 +19,6 @@
 PRESET_MASK = '''id, name, keyName, description, prices[id, hourlyRecurringFee, recurringFee], locations'''
 
 
-# pylint: disable=R0904
 class OrderingManager(object):
     """Manager to help ordering via the SoftLayer API.
 
@@ -746,12 +745,3 @@ def delete_quote(self, quote_id):
         """
 
         return self.client['SoftLayer_Billing_Order_Quote'].deleteQuote(id=quote_id)
-
-    def get_all_cancelation(self, limit=50):
-        """returns the all cancelations, completed orders"""
-
-        mask = 'mask[id,itemCount,modifyDate,createDate,ticketId,' \
-               'ticket[assignedUserId,id,' \
-               'serviceProviderResourceId],status[name,id],user[id,firstName,lastName]]'
-        return self.client.call('SoftLayer_Billing_Item_Cancellation_Request', 'getAllCancellationRequests',
-                                mask=mask, limit=limit)
diff --git a/SoftLayer/managers/user.py b/SoftLayer/managers/user.py
index dfec39bb..b0d85fcd 100644
--- a/SoftLayer/managers/user.py
+++ b/SoftLayer/managers/user.py
@@ -332,26 +332,6 @@ def add_api_authentication_key(self, user_id):
         """
         return self.user_service.addApiAuthenticationKey(id=user_id)
 
-    def get_api_authentication_keys(self, user_id):
-        """Calls SoftLayer_User_Customer::getApiAuthenticationKeys
-
-        :param int user_id: User to add API key to
-        """
-        return self.user_service.getApiAuthenticationKeys(id=user_id)
-
-    def remove_api_authentication_key(self, user_id):
-        """Calls SoftLayer_User_Customer::getApiAuthenticationKeys and
-
-        SoftLayer_User_Customer::removeApiAuthenticationKey
-
-        :param int user_id: User to remove API key
-        """
-        api_authentication_keys = self.get_api_authentication_keys(user_id)
-        if len(api_authentication_keys) == 0:
-            return True
-
-        return self.user_service.removeApiAuthenticationKey(api_authentication_keys[0]['id'])
-
     def vpn_manual(self, user_id, value):
         """Enable or disable the manual config of subnets.
 
diff --git a/docs/cli/ordering.rst b/docs/cli/ordering.rst
index b4f70749..93d578cf 100644
--- a/docs/cli/ordering.rst
+++ b/docs/cli/ordering.rst
@@ -143,10 +143,6 @@ Quotes
     :prog: order quote-delete
     :show-nested:
 
-.. click:: SoftLayer.CLI.order.cancelation:cli
-    :prog: order cancelation
-    :show-nested:
-
 Lookup
 ======
 .. click:: SoftLayer.CLI.order.lookup:cli
diff --git a/docs/cli/users.rst b/docs/cli/users.rst
index e3d45bb1..c1f2d79e 100644
--- a/docs/cli/users.rst
+++ b/docs/cli/users.rst
@@ -64,7 +64,3 @@ Version 5.6.0 introduces the ability to interact with user accounts from the cli
     :prog: user vpn-password
     :show-nested:
 
-.. click:: SoftLayer.CLI.user.apikey:cli
-    :prog: user apikey
-    :show-nested:
-


Test patch:
diff --git a/tests/CLI/modules/account_tests.py b/tests/CLI/modules/account_tests.py
index 39913f59..d45c70aa 100644
--- a/tests/CLI/modules/account_tests.py
+++ b/tests/CLI/modules/account_tests.py
@@ -127,21 +127,6 @@ def test_account_billing_items(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
 
-    def test_account_billing_items_by_category(self):
-        result = self.run_command(['account', 'billing-items', '--category', 'server'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
-
-    def test_account_billing_items_by_ordered(self):
-        result = self.run_command(['account', 'billing-items', '--ordered', 'Test'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
-
-    def test_account_billing_items_create(self):
-        result = self.run_command(['account', 'billing-items', '--create', '04-21-2023'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Account', 'getAllTopLevelBillingItems')
-
     # slcli account item-detail
     def test_account_get_billing_item_detail(self):
         result = self.run_command(['account', 'item-detail', '12345'])
@@ -195,23 +180,3 @@ def test_order_upgrade(self):
         result = self.run_command(['account', 'orders', '--upgrades'])
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Account', 'getUpgradeRequests')
-
-    def test_account_events(self):
-        result = self.run_command(['account', 'events', '--date-min', '5/9/2023'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
-
-    def test_account_planned_events(self):
-        result = self.run_command(['account', 'events', '--planned'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
-
-    def test_account_unplanned_events(self):
-        result = self.run_command(['account', 'events', '--unplanned'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
-
-    def test_account_announcement_events(self):
-        result = self.run_command(['account', 'events', '--announcement'])
-        self.assert_no_fail(result)
-        self.assert_called_with(self.SLNOE, 'getAllObjects')
diff --git a/tests/CLI/modules/block_tests.py b/tests/CLI/modules/block_tests.py
index ddeb755d..27a20c92 100644
--- a/tests/CLI/modules/block_tests.py
+++ b/tests/CLI/modules/block_tests.py
@@ -858,9 +858,3 @@ def test_object_permissions(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Network_Storage_Hub_Cleversafe_Account', 'getObject')
         self.assert_called_with('SoftLayer_Network_Storage_Hub_Cleversafe_Account', 'getEndpoints')
-
-    def test_block_duplicate_covert_status(self):
-        result = self.run_command(['block', 'duplicate-convert-status', '12345678'])
-
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Network_Storage', 'getDuplicateConversionStatus')
diff --git a/tests/CLI/modules/order_tests.py b/tests/CLI/modules/order_tests.py
index dc2c892a..c175e1b8 100644
--- a/tests/CLI/modules/order_tests.py
+++ b/tests/CLI/modules/order_tests.py
@@ -415,11 +415,6 @@ def test_quote_list(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Account', 'getActiveQuotes')
 
-    def test_cancelation(self):
-        result = self.run_command(['order', 'cancelation'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Billing_Item_Cancellation_Request', 'getAllCancellationRequests')
-
     def _get_order_items(self):
         item1 = {'keyName': 'ITEM1', 'description': 'description1',
                  'itemCategory': {'categoryCode': 'cat1'},
diff --git a/tests/CLI/modules/report_tests.py b/tests/CLI/modules/report_tests.py
index 7f27c361..1b1ab8bb 100644
--- a/tests/CLI/modules/report_tests.py
+++ b/tests/CLI/modules/report_tests.py
@@ -13,289 +13,28 @@
 
 
 class ReportTests(testing.TestCase):
-
-    def test_bandwidth_invalid_date(self):
-        result = self.run_command(
-            [
-                'report',
-                'bandwidth',
-                '--start=welp',
-                '--end=2016-01-01',
-            ],
-        )
-        self.assertTrue('Invalid value for "--start"', result.output)
-
-        result = self.run_command(
-            [
-                'report',
-                'bandwidth',
-                '--start=2016-01-01',
-                '--end=welp',
-            ],
-        )
-        self.assertTrue('Invalid value for "--end"', result.output)
-
-    def test_bandwidth_report(self):
-        racks = self.set_mock('SoftLayer_Account', 'getVirtualDedicatedRacks')
-        racks.return_value = [{
-            'id': 1,
-            'name': 'pool1',
-            'metricTrackingObjectId': 1,
-        }, {
-            'id': 2,
-            'name': 'pool2',
-        }, {
-            'id': 3,
-            'name': 'pool3',
-            'metricTrackingObjectId': 3,
-        }]
-        hardware = self.set_mock('SoftLayer_Account', 'getHardware')
-        hardware.return_value = [{
-            'id': 101,
-            'metricTrackingObject': {'id': 101},
-            'hostname': 'host1',
-        }, {
-            'id': 102,
-            'hostname': 'host2',
-            'virtualRack': {'id': 1, 'bandwidthAllotmentTypeId': 2},
-        }, {
-            'id': 103,
-            'metricTrackingObject': {'id': 103},
-            'hostname': 'host3',
-            'virtualRack': {'id': 1, 'bandwidthAllotmentTypeId': 2},
-        }]
-        guests = self.set_mock('SoftLayer_Account', 'getVirtualGuests')
-        guests.return_value = [{
-            'id': 201,
-            'metricTrackingObjectId': 201,
-            'hostname': 'host1',
-        }, {
-            'id': 202,
-            'hostname': 'host2',
-            'virtualRack': {'id': 2, 'bandwidthAllotmentTypeId': 2},
-        }, {
-            'id': 203,
-            'metricTrackingObjectId': 203,
-            'hostname': 'host3',
-            'virtualRack': {'id': 2, 'bandwidthAllotmentTypeId': 2},
-        }]
-        summary_data = self.set_mock('SoftLayer_Metric_Tracking_Object', 'getSummaryData')
-        summary_data.return_value = [
-            {'type': 'publicIn_net_octet', 'counter': 10},
-            {'type': 'publicOut_net_octet', 'counter': 20},
-            {'type': 'privateIn_net_octet', 'counter': 30},
-            {'type': 'privateOut_net_octet', 'counter': 40},
-        ]
-
-        result = self.run_command([
-            'report',
-            'bandwidth',
-            '--start=2016-02-04',
-            '--end=2016-03-04 12:34:56',
-        ])
-
-        self.assert_no_fail(result)
-
-        stripped_output = '[' + result.output.split('[', 1)[1]
-        json_output = json.loads(stripped_output)
-        pp(json.loads(stripped_output))
-        print("======= ^^^^^^^^^ ==============")
-        self.assertEqual(json_output[0]['hostname'], 'pool1')
-        self.assertEqual(json_output[0]['private_in'], 30)
-
-        self.assertEqual(6, len(self.calls('SoftLayer_Metric_Tracking_Object', 'getSummaryData')))
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=1)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=3)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=101)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=103)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=201)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=203)
-        call = self.calls('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=1)[0]
-        expected_args = ('2016-02-04 00:00:00 ', '2016-03-04 12:34:56 ',
-                         [{
-                             'keyName': 'PUBLICIN',
-                             'name': 'publicIn',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PUBLICOUT',
-                             'name': 'publicOut',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PRIVATEIN',
-                             'name': 'privateIn',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PRIVATEOUT',
-                             'name': 'privateOut',
-                             'summaryType': 'sum',
-                         }],
-                         300,
-                         )
-        self.assertEqual(expected_args, call.args)
-
-    def test_virtual_bandwidth_report(self):
-        racks = self.set_mock('SoftLayer_Account', 'getVirtualDedicatedRacks')
-        racks.return_value = [{
-            'id': 1,
-            'name': 'pool1',
-            'metricTrackingObjectId': 1,
-        }, {
-            'id': 2,
-            'name': 'pool2',
-        }, {
-            'id': 3,
-            'name': 'pool3',
-            'metricTrackingObjectId': 3,
-        }]
-        guests = self.set_mock('SoftLayer_Account', 'getVirtualGuests')
-        guests.return_value = [{
-            'id': 201,
-            'metricTrackingObjectId': 201,
-            'hostname': 'host1',
-        }, {
-            'id': 202,
-            'hostname': 'host2',
-            'virtualRack': {'id': 2, 'bandwidthAllotmentTypeId': 2},
-        }, {
-            'id': 203,
-            'metricTrackingObjectId': 203,
-            'hostname': 'host3',
-            'virtualRack': {'id': 2, 'bandwidthAllotmentTypeId': 2},
-        }]
-        summary_data = self.set_mock('SoftLayer_Metric_Tracking_Object',
-                                     'getSummaryData')
-        summary_data.return_value = [
-            {'type': 'publicIn_net_octet', 'counter': 10},
-            {'type': 'publicOut_net_octet', 'counter': 20},
-            {'type': 'privateIn_net_octet', 'counter': 30},
-            {'type': 'privateOut_net_octet', 'counter': 40},
-        ]
-
-        result = self.run_command([
-            'report',
-            'bandwidth',
-            '--start=2016-02-04',
-            '--end=2016-03-04 12:34:56',
-            '--virtual',
-        ])
-
-        self.assert_no_fail(result)
-        stripped_output = '[' + result.output.split('[', 1)[1]
-        json_output = json.loads(stripped_output)
-        self.assertEqual(json_output[0]['hostname'], 'pool1')
-        self.assertEqual(json_output[1]['private_out'], 40)
-        self.assertEqual(json_output[2]['private_in'], 30)
-        self.assertEqual(json_output[3]['type'], 'virtual')
-
-        self.assertEqual(4, len(self.calls('SoftLayer_Metric_Tracking_Object', 'getSummaryData')))
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=1)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=3)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=201)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=203)
-        call = self.calls('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=1)[0]
-        expected_args = ('2016-02-04 00:00:00 ', '2016-03-04 12:34:56 ',
-                         [{
-                             'keyName': 'PUBLICIN',
-                             'name': 'publicIn',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PUBLICOUT',
-                             'name': 'publicOut',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PRIVATEIN',
-                             'name': 'privateIn',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PRIVATEOUT',
-                             'name': 'privateOut',
-                             'summaryType': 'sum',
-                         }],
-                         300,
-                         )
-        self.assertEqual(expected_args, call.args)
-
-    def test_server_bandwidth_report(self):
-        racks = self.set_mock('SoftLayer_Account', 'getVirtualDedicatedRacks')
-        racks.return_value = [{
-            'id': 1,
-            'name': 'pool1',
-            'metricTrackingObjectId': 1,
-        }, {
-            'id': 2,
-            'name': 'pool2',
-        }, {
-            'id': 3,
-            'name': 'pool3',
-            'metricTrackingObjectId': 3,
-        }]
-        hardware = self.set_mock('SoftLayer_Account', 'getHardware')
-        hardware.return_value = [{
-            'id': 101,
-            'metricTrackingObject': {'id': 101},
-            'hostname': 'host1',
-        }, {
-            'id': 102,
-            'hostname': 'host2',
-            'virtualRack': {'id': 1, 'bandwidthAllotmentTypeId': 2},
-        }, {
-            'id': 103,
-            'metricTrackingObject': {'id': 103},
-            'hostname': 'host3',
-            'virtualRack': {'id': 1, 'bandwidthAllotmentTypeId': 2},
-        }]
-
-        summary_data = self.set_mock('SoftLayer_Metric_Tracking_Object',
-                                     'getSummaryData')
-        summary_data.return_value = [
-            {'type': 'publicIn_net_octet', 'counter': 10},
-            {'type': 'publicOut_net_octet', 'counter': 20},
-            {'type': 'privateIn_net_octet', 'counter': 30},
-            {'type': 'privateOut_net_octet', 'counter': 40},
-        ]
-
-        result = self.run_command([
-            'report',
-            'bandwidth',
-            '--start=2016-02-04',
-            '--end=2016-03-04 12:34:56',
-            '--server',
-        ])
+    def test_bandwidth_summary_report(self):
+        search_mock = self.set_mock('SoftLayer_Search', 'advancedSearch')
+        search_mock.side_effect = [_bandwidth_advanced_search(), [], [], []]
+        result = self.run_command(['report', 'bandwidth'])
 
         self.assert_no_fail(result)
-        stripped_output = '[' + result.output.split('[', 1)[1]
-        json_output = json.loads(stripped_output)
-        self.assertEqual(json_output[0]['hostname'], 'pool1')
-        self.assertEqual(json_output[1]['private_out'], 40)
-        self.assertEqual(json_output[2]['private_in'], 30)
-        self.assertEqual(json_output[3]['type'], 'hardware')
-
-        self.assertEqual(4, len(self.calls('SoftLayer_Metric_Tracking_Object', 'getSummaryData')))
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=101)
-        self.assert_called_with('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=103)
-
-        call = self.calls('SoftLayer_Metric_Tracking_Object', 'getSummaryData', identifier=1)[0]
-        expected_args = ('2016-02-04 00:00:00 ', '2016-03-04 12:34:56 ',
-                         [{
-                             'keyName': 'PUBLICIN',
-                             'name': 'publicIn',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PUBLICOUT',
-                             'name': 'publicOut',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PRIVATEIN',
-                             'name': 'privateIn',
-                             'summaryType': 'sum',
-                         }, {
-                             'keyName': 'PRIVATEOUT',
-                             'name': 'privateOut',
-                             'summaryType': 'sum',
-                         }],
-                         300,
-                         )
-        self.assertEqual(expected_args, call.args)
+        self.assert_called_with('SoftLayer_Search', 'advancedSearch')
+        json_output = json.loads(result.output)
+        pp(json_output)
+        self.assertEqual(5, len(json_output))
+        self.assertEqual(100250634, json_output[0]['Id'])
+        self.assertEqual('TestRegion', json_output[0]['Pool'])
+        self.assertEqual('dal10', json_output[0]['Location'])
+        self.assertEqual(['tag test', 'tag test2'], json_output[0]['Tags'])
+        self.assertEqual('Virtual Private Rack', json_output[1]['Pool'])
+        self.assertEqual('1.04 GB', json_output[2]['Total usage'])
+        self.assertEqual('5.00 TB', json_output[2]['Allocation'])
+        self.assertEqual('Unlimited', json_output[3]['Allocation'])
+        self.assertEqual('Not Applicable', json_output[3]['Pool'])
+        self.assertEqual('0.00 MB', json_output[3]['Data in'])
+        self.assertEqual('0.00 MB', json_output[3]['Data out'])
+        self.assertEqual('Pay-As-You-Go', json_output[4]['Allocation'])
 
     def test_dc_closure_report(self):
         search_mock = self.set_mock('SoftLayer_Search', 'advancedSearch')
@@ -311,6 +50,181 @@ def test_dc_closure_report(self):
         self.assertEqual('bcr01a.ams01', json_output[0]['POD'])
 
 
+def _bandwidth_advanced_search():
+    result = [
+        {
+            "matchedTerms": [],
+            "relevanceScore": "1",
+            "resource": {
+                "fullyQualifiedDomainName": "test.com",
+                "id": 100250634,
+                "bandwidthAllocation": "250",
+                "bandwidthAllotmentDetail": {
+                    "id": 53306635,
+                    "bandwidthAllotment": {
+                        "bandwidthAllotmentTypeId": 2,
+                        "id": 1289128,
+                        "name": "TestRegion"
+                    }
+                },
+                "billingItem": {
+                    "createDate": "2022-03-07T05:28:44-06:00",
+                    "id": 937460400,
+                    "lastBillDate": "2023-05-03T23:07:54-06:00"
+                },
+                "datacenter": {
+                    "id": 1441195,
+                    "name": "dal10"
+                },
+                "inboundPublicBandwidthUsage": ".16204",
+                "outboundPublicBandwidthUsage": ".01351",
+                "primaryIpAddress": "169.46.48.110",
+                "tagReferences": [
+                    {
+                        "id": 172236920,
+                        "tag": {
+                                    "id": 3414982,
+                                    "name": "tag test"
+                        }
+                    },
+                    {
+                        "id": 172236918,
+                        "tag": {
+                            "id": 3307656,
+                            "name": "tag test2"
+                        }
+                    }
+                ]
+            },
+            "resourceType": "SoftLayer_Virtual_Guest"
+        },
+        {
+            "matchedTerms": [],
+            "relevanceScore": "1",
+            "resource": {
+                "fullyQualifiedDomainName": "test.cloud",
+                "id": 1867001,
+                "bandwidthAllocation": "20000",
+                "bandwidthAllotmentDetail": {
+                    "id": 37331756,
+                    "bandwidthAllotment": {
+                        "bandwidthAllotmentTypeId": 1,
+                        "id": 138442,
+                        "name": "Virtual Private Rack"
+                    }
+                },
+                "billingItem": {
+                    "createDate": "2020-04-27T14:02:03-06:00",
+                    "id": 658642904,
+                    "lastBillDate": "2023-05-03T23:07:47-06:00"
+                },
+                "datacenter": {
+                    "id": 1441195,
+                    "name": "dal10"
+                },
+                "inboundPublicBandwidthUsage": ".48562",
+                "outboundPublicBandwidthUsage": ".1987",
+                "primaryIpAddress": "169.48.191.246",
+                "tagReferences": [
+                    {
+                        "id": 1060153378,
+                        "tag": {
+                                    "id": 4974546,
+                                    "name": "tags"
+                        }
+                    }
+                ]
+            },
+            "resourceType": "SoftLayer_Hardware"
+        },
+        {
+            "matchedTerms": [],
+            "relevanceScore": "1",
+            "resource": {
+                "fullyQualifiedDomainName": "testcommunity.cloud",
+                "id": 3190740,
+                "bandwidthAllocation": "5000",
+                "bandwidthAllotmentDetail": {
+                    "id": 50932574,
+                    "bandwidthAllotment": {
+                        "bandwidthAllotmentTypeId": 1,
+                        "id": 138442,
+                        "name": "Virtual Private Rack"
+                    }
+                },
+                "billingItem": {
+                    "createDate": "2022-08-11T11:39:55-06:00",
+                    "id": 983649084,
+                    "lastBillDate": "2023-05-03T23:07:48-06:00"
+                },
+                "datacenter": {
+                    "id": 1441195,
+                    "name": "dal10"
+                },
+                "inboundPublicBandwidthUsage": ".63179",
+                "outboundPublicBandwidthUsage": ".40786",
+                "primaryIpAddress": "52.118.38.243",
+                "tagReferences": []
+            },
+            "resourceType": "SoftLayer_Hardware"
+        },
+        {
+            "matchedTerms": [],
+            "relevanceScore": "1",
+            "resource": {
+                "id": 47758,
+                "name": "SLADC307608-jt48",
+                        "billingItem": {
+                            "createDate": "2022-02-11T09:49:16-06:00",
+                            "id": 931026566,
+                            "lastBillDate": "2023-05-03T23:08:02-06:00"
+                        },
+                "datacenter": {
+                            "id": 2017603,
+                            "name": "wdc07"
+                        },
+                "primaryIpAddress": "169.62.12.146",
+                "tagReferences": []
+            },
+            "resourceType": "SoftLayer_Network_Application_Delivery_Controller"
+        },
+        {
+            "matchedTerms": [],
+            "relevanceScore": "1",
+            "resource": {
+                "fullyQualifiedDomainName": "lab-web.test.com",
+                "id": 127890106,
+                "bandwidthAllocation": "0",
+                "bandwidthAllotmentDetail": {
+                    "id": 48915580,
+                    "bandwidthAllotment": {
+                        "bandwidthAllotmentTypeId": 1,
+                        "id": 138442,
+                        "name": "Virtual Private Rack"
+                    }
+                },
+                "billingItem": {
+                    "createDate": "2022-02-08T08:33:14-06:00",
+                    "id": 930164384,
+                    "lastBillDate": "2023-05-03T23:07:56-06:00"
+                },
+                "datacenter": {
+                    "id": 138124,
+                    "name": "dal05"
+                },
+                "inboundPrivateBandwidthUsage": ".00002",
+                "inboundPublicBandwidthUsage": ".19583",
+                "outboundPrivateBandwidthUsage": ".00002",
+                "outboundPublicBandwidthUsage": ".18446",
+                "primaryIpAddress": "108.168.148.26",
+                "tagReferences": []
+            },
+            "resourceType": "SoftLayer_Virtual_Guest"
+        }
+    ]
+    return result
+
+
 def _advanced_search():
     results = [{'matchedTerms': ['primaryRouter.hostname:|fcr01a.mex01|'],
                 'relevanceScore': '5.4415264',
diff --git a/tests/CLI/modules/sshkey_tests.py b/tests/CLI/modules/sshkey_tests.py
index 85817590..c4646f7b 100644
--- a/tests/CLI/modules/sshkey_tests.py
+++ b/tests/CLI/modules/sshkey_tests.py
@@ -118,7 +118,7 @@ def test_print_key(self):
                          {'id': 1234, 'label': 'label', 'notes': 'notes'})
 
     def test_print_key_file(self):
-        if sys.platform.startswith("win"):
+        if (sys.platform.startswith("win")):
             self.skipTest("Test doesn't work in Windows")
         with tempfile.NamedTemporaryFile() as sshkey_file:
             service = self.client['Security_Ssh_Key']
diff --git a/tests/CLI/modules/user_tests.py b/tests/CLI/modules/user_tests.py
index 02956e68..f863da2f 100644
--- a/tests/CLI/modules/user_tests.py
+++ b/tests/CLI/modules/user_tests.py
@@ -10,7 +10,6 @@
 
 from unittest import mock as mock
 
-from SoftLayer.fixtures import SoftLayer_User_Customer
 from SoftLayer import testing
 
 
@@ -388,31 +387,3 @@ def test_remove_without_password(self):
         result = self.run_command(['user', 'vpn-password', '123456'])
         self.assertEqual(2, result.exit_code)
         self.assertIn("Missing option '--password'", result.output)
-
-    def test_api_key_without_option(self):
-        result = self.run_command(['user', 'apikey', '123456'])
-        self.assertEqual(2, result.exit_code)
-        self.assertIn('At least one option is required', result.exception.message)
-
-    def test_api_key_with_all_option(self):
-        result = self.run_command(['user', 'apikey', '123456', '--add', '--remove', '--refresh'])
-        self.assertEqual(2, result.exit_code)
-        self.assertIn('Can only specify one option', result.exception.message)
-
-    def test_remove_api_authentication_key_without_api_key(self):
-        mock = self.set_mock('SoftLayer_User_Customer', 'getApiAuthenticationKeys')
-        mock.return_value = SoftLayer_User_Customer.getEmptyApiAuthenticationKeys
-        result = self.run_command(['user', 'apikey', '123456', '--remove'])
-        self.assert_no_fail(result)
-
-    def test_add_api_authentication_key(self):
-        result = self.run_command(['user', 'apikey', '123456', '--add'])
-        self.assert_no_fail(result)
-
-    def test_remove_api_authentication_key(self):
-        result = self.run_command(['user', 'apikey', '123456', '--remove'])
-        self.assert_no_fail(result)
-
-    def test_refresh_api_authentication_key(self):
-        result = self.run_command(['user', 'apikey', '123456', '--refresh'])
-        self.assert_no_fail(result)
diff --git a/tests/CLI/modules/vs/vs_create_tests.py b/tests/CLI/modules/vs/vs_create_tests.py
index 06ea63d9..e2e43904 100644
--- a/tests/CLI/modules/vs/vs_create_tests.py
+++ b/tests/CLI/modules/vs/vs_create_tests.py
@@ -692,7 +692,7 @@ def test_create_vs_no_confirm(self, confirm_mock):
         self.assertEqual(result.exit_code, 2)
 
     def test_create_vs_export(self):
-        if sys.platform.startswith("win"):
+        if (sys.platform.startswith("win")):
             self.skipTest("Test doesn't work in Windows")
         with tempfile.NamedTemporaryFile() as config_file:
             result = self.run_command(['vs', 'create', '--hostname', 'TEST', '--export', config_file.name,
diff --git a/tests/managers/ordering_tests.py b/tests/managers/ordering_tests.py
index 1fb79bd2..e38b137f 100644
--- a/tests/managers/ordering_tests.py
+++ b/tests/managers/ordering_tests.py
@@ -905,7 +905,3 @@ def test_get_regions(self):
     def test_delete_quote(self):
         self.ordering.delete_quote(123)
         self.assert_called_with('SoftLayer_Billing_Order_Quote', 'deleteQuote')
-
-    def test_get_all_cancelations(self):
-        self.ordering.get_all_cancelation()
-        self.assert_called_with('SoftLayer_Billing_Item_Cancellation_Request', 'getAllCancellationRequests')
diff --git a/tests/managers/user_tests.py b/tests/managers/user_tests.py
index 2d50d820..0fca5e2f 100644
--- a/tests/managers/user_tests.py
+++ b/tests/managers/user_tests.py
@@ -334,15 +334,3 @@ def test_remove_dedicated(self):
     def test_update_vpn_password(self):
         self.manager.update_vpn_password(123456, "Mypassword1.")
         self.assert_called_with('SoftLayer_User_Customer', 'updateVpnPassword')
-
-    def test_add_api_authentication_key(self):
-        self.manager.add_api_authentication_key(123456)
-        self.assert_called_with('SoftLayer_User_Customer', 'addApiAuthenticationKey')
-
-    def test_get_api_authentication_keys(self):
-        self.manager.get_api_authentication_keys(123456)
-        self.assert_called_with('SoftLayer_User_Customer', 'getApiAuthenticationKeys')
-
-    def test_remove_api_authentication_key(self):
-        self.manager.remove_api_authentication_key(123456)
-        self.assert_called_with('SoftLayer_User_Customer', 'removeApiAuthenticationKey')