def ready(self): client = get_client("CoreV1Api") cfg = util.object_as_dict(self) response = client.read_namespaced_service(cfg["metadata"]["name"], cfg["metadata"]["namespace"]) return response.status is not None
def ready(self): client = get_client("AppsV1beta1Api") cfg = util.object_as_dict(self) response = client.read_namespaced_deployment( cfg["metadata"]["name"], cfg["metadata"]["namespace"]) return hasattr(response, "status") and (response.status.ready_replicas >= 1)
def create(self): client = get_client("CoreV1Api") cfg = util.object_as_dict(self) logging.info("Creating object with config: %s" % cfg) response = client.create_namespaced_service( cfg["metadata"]["namespace"], cfg) pprint.pprint(response)
def delete(self): client = get_client("CoreV1Api") cfg = util.object_as_dict(self) return client.delete_namespaced_service(cfg["metadata"]["name"], cfg["metadata"]["namespace"])
def delete(self): client = get_client("AppsV1beta1Api") cfg = util.object_as_dict(self) return client.delete_namespaced_deployment( cfg["metadata"]["name"], cfg["metadata"]["namespace"], kubernetes.client.V1DeleteOptions())