Skip to content

Modify kentik license

A workflow that modifies the Kentik license of a router.

Change the license of a router in Kentik. The operator can select the license from a list of all available plans in Kentik, and it will show the utilisation of each license.

update_kentik_license(subscription, new_plan_id)

Update a Kentik device with a new license attached to it.

Source code in gso/workflows/router/modify_kentik_license.py
@step("Update device license in Kentik")
def update_kentik_license(subscription: Router, new_plan_id: int) -> State:
    """Update a Kentik device with a new license attached to it."""
    kentik_client = KentikClient()
    kentik_device = kentik_client.get_device_by_name(subscription.router.router_fqdn)
    if "id" not in kentik_device:
        msg = "Failed to find Kentik device by name"
        raise ProcessFailureError(msg, details=subscription.router.router_fqdn)

    updated_kentik_device = kentik_client.update_device(kentik_device["id"], {"device": {"plan_id": new_plan_id}})

    return {"kentik_device": updated_kentik_device}

modify_router_kentik_license()

Apply a selected Kentik license on an existing PE router.

This workflow is not authorized to run if the Kentik integration is disabled.

Source code in gso/workflows/router/modify_kentik_license.py
@modify_workflow(
    "Modify Kentik license",
    initial_input_form=_initial_input_form,
    authorize_callback=lambda _: bool(load_oss_params().KENTIK),
)
def modify_router_kentik_license() -> StepList:
    """Apply a selected Kentik license on an existing PE router.

    This workflow is not authorized to run if the Kentik integration is disabled.
    """
    return begin >> update_kentik_license