action hetzner_post_firewalls { label: "Create a Firewall" description: "Creates a new Firewall.\n\n#### Call specific error codes\n\n| Code | Description |\n|------------------------------ |-------------------------------------------------------------- |\n| `server_already_added` | Server added more than one time to resource |\n| `incompatible_network_type` | The Network type is incompatible for the given resource |\n| `firewall_resource_not_found` | The resource the Firewall should be attached to was not found |\n" provider: hetzner method: POST path: "/firewalls" encoding: json input: { type: "object" required: ["name"] properties: { apply_to: { type: "array" description: "Resources the Firewall should be applied to after creation" items: { type: "object" required: ["type"] properties: { label_selector: { type: "object" description: "Configuration for type LabelSelector, required if type is `label_selector`" required: ["selector"] properties: { selector: { type: "string" description: "Label selector" } } } server: { type: "object" description: "Configuration for type Server, required if type is `server`" required: ["id"] properties: { id: { type: "integer" description: "ID of the Server" } } } type: { type: "string" description: "Type of the resource" enum: ["server", "label_selector"] } } } } labels: { type: "object" description: "User-defined labels (key-value pairs)" } name: { type: "string" description: "Name of the Firewall" } rules: { type: "array" description: "Array of rules" items: { type: "object" required: ["direction", "protocol"] properties: { description: { type: "string" description: "Description of the Rule" } destination_ips: { type: "array" description: "List of permitted IPv4/IPv6 addresses in CIDR notation. Use `0.0.0.0/0` to allow all IPv4 addresses and `::/0` to allow all IPv6 addresses. You can specify 100 CIDRs at most." items: { type: "string" } } direction: { type: "string" description: "Select traffic direction on which rule should be applied. Use `source_ips` for direction `in` and `destination_ips` for direction `out`." enum: ["in", "out"] } port: { type: "string" description: "Port or port range to which traffic will be allowed, only applicable for protocols TCP and UDP. A port range can be specified by separating two ports with a dash, e.g `1024-5000`." } protocol: { type: "string" description: "Type of traffic to allow" enum: ["tcp", "udp", "icmp", "esp", "gre"] } source_ips: { type: "array" description: "List of permitted IPv4/IPv6 addresses in CIDR notation. Use `0.0.0.0/0` to allow all IPv4 addresses and `::/0` to allow all IPv6 addresses. You can specify 100 CIDRs at most." items: { type: "string" } } } } } } } output: { type: "object" properties: { actions: { type: "array" items: { type: "object" required: ["id", "command", "status", "progress", "started", "finished", "resources", "error"] properties: { command: { type: "string" description: "Command executed in the Action" } error: { type: "object" description: "Error message for the Action if error occurred, otherwise null" required: ["code", "message"] properties: { code: { type: "string" description: "Fixed machine readable code" } message: { type: "string" description: "Humanized error message" } } } finished: { type: "string" description: "Point in time when the Action was finished (in ISO-8601 format). Only set if the Action is finished otherwise null." } id: { type: "integer" description: "ID of the Resource" } progress: { type: "number" description: "Progress of Action in percent" } resources: { type: "array" description: "Resources the Action relates to" items: { type: "object" required: ["id", "type"] properties: { id: { type: "integer" description: "ID of the Resource" } type: { type: "string" description: "Type of resource referenced" } } } } started: { type: "string" description: "Point in time when the Action was started (in ISO-8601 format)" } status: { type: "string" description: "Status of the Action" enum: ["success", "running", "error"] } } } } firewall: { type: "object" required: ["applied_to", "created", "id", "name", "rules"] properties: { applied_to: { type: "array" items: { type: "object" required: ["type"] properties: { applied_to_resources: { type: "array" items: { type: "object" properties: { server: { type: "object" required: ["id"] properties: { id: { type: "integer" description: "ID of the Resource" } } } type: { type: "string" description: "Type of resource referenced" enum: ["server"] } } } } label_selector: { type: "object" required: ["selector"] properties: { selector: { type: "string" description: "Label selector" } } } server: { type: "object" required: ["id"] properties: { id: { type: "integer" description: "ID of the Resource" } } } type: { type: "string" description: "Type of resource referenced" enum: ["server", "label_selector"] } } } } created: { type: "string" description: "Point in time when the Resource was created (in ISO-8601 format)" } id: { type: "integer" description: "ID of the Resource" } labels: { type: "object" description: "User-defined labels (key-value pairs)" } name: { type: "string" description: "Name of the Resource. Must be unique per Project." } rules: { type: "array" items: { type: "object" required: ["direction", "protocol"] properties: { description: { type: "string" description: "Description of the Rule" } destination_ips: { type: "array" description: "List of permitted IPv4/IPv6 addresses in CIDR notation. Use `0.0.0.0/0` to allow all IPv4 addresses and `::/0` to allow all IPv6 addresses. You can specify 100 CIDRs at most." items: { type: "string" } } direction: { type: "string" description: "Select traffic direction on which rule should be applied. Use `source_ips` for direction `in` and `destination_ips` for direction `out`." enum: ["in", "out"] } port: { type: "string" description: "Port or port range to which traffic will be allowed, only applicable for protocols TCP and UDP. A port range can be specified by separating two ports with a dash, e.g `1024-5000`." } protocol: { type: "string" description: "Type of traffic to allow" enum: ["tcp", "udp", "icmp", "esp", "gre"] } source_ips: { type: "array" description: "List of permitted IPv4/IPv6 addresses in CIDR notation. Use `0.0.0.0/0` to allow all IPv4 addresses and `::/0` to allow all IPv6 addresses. You can specify 100 CIDRs at most." items: { type: "string" } } } } } } } } } }