{
  "description": "AutoOpsAgentPolicy represents an Elastic AutoOps Policy resource in a Kubernetes cluster.",
  "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": {
      "properties": {
        "autoOpsRef": {
          "description": "AutoOpsRef defines a reference to a secret containing connection details for AutoOps via Cloud Connect.",
          "properties": {
            "secretName": {
              "description": "SecretName references a Secret containing connection details for external AutoOps.\nRequired when connecting via Cloud Connect. The secret must contain:\n- `cloud-connected-mode-api-key`: Cloud Connected Mode API key\n- `autoops-otel-url`: AutoOps OpenTelemetry endpoint URL\n- `autoops-token`: AutoOps authentication token\n- `cloud-connected-mode-api-url`: (optional) Cloud Connected Mode API URL\nThis field cannot be used in combination with `name`.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "config": {
          "description": "Config holds additional OpenTelemetry collector configuration for the AutoOps agent.\nUser-supplied settings are merged between the operator baseline defaults and the\noperator-owned mandatory settings, which always take final precedence. This allows\ntuning knobs such as the sending_queue sizing, appending custom metricbeat modules,\nor defining additional exporters and pipelines. Supplying at least one autoops_es\nmodule replaces the operator's built-in modules entirely, giving full control over\nwhich metricsets are collected and at what period. Elasticsearch connection details\n(hosts, SSL), OTLP endpoint and authorization, and the healthcheck extension are\nalways injected by the operator and cannot be overridden.\nAt most one of [`config`, `configRef`] can be specified.",
          "type": "object",
          "x-kubernetes-preserve-unknown-fields": true
        },
        "configRef": {
          "description": "ConfigRef references a Kubernetes Secret holding the AutoOps agent configuration\nunder the `autoops_es.yml` key. Applies the same merge semantics as `config`.\nAt most one of [`config`, `configRef`] can be specified.",
          "properties": {
            "secretName": {
              "description": "SecretName is the name of the secret.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "image": {
          "description": "Image is the AutoOps Agent Docker image to deploy.",
          "type": "string"
        },
        "namespaceSelector": {
          "description": "NamespaceSelector is a namespace selector for the resources to be configured.\nAny Elasticsearch instances that belong to the selected namespaces will be configured to send data to AutoOps.",
          "properties": {
            "matchExpressions": {
              "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
              "items": {
                "description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values.",
                "properties": {
                  "key": {
                    "description": "key is the label key that the selector applies to.",
                    "type": "string"
                  },
                  "operator": {
                    "description": "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist.",
                    "type": "string"
                  },
                  "values": {
                    "description": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array",
                    "x-kubernetes-list-type": "atomic"
                  }
                },
                "required": [
                  "key",
                  "operator"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array",
              "x-kubernetes-list-type": "atomic"
            },
            "matchLabels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
              "type": "object"
            }
          },
          "type": "object",
          "x-kubernetes-map-type": "atomic",
          "additionalProperties": false
        },
        "podTemplate": {
          "description": "PodTemplate provides customization options (labels, annotations, affinity rules, resource requests, and so on) for the Agent pods",
          "type": "object",
          "x-kubernetes-preserve-unknown-fields": true
        },
        "resourceSelector": {
          "description": "ResourceSelector is a label selector for the resources to be configured.\nAny Elasticsearch instances that match the selector will be configured to send data to AutoOps.",
          "properties": {
            "matchExpressions": {
              "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
              "items": {
                "description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values.",
                "properties": {
                  "key": {
                    "description": "key is the label key that the selector applies to.",
                    "type": "string"
                  },
                  "operator": {
                    "description": "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist.",
                    "type": "string"
                  },
                  "values": {
                    "description": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array",
                    "x-kubernetes-list-type": "atomic"
                  }
                },
                "required": [
                  "key",
                  "operator"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array",
              "x-kubernetes-list-type": "atomic"
            },
            "matchLabels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
              "type": "object"
            }
          },
          "type": "object",
          "x-kubernetes-map-type": "atomic",
          "additionalProperties": false
        },
        "resources": {
          "description": "Resources provides a shorthand to set CPU and Memory resources on the AutoOps Agent container.\nWhen set, these values override any CPU or memory resource settings specified in the PodTemplate for\nthe primary AutoOps Agent container. To set resources on other containers, use the PodTemplate.",
          "properties": {
            "limits": {
              "description": "Limits is the shorthand for the main container's CPU and memory limits.",
              "properties": {
                "cpu": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "CPU overrides the main container's CPU request/limit when the parent Resources\nis merged into a PodTemplate. A nil value means \"do not override\": any CPU\nvalue already set on the main container in the PodTemplate is passed through\nunchanged. Setting this field to nil does not unset a CPU value present in\nthe PodTemplate; to remove it, edit the PodTemplate's container resources.\nA non-nil value wins over the PodTemplate's CPU, including an explicit zero quantity.",
                  "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                  "x-kubernetes-int-or-string": true
                },
                "memory": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "Memory overrides the main container's memory request/limit when the parent\nResources is merged into a PodTemplate. A nil value means \"do not override\":\nany memory value already set on the main container in the PodTemplate is\npassed through unchanged. Setting this field to nil does not unset a memory\nvalue present in the PodTemplate; to remove it, edit the PodTemplate's\ncontainer resources.\nA non-nil value wins over the PodTemplate's memory, including an explicit zero quantity.",
                  "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                  "x-kubernetes-int-or-string": true
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "requests": {
              "description": "Requests is the shorthand for the main container's CPU and memory requests.",
              "properties": {
                "cpu": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "CPU overrides the main container's CPU request/limit when the parent Resources\nis merged into a PodTemplate. A nil value means \"do not override\": any CPU\nvalue already set on the main container in the PodTemplate is passed through\nunchanged. Setting this field to nil does not unset a CPU value present in\nthe PodTemplate; to remove it, edit the PodTemplate's container resources.\nA non-nil value wins over the PodTemplate's CPU, including an explicit zero quantity.",
                  "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                  "x-kubernetes-int-or-string": true
                },
                "memory": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "description": "Memory overrides the main container's memory request/limit when the parent\nResources is merged into a PodTemplate. A nil value means \"do not override\":\nany memory value already set on the main container in the PodTemplate is\npassed through unchanged. Setting this field to nil does not unset a memory\nvalue present in the PodTemplate; to remove it, edit the PodTemplate's\ncontainer resources.\nA non-nil value wins over the PodTemplate's memory, including an explicit zero quantity.",
                  "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                  "x-kubernetes-int-or-string": true
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "revisionHistoryLimit": {
          "description": "RevisionHistoryLimit is the number of revisions to retain to allow rollback in the underlying Deployment.",
          "format": "int32",
          "type": "integer"
        },
        "serviceAccountName": {
          "description": "ServiceAccountName is used to check access to Elasticsearch resources in different namespaces.\nCan only be used if ECK is enforcing RBAC on references (--enforce-rbac-on-refs flag).\nThe service account must have \"get\" permission on elasticsearch.k8s.elastic.co/elasticsearches\nin the target namespaces.",
          "type": "string"
        },
        "version": {
          "description": "Version of the AutoOpsAgentPolicy.",
          "type": "string"
        }
      },
      "required": [
        "version"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "conditions": {
          "description": "Conditions holds the current service state of the deployment.",
          "items": {
            "description": "Condition represents the ECK resource's condition.",
            "properties": {
              "lastTransitionTime": {
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "type": {
                "description": "ConditionType defines the condition of a resource.",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "details": {
          "additionalProperties": {
            "description": "AutoOpsResourceStatus represents the status of an individual Elasticsearch resource\nmonitored by an AutoOpsAgentPolicy. It is used in the Details map of AutoOpsAgentPolicyStatus\nto provide lightweight per-resource status information. Only resources that are not in a\nready state are included in the Details map; ready resources, and resources that were skipped by resource selector and namespace selector,\nare omitted to reduce status size.",
            "properties": {
              "error": {
                "description": "Error contains the error message when the resource is in an error state.\nOnly populated when Phase is \"Error\".",
                "type": "string"
              },
              "message": {
                "description": "Message provides a human-readable explanation of the current phase.\nOnly populated for non-ready states to provide context about why\nthe resource is not ready.",
                "type": "string"
              },
              "phase": {
                "description": "Phase indicates the current state of the monitored resource.\nPossible values are \"Error\" (resource encountered an error) or \"Skipped\"\n(resource was skipped due to RBAC permissions).",
                "type": "string"
              }
            },
            "required": [
              "phase"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "description": "Details contains lightweight per-resource details.",
          "type": "object"
        },
        "errors": {
          "description": "Errors is the number of resources that are in an error state.",
          "type": "integer"
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the most recent generation observed for this AutoOpsAgentPolicy.",
          "format": "int64",
          "type": "integer"
        },
        "phase": {
          "description": "Phase is the phase of the AutoOpsAgentPolicy.",
          "type": "string"
        },
        "ready": {
          "description": "Ready is the number of resources that are in a ready state.",
          "type": "integer"
        },
        "readyCount": {
          "description": "ReadyCount is a human readable string of ready monitored resources vs all monitored resources, Ready/Resources.",
          "type": "string"
        },
        "resources": {
          "description": "Resources is the number of resources that match the ResourceSelector.",
          "type": "integer"
        },
        "skipped": {
          "description": "Skipped is the number of resources that are skipped from monitoring due to rbac permissions.",
          "type": "integer"
        }
      },
      "required": [
        "errors",
        "ready",
        "resources"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
