Skip to content
DocsOpenAPI spec

    Firewall Rules

    Create Firewall Rule
    client.Networking.FirewallRules.New(ctx, vpcID, body) (*Operation, error)
    POST/v1/networking/vpcs/{vpc_id}/firewall_rules
    Firewall Rule Details
    client.Networking.FirewallRules.Get(ctx, vpcID, firewallRuleID) (*FirewallRule, error)
    GET/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}
    Update Firewall Rule
    client.Networking.FirewallRules.Update(ctx, vpcID, firewallRuleID, body) (*Operation, error)
    PATCH/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}
    Delete Firewall Rule
    client.Networking.FirewallRules.Delete(ctx, vpcID, firewallRuleID) (*Operation, error)
    DELETE/v1/networking/vpcs/{vpc_id}/firewall_rules/{firewall_rule_id}
    List Firewall Rules
    client.Networking.FirewallRules.List(ctx, vpcID, query) (*Cursor[FirewallRule], error)
    GET/v1/networking/vpcs/{vpc_id}/firewall_rules
    ModelsExpand Collapse
    type FirewallRule struct{…}

    Firewall rule details.

    ID string

    Unique identifier for the Firewall Rule.

    Action FirewallRuleAction

    What the Firewall Rule does with the traffic it matches. Rules you create allow traffic.

    One of the following:
    const FirewallRuleActionAllow FirewallRuleAction = "allow"
    const FirewallRuleActionDeny FirewallRuleAction = "deny"
    CreatedAt Time

    When the Firewall Rule was created.

    formatdate-time
    DestinationAddress string

    Destination address of the Firewall Rule. For an ingress rule, either VPC CIDR or VM in VPC.

    DestinationPorts []string

    Destination ports of the Firewall Rule.

    Direction FirewallRuleDirection

    Direction of the traffic the Firewall Rule matches. Rules you create are ingress rules.

    One of the following:
    const FirewallRuleDirectionIngress FirewallRuleDirection = "ingress"
    const FirewallRuleDirectionEgress FirewallRuleDirection = "egress"
    ManagedBy FirewallRuleManagedBy

    What manages the resource, or null when nothing does. A managed resource can be read but not changed.

    ID string

    ID of the thing managing the resource. For a vpc_egress_policy, the ID of the VPC.

    Type string

    Kind of thing managing the resource. A vpc_egress_policy manages the Firewall Rules that block outbound traffic to ports commonly used for abuse.

    One of the following:
    const FirewallRuleManagedByTypeSandboxCluster FirewallRuleManagedByType = "sandbox_cluster"
    const FirewallRuleManagedByTypeVPCEgressPolicy FirewallRuleManagedByType = "vpc_egress_policy"
    Name string

    Name of the Firewall Rule.

    Protocol FirewallRuleProtocol

    Protocol of the Firewall Rule.

    One of the following:
    const FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"
    const FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"
    SourceAddress string

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0. For an egress rule, the VPC CIDR.

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    const ResourceStatusSuspended ResourceStatus = "suspended"
    Tags []string

    Tags to attach to the Firewall Rule.

    UpdatedAt Time

    When the Firewall Rule was updated.

    formatdate-time
    VPCID string

    ID of the VPC the Firewall Rule belongs to.

    type FirewallRuleList struct{…}
    Items []FirewallRule
    ID string

    Unique identifier for the Firewall Rule.

    Action FirewallRuleAction

    What the Firewall Rule does with the traffic it matches. Rules you create allow traffic.

    One of the following:
    const FirewallRuleActionAllow FirewallRuleAction = "allow"
    const FirewallRuleActionDeny FirewallRuleAction = "deny"
    CreatedAt Time

    When the Firewall Rule was created.

    formatdate-time
    DestinationAddress string

    Destination address of the Firewall Rule. For an ingress rule, either VPC CIDR or VM in VPC.

    DestinationPorts []string

    Destination ports of the Firewall Rule.

    Direction FirewallRuleDirection

    Direction of the traffic the Firewall Rule matches. Rules you create are ingress rules.

    One of the following:
    const FirewallRuleDirectionIngress FirewallRuleDirection = "ingress"
    const FirewallRuleDirectionEgress FirewallRuleDirection = "egress"
    ManagedBy FirewallRuleManagedBy

    What manages the resource, or null when nothing does. A managed resource can be read but not changed.

    ID string

    ID of the thing managing the resource. For a vpc_egress_policy, the ID of the VPC.

    Type string

    Kind of thing managing the resource. A vpc_egress_policy manages the Firewall Rules that block outbound traffic to ports commonly used for abuse.

    One of the following:
    const FirewallRuleManagedByTypeSandboxCluster FirewallRuleManagedByType = "sandbox_cluster"
    const FirewallRuleManagedByTypeVPCEgressPolicy FirewallRuleManagedByType = "vpc_egress_policy"
    Name string

    Name of the Firewall Rule.

    Protocol FirewallRuleProtocol

    Protocol of the Firewall Rule.

    One of the following:
    const FirewallRuleProtocolTcp FirewallRuleProtocol = "tcp"
    const FirewallRuleProtocolUdp FirewallRuleProtocol = "udp"
    SourceAddress string

    Source address of the Firewall Rule. Address of 0.0.0.0 requires a CIDR mask of 0. For an egress rule, the VPC CIDR.

    Status of the resource.

    One of the following:
    const ResourceStatusPending ResourceStatus = "pending"
    const ResourceStatusCreating ResourceStatus = "creating"
    const ResourceStatusUpdating ResourceStatus = "updating"
    const ResourceStatusReady ResourceStatus = "ready"
    const ResourceStatusDeleting ResourceStatus = "deleting"
    const ResourceStatusDeleted ResourceStatus = "deleted"
    const ResourceStatusError ResourceStatus = "error"
    const ResourceStatusSuspended ResourceStatus = "suspended"
    Tags []string

    Tags to attach to the Firewall Rule.

    UpdatedAt Time

    When the Firewall Rule was updated.

    formatdate-time
    VPCID string

    ID of the VPC the Firewall Rule belongs to.