{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/contabo/json-schema/contabo-create-firewall-response-schema.json",
  "title": "CreateFirewallResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/contabo-firewalls-api-openapi.yml#/components/schemas/CreateFirewallResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/FirewallResponse"
      }
    },
    "_links": {
      "allOf": [
        {
          "$ref": "#/$defs/SelfLinks"
        }
      ]
    }
  },
  "required": [
    "data",
    "_links"
  ],
  "$defs": {
    "FirewallResponse": {
      "type": "object",
      "properties": {
        "tenantId": {
          "type": "string",
          "minLength": 1,
          "description": "Your customer tenant id"
        },
        "customerId": {
          "type": "string",
          "minLength": 1,
          "description": "Your customer number"
        },
        "firewallId": {
          "type": "string",
          "minLength": 1,
          "description": "Your firewall id."
        },
        "name": {
          "type": "string",
          "maxLength": 255,
          "description": "The name of the firewall."
        },
        "description": {
          "type": "string",
          "maxLength": 255,
          "description": "The description of the firewall."
        },
        "status": {
          "type": "string",
          "description": "Inactive status means no rules of this firewall are set for all assigned instances.",
          "enum": [
            "active",
            "inactive"
          ]
        },
        "instanceStatus": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InstanceStatusRepresentation"
          }
        },
        "instances": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/InstanceDetails"
          }
        },
        "rules": {
          "$ref": "#/$defs/Rules"
        },
        "createdDate": {
          "type": "string",
          "format": "date-time",
          "description": "The creation date time for the firewall"
        },
        "updatedDate": {
          "type": "string",
          "format": "date-time",
          "description": "The update date time for the firewall"
        }
      },
      "required": [
        "tenantId",
        "customerId",
        "firewallId",
        "name",
        "description",
        "status",
        "instanceStatus",
        "instances",
        "rules",
        "createdDate",
        "updatedDate"
      ]
    },
    "FirewallRuleResponse": {
      "type": "object",
      "properties": {
        "protocol": {
          "type": "string",
          "description": "Protocol for incoming traffic to be allowed. ‘tcp‘, ´udp´, ´icmp´ or ´´ empty value are allowed. Empty means any traffic.",
          "enum": [
            "tcp",
            "udp",
            "icmp",
            ""
          ]
        },
        "destPorts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Ports to specify allowed traffic. Not available for protocol `ICMP`. Port ranges can specified like in example."
        },
        "srcCidr": {
          "$ref": "#/$defs/SrcCidr"
        },
        "action": {
          "type": "string",
          "enum": [
            "accept",
            "drop"
          ],
          "description": "Currently only `accept` is supported."
        },
        "status": {
          "type": "string",
          "description": "Status of the inbound rule. An inactive rule is removed from all assigned instances.",
          "enum": [
            "active",
            "inactive"
          ]
        },
        "displayName": {
          "type": "string",
          "description": "Display name for the firewall rule."
        }
      },
      "required": [
        "protocol",
        "destPorts",
        "srcCidr",
        "action",
        "status",
        "displayName"
      ]
    },
    "InstanceDetails": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "integer",
          "format": "int64",
          "description": "Instance id which is assigned to firewall"
        },
        "displayName": {
          "type": "string",
          "description": "Instance display name"
        },
        "name": {
          "type": "string",
          "description": "Instance name"
        },
        "productId": {
          "type": "string",
          "description": "Product id"
        },
        "ipConfig": {
          "$ref": "#/$defs/IpConfig1"
        },
        "regionSlug": {
          "type": "string",
          "description": "Slug of the region where the instance is located."
        },
        "regionName": {
          "type": "string",
          "description": "Name of the region where the instance is located."
        },
        "dataCenterSlug": {
          "type": "string",
          "description": "Slug of the data center where the instance is located."
        },
        "dataCenterName": {
          "type": "string",
          "description": "Name of the data center where the instance is located."
        }
      },
      "required": [
        "instanceId",
        "displayName",
        "name",
        "productId",
        "ipConfig",
        "regionSlug",
        "regionName",
        "dataCenterSlug",
        "dataCenterName"
      ]
    },
    "InstanceStatusRepresentation": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "integer",
          "format": "int64",
          "description": "Instance id which is assigned to the firewall."
        },
        "status": {
          "type": "string",
          "enum": [
            "ok",
            "processing",
            "deleting",
            "error_processing",
            "error_deleting"
          ],
          "description": "Instance status in firewall can be:<br/> `ok` - instance was successfully assigned <br/> `processing` -  creating firewall rules <br/> `deleting` - deleting firewall rules <br/> `error_processing` - error occurred while creating firewall rules <br/>  `error_deleting` - error occurred while deleting firewall rules"
        },
        "errorMessage": {
          "type": "string",
          "description": "More detailed error message in case of error status."
        }
      },
      "required": [
        "instanceId",
        "status"
      ]
    },
    "IpConfig1": {
      "type": "object",
      "properties": {
        "v4": {
          "$ref": "#/$defs/IpV42"
        },
        "v6": {
          "$ref": "#/$defs/IpV6"
        }
      },
      "required": [
        "v4",
        "v6"
      ]
    },
    "IpV42": {
      "type": "object",
      "properties": {
        "ip": {
          "type": "string",
          "description": "IP Address"
        },
        "netmaskCidr": {
          "type": "integer",
          "format": "int32",
          "description": "Netmask CIDR"
        },
        "gateway": {
          "type": "string",
          "description": "Gateway"
        }
      },
      "required": [
        "ip",
        "netmaskCidr",
        "gateway"
      ]
    },
    "IpV6": {
      "type": "object",
      "properties": {
        "ip": {
          "type": "string",
          "description": "IP Address"
        },
        "netmaskCidr": {
          "type": "integer",
          "format": "int32",
          "description": "Netmask CIDR"
        },
        "gateway": {
          "type": "string",
          "description": "Gateway"
        }
      },
      "required": [
        "ip",
        "netmaskCidr",
        "gateway"
      ]
    },
    "Rules": {
      "type": "object",
      "properties": {
        "inbound": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FirewallRuleResponse"
          }
        }
      },
      "required": [
        "inbound"
      ]
    },
    "SelfLinks": {
      "type": "object",
      "properties": {
        "self": {
          "type": "string",
          "description": "Link to current resource."
        }
      },
      "required": [
        "self"
      ]
    },
    "SrcCidr": {
      "type": "object",
      "properties": {
        "ipv4": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IPv4 addresses in CIDR notation or \"AnyIPv4\" to allow all IPv4 sources (translates to 0.0.0.0/0)"
        },
        "ipv6": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "IPv6 addresses in CIDR notation or \"AnyIPv6\" to allow all IPv6 sources (translates to ::/0)"
        }
      }
    }
  }
}