def METHOD_NAME(self, app, work):
    app_id = self._get_app_id()
    project_id = self._get_project_id()
    assert project_id
    client = LightningClient()
    list_apps_resp = client.lightningapp_instance_service_list_lightningapp_instances(project_id=project_id)
    lightning_app: Optional[Externalv1LightningappInstance] = None
    for lightningapp in list_apps_resp.lightningapps:
        if lightningapp.id == app_id:
            lightning_app = lightningapp
    assert lightning_app
    network_config = self.work_to_network_configs[work.name]
    for nc in lightning_app.spec.network_config:
        if nc.host == network_config.host:
            nc.enable = False
    client.lightningapp_instance_service_update_lightningapp_instance(
        project_id=project_id,
        id=lightning_app.id,
        body=AppinstancesIdBody(name=lightning_app.name, spec=lightning_app.spec),
    )
    del self.work_to_network_configs[work.name]