Repository: softlayer/softlayer-python
Pull request #2011 (2023-07-11 20:03:57)

slcli search command help/abort message when no option provided
slcli search command should work with options provided. 

Fixes: #1863

TODO:
If option is not provided, help/abort message should print on console and abort the search operation right away.

<img width="798" alt="Screenshot 2023-07-12 at 1 30 49 AM" src="https://github.com/softlayer/softlayer-python/assets/134699156/cd1eb676-dc09-4757-9658-aa562e28a7ff">


<img width="701" alt="Screenshot 2023-07-12 at 1 31 07 AM" src="https://github.com/softlayer/softlayer-python/assets/134699156/137bd02e-d096-4226-94b7-fb0c0f8c80d2">

@allmightyspiff, Please review this change.

Thanks,
Jayasilan


Patch:
diff --git a/SoftLayer/CLI/bandwidth/pools.py b/SoftLayer/CLI/bandwidth/pools.py
index feae25a9..8a081d94 100644
--- a/SoftLayer/CLI/bandwidth/pools.py
+++ b/SoftLayer/CLI/bandwidth/pools.py
@@ -31,8 +31,7 @@ def cli(env):
         "Allocation",
         "Current Usage",
         "Projected Usage",
-        "Cost",
-        "Deletion"
+        "Cost"
     ], title="Bandwidth Pools")
     table.align = 'l'
     for item in items:
@@ -56,10 +55,5 @@ def cli(env):
         else:
             cost = "$0.0"
 
-        deletion = utils.clean_time(item.get('endDate'))
-
-        if deletion == '':
-            deletion = formatting.blank()
-
-        table.add_row([id_bandwidth, name, region, servers, allocation, current, projected, cost, deletion])
+        table.add_row([id_bandwidth, name, region, servers, allocation, current, projected, cost])
     env.fout(table)
diff --git a/SoftLayer/CLI/bandwidth/pools_delete.py b/SoftLayer/CLI/bandwidth/pools_delete.py
deleted file mode 100644
index 778336ef..00000000
--- a/SoftLayer/CLI/bandwidth/pools_delete.py
+++ /dev/null
@@ -1,18 +0,0 @@
-"""Delete bandwidth pool."""
-# :license: MIT, see LICENSE for more details.
-import click
-
-from SoftLayer import BandwidthManager
-from SoftLayer.CLI.command import SLCommand as SLCommand
-from SoftLayer.CLI import environment
-
-
-@click.command(cls=SLCommand)
-@click.argument('identifier')
-@environment.pass_env
-def cli(env, identifier):
-    """Delete bandwidth pool."""
-
-    manager = BandwidthManager(env.client)
-    manager.delete_pool(identifier)
-    env.fout(f"Bandwidth pool {identifier} has been scheduled for deletion.")
diff --git a/SoftLayer/CLI/bandwidth/pools_detail.py b/SoftLayer/CLI/bandwidth/pools_detail.py
index c59c6300..c1e739bf 100644
--- a/SoftLayer/CLI/bandwidth/pools_detail.py
+++ b/SoftLayer/CLI/bandwidth/pools_detail.py
@@ -24,12 +24,6 @@ def cli(env, identifier):
     table.add_row(['Id', bandwidths['id']])
     table.add_row(['Name', bandwidths['name']])
     table.add_row(['Create Date', utils.clean_time(bandwidths.get('createDate'), '%Y-%m-%d')])
-    end_date = utils.clean_time(bandwidths.get('endDate'))
-    if end_date == '':
-        end_date = formatting.blank()
-        table.add_row(['End Date', end_date])
-    else:
-        table.add_row(['End Date', utils.clean_time(bandwidths.get('endDate'))])
     current = f"{utils.lookup(bandwidths, 'billingCyclePublicBandwidthUsage', 'amountOut')} GB"
     if current is None:
         current = '-'
