{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/isovalent/json-schema/isovalent-lrpspec-schema.json",
  "title": "LRPSpec",
  "description": "Configuration of an LRP",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/isovalent-service-api-openapi.yml#/components/schemas/LRPSpec",
  "type": "object",
  "properties": {
    "uid": {
      "description": "Unique identification",
      "type": "string"
    },
    "name": {
      "description": "LRP service name",
      "type": "string"
    },
    "namespace": {
      "description": "LRP service namespace",
      "type": "string"
    },
    "frontend-type": {
      "description": "LRP frontend type",
      "type": "string"
    },
    "lrp-type": {
      "description": "LRP config type",
      "type": "string"
    },
    "service-id": {
      "description": "matching k8s service namespace and name",
      "type": "string"
    },
    "frontend-mappings": {
      "description": "mapping of frontends to pod backends",
      "type": "array",
      "items": {
        "$ref": "#/$defs/FrontendMapping"
      }
    }
  },
  "$defs": {
    "BackendAddress": {
      "description": "Service backend address",
      "type": "object",
      "required": [
        "ip"
      ],
      "properties": {
        "ip": {
          "description": "Layer 3 address",
          "type": "string"
        },
        "protocol": {
          "description": "Layer 4 protocol (TCP, UDP, etc)",
          "type": "string"
        },
        "port": {
          "description": "Layer 4 port number",
          "type": "integer",
          "format": "uint16"
        },
        "nodeName": {
          "description": "Optional name of the node on which this backend runs",
          "type": "string"
        },
        "state": {
          "description": "State of the backend for load-balancing service traffic",
          "type": "string",
          "enum": [
            "active",
            "terminating",
            "terminating-not-serving",
            "quarantined",
            "maintenance"
          ]
        },
        "preferred": {
          "description": "Indicator if this backend is preferred in the context of clustermesh service affinity. The value is set based\non related annotation of global service. Applicable for active state only.",
          "type": "boolean"
        },
        "weight": {
          "description": "Backend weight",
          "type": [
            "integer",
            "null"
          ],
          "format": "uint16"
        },
        "zone": {
          "description": "Optional name of the zone in which this backend runs",
          "type": "string"
        }
      }
    },
    "FrontendAddress": {
      "description": "Layer 4 address. The protocol is currently ignored, all services will\nbehave as if protocol any is specified. To restrict to a particular\nprotocol, use policy.\n",
      "type": "object",
      "properties": {
        "ip": {
          "description": "Layer 3 address",
          "type": "string"
        },
        "protocol": {
          "description": "Layer 4 protocol",
          "type": "string",
          "enum": [
            "tcp",
            "udp",
            "any"
          ]
        },
        "scope": {
          "description": "Load balancing scope for frontend address",
          "type": "string",
          "enum": [
            "external",
            "internal"
          ]
        },
        "port": {
          "description": "Layer 4 port number",
          "type": "integer",
          "format": "uint16"
        }
      }
    },
    "FrontendMapping": {
      "description": "Mapping of frontend to backend pods of an LRP",
      "type": "object",
      "properties": {
        "frontend-address": {
          "$ref": "#/$defs/FrontendAddress"
        },
        "backends": {
          "description": "Pod backends of an LRP",
          "type": "array",
          "items": {
            "$ref": "#/$defs/LRPBackend"
          }
        }
      }
    },
    "LRPBackend": {
      "description": "Pod backend of an LRP",
      "type": "object",
      "properties": {
        "pod-id": {
          "description": "Namespace and name of the backend pod",
          "type": "string"
        },
        "backend-address": {
          "$ref": "#/$defs/BackendAddress"
        }
      }
    }
  }
}