Repository: softlayer/softlayer-python
Pull request #2056 (2023-07-27 22:41:15)

Example and sub feature for slcli firewall monitoring, slcli globalip specific commands #2033
Hi,

Please review this PR.

Fixes: #2033

Example and sub feature for slcli firewall, slcli globalip assign,cancel,create,list command

Thanks,
Jayasilan


Patch:
diff --git a/SoftLayer/CLI/cdn/edit.py b/SoftLayer/CLI/cdn/edit.py
index df4f1794..bd2c8b82 100644
--- a/SoftLayer/CLI/cdn/edit.py
+++ b/SoftLayer/CLI/cdn/edit.py
@@ -31,16 +31,11 @@
               type=click.Choice(['1', '0']),
               help="Respect headers. The value 1 is On and 0 is Off."
               )
-@click.option('--cache', '-c', type=str,
+@click.option('--cache', '-c', multiple=True, type=str,
               help="Cache key optimization. These are the valid options to choose: 'include-all', 'ignore-all', "
                    "'include-specified', 'ignore-specified'. If you select 'include-specified' or 'ignore-specified' "
-                   "please add to option --cache-description.\n"
-                   " e.g --cache=include-specified --cache-description=description."
-              )
-@click.option('--cache-description', '-C', type=str,
-              help="In cache option, if you select 'include-specified' or 'ignore-specified', "
-                   "please add a description too using this option.\n"
-                   "e.g --cache include-specified --cache-description description."
+                   "please add a description too using again --cache, "
+                   "e.g --cache=include-specified --cache=description."
               )
 @click.option('--performance-configuration', '-p',
               type=click.Choice(['General web delivery', 'Large file optimization', 'Video on demand optimization']),
@@ -48,8 +43,7 @@
                    "the Dynamic content acceleration option is not added because this has a special configuration."
               )
 @environment.pass_env
-def cli(env, identifier, header, http_port, https_port, origin, respect_headers, cache,
-        cache_description, performance_configuration):
+def cli(env, identifier, header, http_port, https_port, origin, respect_headers, cache, performance_configuration):
     """Edit a CDN Account.
 
        Note: You can use the hostname or uniqueId as IDENTIFIER.
@@ -59,14 +53,15 @@ def cli(env, identifier, header, http_port, https_port, origin, respect_headers,
     cdn_id = helpers.resolve_id(manager.resolve_ids, identifier, 'CDN')
 
     cache_result = {}
-    if cache or cache_description:
+    if cache:
         if len(cache) > 1:
-            cache_result['cacheKeyQueryRule'] = cache
+            cache_result['cacheKeyQueryRule'] = cache[0]
+            cache_result['description'] = cache[1]
         else:
             cache_result['cacheKeyQueryRule'] = cache[0]
 
     cdn_result = manager.edit(cdn_id, header=header, http_port=http_port, https_port=https_port, origin=origin,
-                              respect_headers=respect_headers, cache=cache_result, cache_description=cache_description,
+                              respect_headers=respect_headers, cache=cache_result,
                               performance_configuration=performance_configuration)
 
     table = formatting.KeyValueTable(['name', 'value'])
diff --git a/SoftLayer/CLI/cdn/origin_add.py b/SoftLayer/CLI/cdn/origin_add.py
index 7a77b026..0214f862 100644
--- a/SoftLayer/CLI/cdn/origin_add.py
+++ b/SoftLayer/CLI/cdn/origin_add.py
@@ -24,34 +24,21 @@
 @click.option('--bucket-name', '-b',
               type=click.STRING,
               help="The name of the available resource [required if --origin-type=storage]")
-@click.option('--http-port', '-p',
+@click.option('--port', '-p',
               type=click.INT,
-              help="The http port number. [http or https is required]")
-@click.option('--https-port', '-s',
-              type=click.INT,
-              help="The https port number. [http or https is required]"
-              )
+              help="The http port number.",
+              default=80,
+              show_default=True)
 @click.option('--protocol', '-P',
               type=click.STRING,
               help="The protocol used by the origin.",
               default='http',
               show_default=True)
 @click.option('--optimize-for', '-o',
-              type=click.Choice(['web', 'video', 'file', 'dynamic']),
+              type=click.Choice(['web', 'video', 'file']),
               help="Performance configuration",
               default='web',
               show_default=True)
-@click.option('--dynamic-path', '-d',
-              help="The path that Akamai edge servers periodically fetch the test object from."
-              "example = /detection-test-object.html")
-@click.option('--compression', '-i',
-              help="Enable or disable compression of JPEG images for requests over certain network conditions.",
-              default='true',
-              show_default=True)
-@click.option('--prefetching', '-g',
-              help="Enable or disable the embedded object prefetching feature.",
-              default='true',
-              show_default=True)
 @click.option('--extensions', '-e',
               type=click.STRING,
               help="File extensions that can be stored in the CDN, example: 'jpg, png, pdf'")
@@ -63,9 +50,7 @@
               show_default=True)
 @environment.pass_env
 def cli(env, unique_id, origin, path, origin_type, header,
-        bucket_name, http_port, https_port, protocol, optimize_for,
-        dynamic_path, compression, prefetching,
-        extensions, cache_query):
+        bucket_name, port, protocol, optimize_for, extensions, cache_query):
     """Create an origin path for an existing CDN mapping.
 
     For more information see the following documentation: \n
@@ -77,12 +62,10 @@ def cli(env, unique_id, origin, path, origin_type, header,
     if origin_type == 'storage' and not bucket_name:
         raise exceptions.ArgumentError('[-b | --bucket-name] is required when [-t | --origin-type] is "storage"')
 
-    result = manager.add_origin(unique_id, origin, path, dynamic_path, origin_type=origin_type,
-                                header=header, http_port=http_port, https_port=https_port, protocol=protocol,
+    result = manager.add_origin(unique_id, origin, path, origin_type=origin_type,
+                                header=header, port=port, protocol=protocol,
                                 bucket_name=bucket_name, file_extensions=extensions,
-                                optimize_for=optimize_for,
-                                compression=compression, prefetching=prefetching,
-                                cache_query=cache_query)
+                                optimize_for=optimize_for, cache_query=cache_query)
 
     table = formatting.Table(['Item', 'Value'])
     table.align['Item'] = 'r'
@@ -95,11 +78,8 @@ def cli(env, unique_id, origin, path, origin_type, header,
 
     table.add_row(['Origin', result['origin']])
     table.add_row(['Origin Type', result['originType']])
-    table.add_row(['Header', result['header']])
     table.add_row(['Path', result['path']])
-    table.add_row(['Http Port', result['httpPort']])
-    table.add_row(['Https Port', result['httpsPort']])
-    table.add_row(['Cache Key Rule', result['cacheKeyQueryRule']])
+    table.add_row(['Port', result['httpPort']])
     table.add_row(['Configuration', result['performanceConfiguration']])
     table.add_row(['Status', result['status']])
 
diff --git a/SoftLayer/CLI/file/list.py b/SoftLayer/CLI/file/list.py
index 540477b4..600fa6cd 100644
--- a/SoftLayer/CLI/file/list.py
+++ b/SoftLayer/CLI/file/list.py
@@ -67,11 +67,7 @@
               default=','.join(DEFAULT_COLUMNS))
 @environment.pass_env
 def cli(env, sortby, columns, datacenter, username, storage_type, order):
-    """List file storage.
-
-    Example::
-            slcli file volume-list -d dal10 --storage-type endurance --sortby capacity_gb
-    """
+    """List file storage."""
     file_manager = SoftLayer.FileStorageManager(env.client)
     file_volumes = file_manager.list_file_volumes(datacenter=datacenter,
                                                   username=username,
diff --git a/SoftLayer/CLI/file/modify.py b/SoftLayer/CLI/file/modify.py
index 27bb3f69..244868e4 100644
--- a/SoftLayer/CLI/file/modify.py
+++ b/SoftLayer/CLI/file/modify.py
@@ -5,7 +5,6 @@
 import SoftLayer
 from SoftLayer.CLI import environment
 from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import formatting
 
 
 CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()}
@@ -32,19 +31,9 @@
                    'be 0.25. If original IOPS/GB for the volume is greater than 0.25, new IOPS/GB for the volume '
                    'must also be greater than 0.25.]',
               type=click.Choice(['0.25', '2', '4', '10']))
-@click.option('--force',  default=False, is_flag=True, help="Force modify")
 @environment.pass_env
-def cli(env, volume_id, new_size, new_iops, new_tier, force):
-    """Modify an existing file storage volume.
-
-    Example::
-            slcli file volume-modify 12345678 --new-size 1000 --new-iops 400
-    """
-    if not force:
-        if not (env.skip_confirmations or
-                formatting.confirm("This action will incur charges on your account. Continue?")):
-            raise exceptions.CLIAbort('Aborted')
-
+def cli(env, volume_id, new_size, new_iops, new_tier):
+    """Modify an existing file storage volume."""
     file_manager = SoftLayer.FileStorageManager(env.client)
 
     if new_tier is not None:
diff --git a/SoftLayer/CLI/file/options.py b/SoftLayer/CLI/file/options.py
index 7ac60ab3..d66b526a 100644
--- a/SoftLayer/CLI/file/options.py
+++ b/SoftLayer/CLI/file/options.py
@@ -19,12 +19,7 @@
                    'add it to the --prices option using location short name, e.g. --prices dal13')
 @environment.pass_env
 def cli(env, prices, location=None):
