UNPKG

@soft-stech/flagger

Version:
50 lines (49 loc) 1.7 kB
import { z } from "zod"; import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema"; /** * MetricTemplate is the Schema for the MetricTemplates API. */ export const IMetricTemplateSchema = z.object({ "apiVersion": z.literal("flagger.app/v1beta1"), "kind": z.literal("MetricTemplate"), "metadata": iObjectMetaSchema.optional(), /** * MetricTemplateSpec defines the desired state of a MetricTemplate. */ "spec": z.object({ /** * Provider of this metric template */ "provider": z.object({ /** * Type of this provider */ "type": z.union([z.literal("prometheus"), z.literal("influxdb"), z.literal("datadog"), z.literal("stackdriver"), z.literal("cloudwatch"), z.literal("newrelic"), z.literal("graphite"), z.literal("dynatrace")]), /** * API address of this provider */ "address": z.string().optional(), /** * Kubernetes secret reference containing the provider credentials */ "secretRef": z.object({ /** * Name of the Kubernetes secret */ "name": z.string() }).optional(), /** * Region of the provider */ "region": z.string().optional(), /** * Disable SSL certificate validation for the provider address */ "insecureSkipVerify": z.boolean().optional() }), /** * Query of this metric template */ "query": z.string() }).optional() });