You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/nomad/nomad.service.ts

21 lines
485 B

import axios, { parseAxiosError } from '@/portainer/services/axios';
import { EnvironmentId } from '@/react/portainer/environments/types';
interface LeaderResponse {
Leader: string;
}
export async function getLeader(environmentId: EnvironmentId) {
try {
const { data } = await axios.get<LeaderResponse>(
`/nomad/endpoints/${environmentId}/leader`,
{
params: {},
}
);
return data;
} catch (e) {
throw parseAxiosError(e as Error);
}
}