{"openapi":"3.0.0","info":{"title":"OVHcloud API specification","description":"Specification for OVHcloud API","version":"1.0","contact":{"name":"OVH","email":"api@ml.ovh.net"}},"servers":[{"url":"https://api.eu.ovhcloud.com/1.0"}],"components":{"schemas":{"any":{"description":"Can be anything (text, int, bool, json, html, etc.)","example":"This is a content of any type !"},"complexType.Range_long":{"type":"object","description":"Start and end points (inclusive) of a range","properties":{"from":{"type":"integer"},"to":{"type":"integer"}}},"duration":{"type":"string","description":"Duration (e.g., P1Y2M3DT4H6M9S)","example":"P1Y2M3DT4H6M9S"},"email":{"type":"string","description":"Email address (e.g., api@ml.ovh.net)","format":"email","example":"api@ml.ovh.net"},"internationalPhoneNumber":{"type":"string","description":"International phone number","format":"phone-number"},"ip":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ip.FirewallActionEnum":{"type":"string","description":"Possible values for action","enum":["deny","permit"]},"ip.FirewallIp":{"type":"object","description":"Your IP on firewall","properties":{"enabled":{"type":"boolean"},"ipOnFirewall":{"allOf":[{"$ref":"#/components/schemas/ipv4"}],"readOnly":true},"state":{"allOf":[{"$ref":"#/components/schemas/ip.FirewallStateEnum"}],"description":"Current state of your ip on firewall","readOnly":true}}},"ip.FirewallNetworkRule":{"type":"object","description":"Rule on ip","properties":{"action":{"allOf":[{"$ref":"#/components/schemas/ip.FirewallActionEnum"}],"description":"Action on this rule","readOnly":true},"creationDate":{"type":"string","format":"date-time","readOnly":true},"destination":{"type":"string","description":"Destination ip for your rule","readOnly":true},"destinationPort":{"type":"string","description":"Destination port range for your rule. Only with TCP/UDP protocol","nullable":true,"readOnly":true},"fragments":{"type":"boolean","description":"Fragments option","nullable":true,"readOnly":true},"l3PacketLength":{"type":"string","description":"IP packet's total length","nullable":true,"readOnly":true},"protocol":{"allOf":[{"$ref":"#/components/schemas/ip.FirewallProtocolEnum"}],"description":"Network protocol","readOnly":true},"rule":{"type":"string","readOnly":true},"sequence":{"type":"integer","readOnly":true},"source":{"type":"string","description":"Source ip for your rule","readOnly":true},"sourcePort":{"type":"string","description":"Source port range for your rule. Only with TCP/UDP protocol","nullable":true,"readOnly":true},"state":{"allOf":[{"$ref":"#/components/schemas/ip.FirewallRuleStateEnum"}],"description":"Current state of your rule","readOnly":true},"tcpOption":{"type":"string","description":"TCP option on your rule","nullable":true,"readOnly":true}}},"ip.FirewallOptionTCP":{"type":"object","description":"Possible option for TCP","properties":{"fragments":{"type":"boolean","description":"TCP fragments","nullable":true},"option":{"allOf":[{"$ref":"#/components/schemas/ip.FirewallTCPOptionEnum"}],"description":"TCP option","nullable":true}}},"ip.FirewallProtocolEnum":{"type":"string","description":"Possible values for protocol","enum":["ah","esp","gre","icmp","ipv4","tcp","udp"]},"ip.FirewallRuleStateEnum":{"type":"string","description":"Possible values for firewall rule state","enum":["creationPending","ok","removalPending"]},"ip.FirewallSequenceRangeEnum":{"type":"integer","description":"Possible values for action","enum":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]},"ip.FirewallStateEnum":{"type":"string","description":"Possible values for firewall ip state","enum":["disableFirewallPending","enableFirewallPending","ok"]},"ip.FirewallTCPOptionEnum":{"type":"string","description":"Possible values for TCP option - only for TCP protocol","enum":["established","syn"]},"ipBlock":{"type":"string","description":"IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24)","format":"ip-block","example":"192.0.2.0/24"},"ipInterface":{"type":"string","description":"IP address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4":{"type":"string","description":"IPv4 address (e.g., 192.0.2.0)","format":"ipv4","example":"192.0.2.0"},"ipv4Block":{"type":"string","description":"IPv4 CIDR notation (e.g., 192.0.2.0/24)","format":"ipv4-block","example":"192.0.2.0/24"},"ipv6":{"type":"string","description":"IPv6 address (e.g., 2001:41d0:1:1994::1)","format":"ipv6","example":"2001:41d0:1:1994::1"},"ipv6Block":{"type":"string","description":"IPv6 CIDR notation (e.g., 2001:41d0::/128)","format":"ipv6-block","example":"2001:41d0::/128"},"macAddress":{"type":"string","description":"MAC address (e.g., 00:00:5e:00:53:01)","format":"mac-address","example":"00:00:5e:00:53:01"},"phoneNumber":{"type":"string","description":"Phone number","format":"phone-number"},"time":{"type":"string","description":"Time (e.g., 15:04:05)","format":"time","example":"15:04:05"}},"securitySchemes":{"oAuth2AuthCode":{"type":"oauth2","description":"Oauth2","x-client-id":"1bb9c7df371741c0","x-client-secret":"a5b4de870aca620d10fbf63cd18d205b","flows":{"authorizationCode":{"authorizationUrl":"https://auth.eu.ovhcloud.com/oauth2/authorize","tokenUrl":"https://auth.eu.ovhcloud.com/oauth2/token","scopes":{"account/all":"Manage your account","all":"Manage your whole account and all your services","services/all":"Manage your services lifecycle and billing"}}}}}},"paths":{"/ip/{ip}/firewall":{"get":{"summary":"List firewalled IPs","description":"List firewalled IPs. Returns the addresses of the block added to the firewall, filterable by state or by whether the firewall is enabled.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"query","name":"enabled","description":"Filter the value of enabled property (=)","schema":{"type":"boolean"}},{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"query","name":"state","description":"Filter the value of state property (=)","schema":{"$ref":"#/components/schemas/ip.FirewallStateEnum"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ipv4"}}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@10"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/ip/{ip}/firewall\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/ip/{ip}/firewall\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/get","required":true}],"x-expanded-response":"IpFirewallIp"},"post":{"summary":"Create a firewalled IP","description":"Create a firewalled IP. Adds one address of the block to the firewall. Turn it on with Update a firewalled IP.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ipOnFirewall":{"$ref":"#/components/schemas/ipv4"}},"required":["ipOnFirewall"]}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ip.FirewallIp"}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@50"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\n# Request body type: ipv4\nresult = client.post(\"/ip/{ip}/firewall\",\n\tipOnFirewall = None, #  (type: ipv4)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n// Request body type: ipv4\n$result = $ovh->post(\"/ip/{ip}/firewall\", array(\n\tipOnFirewall => null, //  (type: ipv4)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/create","required":true}]}},"/ip/{ip}/firewall/{ipOnFirewall}":{"delete":{"summary":"Delete a firewalled IP","description":"Delete a firewalled IP. Removes the address of the block from the firewall, together with all the rules set on it.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"string"}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@70"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.delete(\"/ip/{ip}/firewall/{ipOnFirewall}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->delete(\"/ip/{ip}/firewall/{ipOnFirewall}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/delete","required":true}]},"get":{"summary":"Get a firewalled IP","description":"Get a firewalled IP. Returns whether the firewall is enabled on this address, and its state: ok, enableFirewallPending or disableFirewallPending.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ip.FirewallIp"}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@30"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/ip/{ip}/firewall/{ipOnFirewall}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/ip/{ip}/firewall/{ipOnFirewall}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/get","required":true}]},"put":{"summary":"Update a firewalled IP","description":"Update a firewalled IP. Turns the firewall on or off for this address. Its state is enableFirewallPending or disableFirewallPending until the change is applied.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ip.FirewallIp"}}}},"responses":{"200":{"description":"successful operation"}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@90"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\n# Request body type: ip.FirewallIp\nresult = client.put(\"/ip/{ip}/firewall/{ipOnFirewall}\",\n\tenabled = None, #  (type: boolean)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n// Request body type: ip.FirewallIp\n$result = $ovh->put(\"/ip/{ip}/firewall/{ipOnFirewall}\", array(\n\tenabled => null, //  (type: boolean)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/edit","required":true}]}},"/ip/{ip}/firewall/{ipOnFirewall}/rule":{"get":{"summary":"List rules","description":"List rules. Returns the sequence numbers of the address's firewall rules, filterable by state: creationPending, ok or removalPending.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}},{"in":"query","name":"state","description":"Filter the value of state property (=)","schema":{"$ref":"#/components/schemas/ip.FirewallRuleStateEnum"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer"}}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@20"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/ip/{ip}/firewall/{ipOnFirewall}/rule\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/ip/{ip}/firewall/{ipOnFirewall}/rule\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/rule/get","required":true}],"x-expanded-response":"IpFirewallNetworkRule"},"post":{"summary":"Create a rule","description":"Create a rule. Adds a permit or deny rule at sequence 0 to 19, matching protocol, source, ports or TCP options.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"description":"Action on this rule","$ref":"#/components/schemas/ip.FirewallActionEnum"},"destinationPort":{"type":"integer","description":"Destination port for your rule. Only with TCP/UDP protocol"},"destinationPortRange":{"description":"Destination port range for your rule. Only with TCP/UDP protocol. Cannot be set alongside destinationPort.","$ref":"#/components/schemas/complexType.Range_long"},"l3PacketLength":{"description":"IP packet's total length","$ref":"#/components/schemas/complexType.Range_long"},"protocol":{"description":"Network protocol","$ref":"#/components/schemas/ip.FirewallProtocolEnum"},"sequence":{"description":"Sequence number of your rule","$ref":"#/components/schemas/ip.FirewallSequenceRangeEnum"},"source":{"description":"Source ip for your rule. Any if not set","$ref":"#/components/schemas/ipv4Block"},"sourcePort":{"type":"integer","description":"Source port for your rule. Only with TCP/UDP protocol"},"sourcePortRange":{"description":"Source port range for your rule. Only with TCP/UDP protocol. Cannot be set alongside sourcePort.","$ref":"#/components/schemas/complexType.Range_long"},"tcpOption":{"description":"Option on your rule. Can only be used with TCP protocol","$ref":"#/components/schemas/ip.FirewallOptionTCP"}},"required":["action","protocol","sequence"]}}}},"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ip.FirewallNetworkRule"}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@60"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.post(\"/ip/{ip}/firewall/{ipOnFirewall}/rule\",\n\taction = None, # Action on this rule (type: ip.FirewallActionEnum)\n\tdestinationPort = None, # Destination port for your rule. Only with TCP/UDP protocol (type: long, nullable)\n\tdestinationPortRange = None, # Destination port range for your rule. Only with TCP/UDP protocol. Cannot be set alongside destinationPort. (type: complexType.Range<long>, nullable)\n\tl3PacketLength = None, # IP packet's total length (type: complexType.Range<long>, nullable)\n\tprotocol = None, # Network protocol (type: ip.FirewallProtocolEnum)\n\tsequence = None, # Sequence number of your rule (type: ip.FirewallSequenceRangeEnum)\n\tsource = None, # Source ip for your rule. Any if not set (type: ipv4Block, nullable)\n\tsourcePort = None, # Source port for your rule. Only with TCP/UDP protocol (type: long, nullable)\n\tsourcePortRange = None, # Source port range for your rule. Only with TCP/UDP protocol. Cannot be set alongside sourcePort. (type: complexType.Range<long>, nullable)\n\ttcpOption = None, # Option on your rule. Can only be used with TCP protocol (type: ip.FirewallOptionTCP, nullable)\n)\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->post(\"/ip/{ip}/firewall/{ipOnFirewall}/rule\", array(\n\taction => null, // Action on this rule (type: ip.FirewallActionEnum)\n\tdestinationPort => null, // Destination port for your rule. Only with TCP/UDP protocol (type: long, nullable)\n\tdestinationPortRange => null, // Destination port range for your rule. Only with TCP/UDP protocol. Cannot be set alongside destinationPort. (type: complexType.Range<long>, nullable)\n\tl3PacketLength => null, // IP packet's total length (type: complexType.Range<long>, nullable)\n\tprotocol => null, // Network protocol (type: ip.FirewallProtocolEnum)\n\tsequence => null, // Sequence number of your rule (type: ip.FirewallSequenceRangeEnum)\n\tsource => null, // Source ip for your rule. Any if not set (type: ipv4Block, nullable)\n\tsourcePort => null, // Source port for your rule. Only with TCP/UDP protocol (type: long, nullable)\n\tsourcePortRange => null, // Source port range for your rule. Only with TCP/UDP protocol. Cannot be set alongside sourcePort. (type: complexType.Range<long>, nullable)\n\ttcpOption => null, // Option on your rule. Can only be used with TCP protocol (type: ip.FirewallOptionTCP, nullable)\n));\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/rule/create","required":true}]}},"/ip/{ip}/firewall/{ipOnFirewall}/rule/{sequence}":{"delete":{"summary":"Delete a rule","description":"Delete a rule. Removes the rule at this sequence from the address's firewall, and returns the deleted rule.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}},{"in":"path","name":"sequence","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ip.FirewallNetworkRule"}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@80"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.delete(\"/ip/{ip}/firewall/{ipOnFirewall}/rule/{sequence}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->delete(\"/ip/{ip}/firewall/{ipOnFirewall}/rule/{sequence}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/rule/delete","required":true}]},"get":{"summary":"Get a rule","description":"Get a rule. Returns the rule's action, protocol, source, destination, ports, TCP options, fragments option, packet length and state.","security":[{"oAuth2AuthCode":[]}],"parameters":[{"in":"path","name":"ip","required":true,"schema":{"$ref":"#/components/schemas/ipBlock"}},{"in":"path","name":"ipOnFirewall","required":true,"schema":{"$ref":"#/components/schemas/ipv4"}},{"in":"path","name":"sequence","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ip.FirewallNetworkRule"}}}}},"x-developer-hub-navigation":[["Network","IP addresses","Edge Network Firewall@@@40"]],"x-badges":[{"color":"green","label":"Stable production version"}],"x-code-samples":[{"lang":"python","label":"Python","source":"'''\nFirst, install the latest release of Python wrapper: $ pip install ovh\n'''\nimport json\nimport ovh\n\n# Instantiate an OVH Client.\n# You can generate new credentials with full access to your account on\n# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\nclient = ovh.Client(\n\tendpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n\tapplication_key='xxxxxxxxxx',    # Application Key\n\tapplication_secret='xxxxxxxxxx', # Application Secret\n\tconsumer_key='xxxxxxxxxx',       # Consumer Key\n)\n\nresult = client.get(\"/ip/{ip}/firewall/{ipOnFirewall}/rule/{sequence}\")\n\n# Pretty print\nprint(json.dumps(result, indent=4))"},{"lang":"php","label":"PHP","source":"<?php\n/**\n * First, download the latest release of PHP wrapper on github\n * And include this script into the folder with extracted files\n */\nrequire __DIR__ . '/vendor/autoload.php';\nuse \\Ovh\\Api;\n\n/**\n * Instantiate an OVH Client.\n * You can generate new credentials with full access to your account on\n * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)\n */\n$ovh = new Api('xxxxxxxxxx',  // Application Key\n               'xxxxxxxxxx',  // Application Secret\n               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)\n               'xxxxxxxxxx'); // Consumer Key\n\n$result = $ovh->get(\"/ip/{ip}/firewall/{ipOnFirewall}/rule/{sequence}\");\n\nprint_r($result);\n?>"}],"x-iam-actions":[{"name":"ip:apiovh:firewall/rule/get","required":true}]}}}}