diff --git a/SoftLayer/CLI/bandwidth/pools_edit.py b/SoftLayer/CLI/bandwidth/pools_edit.py
deleted file mode 100644
index 98f2d08a..00000000
--- a/SoftLayer/CLI/bandwidth/pools_edit.py
+++ /dev/null
@@ -1,50 +0,0 @@
-"""Edit bandwidth pool."""
-# :license: MIT, see LICENSE for more details.
-import click
-
-from SoftLayer import BandwidthManager
-from SoftLayer.CLI.command import SLCommand as SLCommand
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import formatting
-from SoftLayer import utils
-
-location_groups = {
-    "SJC/DAL/WDC/TOR/MON": "US/Canada",
-    "AMS/LON/MAD/PAR": "AMS/LON/MAD/PAR",
-    "SNG/HKG/OSA/TOK": "SNG/HKG/JPN",
-    "SYD": "AUS",
-    "MEX": "MEX",
-    "SAO": "BRA",
-    "CHE": "IND",
-    "MIL": "ITA",
-    "SEO": "KOR",
-    "FRA": "FRA"
-}
-
-
-@click.command(cls=SLCommand)
-@click.argument('identifier')
-@click.option('--name', required=True, help="Pool name")
-@environment.pass_env
-def cli(env, identifier, name):
-    """Edit bandwidth pool."""
-
-    manager = BandwidthManager(env.client)
-    bandwidth_pool = manager.edit_pool(identifier, name)
-
-    if bandwidth_pool:
-
-        edited_pool = manager.get_bandwidth_detail(identifier)
-        locations = manager.get_location_group()
-
-        location = next(
-            (location for location in locations if location['id'] == edited_pool.get('locationGroupId')), None)
-
-        region_name = next((key for key, value in location_groups.items() if value == location.get('name')), None)
-
-        table = formatting.KeyValueTable(['Name', 'Value'])
-        table.add_row(['Id', edited_pool.get('id')])
-        table.add_row(['Name Pool', name])
-        table.add_row(['Region', region_name])
-        table.add_row(['Created Date', utils.clean_time(edited_pool.get('createDate'))])
-        env.fout(table)
diff --git a/SoftLayer/CLI/loadbal/protocol_add.py b/SoftLayer/CLI/loadbal/protocol_add.py
deleted file mode 100644
index dd5a4f60..00000000
--- a/SoftLayer/CLI/loadbal/protocol_add.py
+++ /dev/null
@@ -1,66 +0,0 @@
-"""Add a new load balancer protocol."""
-import click
-
-import SoftLayer
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import formatting
-
-
-# pylint: disable=unused-argument
-def parse_proto(ctx, param, value):
-    """Parses the frontend and backend cli options"""
-    proto = {'protocol': 'HTTP', 'port': 80}
-    splitout = value.split(':')
-    if len(splitout) != 2:
-        raise exceptions.ArgumentError("{}={} is not properly formatted.".format(param, value))
-    proto['protocol'] = splitout[0]
-    proto['port'] = int(splitout[1])
-    return proto
-
-
-@click.command(cls=SoftLayer.CLI.command.SLCommand, )
-@click.argument('identifier')
-@click.option('--frontend', '-f', required=True, default='HTTP:80', show_default=True, callback=parse_proto,
-              help='PROTOCOL:PORT string for incoming internet connections.')
-@click.option('--backend', '-b', required=True, default='HTTP:80', show_default=True, callback=parse_proto,
-              help='PROTOCOL:PORT string for connecting to backend servers.')
-@click.option('--method', '-m', help="Balancing Method.", default='ROUNDROBIN', show_default=True,
-              type=click.Choice(['ROUNDROBIN', 'LEASTCONNECTION', 'WEIGHTED_RR']))
-@click.option('--session', '-s', required=True,
-              help="Session stickiness type. Valid values are SOURCE_IP or HTTP_COOKIE ")
-@click.option('--max', help="Max Connections setting", type=int)
-@environment.pass_env
-def cli(env, identifier, **args):
-    """Add a new load balancer protocol."""
-
-    mgr = SoftLayer.LoadBalancerManager(env.client)
-
-    uuid = mgr.get_lb_uuid(identifier)
-
-    backend = args.get('backend')
-    frontend = args.get('frontend')
-    protocols = [
-        {
-            "backendPort": backend.get('port'),
-            "backendProtocol": backend.get('protocol'),
-            "frontendPort": frontend.get('port'),
-            "frontendProtocol": frontend.get('protocol'),
-            "loadBalancingMethod": args.get('method'),
-            "sessionType": args.get('session'),
-            "maxConn": args.get('max')
-        }
-    ]
-
-    protocol = mgr.add_protocols(uuid, protocols)
-
-    table = formatting.KeyValueTable(['name', 'value'])
-    table.align['name'] = 'r'
-    table.align['value'] = 'l'
-    table.add_row(['Id', protocol.get('id')])
-    table.add_row(['UUI', protocol.get('uuid')])
-    table.add_row(['Address', protocol.get('address')])
-    table.add_row(['Type', mgr.get_lb_type(protocol.get('type'))])
-    table.add_row(['Description', protocol.get('description')])
-
-    env.fout(table)
diff --git a/SoftLayer/CLI/loadbal/protocol_delete.py b/SoftLayer/CLI/loadbal/protocol_delete.py
deleted file mode 100644
index 105b585b..00000000
--- a/SoftLayer/CLI/loadbal/protocol_delete.py
+++ /dev/null
@@ -1,31 +0,0 @@
-"""Delete load balancer protocol."""
-import click
-
-import SoftLayer
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import formatting
-
-
-@click.command(cls=SoftLayer.CLI.command.SLCommand, )
-@click.argument('identifier')
-@click.option('--uuid', help="Load Balancer Uuid.")
-@environment.pass_env
-def cli(env, identifier, uuid):
-    """delete a load balancer protocol."""
-
-    mgr = SoftLayer.LoadBalancerManager(env.client)
-
-    uuid_lb = mgr.get_lb(identifier)['uuid']
-
-    protocol = mgr.delete_protocol(uuid_lb, uuid)
-
-    table = formatting.KeyValueTable(['name', 'value'])
-    table.align['name'] = 'r'
-    table.align['value'] = 'l'
-    table.add_row(['Id', protocol.get('id')])
-    table.add_row(['UUI', protocol.get('uuid')])
-    table.add_row(['Address', protocol.get('address')])
-    table.add_row(['Type', SoftLayer.LoadBalancerManager.TYPE.get(protocol.get('type'))])
-    table.add_row(['Description', protocol.get('description')])
-
-    env.fout(table)
diff --git a/SoftLayer/CLI/loadbal/protocol_edit.py b/SoftLayer/CLI/loadbal/protocol_edit.py
deleted file mode 100644
index d0f1a685..00000000
--- a/SoftLayer/CLI/loadbal/protocol_edit.py
+++ /dev/null
@@ -1,67 +0,0 @@
-"""Add a new load balancer protocol."""
-import click
-
-import SoftLayer
-from SoftLayer.CLI import environment
-from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import formatting
-
-
-# pylint: disable=unused-argument
-def parse_proto(ctx, param, value):
-    """Parses the frontend and backend cli options"""
-    proto = {'protocol': 'HTTP', 'port': 80}
-    splitout = value.split(':')
-    if len(splitout) != 2:
-        raise exceptions.ArgumentError("{}={} is not properly formatted.".format(param, value))
-    proto['protocol'] = splitout[0]
-    proto['port'] = int(splitout[1])
-    return proto
-
-
-@click.command(cls=SoftLayer.CLI.command.SLCommand, )
-@click.argument('identifier')
-@click.option('--uuid', help="Load Balancer Uuid.")
-@click.option('--frontend', '-f', required=True, default='HTTP:80', show_default=True, callback=parse_proto,
-              help='PROTOCOL:PORT string for incoming internet connections.')
-@click.option('--backend', '-b', required=True, default='HTTP:80', show_default=True, callback=parse_proto,
-              help='PROTOCOL:PORT string for connecting to backend servers.')
-@click.option('--method', '-m', help="Balancing Method.", default='ROUNDROBIN', show_default=True,
-              type=click.Choice(['ROUNDROBIN', 'LEASTCONNECTION', 'WEIGHTED_RR']))
-@click.option('--session', '-s', required=True,
-              help="Session stickiness type. Valid values are SOURCE_IP or HTTP_COOKIE ")
-@click.option('--max', help="Max Connections setting", type=int)
-@environment.pass_env
-def cli(env, identifier, **args):
-    """Edit a load balancer protocol."""
-
-    mgr = SoftLayer.LoadBalancerManager(env.client)
-
-    uuid = mgr.get_lb_uuid(identifier)
-
-    backend = args.get('backend')
-    frontend = args.get('frontend')
-    protocol_configurations = [
-        {
-            "backendPort": backend.get('port'),
-            "backendProtocol": backend.get('protocol'),
-            "frontendPort": frontend.get('port'),
-            "frontendProtocol": frontend.get('protocol'),
-            "loadBalancingMethod": args.get('method'),
-            "sessionType": args.get('session'),
-            "maxConn": args.get('max')
-        }
-    ]
-    protocol_configurations[0]['listenerUuid'] = args.get('uuid')
-    protocol = mgr.add_protocols(uuid, protocol_configurations)
-
-    table = formatting.KeyValueTable(['name', 'value'])
-    table.align['name'] = 'r'
-    table.align['value'] = 'l'
-    table.add_row(['Id', protocol.get('id')])
-    table.add_row(['UUI', protocol.get('uuid')])
-    table.add_row(['Address', protocol.get('address')])
-    table.add_row(['Type', mgr.get_lb_type(protocol.get('type'))])
-    table.add_row(['Description', protocol.get('description')])
-
-    env.fout(table)
diff --git a/SoftLayer/CLI/routes.py b/SoftLayer/CLI/routes.py
index 54c1deaa..10bbb3c9 100644
--- a/SoftLayer/CLI/routes.py
+++ b/SoftLayer/CLI/routes.py
@@ -244,9 +244,6 @@
     ('loadbal:order', 'SoftLayer.CLI.loadbal.order:order'),
     ('loadbal:order-options', 'SoftLayer.CLI.loadbal.order:order_options'),
     ('loadbal:cancel', 'SoftLayer.CLI.loadbal.order:cancel'),