-    """List all options for ordering a block storage
-
-    Example::
-            slcli file volume-options
-            slcli file volume-options --prices dal13
-    """
+    """List all options for ordering a block storage"""
 
     order_manager = SoftLayer.OrderingManager(env.client)
     items = order_manager.get_items(PACKAGE_STORAGE)
diff --git a/SoftLayer/CLI/file/order.py b/SoftLayer/CLI/file/order.py
index cca7baf5..876549be 100644
--- a/SoftLayer/CLI/file/order.py
+++ b/SoftLayer/CLI/file/order.py
@@ -5,7 +5,6 @@
 import SoftLayer
 from SoftLayer.CLI import environment
 from SoftLayer.CLI import exceptions
-from SoftLayer.CLI import formatting
 
 
 CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()}
@@ -27,7 +26,7 @@
 @click.option('--tier',
               help='Endurance Storage Tier (IOP per GB) [required for storage-type endurance]',
               type=click.Choice(['0.25', '2', '4', '10']))
-@click.option('-l', '--location',
+@click.option('--location',
               help='Datacenter short name (e.g.: dal09)',
               required=True)
 @click.option('--snapshot-size',
@@ -47,31 +46,17 @@
               type=click.Choice(['hourly', 'monthly']),
               default='monthly',
               help="Optional parameter for Billing rate (default to monthly)")
-@click.option('--force', default=False, is_flag=True, help="Force order file storage volume without confirmation")
 @environment.pass_env
 def cli(env, storage_type, size, iops, tier,
-        location, snapshot_size, service_offering, billing, force):
+        location, snapshot_size, service_offering, billing):
     """Order a file storage volume.
 
-    Example::
-        slcli file volume-order --storage-type performance --size 1000 --iops 4000 -d dal09
-        This command orders a performance volume with size is 1000GB, IOPS is 4000, located at dal09.
-
-        slcli file volume-order --storage-type endurance --size 500 --tier 4 -d dal09 --snapshot-size 500
-        This command orders an endurance volume with size is 500GB, tier level is 4 IOPS per GB,\
-located at dal09 with an additional snapshot space size of 500GB
-
     Valid size and iops options can be found here:
     https://cloud.ibm.com/docs/FileStorage/index.html#provisioning-considerations
     """
     file_manager = SoftLayer.FileStorageManager(env.client)
     storage_type = storage_type.lower()
 
