def delete_service_instance(instance_id: str = None): # -> None: if instance_id: if ServiceInstanceAdapter.exists_in_db(instance_id): ServiceInstanceAdapter.delete(instance_id) return 'Instance Deleted', 200 else: return 'Instance ID not found', 500 else: LastOperationAdapter.delete_all() ServiceInstanceAdapter.delete_all() return 'Deleted all Instances', 200
def delete_service(service_id: str = None) -> tuple: if service_id: if ServiceTypeAdapter.exists_in_db(service_id): ServiceTypeAdapter.delete(service_id) return 'Service Deleted', 200 else: return 'Service ID not found', 500 else: PlanServiceTypeAdapter.delete_all() LastOperationAdapter.delete_all() ServiceInstanceAdapter.delete_all() ManifestAdapter.delete_all() ServiceTypeAdapter.delete_all() PlanAdapter.delete_all() return 'Deleted all Services', 200