-    ('loadbal:protocol-add', 'SoftLayer.CLI.loadbal.protocol_add:cli'),
-    ('loadbal:protocol-edit', 'SoftLayer.CLI.loadbal.protocol_edit:cli'),
-    ('loadbal:protocol-delete', 'SoftLayer.CLI.loadbal.protocol_delete:cli'),
 
     ('loadbal:ns-detail', 'SoftLayer.CLI.loadbal.ns_detail:cli'),
     ('loadbal:ns-list', 'SoftLayer.CLI.loadbal.ns_list:cli'),
@@ -428,8 +425,6 @@
     ('bandwidth:pools', 'SoftLayer.CLI.bandwidth.pools:cli'),
     ('bandwidth:pools-detail', 'SoftLayer.CLI.bandwidth.pools_detail:cli'),
     ('bandwidth:pools-create', 'SoftLayer.CLI.bandwidth.pools_create:cli'),
-    ('bandwidth:pools-edit', 'SoftLayer.CLI.bandwidth.pools_edit:cli'),
-    ('bandwidth:pools-delete', 'SoftLayer.CLI.bandwidth.pools_delete:cli'),
 ]
 
 ALL_ALIASES = {
diff --git a/SoftLayer/CLI/search.py b/SoftLayer/CLI/search.py
index 65650087..23329ce5 100644
--- a/SoftLayer/CLI/search.py
+++ b/SoftLayer/CLI/search.py
@@ -24,6 +24,7 @@
 @click.argument('query', nargs=-1)
 @click.option('--types', is_flag=True, default=False, is_eager=True, help="Display searchable types.")
 @click.option('--advanced', is_flag=True, help="Calls the AdvancedSearh API.")
+@click.help_option('--help', '-h')
 @environment.pass_env
 def cli(env, query, types, advanced):
     """Perform a query against the SoftLayer search database.
@@ -35,6 +36,21 @@ def cli(env, query, types, advanced):
         slcli search _objectType:SoftLayer_Virtual_Guest test.com
         slcli -vvv search _objectType:SoftLayer_Hardware hostname:testibm --advanced
     """
+
+    # Before any Search operation
+    def check_opt(list_opt=None):
+        check = False
+        for input_ in list_opt:
+            if input_ is True:
+                check = True
+                break
+        return check
+
+    list_opt = [query, types, advanced]
+
+    if not check_opt(list_opt):
+        raise click.UsageError('Search query must be provided')
+
     search = SearchManager(env.client)
     # query is in array, so we need to convert it to a normal string for the API
     query = " ".join(query)
diff --git a/SoftLayer/fixtures/SoftLayer_Account.py b/SoftLayer/fixtures/SoftLayer_Account.py
index 96a1a0ee..ddd1d799 100644
--- a/SoftLayer/fixtures/SoftLayer_Account.py
+++ b/SoftLayer/fixtures/SoftLayer_Account.py
@@ -1420,7 +1420,6 @@
         'amountIn': '6.94517',
         'amountOut': '6.8859'
     },
