diff --git a/gso/oss-params-example.json b/gso/oss-params-example.json index 7b6c399f5415678f7815f70a65cc95208de365f5..f9523a724d2b433b761ef4c5f33544077e6d850b 100644 --- a/gso/oss-params-example.json +++ b/gso/oss-params-example.json @@ -110,12 +110,7 @@ "api_key": "kentik_api_key", "device_type": "router", "minimize_snmp": false, - "billing_plans": { - "1": "XL license", - "2": "L license", - "3": "M license", - "4": "S license" - }, + "placeholder_license_key": "placeholder license", "sample_rate": 100, "bgp_type": "device", "bgp_lookup_strategy": "lu_global_fallback", diff --git a/gso/services/kentik_client.py b/gso/services/kentik_client.py index bb81a8260b4a55f32685a8904b95af662609e063..7f62d169186b28848ea696b791834bd0192fddee 100644 --- a/gso/services/kentik_client.py +++ b/gso/services/kentik_client.py @@ -114,7 +114,7 @@ class KentikClient: def create_device(self, device: NewKentikDevice) -> dict[str, Any]: """Add a new device to Kentik.""" - plan_id = self.get_plan_by_name(self.config.billing_plans[device.site_tier])["id"] + plan_id = self.get_plan_by_name(self.config.placeholder_license_key)["id"] request_body = { "device": { **device.model_dump(exclude=set("device_name" "site_tier")), diff --git a/gso/settings.py b/gso/settings.py index e0a60a3ef6f841804481b6abfc75fce5a63bf8a4..c105fffc8fbb23933a12a572f208d0bd07cd5b9e 100644 --- a/gso/settings.py +++ b/gso/settings.py @@ -16,7 +16,6 @@ from pydantic_forms.types import UUIDstr, strEnum from pydantic_settings import BaseSettings from typing_extensions import Doc -from gso.products.product_blocks.site import SiteTier from gso.utils.shared_enums import PortNumber logger = logging.getLogger(__name__) @@ -184,7 +183,7 @@ class KentikParams(BaseSettings): api_key: str device_type: str minimize_snmp: bool - billing_plans: dict[SiteTier, str] + placeholder_license_key: str sample_rate: int bgp_type: str bgp_lookup_strategy: str diff --git a/gso/workflows/router/create_router.py b/gso/workflows/router/create_router.py index 8c7fdc06dc78bb3f44baf7ac419566547cda9b14..8382e227181233c145371f00aeb835ba91797f58 100644 --- a/gso/workflows/router/create_router.py +++ b/gso/workflows/router/create_router.py @@ -18,7 +18,6 @@ from gso.products.product_blocks.router import RouterRole from gso.products.product_types.router import RouterInactive, RouterProvisioning from gso.products.product_types.site import Site from gso.services import infoblox, subscriptions -from gso.services.kentik_client import KentikClient, NewKentikDevice from gso.services.lso_client import lso_interaction from gso.services.netbox_client import NetboxClient from gso.services.partners import get_partner_by_name @@ -144,46 +143,6 @@ def create_netbox_device(subscription: RouterInactive) -> State: return {"subscription": subscription} -@step("Create Kentik device") -def create_kentik_device(subscription: RouterInactive) -> State: - """Create a new device in Kentik.""" - if not ( - subscription.router.router_site - and subscription.router.router_site.site_name - and subscription.router.router_site.site_tier - and subscription.router.router_fqdn - ): - msg = "Router object is missing required properties." - raise ProcessFailureError(msg) - - kentik_client = KentikClient() - kentik_site = kentik_client.get_site_by_name(subscription.router.router_site.site_name) - - if not kentik_site: - msg = f"Site could not be found in Kentik: {subscription.router.router_site.site_name}" - raise ProcessFailureError(msg) - - site_tier = subscription.router.router_site.site_tier - new_device = NewKentikDevice( - device_name=subscription.router.router_fqdn, - device_description=str(subscription.subscription_id), - sending_ips=[str(subscription.router.router_lo_ipv4_address)], - site_tier=site_tier, - site_id=kentik_site["id"], - device_snmp_ip=str(subscription.router.router_lo_ipv4_address), - device_bgp_flowspec=False, - device_bgp_neighbor_ip=str(subscription.router.router_lo_ipv4_address), - device_bgp_neighbor_ip6=str(subscription.router.router_lo_ipv6_address), - ) - kentik_device = kentik_client.create_device(new_device) - - if "error" in kentik_device or "kentik_error" in kentik_device: - raise ProcessFailureError(str(kentik_device)) - - kentik_device.pop("custom_column_data", None) - return {"kentik_device": kentik_device} - - @step("Verify IPAM resources for loopback interface") def verify_ipam_loopback(subscription: RouterInactive) -> None: """Validate the :term:`IPAM` resources for the loopback interface. @@ -313,7 +272,6 @@ def create_router() -> StepList: >> prompt_insert_in_ims >> prompt_insert_in_radius >> router_is_nokia(create_netbox_device) - >> create_kentik_device >> lso_interaction(run_checks_after_base_config) >> set_status(SubscriptionLifecycle.PROVISIONING) >> create_new_sharepoint_checklist diff --git a/gso/workflows/router/terminate_router.py b/gso/workflows/router/terminate_router.py index cbb3048d0371539208b6fbb637764c4860969f17..688e3ecc21543ddc5ca678296b763fe7c6194bb5 100644 --- a/gso/workflows/router/terminate_router.py +++ b/gso/workflows/router/terminate_router.py @@ -21,7 +21,6 @@ from orchestrator.workflows.utils import wrap_modify_initial_input_form from gso.products.product_blocks.router import RouterRole from gso.products.product_types.router import Router from gso.services import infoblox, lso_client -from gso.services.kentik_client import KentikClient from gso.services.librenms_client import LibreNMSClient from gso.services.lso_client import execute_playbook, lso_interaction from gso.services.netbox_client import NetboxClient @@ -238,12 +237,6 @@ def remove_device_from_librenms(subscription: Router) -> dict[str, Router]: return {"subscription": subscription} -@step("Archive device in Kentik") -def remove_device_from_kentik(subscription: Router) -> None: - """Archive the device in Kentik.""" - KentikClient().remove_device(subscription.router.router_fqdn, archive=True) - - @workflow( "Terminate router", initial_input_form=wrap_modify_initial_input_form(initial_input_form_generator), @@ -278,7 +271,6 @@ def terminate_router() -> StepList: >> run_config_steps(lso_interaction(remove_config_from_router_real)) >> router_is_nokia(remove_device_from_netbox) >> remove_device_from_librenms - >> remove_device_from_kentik >> set_status(SubscriptionLifecycle.TERMINATED) >> resync >> done