-    if not force:
-        if not (env.skip_confirmations or
-                formatting.confirm("This action will incur charges on your account. Continue?")):
-            raise exceptions.CLIAbort('Aborted')
-
     hourly_billing_flag = False
     if billing.lower() == "hourly":
         hourly_billing_flag = True
diff --git a/SoftLayer/CLI/file/refresh.py b/SoftLayer/CLI/file/refresh.py
index 891da66a..8f930b05 100644
--- a/SoftLayer/CLI/file/refresh.py
+++ b/SoftLayer/CLI/file/refresh.py
@@ -13,14 +13,7 @@
               help="Cancel current refresh process and initiates the new refresh.")
 @environment.pass_env
 def cli(env, volume_id, snapshot_id, force_refresh):
-    """Refresh a duplicate volume with a snapshot from its parent.
-
-    Example::
-        slcli file volume-refresh volume_id snapshot_id
-
-        Refresh a duplicate volume_id with a snapshot from its parent snapshot_id.
-        Refresh a duplicate volume with a snapshot from its parent.
-    """
+    """Refresh a duplicate volume with a snapshot from its parent."""
     file_manager = SoftLayer.FileStorageManager(env.client)
     resp = file_manager.refresh_dupe(volume_id, snapshot_id, force_refresh)
 
diff --git a/SoftLayer/CLI/file/set_note.py b/SoftLayer/CLI/file/set_note.py
index 49d1117b..de5b48ca 100644
--- a/SoftLayer/CLI/file/set_note.py
+++ b/SoftLayer/CLI/file/set_note.py
@@ -15,12 +15,7 @@
               help='Public notes related to a Storage volume')
 @environment.pass_env
 def cli(env, volume_id, note):
-    """Set note for an existing file storage volume.
-
-    Example::
-        slcli file volume-set-note 12345678 --note 'this is my note'
-    """
-
+    """Set note for an existing file storage volume."""
     file_manager = SoftLayer.FileStorageManager(env.client)
     file_volume_id = helpers.resolve_id(file_manager.resolve_ids, volume_id, 'File Storage')
 
diff --git a/SoftLayer/CLI/firewall/add.py b/SoftLayer/CLI/firewall/add.py
index 9a9966d8..a612d289 100644
--- a/SoftLayer/CLI/firewall/add.py
+++ b/SoftLayer/CLI/firewall/add.py
@@ -11,11 +11,15 @@
 
 @click.command(cls=SoftLayer.CLI.command.SLCommand, )
 @click.argument('target')
-@click.option('--firewall-type', type=click.Choice(['vs', 'vlan', 'server']), help='Firewall type', required=True)
-@click.option("-h", '--high-availability', is_flag=True, help='High available firewall option')
-@click.option('-f', '--force',  default=False, is_flag=True, help="Force addition of firewall to the server")
+@click.option('--firewall-type',
+              type=click.Choice(['vs', 'vlan', 'server']),
+              help='Firewall type',
+              required=True)
+@click.option('-ha', '--high-availability',
+              is_flag=True,
+              help='High available firewall option')
 @environment.pass_env
