queries/useSecretYAML.ts

portainer · app/react/kubernetes/configs/secrets/queries/useSecretYAML.ts · typescript · Zlib
infra, Infra / DevOps

Module exposing: useSecretYAML, getSecretYAML

// Source: https://github.com/portainer/portainer | License: Zlib | Copyright 2018 Portainer.io
// Provided via justclaw.it.com; keep this notice with the code.
import { useQuery } from '@tanstack/react-query';

import { EnvironmentId } from '@/react/portainer/environments/types';
import { queryKeys as environmentQueryKeys } from '@/react/kubernetes/queries/query-keys';
import axios from '@/portainer/services/axios/axios';

import { parseKubernetesAxiosError } from '../../../axiosError';

export function useSecretYAML(
  environmentId: EnvironmentId,
  namespace: string,
  name: string
) {
  return useQuery(
    [
      ...environmentQueryKeys.base(environmentId),
      'secrets',
      namespace,
      name,
      'yaml',
    ],
    () => getSecretYAML(environmentId, namespace, name),
   

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key