Implements VM groups API (#206)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #206
This commit is contained in:
@ -22,6 +22,7 @@ export function TokenRightsEditor(p: {
|
||||
editable: boolean;
|
||||
onChange?: () => void;
|
||||
vms: VMInfo[];
|
||||
groups: string[];
|
||||
networks: NetworkInfo[];
|
||||
nwFilters: NWFilter[];
|
||||
tokens: APIToken[];
|
||||
@ -238,6 +239,139 @@ export function TokenRightsEditor(p: {
|
||||
</Table>
|
||||
</RightsSection>
|
||||
|
||||
<RightsSection label="VM groups">
|
||||
<RouteRight
|
||||
{...p}
|
||||
right={{ verb: "POST", path: "/api/group/list" }}
|
||||
label="Get the list of groups"
|
||||
/>
|
||||
|
||||
<Table size="small">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Group name</TableCell>
|
||||
<TableCell align="center">Get VM info</TableCell>
|
||||
<TableCell align="center">Start VM</TableCell>
|
||||
<TableCell align="center">Shutdown VM</TableCell>
|
||||
<TableCell align="center">Suspend VM</TableCell>
|
||||
<TableCell align="center">Resume VM</TableCell>
|
||||
<TableCell align="center">Kill VM</TableCell>
|
||||
<TableCell align="center">Reset VM</TableCell>
|
||||
<TableCell align="center">Screenshot VM</TableCell>
|
||||
<TableCell align="center">Get VM State</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{/* All Group operations */}
|
||||
<TableRow hover>
|
||||
<TableCell>
|
||||
<i>All</i>
|
||||
</TableCell>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/info" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/start" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/shutdown" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/suspend" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/resume" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/kill" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/reset" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/screenshot" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: "/api/group/*/vm/state" }}
|
||||
/>
|
||||
</TableRow>
|
||||
|
||||
{/* Per VM operations */}
|
||||
{p.groups.map((v, n) => (
|
||||
<TableRow hover key={n}>
|
||||
<TableCell>{v}</TableCell>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: `/api/group/${v}/vm/info` }}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/info" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: `/api/group/${v}/vm/start` }}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/start" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{
|
||||
verb: "GET",
|
||||
path: `/api/group/${v}/vm/shutdown`,
|
||||
}}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/shutdown" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{
|
||||
verb: "GET",
|
||||
path: `/api/group/${v}/vm/suspend`,
|
||||
}}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/suspend" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{
|
||||
verb: "GET",
|
||||
path: `/api/group/${v}/vm/resume`,
|
||||
}}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/resume" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: `/api/group/${v}/vm/kill` }}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/kill" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: `/api/group/${v}/vm/reset` }}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/reset" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{
|
||||
verb: "GET",
|
||||
path: `/api/group/${v}/vm/screenshot`,
|
||||
}}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/screenshot" }}
|
||||
/>
|
||||
<CellRight
|
||||
{...p}
|
||||
right={{ verb: "GET", path: `/api/group/${v}/vm/state` }}
|
||||
parent={{ verb: "GET", path: "/api/group/*/vm/state" }}
|
||||
/>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</RightsSection>
|
||||
|
||||
{/* Networks */}
|
||||
<RightsSection label="Networks">
|
||||
<RouteRight
|
||||
|
Reference in New Issue
Block a user