-    "endDate": "2023-07-03T22:59:59-06:00",
     'id': 309961,
     'locationGroup': {
         'description': 'All Datacenters in Mexico',
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Bandwidth_Version1_Allotment.py b/SoftLayer/fixtures/SoftLayer_Network_Bandwidth_Version1_Allotment.py
index 10a4e450..915cf633 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_Bandwidth_Version1_Allotment.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_Bandwidth_Version1_Allotment.py
@@ -156,7 +156,3 @@
     "name": "NewRegion",
     "serviceProviderId": 1
 }
-
-editObject = True
-
-requestVdrCancellation = True
diff --git a/SoftLayer/fixtures/SoftLayer_Network_Storage.py b/SoftLayer/fixtures/SoftLayer_Network_Storage.py
index 2d9cdc49..b6097c71 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_Storage.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_Storage.py
@@ -263,75 +263,3 @@
     'deDuplicateConversionPercentage': 50,
     'volumeUsername': 'testUser'
 }
-
-BLOCK_LIST_ISSUES_1732 = {
-    'capacityGb': 16000,
-    'id': 167214314,
-    'notes': 'test',
-    'username': 'SL02SEL307608-60',
-    'activeTransactionCount': 0,
-    'replicationPartnerCount': 1,
-    'lunId': '1',
-    'parentVolume': {
-        'accountId': 307608,
-        'capacityGb': 16000,
-        'createDate': '2020-09-02T14:55:32-06:00',
-        'guestId': None,
-        'hardwareId': None,
-        'hostId': None,
-        'id': 167214302,
-        'nasType': 'NAS_CONTAINER',
-        'serviceProviderId': 1,
-        'storageTypeId': '3',
-        'upgradableFlag': True,
-        'username': 'SL02SEVC307608_60',
-        'serviceResourceBackendIpAddress': 'fsf-mex0101b-fz.service.softlayer.com',
-        'serviceResourceName': 'Storage Type 02 Aggregate stxf-mex0101b',
-        'snapshotSizeBytes': '831488'
-    },
-    'provisionedIops': '4096',
-    'replicationPartners': [{
-        'id': 167236648,
-        'username': 'SL02SEL307608_60_REP_1',
-        'replicationSchedule': {
-            'active': 1,
-            'createDate': '2020-09-02T17:10:04-06:00',
-            'id': 542062,
-            'modifyDate': None,
-            'name': 'SL02SEVC307608_60_WEEKLY',
-            'partnershipId': None,
-            'typeId': 34,
-            'volumeId': 167214302,
-            'type': {
-                'keyname': 'REPLICATION_WEEKLY'
-            }
-        },
-        'serviceResource': {
-            'backendIpAddress': 'fsf-sao0102c-fz.service.softlayer.com',
-            'id': 30650,
-            'name': 'Storage Type 02 Aggregate stxf-sao0102c',
-            'datacenter': {
-                'name': 'sao01'
-            },
-            'type': {
-                'type': 'NETAPP_STOR_AGGR'
-            }
-        },
-        'serviceResourceBackendIpAddress': '10.200.14.72'
-    }],
-    'replicationStatus': 'FAILBACK_COMPLETED',
-    'serviceResource': {
-        'backendIpAddress': 'fsf-mex0101b-fz.service.softlayer.com',
-        'id': 9291,
-        'name': 'Storage Type 02 Aggregate stxf-mex0101b',
-        'datacenter': {
-            'name': 'mex01'
-        }
-    },
-    'serviceResourceBackendIpAddress': '10.2.190.99',
-    'snapshotCapacityGb': '1000',
-    'storageTierLevel': 'LOW_INTENSITY_TIER',
-    'storageType': {
-        'keyName': 'ENDURANCE_BLOCK_STORAGE'
-    }
-    }
diff --git a/SoftLayer/managers/account.py b/SoftLayer/managers/account.py
index 88d6a15f..7172ddbb 100644
--- a/SoftLayer/managers/account.py
+++ b/SoftLayer/managers/account.py
@@ -374,7 +374,7 @@ def get_bandwidth_pools(self, mask=None):
         if mask is None:
             mask = """mask[totalBandwidthAllocated,locationGroup, id, name, projectedPublicBandwidthUsage,
                       billingCyclePublicBandwidthUsage[amountOut,amountIn],
-                      billingItem[id,nextInvoiceTotalRecurringAmount],outboundPublicBandwidthUsage,serviceProviderId,bandwidthAllotmentTypeId,activeDetailCount,endDate]
+                      billingItem[id,nextInvoiceTotalRecurringAmount],outboundPublicBandwidthUsage,serviceProviderId,bandwidthAllotmentTypeId,activeDetailCount]
                    """
 
         return self.client.call('SoftLayer_Account', 'getBandwidthAllotments', mask=mask, iter=True)
