{
  "description": "HTTPScaledObject is the Schema for the httpscaledobjects 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": "HTTPScaledObjectSpec defines the desired state of HTTPScaledObject",
      "properties": {
        "coldStartTimeoutFailoverRef": {
          "description": "(optional) The name of the failover service to route HTTP requests to when the target is not available",
          "properties": {
            "port": {
              "description": "The port to route to",
              "format": "int32",
              "type": "integer"
            },
            "portName": {
              "description": "The port to route to referenced by name",
              "type": "string"
            },
            "service": {
              "description": "The name of the service to route to",
              "type": "string"
            },
            "timeoutSeconds": {
              "default": 30,
              "description": "The timeout in seconds to wait before routing to the failover service (Default 30)",
              "format": "int32",
              "type": "integer"
            }
          },
          "required": [
            "service"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "must define either the 'portName' or the 'port'",
              "rule": "has(self.portName) != has(self.port)"
            }
          ],
          "additionalProperties": false
        },
        "headers": {
          "description": "The custom headers used to route. Once Hosts and PathPrefixes have been matched,\nit will look for requests which have headers that match all the headers defined\nin .spec.headers, it will be routed to the Service and Port specified in\nthe scaleTargetRef. Interceptor will take precedence for most specific header match.\nIf the headers can't be matched, then use first one without .spec.headers supplied\nIf that doesn't exist then routing will fail.",
          "items": {
            "description": "Header contains the definition for matching on header name and/or value",
            "properties": {
              "name": {
                "minLength": 1,
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "name"
          ],
          "x-kubernetes-list-type": "map"
        },
        "hosts": {
          "description": "The hosts to route. All requests which the \"Host\" header\nmatches any .spec.hosts (and the Request Target matches any\n.spec.pathPrefixes) will be routed to the Service and Port specified in\nthe scaleTargetRef.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "initialCooldownPeriod": {
          "description": "(optional) Initial period before scaling",
          "format": "int32",
          "type": "integer"
        },
        "pathPrefixes": {
          "description": "The paths to route. All requests which the Request Target matches any\n.spec.pathPrefixes (and the \"Host\" header matches any .spec.hosts)\nwill be routed to the Service and Port specified in\nthe scaleTargetRef.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "replicas": {
          "description": "(optional) Replica information",
          "properties": {
            "max": {
              "description": "Maximum amount of replicas to have in the deployment (Default 100)",
              "format": "int32",
              "type": "integer"
            },
            "min": {
              "description": "Minimum amount of replicas to have in the deployment (Default 0)",
              "format": "int32",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "scaleTargetRef": {
          "description": "The name of the deployment to route HTTP requests to (and to autoscale).\nIncluding validation as a requirement to define either the PortName or the Port",
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "port": {
              "description": "The port to route to",
              "format": "int32",
              "type": "integer"
            },
            "portName": {
              "description": "The port to route to referenced by name",
              "type": "string"
            },
            "service": {
              "description": "The name of the service to route to",
              "type": "string"
            }
          },
          "required": [
            "service"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "must define either the 'portName' or the 'port'",
              "rule": "has(self.portName) != has(self.port)"
            }
          ],
          "additionalProperties": false
        },
        "scaledownPeriod": {
          "description": "(optional) Cooldown period value",
          "format": "int32",
          "type": "integer"
        },
        "scalingMetric": {
          "description": "(optional) Configuration for the metric used for scaling",
          "properties": {
            "concurrency": {
              "description": "Scaling based on concurrent requests for a given target",
              "properties": {
                "targetValue": {
                  "default": 100,
                  "description": "Target value for rate scaling",
                  "type": "integer"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "requestRate": {
              "description": "Scaling based the average rate during an specific time window for a given target",
              "properties": {
                "granularity": {
                  "default": "1s",
                  "description": "Time granularity for rate calculation",
                  "type": "string"
                },
                "targetValue": {
                  "default": 100,
                  "description": "Target value for rate scaling",
                  "type": "integer"
                },
                "window": {
                  "default": "1m",
                  "description": "Time window for rate calculation",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "targetPendingRequests": {
          "description": "(optional) DEPRECATED (use ScalingMetric instead) Target metric value",
          "format": "int32",
          "type": "integer"
        },
        "timeouts": {
          "description": "(optional) Timeouts that override the global ones",
          "properties": {
            "conditionWait": {
              "description": "How long to wait for the backing workload to have 1 or more replicas before connecting and sending the HTTP request (Default is set by the KEDA_CONDITION_WAIT_TIMEOUT environment variable)",
              "type": "string"
            },
            "responseHeader": {
              "description": "How long to wait between when the HTTP request is sent to the backing app and when response headers need to arrive (Default is set by the KEDA_RESPONSE_HEADER_TIMEOUT environment variable)",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "required": [
        "scaleTargetRef"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "HTTPScaledObjectStatus defines the observed state of HTTPScaledObject",
      "properties": {
        "conditions": {
          "description": "Conditions of the HTTPScaledObject.",
          "items": {
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "targetService": {
          "description": "TargetService reflects details about the scaled service.",
          "type": "string"
        },
        "targetWorkload": {
          "description": "TargetWorkload reflects details about the scaled workload.",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
