{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/harness/main/json-schema/harness-save-service-request-v2-without-disabled-schema.json",
  "title": "SaveServiceRequestV2WithoutDisabled",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/harness-autostopping-rules-v2-api-openapi.yml#/components/schemas/SaveServiceRequestV2WithoutDisabled",
  "type": "object",
  "properties": {
    "deps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ServiceDep"
      }
    },
    "service": {
      "$ref": "#/$defs/ServiceV2WithoutDisabled"
    },
    "apply_now": {
      "type": "boolean"
    }
  },
  "$defs": {
    "ASGMinimal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "desired": {
          "type": "integer"
        },
        "min": {
          "type": "integer"
        },
        "max": {
          "type": "integer"
        },
        "on_demand": {
          "type": "integer"
        },
        "spot": {
          "type": "integer"
        },
        "mixed_instance": {
          "type": "boolean"
        },
        "cloud_account_id": {
          "type": "string"
        },
        "provider_name": {
          "type": "string"
        },
        "target_groups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TargetGroupMinimal"
          }
        },
        "region": {
          "type": "string"
        },
        "availability_zones": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "status": {
          "type": "string"
        },
        "meta": {
          "type": "object",
          "properties": {}
        }
      }
    },
    "ContainerSvc": {
      "type": "object",
      "properties": {
        "cluster": {
          "type": "string"
        },
        "service": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "task_count": {
          "type": "number"
        }
      }
    },
    "HTTPProxy": {
      "required": [
        "proxy",
        "ports"
      ],
      "type": "object",
      "properties": {
        "proxy": {
          "$ref": "#/$defs/Proxy"
        },
        "ports": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PortConfig"
          }
        }
      }
    },
    "InstanceBasedRoutingData": {
      "type": "object",
      "properties": {
        "filter_text": {
          "type": "string"
        },
        "scale_group": {
          "$ref": "#/$defs/ASGMinimal"
        }
      }
    },
    "Opts": {
      "type": "object",
      "properties": {
        "preserve_private_ip": {
          "type": "boolean"
        },
        "delete_cloud_resources": {
          "type": "boolean"
        },
        "always_use_private_ip": {
          "type": "boolean"
        },
        "access_details": {
          "type": "object",
          "properties": {}
        },
        "hide_progress_page": {
          "type": "boolean"
        },
        "idle_time_for_state_sync": {
          "type": "boolean",
          "description": "If true, idle time is used for state sync instead of the default 5 minutes"
        }
      }
    },
    "PortConfig": {
      "type": "object",
      "properties": {
        "protocol": {
          "type": "string"
        },
        "target_protocol": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        },
        "target_port": {
          "type": "integer"
        },
        "server_name": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "redirect_url": {
          "type": "string"
        },
        "routing_rules": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RoutingRule"
          }
        }
      }
    },
    "Proxy": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "RDSDatabase": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "region": {
          "type": "string"
        }
      }
    },
    "RoutingData": {
      "type": "object",
      "properties": {
        "instance": {
          "$ref": "#/$defs/InstanceBasedRoutingData"
        },
        "ports": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PortConfig"
          }
        },
        "lb": {
          "type": "string"
        },
        "k8s": {
          "type": "object",
          "properties": {
            "RuleJson": {
              "type": "string"
            },
            "ConnectorID": {
              "type": "string"
            },
            "Namespace": {
              "type": "string"
            }
          }
        },
        "custom_domain_providers": {
          "type": "object",
          "properties": {}
        },
        "container_svc": {
          "$ref": "#/$defs/ContainerSvc"
        },
        "database": {
          "$ref": "#/$defs/RDSDatabase"
        }
      }
    },
    "RoutingRule": {
      "type": "object",
      "properties": {
        "path_match": {
          "type": "string"
        }
      }
    },
    "ServiceDep": {
      "type": "object"
    },
    "ServiceError": {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "action": {
          "type": "string"
        }
      }
    },
    "ServiceMetadata": {
      "type": "object",
      "properties": {
        "cloud_provider_details": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          }
        },
        "target_group_details": {
          "type": "object",
          "properties": {}
        },
        "service_errors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ServiceError"
          }
        },
        "kubernetes_connector_id": {
          "type": "string"
        },
        "autostopping_proxy_config": {
          "type": "object",
          "properties": {
            "http": {
              "$ref": "#/$defs/HTTPProxy"
            },
            "tcp": {
              "$ref": "#/$defs/HTTPProxy"
            }
          }
        }
      }
    },
    "ServiceV2WithoutDisabled": {
      "required": [
        "cloud_account_id",
        "kind",
        "name",
        "org_id"
      ],
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "name": {
          "type": "string"
        },
        "org_id": {
          "type": "string"
        },
        "account_identifier": {
          "type": "string"
        },
        "project_id": {
          "type": "string"
        },
        "fulfilment": {
          "type": "string"
        },
        "kind": {
          "type": "string"
        },
        "cloud_account_id": {
          "type": "string"
        },
        "idle_time_mins": {
          "type": "integer",
          "format": "int64"
        },
        "host_name": {
          "type": "string"
        },
        "health_check": {
          "type": "object",
          "properties": {}
        },
        "custom_domains": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "match_all_subdomains": {
          "type": "boolean"
        },
        "routing": {
          "$ref": "#/$defs/RoutingData"
        },
        "opts": {
          "$ref": "#/$defs/Opts"
        },
        "created_at": {
          "type": "string"
        },
        "access_point_id": {
          "type": "string"
        },
        "metadata": {
          "$ref": "#/$defs/ServiceMetadata"
        },
        "status": {
          "type": "string"
        }
      }
    },
    "TargetGroupMinimal": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        },
        "protocol": {
          "type": "string"
        },
        "vpc": {
          "type": "string"
        }
      }
    }
  }
}