{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/leaseweb/main/json-schema/leaseweb-instance-details-schema.json",
  "title": "instanceDetails",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/leaseweb-publiccloud-openapi.yml#/components/schemas/instanceDetails",
  "properties": {
    "id": {
      "description": "The unique identifier of the instance",
      "format": "uuid",
      "type": "string"
    },
    "type": {
      "$ref": "#/$defs/typeName"
    },
    "resources": {
      "$ref": "#/$defs/resources"
    },
    "region": {
      "$ref": "#/$defs/regionName"
    },
    "reference": {
      "description": "The identifying name set to the instance",
      "type": [
        "string",
        "null"
      ]
    },
    "startedAt": {
      "description": "Date and time when the instance was started for the first time, right after launching it",
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "marketAppId": {
      "description": "Market App ID that must be installed into the instance",
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "$ref": "#/$defs/state"
    },
    "productType": {
      "description": "The product type",
      "type": "string"
    },
    "hasPublicIpV4": {
      "type": "boolean"
    },
    "hasPrivateNetwork": {
      "type": "boolean"
    },
    "hasUserData": {
      "type": "boolean"
    },
    "rootDiskSize": {
      "description": "The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances",
      "maximum": 1000,
      "minimum": 5,
      "type": "integer"
    },
    "rootDiskStorageType": {
      "$ref": "#/$defs/storageType"
    },
    "contract": {
      "$ref": "#/$defs/instanceContractDetails"
    },
    "autoScalingGroup": {
      "$ref": "#/$defs/autoScalingGroup"
    },
    "image": {
      "$ref": "#/$defs/image"
    },
    "iso": {
      "$ref": "#/$defs/iso"
    },
    "privateNetwork": {
      "$ref": "#/$defs/privateNetwork"
    },
    "ips": {
      "items": {
        "$ref": "#/$defs/ipDetails"
      },
      "type": "array"
    },
    "targetGroups": {
      "items": {
        "$ref": "#/$defs/targetGroup"
      },
      "type": "array"
    }
  },
  "required": [
    "contract",
    "hasPrivateNetwork",
    "hasPublicIpV4",
    "hasUserData",
    "id",
    "image",
    "ips",
    "iso",
    "marketAppId",
    "privateNetwork",
    "productType",
    "reference",
    "region",
    "resources",
    "rootDiskSize",
    "rootDiskStorageType",
    "startedAt",
    "state",
    "targetGroups",
    "type"
  ],
  "type": "object",
  "$defs": {
    "autoScalingGroup": {
      "properties": {
        "id": {
          "description": "The Auto Scaling Group unique identifier",
          "format": "uuid",
          "type": "string"
        },
        "type": {
          "$ref": "#/$defs/autoScalingGroupType"
        },
        "state": {
          "$ref": "#/$defs/autoScalingGroupState"
        },
        "desiredAmount": {
          "description": "Number of instances that should be running",
          "type": [
            "integer",
            "null"
          ]
        },
        "region": {
          "$ref": "#/$defs/regionName"
        },
        "reference": {
          "description": "The identifying name set to the auto scaling group",
          "maxLength": 255,
          "type": "string"
        },
        "createdAt": {
          "description": "Date and time when the Auto Scaling Group was created",
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "description": "Date and time when the Auto Scaling Group was last updated",
          "format": "date-time",
          "type": "string"
        },
        "startsAt": {
          "description": "Only for \"SCHEDULED\" auto scaling group. Date and time (UTC) that the instances need to be launched",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "endsAt": {
          "description": "Only for \"SCHEDULED\" auto scaling group. Date and time (UTC) that the instances need to be terminated",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "minimumAmount": {
          "description": "The minimum number of instances that should be running",
          "type": [
            "integer",
            "null"
          ]
        },
        "maximumAmount": {
          "description": "Only for \"CPU_BASED\" auto scaling group. The maximum number of instances that can be running",
          "type": [
            "integer",
            "null"
          ]
        },
        "cpuThreshold": {
          "description": "Only for \"CPU_BASED\" auto scaling group. The target average CPU utilization for scaling",
          "type": [
            "integer",
            "null"
          ]
        },
        "warmupTime": {
          "description": "Only for \"CPU_BASED\" auto scaling group. Warm-up time in seconds for new instances",
          "type": [
            "integer",
            "null"
          ]
        },
        "cooldownTime": {
          "description": "Only for \"CPU_BASED\" auto scaling group. Cool-down time in seconds for new instances",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "cooldownTime",
        "cpuThreshold",
        "createdAt",
        "desiredAmount",
        "endsAt",
        "id",
        "maximumAmount",
        "minimumAmount",
        "reference",
        "region",
        "startsAt",
        "state",
        "type",
        "updatedAt",
        "warmupTime"
      ],
      "title": "autoScalingGroup",
      "type": [
        "object",
        "null"
      ]
    },
    "autoScalingGroupState": {
      "description": "The Auto Scaling Group's current state.",
      "enum": [
        "ACTIVE",
        "CREATING",
        "CREATED",
        "DESTROYED",
        "DESTROYING",
        "SCALING",
        "UPDATING"
      ],
      "type": "string"
    },
    "autoScalingGroupType": {
      "description": "Auto Scaling Group type",
      "enum": [
        "MANUAL",
        "SCHEDULED",
        "CPU_BASED"
      ],
      "title": "autoScalingGroupType",
      "type": "string"
    },
    "billingFrequency": {
      "description": "The billing frequency (in months) of the instance. Used only when contract type is MONTHLY",
      "enum": [
        1,
        3,
        6,
        12
      ],
      "type": "integer"
    },
    "contractState": {
      "enum": [
        "ACTIVE",
        "DELETE_SCHEDULED",
        "PENDING",
        "INACTIVE",
        "CANCELLED"
      ],
      "type": "string"
    },
    "contractTerm": {
      "description": "Contract commitment. Used only when contract type is MONTHLY",
      "enum": [
        0,
        1,
        3,
        6,
        12,
        24,
        36
      ],
      "type": "integer"
    },
    "contractType": {
      "description": "Select HOURLY for billing based on hourly usage, else MONTHLY for billing per month usage",
      "enum": [
        "HOURLY",
        "MONTHLY"
      ],
      "type": "string"
    },
    "cpu": {
      "description": "Number of cores",
      "properties": {
        "value": {
          "type": "integer"
        },
        "unit": {
          "type": "string"
        }
      },
      "required": [
        "unit",
        "value"
      ],
      "title": "cpu",
      "type": "object"
    },
    "ddos": {
      "properties": {
        "detectionProfile": {
          "type": "string"
        },
        "protectionType": {
          "type": "string"
        }
      },
      "required": [
        "detectionProfile",
        "protectionType"
      ],
      "title": "ddos",
      "type": [
        "object",
        "null"
      ]
    },
    "flavour": {
      "description": "Standard images flavours",
      "enum": [
        "ubuntu",
        "debian",
        "freebsd",
        "centos",
        "almalinux",
        "rockylinux",
        "archlinux",
        "windows"
      ],
      "title": "flavour",
      "type": "string"
    },
    "healthCheck": {
      "properties": {
        "protocol": {
          "$ref": "#/$defs/protocol"
        },
        "method": {
          "$ref": "#/$defs/httpMethod"
        },
        "uri": {
          "description": "URI to check in the target instances",
          "type": "string"
        },
        "host": {
          "description": "Host for the health check if any",
          "type": [
            "string",
            "null"
          ]
        },
        "port": {
          "description": "Port number",
          "type": "integer"
        }
      },
      "required": [
        "host",
        "method",
        "port",
        "protocol",
        "uri"
      ],
      "title": "healthCheck",
      "type": [
        "object",
        "null"
      ]
    },
    "httpMethod": {
      "description": "HTTP method to be used for health check - Required if `protocol` is HTTP or HTTPS. Not allowed if `protocol` is TCP",
      "enum": [
        "GET",
        "HEAD",
        "POST",
        "OPTIONS"
      ],
      "type": [
        "string",
        "null"
      ]
    },
    "image": {
      "properties": {
        "id": {
          "description": "imageId can be either an Operating System or a UUID in case of a Custom Image",
          "title": "imageId",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "family": {
          "type": "string"
        },
        "flavour": {
          "$ref": "#/$defs/flavour"
        },
        "custom": {
          "description": "Standard or Custom image",
          "type": "boolean"
        }
      },
      "required": [
        "custom",
        "family",
        "flavour",
        "id",
        "name"
      ],
      "title": "image",
      "type": "object"
    },
    "instanceContract": {
      "properties": {
        "billingFrequency": {
          "$ref": "#/$defs/billingFrequency"
        },
        "term": {
          "$ref": "#/$defs/contractTerm"
        },
        "type": {
          "$ref": "#/$defs/contractType"
        }
      },
      "required": [
        "billingFrequency",
        "term",
        "type"
      ],
      "type": "object"
    },
    "instanceContractDetails": {
      "allOf": [
        {
          "$ref": "#/$defs/instanceContract"
        },
        {
          "properties": {
            "endsAt": {
              "description": "End date is null for hourly instances",
              "format": "date-time",
              "type": [
                "string",
                "null"
              ]
            },
            "startsAt": {
              "description": "Date when the contract is starting",
              "format": "date-time",
              "type": "string"
            },
            "state": {
              "$ref": "#/$defs/contractState"
            },
            "id": {
              "description": "Contract id is empty for hourly instances",
              "type": "string"
            },
            "sla": {
              "type": "string"
            },
            "controlPanel": {
              "type": [
                "string",
                "null"
              ]
            },
            "inModification": {
              "type": "boolean"
            }
          },
          "required": [
            "controlPanel",
            "endsAt",
            "id",
            "inModification",
            "sla",
            "startsAt",
            "state"
          ],
          "type": "object"
        }
      ]
    },
    "ip": {
      "properties": {
        "ip": {
          "description": "Ip Address",
          "type": "string"
        },
        "prefixLength": {
          "description": "The number of leading bits in the IP address",
          "type": "string"
        },
        "version": {
          "$ref": "#/$defs/ipVersion"
        },
        "nullRouted": {
          "description": "Whether or not the IP has been nulled",
          "type": "boolean"
        },
        "mainIp": {
          "type": "boolean"
        },
        "networkType": {
          "$ref": "#/$defs/networkType"
        },
        "reverseLookup": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "ip",
        "mainIp",
        "networkType",
        "nullRouted",
        "prefixLength",
        "reverseLookup",
        "version"
      ],
      "title": "ip",
      "type": "object"
    },
    "ipDetails": {
      "allOf": [
        {
          "$ref": "#/$defs/ip"
        },
        {
          "properties": {
            "ddos": {
              "$ref": "#/$defs/ddos"
            }
          },
          "required": [
            "ddos"
          ],
          "title": "ipDetails",
          "type": "object"
        }
      ]
    },
    "ipVersion": {
      "description": "Ip version",
      "enum": [
        4,
        6
      ],
      "type": "integer"
    },
    "iso": {
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "title": "iso",
      "type": [
        "object",
        "null"
      ]
    },
    "memory": {
      "description": "Total memory in GiB",
      "properties": {
        "value": {
          "type": "number"
        },
        "unit": {
          "type": "string"
        }
      },
      "required": [
        "unit",
        "value"
      ],
      "title": "memory",
      "type": "object"
    },
    "networkSpeed": {
      "description": "Network speed in Gbps",
      "properties": {
        "value": {
          "type": "integer"
        },
        "unit": {
          "type": "string"
        }
      },
      "required": [
        "unit",
        "value"
      ],
      "title": "networkSpeed",
      "type": "object"
    },
    "networkType": {
      "enum": [
        "INTERNAL",
        "PUBLIC"
      ],
      "type": "string"
    },
    "privateNetwork": {
      "properties": {
        "privateNetworkId": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "subnet": {
          "type": "string"
        }
      },
      "required": [
        "privateNetworkId",
        "status",
        "subnet"
      ],
      "title": "privateNetwork",
      "type": [
        "object",
        "null"
      ]
    },
    "protocol": {
      "enum": [
        "HTTP",
        "HTTPS",
        "TCP"
      ],
      "type": "string"
    },
    "regionName": {
      "description": "region name",
      "enum": [
        "eu-west-3",
        "us-east-1",
        "eu-central-1",
        "ap-southeast-1",
        "us-west-1",
        "eu-west-2",
        "ca-central-1",
        "ap-northeast-1"
      ],
      "title": "regionName",
      "type": "string"
    },
    "resources": {
      "description": "Available resources",
      "properties": {
        "cpu": {
          "$ref": "#/$defs/cpu"
        },
        "memory": {
          "$ref": "#/$defs/memory"
        },
        "publicNetworkSpeed": {
          "$ref": "#/$defs/networkSpeed"
        },
        "privateNetworkSpeed": {
          "$ref": "#/$defs/networkSpeed"
        }
      },
      "required": [
        "cpu",
        "memory",
        "privateNetworkSpeed",
        "publicNetworkSpeed"
      ],
      "type": "object"
    },
    "state": {
      "description": "The current state",
      "enum": [
        "CREATING",
        "DESTROYED",
        "DESTROYING",
        "FAILED",
        "RUNNING",
        "STARTING",
        "STOPPED",
        "STOPPING",
        "UNKNOWN"
      ],
      "type": "string"
    },
    "storageType": {
      "description": "Storage type",
      "enum": [
        "LOCAL",
        "CENTRAL"
      ],
      "type": "string"
    },
    "targetGroup": {
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "The name of the target group",
          "type": "string"
        },
        "protocol": {
          "$ref": "#/$defs/protocol"
        },
        "port": {
          "description": "The port of the target group",
          "type": "integer"
        },
        "region": {
          "$ref": "#/$defs/regionName"
        },
        "healthCheck": {
          "$ref": "#/$defs/healthCheck"
        }
      },
      "required": [
        "healthCheck",
        "id",
        "name",
        "port",
        "protocol",
        "region"
      ],
      "title": "targetGroup",
      "type": "object"
    },
    "typeName": {
      "description": "Instance/Load balancer type",
      "enum": [
        "lsw.m3.large",
        "lsw.m3.xlarge",
        "lsw.m3.2xlarge",
        "lsw.m4.large",
        "lsw.m4.xlarge",
        "lsw.m4.2xlarge",
        "lsw.m4.4xlarge",
        "lsw.m5.large",
        "lsw.m5.xlarge",
        "lsw.m5.2xlarge",
        "lsw.m5.4xlarge",
        "lsw.m5a.large",
        "lsw.m5a.xlarge",
        "lsw.m5a.2xlarge",
        "lsw.m5a.4xlarge",
        "lsw.m5a.8xlarge",
        "lsw.m5a.12xlarge",
        "lsw.m6a.large",
        "lsw.m6a.xlarge",
        "lsw.m6a.2xlarge",
        "lsw.m6a.4xlarge",
        "lsw.m6a.8xlarge",
        "lsw.m6a.12xlarge",
        "lsw.m6a.16xlarge",
        "lsw.m6a.24xlarge",
        "lsw.c3.large",
        "lsw.c3.xlarge",
        "lsw.c3.2xlarge",
        "lsw.c3.4xlarge",
        "lsw.c4.large",
        "lsw.c4.xlarge",
        "lsw.c4.2xlarge",
        "lsw.c4.4xlarge",
        "lsw.c5.large",
        "lsw.c5.xlarge",
        "lsw.c5.2xlarge",
        "lsw.c5.4xlarge",
        "lsw.c5a.large",
        "lsw.c5a.xlarge",
        "lsw.c5a.2xlarge",
        "lsw.c5a.4xlarge",
        "lsw.c5a.9xlarge",
        "lsw.c5a.12xlarge",
        "lsw.c6a.large",
        "lsw.c6a.xlarge",
        "lsw.c6a.2xlarge",
        "lsw.c6a.4xlarge",
        "lsw.c6a.8xlarge",
        "lsw.c6a.12xlarge",
        "lsw.c6a.16xlarge",
        "lsw.c6a.24xlarge",
        "lsw.r3.large",
        "lsw.r3.xlarge",
        "lsw.r3.2xlarge",
        "lsw.r4.large",
        "lsw.r4.xlarge",
        "lsw.r4.2xlarge",
        "lsw.r5.large",
        "lsw.r5.xlarge",
        "lsw.r5.2xlarge",
        "lsw.r5a.large",
        "lsw.r5a.xlarge",
        "lsw.r5a.2xlarge",
        "lsw.r5a.4xlarge",
        "lsw.r5a.8xlarge",
        "lsw.r5a.12xlarge",
        "lsw.r6a.large",
        "lsw.r6a.xlarge",
        "lsw.r6a.2xlarge",
        "lsw.r6a.4xlarge",
        "lsw.r6a.8xlarge",
        "lsw.r6a.12xlarge",
        "lsw.r6a.16xlarge",
        "lsw.r6a.24xlarge",
        "lsw.g6.xlarge",
        "lsw.g6.2xlarge",
        "lsw.g6.4xlarge",
        "lsw.g6.8xlarge",
        "lsw.g6.12xlarge",
        "lsw.g6.16xlarge",
        "lsw.g6.18xlarge",
        "lsw.g6.24xlarge",
        "lsw.gr6.4xlarge",
        "lsw.gr6.8xlarge"
      ],
      "title": "typeName",
      "type": "string"
    }
  }
}