diff --git a/SoftLayer/managers/bandwidth.py b/SoftLayer/managers/bandwidth.py
index c9c78b3e..55574d8d 100644
--- a/SoftLayer/managers/bandwidth.py
+++ b/SoftLayer/managers/bandwidth.py
@@ -43,36 +43,3 @@ def create_pool(self, name_pool, id_location_group):
         }
 
         return self.client.call('Network_Bandwidth_Version1_Allotment', 'createObject', template)
-
-    def get_bandwidth_detail(self, identifier):
-        """Gets bandwidth pool detail.
-
-        :returns: bandwidth pool detail
-        """
-        _mask = """activeDetails[allocation],projectedPublicBandwidthUsage, billingCyclePublicBandwidthUsage,
-        hardware[outboundBandwidthUsage,bandwidthAllotmentDetail[allocation]],inboundPublicBandwidthUsage,
-        virtualGuests[outboundPublicBandwidthUsage,bandwidthAllotmentDetail[allocation]],
-        bareMetalInstances[outboundBandwidthUsage,bandwidthAllotmentDetail[allocation]]"""
-        return self.client['SoftLayer_Network_Bandwidth_Version1_Allotment'].getObject(id=identifier, mask=_mask)
-
-    def edit_pool(self, identifier, new_name_pool):
-        """Edit bandwidth pool name
-
-        :return: Bandwidth object
-        """
-        actual_bandwidth = self.get_bandwidth_detail(identifier)
-        template = {
-            "accountId": actual_bandwidth.get('accountId'),
-            "bandwidthAllotmentTypeId": actual_bandwidth.get('bandwidthAllotmentTypeId'),
-            "locationGroupId": actual_bandwidth.get('locationGroupId'),
-            "name": new_name_pool
-        }
-
-        return self.client.call('Network_Bandwidth_Version1_Allotment', 'editObject', template, id=identifier)
-
-    def delete_pool(self, identifier):
-        """Delete bandwidth pool
-
-        :return: Boolean value
-        """
-        return self.client.call('Network_Bandwidth_Version1_Allotment', 'requestVdrCancellation', id=identifier)
diff --git a/SoftLayer/managers/load_balancer.py b/SoftLayer/managers/load_balancer.py
index 9546fe50..5d848c94 100644
--- a/SoftLayer/managers/load_balancer.py
+++ b/SoftLayer/managers/load_balancer.py
@@ -5,7 +5,6 @@
 
     :license: MIT, see LICENSE for more details.
 """
-import SoftLayer
 from SoftLayer import exceptions
 from SoftLayer.managers import ordering
 from SoftLayer import utils
@@ -71,7 +70,7 @@ def get_lb(self, identifier, mask=None):
         :returns: SoftLayer_Network_LBaaS_LoadBalancer
         """
         if mask is None:
-            mask = "mask[healthMonitors, l7Pools, uuid, members, sslCiphers, " \
+            mask = "mask[healthMonitors, l7Pools,  members, sslCiphers, " \
                    "listeners[defaultPool[healthMonitor, members, sessionAffinity],l7Policies]]"
 
         this_lb = self.lbaas.getObject(id=identifier, mask=mask)
@@ -276,38 +275,3 @@ def cancel_lbaas(self, uuid):
         """
 
         return self.lbaas.cancelLoadBalancer(uuid)
-
-    def add_protocols(self, uuid, protocols):
-        """This sample shows how to add protocols to the LBaaS.
-
-        https://softlayer.github.io/reference/services/SoftLayer_Network_LBaaS_Listener/updateLoadBalancerProtocols/
-        :param uuid string: UUID of the LBaaS instance to add a new protocol
-        :param protocols SoftLayer_Network_LBaaS_LoadBalancerProtocolConfiguration[]: protocol configurations
-        """
-        return self.client.call('SoftLayer_Network_LBaaS_Listener', 'updateLoadBalancerProtocols',
-                                uuid, protocols)
-
-    def delete_protocol(self, uuid_lb, uuid):
-        """This sample shows how to delete protocols to the LBaaS.
-
-        https://softlayer.github.io/reference/services/SoftLayer_Network_LBaaS_Listener/updateLoadBalancerProtocols/
-        :param uuid string: UUID of the LBaaS instance to add a new protocol
-        :param protocols SoftLayer_Network_LBaaS_LoadBalancerProtocolConfiguration[]: protocol configurations
-        """
-        return self.client.call('SoftLayer_Network_LBaaS_Listener', 'deleteLoadBalancerProtocols',
-                                uuid_lb, [uuid])
-
-    def get_lb_uuid(self, identifier):
-        """this sample show the uuid from loadbalancer.
-
-        :param identifier int: loadbalancer identifier.
-        """
-        load_balancer = self.lbaas.getObject(id=identifier, mask="mask[id,uuid]")
-        return load_balancer.get('uuid')
-
-    def get_lb_type(self, lb_type):
-        """return the loadbalancer type.
-
-        :param lb_type: load balancer type
-        """
-        return SoftLayer.LoadBalancerManager.TYPE.get(lb_type)
diff --git a/SoftLayer/managers/ordering.py b/SoftLayer/managers/ordering.py
index 8e6a34d8..9bd25c90 100644
--- a/SoftLayer/managers/ordering.py
+++ b/SoftLayer/managers/ordering.py
@@ -10,8 +10,6 @@
 
 from SoftLayer import exceptions
 
-from SoftLayer import utils
-
 CATEGORY_MASK = '''id, isRequired, itemCategory[id, name, categoryCode]'''
 
 ITEM_MASK = '''id, keyName, description, itemCategory, categories, prices'''
@@ -34,8 +32,6 @@ def __init__(self, client):
         self.order_svc = client['Product_Order']
         self.billing_svc = client['Billing_Order']
         self.package_preset = client['Product_Package_Preset']
-        self.package_mask = 'id, description, capacity, itemCategory, keyName, prices[categories], ' \
-            'softwareDescription[id,referenceCode,longDescription]'
 
     def get_packages_of_type(self, package_types, mask=None):
         """Get packages that match a certain type.
