{
  "description": "Silence is the Schema for the silences API.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "SilenceSpec defines the desired state of Silence.",
      "properties": {
        "duration": {
          "description": "Duration defines how long the silence is active from StartsAt (or creation time when StartsAt is unset).\nIgnored when EndsAt is set. Takes precedence over the valid-until annotation.\nSupports weeks (w), days (d), hours (h), minutes (m), and seconds (s): \"7d\", \"2w\", \"1d12h\", \"30m\".",
          "pattern": "^(\\d+w(\\d+d)?(\\d+h)?(\\d+m)?(\\d+s)?|\\d+d(\\d+h)?(\\d+m)?(\\d+s)?|\\d+h(\\d+m)?(\\d+s)?|\\d+m(\\d+s)?|\\d+s)$",
          "type": "string"
        },
        "endsAt": {
          "description": "EndsAt defines when the silence expires. Takes precedence over Duration and the valid-until annotation.",
          "format": "date-time",
          "type": "string"
        },
        "matchers": {
          "description": "Matchers defines the alert matchers that this silence will apply to.",
          "items": {
            "description": "SilenceMatcher defines an alert matcher to be muted by the Silence.",
            "properties": {
              "matchType": {
                "default": "=",
                "description": "MatchType defines the type of matching to perform.",
                "enum": [
                  "=",
                  "!=",
                  "=~",
                  "!~"
                ],
                "type": "string"
              },
              "name": {
                "description": "Name of the label to match.",
                "maxLength": 256,
                "minLength": 1,
                "type": "string"
              },
              "value": {
                "description": "Value to match for the given label name.",
                "maxLength": 1024,
                "type": "string"
              }
            },
            "required": [
              "name",
              "value"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "minItems": 1,
          "type": "array"
        },
        "startsAt": {
          "description": "StartsAt defines when the silence becomes active. Defaults to the object's creation timestamp.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "matchers"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object",
  "x-kubernetes-validations": [
    {
      "message": "endsAt and duration are mutually exclusive",
      "rule": "!(has(self.spec.endsAt) && has(self.spec.duration))"
    },
    {
      "message": "startsAt must be before endsAt",
      "rule": "!has(self.spec.startsAt) || !has(self.spec.endsAt) || timestamp(self.spec.startsAt) < timestamp(self.spec.endsAt)"
    }
  ]
}
