| Current Path : /proc/thread-self/root/snap/lxd/current/share/lxd-ui/assets/ |
| Current File : //proc/thread-self/root/snap/lxd/current/share/lxd-ui/assets/usePlacementGroups-C9iFT3T3.js |
import{R as s,az as r,cp as c,u as o,ae as p,w as m}from"./index-BFGypnt-.js";const u=["can_delete","can_edit"],i=async(t,n)=>{const e=new URLSearchParams;return e.set("recursion","1"),e.set("project",t),c(e,n,u),fetch(`${s}/1.0/placement-groups?${e.toString()}`).then(r).then(a=>a.metadata)},l=async(t,n,e)=>{const a=new URLSearchParams;return a.set("project",n),c(a,e,u),fetch(`${s}/1.0/placement-groups/${encodeURIComponent(t)}?${a.toString()}`).then(r).then(h=>h.metadata)},y=async(t,n)=>{const e=new URLSearchParams;e.set("project",n),await fetch(`${s}/1.0/placement-groups?${e.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:t}).then(r)},P=async(t,n)=>{const e=new URLSearchParams;e.set("project",n),await fetch(`${s}/1.0/placement-groups/${encodeURIComponent(t.name)}?${e.toString()}`,{method:"PUT",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(r)},$=async(t,n)=>{const e=new URLSearchParams;e.set("project",n),await fetch(`${s}/1.0/placement-groups/${encodeURIComponent(t)}?${e.toString()}`,{method:"DELETE"}).then(r)},G=t=>{const{isFineGrained:n}=o();return p({queryKey:[m.placementGroups,t],queryFn:async()=>i(t,n)})},S=(t,n)=>{const{isFineGrained:e}=o();return p({queryKey:[m.placementGroups,n,t],queryFn:async()=>l(t,n,e)})};export{S as a,P as b,y as c,$ as d,G as u};