@@ -374,8 +370,7 @@ def get_price_id_list(self, package_keyname, item_keynames, core=None):
                   keynames in the given package
 
         """
-        mask = 'id, description, capacity, itemCategory, keyName, prices[categories], ' \
-            'softwareDescription[id,referenceCode,longDescription]'
+        mask = 'id, description, capacity, itemCategory, keyName, prices[categories]'
         items = self.list_items(package_keyname, mask=mask)
         item_capacity = self.get_item_capacity(items, item_keynames)
 
@@ -383,18 +378,14 @@ def get_price_id_list(self, package_keyname, item_keynames, core=None):
         category_dict = {"gpu0": -1, "pcie_slot0": -1}
 
         for item_keyname in item_keynames:
-            matching_item = []
-            # Need to find the item in the package that has a matching
-            # keyName with the current item we are searching for
-            for i in items:
-                reference_code = utils.lookup(i, 'softwareDescription', 'referenceCode')
-                if i['keyName'] == item_keyname or reference_code == item_keyname:
-                    matching_item.append(i)
-
-            if len(matching_item) == 0:
+            try:
+                # Need to find the item in the package that has a matching
+                # keyName with the current item we are searching for
+                matching_item = [i for i in items
+                                 if i['keyName'] == item_keyname][0]
+            except IndexError as ex:
                 message = f"Item {item_keyname} does not exist for package {package_keyname}"
-                raise exceptions.SoftLayerError(message)
-            matching_item = matching_item[0]
+                raise exceptions.SoftLayerError(message) from ex
 
             # we want to get the price ID that has no location attached to it,
             # because that is the most generic price. verifyOrder/placeOrder
diff --git a/docs/cli/bandwidth.rst b/docs/cli/bandwidth.rst
index f194e2c8..8560e533 100644
--- a/docs/cli/bandwidth.rst
+++ b/docs/cli/bandwidth.rst
@@ -19,11 +19,3 @@ bandwidth Commands
 .. click:: SoftLayer.CLI.bandwidth.pools_create:cli
     :prog: bandwidth pools-create
     :show-nested:
-
-.. click:: SoftLayer.CLI.bandwidth.pools_edit:cli
-    :prog: bandwidth pools-edit
-    :show-nested:
-
-.. click:: SoftLayer.CLI.bandwidth.pools_delete:cli
-    :prog: bandwidth pools-delete
-    :show-nested:
diff --git a/docs/cli/loadbal.rst b/docs/cli/loadbal.rst
index 3ba20f9e..e019e2aa 100644
--- a/docs/cli/loadbal.rst
+++ b/docs/cli/loadbal.rst
@@ -52,15 +52,6 @@ LBaaS Commands
 .. click:: SoftLayer.CLI.loadbal.order:cancel
    :prog: loadbal cancel
    :show-nested:
-.. click:: SoftLayer.CLI.loadbal.protocol_add:cli
-   :prog: loadbal protocol-add
-   :show-nested:
-.. click:: SoftLayer.CLI.loadbal.protocol_edit:cli
-   :prog: loadbal protocol-edit
-   :show-nested:
-.. click:: SoftLayer.CLI.loadbal.protocol_delete:cli
-   :prog: loadbal protocol-delete
-   :show-nested:
 
 
 NetScaler Commands


Test patch:
diff --git a/tests/CLI/modules/bandwidth_tests.py b/tests/CLI/modules/bandwidth_tests.py
index ccc4f572..b0f77f7a 100644
--- a/tests/CLI/modules/bandwidth_tests.py
+++ b/tests/CLI/modules/bandwidth_tests.py
@@ -8,6 +8,8 @@
 
 import json
 
+from pprint import pprint as pp
+
 
 class BandwidthTests(testing.TestCase):
     def test_bandwidth_pools(self):
@@ -29,6 +31,7 @@ def test_bandwidth_summary(self):
         self.assert_no_fail(result)
         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'])
@@ -48,31 +51,17 @@ def test_create_bandwidth(self):
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Network_Bandwidth_Version1_Allotment', 'createObject')
         json_output = json.loads(result.output)
+        pp(json_output)
         self.assertEqual(123456789, json_output['Id'])
         self.assertEqual('NewRegion', json_output['Name Pool'])
         self.assertEqual('SJC/DAL/WDC/TOR/MON', json_output['Region'])
 
-    def test_edit_bandwidth(self):
-        result = self.run_command(['bandwidth', 'pools-edit', '123456', '--name=MexRegionEdited'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Network_Bandwidth_Version1_Allotment', 'editObject')
-        json_output = json.loads(result.output)
-        self.assertEqual(123456, json_output['Id'])
-        self.assertEqual('MexRegionEdited', json_output['Name Pool'])
-        self.assertEqual('MEX', json_output['Region'])
-
-    def test_delete_bandwidth(self):
-        result = self.run_command(['bandwidth', 'pools-delete', '123456'])
-        self.assert_no_fail(result)
-        self.assert_called_with('SoftLayer_Network_Bandwidth_Version1_Allotment', 'requestVdrCancellation')
-        json_output = json.loads(result.output)
-        self.assertEqual("Bandwidth pool 123456 has been scheduled for deletion.", json_output)
-
     def test_create_bandwidth_single_region(self):
         result = self.run_command(['bandwidth', 'pools-create', '--name=NewRegion', '--region=AMS'])
         self.assert_no_fail(result)
         self.assert_called_with('SoftLayer_Network_Bandwidth_Version1_Allotment', 'createObject')
         json_output = json.loads(result.output)
+        pp(json_output)
         self.assertEqual(123456789, json_output['Id'])
         self.assertEqual('NewRegion', json_output['Name Pool'])
         self.assertEqual('AMS/LON/MAD/PAR', json_output['Region'])
diff --git a/tests/CLI/modules/block_tests.py b/tests/CLI/modules/block_tests.py
index ac34b537..894acd94 100644
--- a/tests/CLI/modules/block_tests.py
+++ b/tests/CLI/modules/block_tests.py
@@ -5,7 +5,6 @@
     :license: MIT, see LICENSE for more details.
 """
 from SoftLayer.CLI import exceptions