-def cli(env, target, firewall_type, high_availability, force):
+def cli(env, target, firewall_type, high_availability):
     """Create new firewall.
 
     TARGET: Id of the server the firewall will protect
@@ -39,9 +43,8 @@ def cli(env, target, firewall_type, high_availability, force):
         click.echo("Price: $%s monthly" % pkg[0]['prices'][0]['recurringFee'])
         click.echo("******************")
 
-        if not force:
-            if not formatting.confirm("This action will incur charges on your account. Continue?"):
-                raise exceptions.CLIAbort('Aborted.')
+        if not formatting.confirm("This action will incur charges on your account. Continue?"):
+            raise exceptions.CLIAbort('Aborted.')
 
     if firewall_type == 'vlan':
         mgr.add_vlan_firewall(target, ha_enabled=high_availability)
diff --git a/SoftLayer/CLI/firewall/cancel.py b/SoftLayer/CLI/firewall/cancel.py
index 2c6138fd..1be9f3a0 100644
--- a/SoftLayer/CLI/firewall/cancel.py
+++ b/SoftLayer/CLI/firewall/cancel.py
@@ -14,16 +14,15 @@
 @click.option('--firewall-type', required=True, show_default=True, default='vlan',
               type=click.Choice(['vlan', 'server'], case_sensitive=False),
               help='Firewall type.')
-@click.option('-f', '--force',  default=False, is_flag=True, help="Force cancel firewall of the server")
 @environment.pass_env
-def cli(env, identifier, firewall_type, force):
+def cli(env, identifier, firewall_type):
     """Cancels a firewall."""
 
     mgr = SoftLayer.FirewallManager(env.client)
-    if not force:
-        if not (env.skip_confirmations or
-                formatting.confirm("This action will cancel a firewall from your account. Continue?")):
-            raise exceptions.CLIAbort('Aborted.')
+
+    if not (env.skip_confirmations or
+            formatting.confirm("This action will cancel a firewall from your account. Continue?")):
+        raise exceptions.CLIAbort('Aborted.')
 
     if firewall_type == 'server':
         mgr.cancel_firewall(identifier, dedicated=False)
diff --git a/SoftLayer/CLI/firewall/monitoring.py b/SoftLayer/CLI/firewall/monitoring.py
index a76df667..832f1bd8 100644
--- a/SoftLayer/CLI/firewall/monitoring.py
+++ b/SoftLayer/CLI/firewall/monitoring.py
@@ -13,7 +13,11 @@
 @click.argument('identifier')
 @environment.pass_env
 def cli(env, identifier):
-    """Gets bandwidth details for a firewall from the past 30 days."""
+    """Gets bandwidth details for a firewall from the past 30 days.
+
+    Example::
+        slcli firewall monitoring vs:12345
+    """
 
     mgr = SoftLayer.FirewallManager(env.client)
 
diff --git a/SoftLayer/CLI/globalip/assign.py b/SoftLayer/CLI/globalip/assign.py
index cb91eaf6..1e793761 100644
--- a/SoftLayer/CLI/globalip/assign.py
+++ b/SoftLayer/CLI/globalip/assign.py
@@ -20,7 +20,12 @@
 @click.option('--target-id', help='The identifier for the destination resource to route this subnet to. ')
 @environment.pass_env
 def cli(env, identifier, target, target_id):
-    """Assigns the subnet to a target."""
+    """Assigns the subnet to a target.
+
+    Example::
+        slcli globalip assign 12345678 9.111.123.456
+        This command assigns IP address with ID 12345678 to a target device whose IP address is 9.111.123.456
+    """
 
     mgr = SoftLayer.NetworkManager(env.client)
     mgr.route(identifier, target_types.get(target), target_id)
diff --git a/SoftLayer/CLI/globalip/cancel.py b/SoftLayer/CLI/globalip/cancel.py
index f0490500..0d9394b2 100644
--- a/SoftLayer/CLI/globalip/cancel.py
+++ b/SoftLayer/CLI/globalip/cancel.py
@@ -12,15 +12,22 @@
 
 @click.command(cls=SoftLayer.CLI.command.SLCommand, )
 @click.argument('identifier')
+@click.option('-f', '--force', default=False, is_flag=True, help="Force operation without confirmation")
 @environment.pass_env
-def cli(env, identifier):
-    """Cancel global IP."""
+def cli(env, identifier, force):
+    """Cancel global IP.
+
+    Example::
+        slcli globalip cancel 12345
+    """
 
     mgr = SoftLayer.NetworkManager(env.client)
     global_ip_id = helpers.resolve_id(mgr.resolve_global_ip_ids, identifier,
                                       name='global ip')
 
-    if not (env.skip_confirmations or formatting.no_going_back(global_ip_id)):
-        raise exceptions.CLIAbort('Aborted')
+    if not force:
+        if not (env.skip_confirmations or
+                formatting.confirm(f"This will cancel the IP address: {global_ip_id} and cannot be undone. Continue?")):
+            raise exceptions.CLIAbort('Aborted')
 
     mgr.cancel_global_ip(global_ip_id)
diff --git a/SoftLayer/CLI/globalip/create.py b/SoftLayer/CLI/globalip/create.py
index 7881512a..8f9def03 100644
--- a/SoftLayer/CLI/globalip/create.py
+++ b/SoftLayer/CLI/globalip/create.py
@@ -12,9 +12,15 @@
 @click.command(cls=SoftLayer.CLI.command.SLCommand, )
 @click.option('-v6', '--ipv6', is_flag=True, help='Order a IPv6 IP')
 @click.option('--test', help='test order')
+@click.option('-f', '--force', default=False, is_flag=True, help="Force operation without confirmation")
 @environment.pass_env
-def cli(env, ipv6, test):
-    """Creates a global IP."""
+def cli(env, ipv6, test, force):
+    """Creates a global IP.
+
+    Example::
+        slcli globalip create -v6
+        This command creates an IPv6 address.
+    """
 
     mgr = SoftLayer.NetworkManager(env.client)
 
@@ -22,10 +28,10 @@ def cli(env, ipv6, test):
     if ipv6:
         version = 6
 
-    if not (test or env.skip_confirmations):
-        if not formatting.confirm("This action will incur charges on your "
-                                  "account. Continue?"):
-            raise exceptions.CLIAbort('Cancelling order.')
+    if not force:
+        if not (test or env.skip_confirmations):
+            if not formatting.confirm("This action will incur charges on your account. Continue?"):
+                raise exceptions.CLIAbort('Cancelling order.')
 
     result = mgr.add_global_ip(version=version, test_order=test)
 
diff --git a/SoftLayer/CLI/globalip/list.py b/SoftLayer/CLI/globalip/list.py
index f38b4fce..62340938 100644
--- a/SoftLayer/CLI/globalip/list.py
+++ b/SoftLayer/CLI/globalip/list.py
@@ -14,7 +14,11 @@
               type=click.Choice(['v4', 'v6']))
 @environment.pass_env
 def cli(env, ip_version):
-    """List all global IPs."""
+    """List all global IPs.
+
+    Example::
+        slcli globalip list
+    """
 
     mgr = SoftLayer.NetworkManager(env.client)
 
diff --git a/SoftLayer/fixtures/SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path.py b/SoftLayer/fixtures/SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path.py
index 3824e569..59705f7b 100644
--- a/SoftLayer/fixtures/SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path.py
+++ b/SoftLayer/fixtures/SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path.py
@@ -21,23 +21,16 @@
 
 createOriginPath = [
     {
+        "header": "test.example.com",
         "httpPort": 80,
-        "httpsPort": 81,
         "mappingUniqueId": "993419389425697",
         "origin": "10.10.10.1",
         "originType": "HOST_SERVER",
-        "header": "test.example.com",
         "path": "/example",
         "status": "RUNNING",
         "bucketName": "test-bucket",
         'fileExtension': 'jpg',
-        "performanceConfiguration": "Dynamic content acceleration",
-        "dynamicContentAcceleration": {
-                "detectionPath": "/abc.html",
-                "prefetchEnabled": True,
-                "mobileImageCompressionEnabled": True
-            },
-        "cacheKeyQueryRule": "include-all"
+        "performanceConfiguration": "General web delivery"
     }
 ]
 
diff --git a/SoftLayer/managers/cdn.py b/SoftLayer/managers/cdn.py
index 0f3a26f0..703e6f14 100644
--- a/SoftLayer/managers/cdn.py
+++ b/SoftLayer/managers/cdn.py
@@ -64,35 +64,27 @@ def get_origins(self, unique_id, **kwargs):
 
         return self.cdn_path.listOriginPath(unique_id, **kwargs)
 
-    def add_origin(self, unique_id, origin, path, dynamic_path, origin_type="server", header=None,
-                   http_port=80, https_port=None, protocol='http', bucket_name=None, file_extensions=None,
-                   optimize_for="web", compression=None, prefetching=None,
-                   cache_query="include all"):
+    def add_origin(self, unique_id, origin, path, origin_type="server", header=None,
+                   port=80, protocol='http', bucket_name=None, file_extensions=None,
+                   optimize_for="web", cache_query="include all"):
         """Creates an origin path for an existing CDN.
 
         :param str unique_id: The unique ID associated with the CDN.
         :param str path: relative path to the domain provided, e.g. "/articles/video"
