2024-10-01 01:15:51 +00:00
|
|
|
import { compact } from 'lodash';
|
|
|
|
|
2024-12-10 21:15:46 +00:00
|
|
|
import { EnvironmentId } from '@/react/portainer/environments/types';
|
|
|
|
|
2024-10-01 01:15:51 +00:00
|
|
|
export const queryKeys = {
|
2024-12-10 21:15:46 +00:00
|
|
|
list: (
|
|
|
|
environmentId: EnvironmentId,
|
|
|
|
options?: { withResourceQuota?: boolean }
|
|
|
|
) =>
|
2024-10-01 01:15:51 +00:00
|
|
|
compact([
|
|
|
|
'environments',
|
|
|
|
environmentId,
|
|
|
|
'kubernetes',
|
|
|
|
'namespaces',
|
|
|
|
options?.withResourceQuota,
|
|
|
|
]),
|
2024-12-10 21:15:46 +00:00
|
|
|
namespace: (environmentId: EnvironmentId, namespace: string) =>
|
|
|
|
[
|
|
|
|
'environments',
|
|
|
|
environmentId,
|
|
|
|
'kubernetes',
|
|
|
|
'namespaces',
|
|
|
|
namespace,
|
|
|
|
] as const,
|
|
|
|
namespaceYAML: (environmentId: EnvironmentId, namespace: string) =>
|
2024-10-01 01:15:51 +00:00
|
|
|
[
|
|
|
|
'environments',
|
|
|
|
environmentId,
|
|
|
|
'kubernetes',
|
|
|
|
'namespaces',
|
|
|
|
namespace,
|
2024-12-10 21:15:46 +00:00
|
|
|
'yaml',
|
2024-10-01 01:15:51 +00:00
|
|
|
] as const,
|
|
|
|
};
|