예제 #1
0
def _unschedule_job(api: CustomObjectsApi, namespace: str, resource_name: str):
    try:
        api.delete_namespaced_custom_object(
            **_scheduled_crd_args(namespace),
            name=resource_name,
        )
    except client.ApiException as e:
        if e.status != 404:
            raise
예제 #2
0
def _cancel_job_by_id(api: CustomObjectsApi, namespace: str, job_id: str):
    try:
        api.delete_namespaced_custom_object(
            **_crd_args(namespace), name=_job_id_to_resource_name(job_id),
        )
    except client.ApiException as e:
        if e.status == 404:
            return None
        else:
            raise