fleet/frontend/services/entities/spec.ts
2021-11-15 16:16:06 -05:00

24 lines
617 B
TypeScript

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import sendRequest from "services";
import endpoints from "fleet/endpoints";
import { IEnrollSecret } from "interfaces/enroll_secret";
interface IEnrollSecretSpec {
spec: {
secrets: IEnrollSecret[];
};
}
export default {
getEnrollSecretSpec: () => {
const { GLOBAL_ENROLL_SECRETS } = endpoints;
return sendRequest("GET", GLOBAL_ENROLL_SECRETS);
},
applyEnrollSecretSpec: (spec: IEnrollSecretSpec) => {
const { GLOBAL_ENROLL_SECRETS } = endpoints;
return sendRequest("POST", GLOBAL_ENROLL_SECRETS, spec);
},
};