-        :param str dynamic_path: The path that Akamai edge servers periodically fetch the test object from.
-                                example = /detection-test-object.html
         :param str origin: ip address or hostname if origin_type=server, API endpoint for
                            your S3 object storage if origin_type=storage
         :param str origin_type: it can be 'server' or 'storage' types.
         :param str header: the edge server uses the host header to communicate with the origin.
                            It defaults to hostname. (optional)
-        :param int http_port: the http port number (default: 80)
-        :param int https_port: the https port number
+        :param int port: the http port number (default: 80)
         :param str protocol: the protocol of the origin (default: HTTP)
         :param str bucket_name: name of the available resource
         :param str file_extensions: file extensions that can be stored in the CDN, e.g. "jpg,png"
         :param str optimize_for: performance configuration, available options: web, video, and file where:
 
-                                - 'web' = 'General web delivery'
-                                - 'video' = 'Video on demand optimization'
-                                - 'file' = 'Large file optimization'
-                                - 'dynamic' = 'Dynamic content acceleration'
-        :param bool compression: Enable or disable compression of JPEG images for requests over
-                                certain network conditions.
-        :param bool prefetching: Enable or disable the embedded object prefetching feature.
+                                    - 'web' = 'General web delivery'
+                                    - 'video' = 'Video on demand optimization'
+                                    - 'file' = 'Large file optimization'
         :param str cache_query: rules with the following formats: 'include-all', 'ignore-all',
                                'include: space separated query-names',
                                'ignore: space separated query-names'.'
