async def put_api_networks( current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db)): post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("network", "list", "update") return task_model
async def put_api_images(current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db)): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("storage", "list", "update") return task_model
def patch_api_node_role(bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), model: NodeRolePatch = None): post_task = PostTask(db=db, user=current_user, model=model) task_model = post_task.commit("node", "role", "change", bg=bg) return task_model
async def post_api_nodes(current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: NodeInsert = None): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("node", "base", "add") return task_model
def delete_api_domains(bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: DomainDelete = None): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("vm", "base", "delete", bg) return task_model
def publish_task_to_update_vm_list( bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db)): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("vm", "list", "update", bg) return task_model
def patch_api_vm_network(bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: DomainNetworkChange = None): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("vm", "network", "change", bg) return task_model
def post_api_storage(bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: NetworkDelete = None): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("network", "base", "delete", bg) return task_model
async def delete_api_storages( current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: StorageDelete = None): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("storage", "base", "delete") return task_model
async def patch_api_domains( current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: DomainPatch = None ): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("vm","base","change") return task_model
def post_api_networks_uuid_ovs( bg: BackgroundTasks, request_model: NetworkOVSDelete, db: Session = Depends(get_db), current_user: CurrentUser = Depends(get_current_user), ): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("network", "ovs", "delete", bg=bg, status="wait") return task_model
def post_api_vms(bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: DomainInsert = None): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("vm", "base", "add", bg) # ストレージ更新タスク post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("storage", "list", "update", bg, status="wait", dependence_uuid=task_model.uuid) return task_model
def post_api_networks_uuid_ovs( bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: NetworkOVSAdd = None, ): # タスクを追加 post_task = PostTask(db=db, user=current_user, model=request_model) task_model = post_task.commit("network", "ovs", "add", bg) post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("network", "list", "update", bg=bg, status="wait", dependence_uuid=task_model.uuid) return task_model
def post_api_nodes(bg: BackgroundTasks, current_user: CurrentUser = Depends(get_current_user), db: Session = Depends(get_db), request_model: NodeInsert = None): # ノード追加タスク node_post_task = PostTask(db=db, user=current_user, model=request_model) node_post_model = node_post_task.commit("node", "base", "add", bg) if request_model.libvirt_role: libvirt_role = NodeRolePatch(node_name=request_model.name, role_name="libvirt") libvirt_task = PostTask(db=db, user=current_user, model=libvirt_role) libvirt_model = libvirt_task.commit( "node", "role", "change", bg=bg, status="wait", dependence_uuid=node_post_model.uuid) # ドメインリスト更新タスク post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("vm", "list", "update", bg, status="wait", dependence_uuid=libvirt_model.uuid) # ネットワーク更新タスク post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("network", "list", "update", bg, status="wait", dependence_uuid=libvirt_model.uuid) # ストレージ更新タスク post_task = PostTask(db=db, user=current_user, model=None) task_model = post_task.commit("storage", "list", "update", bg, status="wait", dependence_uuid=libvirt_model.uuid) return node_post_model