diff --git a/VERSION b/VERSION index e0ea44c..bf21f52 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.5 \ No newline at end of file +0.6.6 \ No newline at end of file diff --git a/bin/akamai-eaa b/bin/akamai-eaa index b5f7010..e64fa96 100755 --- a/bin/akamai-eaa +++ b/bin/akamai-eaa @@ -317,6 +317,9 @@ if __name__ == "__main__": elif config.action == "apps": con_moniker = EAAItem(config.connector_id) c.list_apps(con_moniker, perf=perf) + elif config.action in ("delete", "rm"): + con_moniker = EAAItem(config.connector_id) + c.remove(con_moniker) elif config.action == "allowlist": c.allow_list() else: diff --git a/bin/config.py b/bin/config.py index 91f35c3..bf6796f 100644 --- a/bin/config.py +++ b/bin/config.py @@ -162,8 +162,11 @@ def __init__(self, config_values, configuration, flags=None): # subparsers.required = False swap_parser = subsub.add_parser("swap", help="Swap connector with another one") swap_parser.add_argument(dest="new_connector_id", help='New connector ID') - swap_parser.add_argument('--dryrun', dest="dryrun", action="store_true", default=False, - help='Dry run mode') + swap_parser.add_argument('--dryrun', dest="dryrun", action="store_true", default=False, help='Dry run mode') + + remove_parser = subsub.add_parser("remove", aliases=["rm"], help="Unregister a connector") + remove_parser.add_argument('--force', dest="force", action="store_true", default=False, help='Forcibly remove the connector from apps') + allowlist_parser = subsub.add_parser("allowlist", help="Dump EAA Cloud Endpoint for Firewall/Proxy/Network Security equipement") allowlist_parser.add_argument('--skip-header', dest="skip_header", action="store_true", default=False, @@ -175,7 +178,6 @@ def __init__(self, config_values, configuration, flags=None): allowlist_parser.add_argument('--since-time', dest="since_time", default=None, help='Only print endpoints updated after a specific date (RFC3339)') - subparsers.add_parser('idp', aliases=["i"], help='Manage EAA Identity Providers') info_parser = subparsers.add_parser('info', help='Display tenant info (cloud zone)') diff --git a/cli.json b/cli.json index 4472c2f..d576dce 100755 --- a/cli.json +++ b/cli.json @@ -5,7 +5,7 @@ "commands": [ { "name": "eaa", - "version": "0.6.5", + "version": "0.6.6", "description": "Akamai CLI for Enterprise Application Access (EAA)" } ] diff --git a/libeaa/application.py b/libeaa/application.py index 65b36b6..e2dd33e 100644 --- a/libeaa/application.py +++ b/libeaa/application.py @@ -429,6 +429,8 @@ def create_urlbasedpolicies(self, app_moniker, app_config): "name": upp_rule.get("name"), "url": upp_rule.get("url") } + if upp_rule.get("settings"): + upp_create_payload["settings"] = upp_rule.get("settings") upp_create = self.post(upp_url, json=upp_create_payload) upp_create_data = upp_create.json() if upp_create_data.get('uuid_url'): diff --git a/libeaa/common.py b/libeaa/common.py index f0a2390..9644af8 100644 --- a/libeaa/common.py +++ b/libeaa/common.py @@ -1,4 +1,4 @@ -# Copyright 2022 Akamai Technologies, Inc. All Rights Reserved +# Copyright 2024 Akamai Technologies, Inc. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ """ #: cli-eaa version [PEP 8] -__version__ = '0.6.5' +__version__ = '0.6.6' import sys from threading import Event diff --git a/libeaa/connector.py b/libeaa/connector.py index 57ca81b..5dc960f 100644 --- a/libeaa/connector.py +++ b/libeaa/connector.py @@ -411,3 +411,16 @@ def swap(self, old_con_id, new_con_id, dryrun=False): else: cli.footer("Connector swapped in %s application(s)." % app_processed) cli.footer("Updated application(s) is/are marked as ready to deploy") + + + def remove(self, connector_moniker: EAAItem): + "Delete an EAA connector." + r = self.delete(f'mgmt-pop/agents/{connector_moniker.uuid}') + if r.status_code == 204: + cli.print("Connector deleted successfully.") + return_code = 0 + else: + cli.print_error(f"Can't delete connector {connector_moniker.uuid}, API returned HTTP/{r.status_code}.") + cli.print_error("Use: akamai eaa connector list") + return_code = 1 + cli.exit(return_code)