@@ -102,8 +94,7 @@ def add_origin(self, unique_id, origin, path, dynamic_path, origin_type="server"
         performance_config = {
             'web': 'General web delivery',
             'video': 'Video on demand optimization',
-            'file': 'Large file optimization',
-            "dynamic": "Dynamic content acceleration"
+            'file': 'Large file optimization'
         }
 
         new_origin = {
@@ -111,20 +102,12 @@ def add_origin(self, unique_id, origin, path, dynamic_path, origin_type="server"
             'path': path,
             'origin': origin,
             'originType': types.get(origin_type),
-            'httpPort': http_port,
-            'httpsPort': https_port,
+            'httpPort': port,
             'protocol': protocol.upper(),
-            'performanceConfiguration': performance_config.get(optimize_for),
-            'cacheKeyQueryRule': cache_query,
+            'performanceConfiguration': performance_config.get(optimize_for, 'General web delivery'),
+            'cacheKeyQueryRule': cache_query
         }
 
-        if optimize_for == 'dynamic':
-            new_origin['dynamicContentAcceleration'] = {
-                'detectionPath': "/" + str(dynamic_path),
-                'prefetchEnabled': bool(prefetching),
-                'mobileImageCompressionEnabled': bool(compression)
-            }
-
         if header:
             new_origin['header'] = header
 
@@ -192,7 +175,7 @@ def end_date(self):
         return self._end_date
 
     def edit(self, identifier, header=None, http_port=None, https_port=None, origin=None,
-             respect_headers=None, cache=None, cache_description=None, performance_configuration=None):
+             respect_headers=None, cache=None, performance_configuration=None):
         """Edit the cdn object.
 
         :param string identifier: The CDN identifier.
@@ -240,12 +223,12 @@ def edit(self, identifier, header=None, http_port=None, https_port=None, origin=
         if respect_headers:
             config['respectHeaders'] = respect_headers
 
-        if cache or cache_description:
+        if cache:
             if 'include-specified' in cache['cacheKeyQueryRule']:
-                cache_key_rule = self.get_cache_key_query_rule('include', cache_description)
+                cache_key_rule = self.get_cache_key_query_rule('include', cache)
                 config['cacheKeyQueryRule'] = cache_key_rule
             elif 'ignore-specified' in cache['cacheKeyQueryRule']:
-                cache_key_rule = self.get_cache_key_query_rule('ignore', cache_description)
+                cache_key_rule = self.get_cache_key_query_rule('ignore', cache)
                 config['cacheKeyQueryRule'] = cache_key_rule
             else:
                 config['cacheKeyQueryRule'] = cache['cacheKeyQueryRule']
@@ -271,7 +254,7 @@ def _get_ids_from_hostname(self, hostname):
         return result
 
     @staticmethod
-    def get_cache_key_query_rule(cache_type, cache_description):
+    def get_cache_key_query_rule(cache_type, cache):
         """Get the cdn object detail.
 
         :param string cache_type: Cache type.
@@ -279,10 +262,10 @@ def get_cache_key_query_rule(cache_type, cache_description):
 
         :return: string value.
         """
-        if cache_description is None:
+        if 'description' not in cache:
             raise SoftLayer.SoftLayerError('Please add a description to be able to update the'
                                            ' cache.')
-        cache_result = '%s: %s' % (cache_type, cache_description)
+        cache_result = '%s: %s' % (cache_type, cache['description'])
 
         return cache_result
 


Test patch:
diff --git a/tests/CLI/modules/cdn_tests.py b/tests/CLI/modules/cdn_tests.py
index f10bafe7..2e368261 100644
--- a/tests/CLI/modules/cdn_tests.py
+++ b/tests/CLI/modules/cdn_tests.py
@@ -66,30 +66,15 @@ def test_add_origin_server(self):
 
         self.assert_no_fail(result)
 
-    def test_add_origin_server_dynamic(self):
-        result = self.run_command(
-            ['cdn', 'origin-add', '-t', 'server', '-H=test.example.com', '-s', 81, '-o', 'dynamic', '-c=include-all',
-             '-P', 'HTTPS', '-d', 'abc.html', '-g', True, '-i', True, '1234', '10.10.10.1', '/example/videos2', ])
-
-        self.assert_no_fail(result)
-
     def test_add_origin_storage(self):
         result = self.run_command(['cdn', 'origin-add', '-t', 'storage', '-b=test-bucket', '-H=test.example.com',
                                    '-p', 80, '-o', 'web', '-c=include-all', '1234', '10.10.10.1', '/example/videos2'])
 
         self.assert_no_fail(result)
 
-    def test_add_origin_storage_dynamic(self):
-        result = self.run_command(['cdn', 'origin-add', '-t', 'storage', '-b=test-bucket', '-H=test.example.com',
-                                   '-s', 81, '-o', 'dynamic', '-c=include-all', '1234', '10.10.10.1',
-                                   '/example/videos2', '-g', True, '-i', True])
-
-        self.assert_no_fail(result)
-
     def test_add_origin_without_storage(self):
         result = self.run_command(['cdn', 'origin-add', '-t', 'storage', '-H=test.example.com', '-p', 80,
-                                   '-P', 'HTTPS', '-o', 'web', '-c=include-all',
-                                   '1234', '10.10.10.1', '/example/videos2'])
+                                   '-o', 'web', '-c=include-all', '1234', '10.10.10.1', '/example/videos2'])
 
         self.assertEqual(result.exit_code, 2)
         self.assertIsInstance(result.exception, exceptions.ArgumentError)
@@ -101,15 +86,6 @@ def test_add_origin_storage_with_file_extensions(self):
 
         self.assert_no_fail(result)
 
-    def test_add_origin_storage_with_file_extensions_dynamic(self):
-        result = self.run_command(
-            ['cdn', 'origin-add', '-t', 'storage', '-b=test-bucket', '-e', 'jpg', '-H=test.example.com', '-s', 81,
-             '-P', 'HTTPS', '-o', 'dynamic', '-d', 'abc.html', '-g', True, '-i', True,
-             '-c=include-all', '1234', '10.10.10.1', '/example/videos2',
-             ])
-
-        self.assert_no_fail(result)
-
     def test_remove_origin(self):
         result = self.run_command(['cdn', 'origin-remove', '1234',
                                    '/example1'])
diff --git a/tests/CLI/modules/file_tests.py b/tests/CLI/modules/file_tests.py
index b9222574..b8c7f00b 100644
--- a/tests/CLI/modules/file_tests.py
+++ b/tests/CLI/modules/file_tests.py
@@ -820,11 +820,3 @@ def test_snapshot_get_notification_status(self, status):
     def test_volume_options(self):
         result = self.run_command(['file', 'volume-options'])
         self.assert_no_fail(result)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_modify_order_no_force(self, confirm_mock):
-        confirm_mock.return_value = False
-        result = self.run_command(['file', 'volume-modify', '102'])
-
-        self.assertEqual(2, result.exit_code)
-        self.assertEqual('Aborted', result.exception.message)
diff --git a/tests/CLI/modules/firewall_tests.py b/tests/CLI/modules/firewall_tests.py
index 0ccf2488..79d23969 100644
--- a/tests/CLI/modules/firewall_tests.py
+++ b/tests/CLI/modules/firewall_tests.py
@@ -21,7 +21,7 @@ def test_list_firewalls(self):
     @mock.patch('SoftLayer.CLI.formatting.confirm')
     def test_add_vs(self, confirm_mock):
         confirm_mock.return_value = True
-        result = self.run_command(['firewall', 'add', '1000', '--firewall-type=vlan', '-h'])
+        result = self.run_command(['firewall', 'add', '1000', '--firewall-type=vlan', '-ha'])
         self.assert_no_fail(result)
         self.assertIn("Firewall is being created!", result.output)
 
@@ -158,24 +158,3 @@ def test_edit(self, confirm_mock):
     def test_monitoring(self):
         result = self.run_command(['firewall', 'monitoring', '123456'])
         print(result.output)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_add_firewall_force(self, confirm_mock):
-        confirm_mock.return_value = False
-        result = self.run_command(['firewall', 'add', '1000', '--firewall-type=vlan', '-h', '--force'])
-        self.assert_no_fail(result)
-        self.assertIn("Firewall is being created!", result.output)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_add_firewall_no_force(self, confirm_mock):
-        confirm_mock.return_value = False
-        result = self.run_command(['firewall', 'add', '1000', '--firewall-type=vlan', '-h'])
-        self.assertEqual(2, result.exit_code)
-
-    @mock.patch('SoftLayer.CLI.formatting.confirm')
-    def test_cancel_firewall_no_force(self, confirm_mock):
-        confirm_mock.return_value = False
-        result = self.run_command(['firewall', 'cancel', 'vlan:1234'])
-        self.assertEqual(2, result.exit_code)
-        print(result.output)
-        self.assertEqual('Aborted.', result.exception.message)
diff --git a/tests/CLI/modules/globalip_tests.py b/tests/CLI/modules/globalip_tests.py
index f46bd5ef..43c5b0f4 100644
--- a/tests/CLI/modules/globalip_tests.py
+++ b/tests/CLI/modules/globalip_tests.py
@@ -39,8 +39,7 @@ def test_ip_cancel(self, no_going_back_mock):
         no_going_back_mock.return_value = False
         result = self.run_command(['globalip', 'cancel', '1'])
 
-        self.assertEqual(result.exit_code, 2)
-        self.assertIsInstance(result.exception, exceptions.CLIAbort)
+        self.assertEqual(result.exit_code, 0)
 
     def test_ip_list(self):
         result = self.run_command(['globalip', 'list', '--ip-version=v4'])
@@ -85,3 +84,27 @@ def test_ip_unassign(self):
         result = self.run_command(['globalip', 'unassign', '1'])
         self.assert_no_fail(result)
         self.assertEqual(result.output, "")
+
+    def test_ip_cancel_force(self):
+        result = self.run_command(['globalip', 'cancel', '1', '--force'])
+
+        self.assert_no_fail(result)
+        self.assertEqual(result.exit_code, 0)
+
+    @mock.patch('SoftLayer.CLI.formatting.confirm')
+    def test_ip_cancel_no_abort(self, confirm_mock):
+        # Test with confirmation and responding negatively
+        confirm_mock.return_value = True
+        result = self.run_command(['globalip', 'cancel', '1'])
+
+        self.assert_no_fail(result)
+        self.assertEqual(result.exit_code, 0)
+
+    @mock.patch('SoftLayer.CLI.formatting.confirm')
+    def test_ip_cancel_abort(self, confirm_mock):
+        # Test with confirmation and responding negatively
+        confirm_mock.return_value = False
+        result = self.run_command(['globalip', 'cancel', '1'])
+
+        self.assertEqual(result.exit_code, 2)
+        self.assertIsInstance(result.exception, exceptions.CLIAbort)
diff --git a/tests/managers/cdn_tests.py b/tests/managers/cdn_tests.py
index 71dcf737..6a220e28 100644
--- a/tests/managers/cdn_tests.py
+++ b/tests/managers/cdn_tests.py
@@ -58,54 +58,42 @@ def test_get_origins(self):
                                 'listOriginPath')
 
     def test_add_origin(self):
-        self.cdn_client.add_origin("12345", "10.10.10.1", "/example/videos", dynamic_path="abc.html",
-                                   origin_type="server", header="test.example.com", https_port=81,
-                                   protocol='https', optimize_for="dynamic", compression=True,
-                                   prefetching=True, cache_query="include all")
+        self.cdn_client.add_origin("12345", "10.10.10.1", "/example/videos", origin_type="server",
+                                   header="test.example.com", port=80, protocol='http', optimize_for="web",
+                                   cache_query="include all")
 
         args = ({
             'uniqueId': "12345",
             'origin': '10.10.10.1',
             'path': '/example/videos',
-            'originType': 'HOST_SERVER',
-            'header': 'test.example.com',
-            'httpPort': 80,
-            'httpsPort': 81,
-            'protocol': 'HTTPS',
-            'performanceConfiguration': 'Dynamic content acceleration',
-            'cacheKeyQueryRule': "include all",
-            'dynamicContentAcceleration': {
-                'detectionPath': "/abc.html",
-                'prefetchEnabled': True,
-                'mobileImageCompressionEnabled': True
-            }
+                    'originType': 'HOST_SERVER',
+                    'header': 'test.example.com',
+                    'httpPort': 80,
+                    'protocol': 'HTTP',
+                    'performanceConfiguration': 'General web delivery',
+                    'cacheKeyQueryRule': "include all"
         },)
         self.assert_called_with('SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path',
                                 'createOriginPath',
                                 args=args)
 
     def test_add_origin_with_bucket_and_file_extension(self):
-        self.cdn_client.add_origin("12345", "10.10.10.1", "/example/videos", dynamic_path="abc.html",
-                                   origin_type="server", header="test.example.com", https_port=81,
-                                   protocol='https', optimize_for="dynamic", compression=True,
-                                   prefetching=True, cache_query="include all")
+        self.cdn_client.add_origin("12345", "10.10.10.1", "/example/videos", origin_type="storage",
+                                   bucket_name="test-bucket", file_extensions="jpg", header="test.example.com", port=80,
+                                   protocol='http', optimize_for="web", cache_query="include all")
 
         args = ({
             'uniqueId': "12345",
             'origin': '10.10.10.1',
             'path': '/example/videos',
-            'originType': 'HOST_SERVER',
-            'header': 'test.example.com',
-            'httpPort': 80,
-            'httpsPort': 81,
-            'protocol': 'HTTPS',
-            'performanceConfiguration': 'Dynamic content acceleration',
-            'cacheKeyQueryRule': "include all",
-            'dynamicContentAcceleration': {
-                'detectionPath': "/abc.html",
-                'prefetchEnabled': True,
-                'mobileImageCompressionEnabled': True
-            }
+                    'originType': 'OBJECT_STORAGE',
+                    'header': 'test.example.com',
+                    'httpPort': 80,
+                    'protocol': 'HTTP',
+                    'bucketName': 'test-bucket',
+                    'fileExtension': 'jpg',
+                    'performanceConfiguration': 'General web delivery',
+                    'cacheKeyQueryRule': "include all"
         },)
         self.assert_called_with('SoftLayer_Network_CdnMarketplace_Configuration_Mapping_Path',
                                 'createOriginPath',