-from SoftLayer.fixtures import SoftLayer_Network_Storage
 from SoftLayer import SoftLayerAPIError
 from SoftLayer import testing
 
@@ -97,16 +96,6 @@ def test_volume_detail(self):
             ]
         }, json.loads(result.output))
 
-    def test_block_detail_issue1732(self):
-        lun_mock = self.set_mock('SoftLayer_Network_Storage', 'getObject')
-        lun_mock.return_value = SoftLayer_Network_Storage.BLOCK_LIST_ISSUES_1732
-        result = self.run_command(['--format=table',  'block', 'volume-detail', '1234'])
-        self.assert_no_fail(result)
-        self.assertIn('│                 Username │ SL02SEL307608-60                          │', result.output)
-        self.assertIn('│            Capacity (GB) │ 16000GB                                   │', result.output)
-        self.assertIn('│       Replication Status │ FAILBACK_COMPLETED                        │', result.output)
-        self.assertIn('│                    Notes │ test                                      │', result.output)
-
     def test_volume_detail_name_identifier(self):
         result = self.run_command(['block', 'volume-detail', 'SL-12345'])
         expected_filter = {
diff --git a/tests/CLI/modules/loadbal_tests.py b/tests/CLI/modules/loadbal_tests.py
index 614dc9dc..247bde0d 100644
--- a/tests/CLI/modules/loadbal_tests.py
+++ b/tests/CLI/modules/loadbal_tests.py
@@ -315,23 +315,3 @@ def test_ns_detail(self):
         result = self.run_command(['loadbal', 'ns-detail', '11111'])
 
         self.assert_no_fail(result)
-
-    def test_lb_protocol_add(self):
-        result = self.run_command(['lb', 'protocol-add', '1111111', '--backend', 'HTTP:216',
-                                   '--frontend', 'HTTP:217', '--method', 'ROUNDROBIN', '-s', 'SOURCE_IP',
-                                   '--max', '190'])
-        self.assert_no_fail(result)
-
-    def test_lb_protocol_edit(self):
-        result = self.run_command(['lb', 'protocol-edit', '1111111',
-                                   '--uuid', '4d088a44-8c42-4f24-a437-9461ff4c9851', '--backend', 'HTTP:216',
-                                   '--frontend', 'HTTP:217', '--method', 'ROUNDROBIN', '-s', 'SOURCE_IP',
-                                   '--max', '190'])
-
-        self.assert_no_fail(result)
-
-    def test_lb_protocol_delete(self):
-        result = self.run_command(['lb', 'protocol-delete', '1111111',
-                                   '--uuid', '4d088a44-8c42-4f24-a437-9461ff4c9851'])
-
-        self.assert_no_fail(result)
diff --git a/tests/CLI/modules/search_tests.py b/tests/CLI/modules/search_tests.py
index 22547ada..c14ce6b8 100644
--- a/tests/CLI/modules/search_tests.py
+++ b/tests/CLI/modules/search_tests.py
@@ -17,3 +17,7 @@ def test_find(self):
     def test_find_advanced(self):
         result = self.run_command(['search', 'hardware', '--advanced'])
         self.assert_no_fail(result)
+
+    def test_no_options(self):
+        result = self.run_command(['search'])
+        self.assertEqual(result.exit_code, 2)
diff --git a/tests/managers/loadbal_tests.py b/tests/managers/loadbal_tests.py
index 4dfbe1d2..fd231be7 100644
--- a/tests/managers/loadbal_tests.py
+++ b/tests/managers/loadbal_tests.py
@@ -9,7 +9,6 @@
 """
 import SoftLayer
 from SoftLayer import exceptions
-from SoftLayer import fixtures
 from SoftLayer.fixtures import SoftLayer_Network_LBaaS_LoadBalancer
 from SoftLayer import testing
 
@@ -210,26 +209,3 @@ def test_get_lbaas_by_name_fails(self):
         load_bal_mock.return_value = []
         name = 'test'
         self.assertRaises(exceptions.SoftLayerError, self.lb_mgr.get_lbaas_by_name, name)
-
-    def test_lbaas_update_protocol(self):
-        uuid = '1a1aa111-4474-4e16-9f02-4de959229b85'
-        protocol_configurations = [
-            {
-                "backendPort": 52,
-                "backendProtocol": 'HTTP',
-                "frontendPort": 216,
-                "frontendProtocol": 'HTTP',
-                "loadBalancingMethod": 'ROUNDROBIN',
-                "sessionType": 'SOURCE_IP',
-                "maxConn": 50
-            }
-        ]
-        result = self.lb_mgr.add_protocols(uuid, protocol_configurations)
-        self.assertEqual(fixtures.SoftLayer_Network_LBaaS_Listener.updateLoadBalancerProtocols, result)
-
-    def test_lbaas_delete_protocol(self):
-        uuid = '1a1aa111-4474-4e16-9f02-4de959229b85'
-        uuid_delete = 'abba-aabb-cc'
-
-        result = self.lb_mgr.delete_protocol(uuid, uuid_delete)
-        self.assertEqual(fixtures.SoftLayer_Network_LBaaS_Listener.deleteLoadBalancerProtocols, result)
diff --git a/tests/managers/ordering_tests.py b/tests/managers/ordering_tests.py
index 7d86c005..9bf11a04 100644
--- a/tests/managers/ordering_tests.py
+++ b/tests/managers/ordering_tests.py
@@ -316,7 +316,8 @@ def test_get_price_id_list(self):
 
             prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM2'], "8")
 
-        list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask=self.ordering.package_mask)
+        list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, keyName, '
+                                                                  'prices[categories]')
         self.assertEqual([price1['id'], price2['id']], prices)
 
     def test_get_price_id_list_no_core(self):
@@ -334,24 +335,22 @@ def test_get_price_id_list_no_core(self):
             prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM2'], None)
 
         list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, keyName, '
-                                          'prices[categories], softwareDescription[id,referenceCode,longDescription]')
+                                                                  'prices[categories]')
         self.assertEqual([price1['id'], price2['id']], prices)
 
     def test_get_price_id_list_item_not_found(self):
         category1 = {'categoryCode': 'cat1'}
         price1 = {'id': 1234, 'locationGroupId': '', 'categories': [category1]}
-        softwareDescription1 = {'id': 1234, 'longDescription': 'ABCD 1.2-34', 'referenceCode': 'ABCD_9_32'}
-        item1 = {'id': 1111, 'keyName': 'ITEM1', 'itemCategory': category1,
-                 'prices': [price1], 'softwareDescription': softwareDescription1, }
+        item1 = {'id': 1111, 'keyName': 'ITEM1', 'itemCategory': category1, 'prices': [price1]}
 
         with mock.patch.object(self.ordering, 'list_items') as list_mock:
             list_mock.return_value = [item1]
 
             exc = self.assertRaises(exceptions.SoftLayerError,
                                     self.ordering.get_price_id_list,
-                                    'PACKAGE_KEYNAME', ['ITEM2'], "12")
+                                    'PACKAGE_KEYNAME', ['ITEM2'], "8")
         list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, keyName, '
-                                          'prices[categories], softwareDescription[id,referenceCode,longDescription]')
+                                                                  'prices[categories]')
         self.assertEqual("Item ITEM2 does not exist for package PACKAGE_KEYNAME", str(exc))
 
     def test_get_price_id_list_gpu_items_with_two_categories(self):
@@ -366,8 +365,7 @@ def test_get_price_id_list_gpu_items_with_two_categories(self):
             prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM1'], "8")
 
             list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, '
-                                              'keyName, prices[categories], '
-                                              'softwareDescription[id,referenceCode,longDescription]')
+                                                                      'keyName, ' 'prices[categories]')
             self.assertEqual([price2['id'], price1['id']], prices)
 
     def test_generate_no_complex_type(self):
@@ -622,7 +620,7 @@ def test_location_group_id_none(self):
             prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM2'], "8")
 
         list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, keyName, '
-                                          'prices[categories], softwareDescription[id,referenceCode,longDescription]')
+                                                                  'prices[categories]')
         self.assertEqual([price1['id'], price2['id']], prices)
 
     def test_location_groud_id_empty(self):
@@ -639,9 +637,8 @@ def test_location_groud_id_empty(self):
 
             prices = self.ordering.get_price_id_list('PACKAGE_KEYNAME', ['ITEM1', 'ITEM2'], "8")
 
-        list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, '
-                                          'keyName, prices[categories], '
-                                          'softwareDescription[id,referenceCode,longDescription]')
+        list_mock.assert_called_once_with('PACKAGE_KEYNAME', mask='id, description, capacity, itemCategory, keyName, '
+                                                                  'prices[categories]')
         self.assertEqual([price1['id'], price2['id']], prices)
 
     def test_get_item_price_id_without_capacity_restriction(self):