1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00
portainer/app/kubernetes/rest/serviceAccount.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
479 B
JavaScript
Raw Normal View History

import axios, { parseAxiosError } from '@/portainer/services/axios';
export async function getServiceAccounts(environmentId, namespaceId) {
try {
const {
data: { items },
} = await axios.get(urlBuilder(environmentId, namespaceId));
return items;
} catch (error) {
throw parseAxiosError(error);
}
}
function urlBuilder(environmentId, namespaceId) {
return `endpoints/${environmentId}/kubernetes/api/v1/namespaces/${namespaceId}/serviceaccounts`;
}