mirror of
https://github.com/rustfs/console.git
synced 2026-11-02 13:42:10 +08:00
- Auto-format all files to comply with Prettier rules - Fix code style issues in 545 files
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
export const useAccessKeys = () => {
|
|
const { $api } = useNuxtApp()
|
|
|
|
const listUserServiceAccounts = async (params: Record<string, string> = {}) => {
|
|
return await $api.get('/list-service-accounts', { params })
|
|
}
|
|
|
|
const createServiceAccount = async (data: any) => {
|
|
return await $api.put('/add-service-accounts', data)
|
|
}
|
|
|
|
const getServiceAccount = async (name: string) => {
|
|
return await $api.get(`/info-service-account?accessKey=${encodeURIComponent(name)}`)
|
|
}
|
|
|
|
const updateServiceAccount = async (name: string, data: any) => {
|
|
return await $api.post(`/update-service-account?accessKey=${encodeURIComponent(name)}`, data)
|
|
}
|
|
|
|
const deleteServiceAccount = async (name: string) => {
|
|
return await $api.delete(`/delete-service-accounts?accessKey=${encodeURIComponent(name)}`, {})
|
|
}
|
|
|
|
const createServiceAccountCreds = async (data: any) => {
|
|
return await $api.post(`/service-account-credentials`, data)
|
|
}
|
|
|
|
return {
|
|
listUserServiceAccounts,
|
|
createServiceAccount,
|
|
deleteServiceAccount,
|
|
createServiceAccountCreds,
|
|
updateServiceAccount,
|
|
getServiceAccount,
|
|
}
|
|
}
|