IP Policy Rules#

Do not construct this object directly, instead access the ip_policy_rules property of an ngrok.Client object.

class ngrok.services.IPPolicyRulesClient(client)[source]#

IP Policy Rules are the IPv4 or IPv6 CIDRs entries that make up an IP Policy.

create(cidr, ip_policy_id, action, description='', metadata='')[source]#

Create a new IP policy rule attached to an IP Policy.

Parameters:
  • description (str) – human-readable description of the source IPs of this IP rule. optional, max 255 bytes.

  • metadata (str) – arbitrary user-defined machine-readable data of this IP policy rule. optional, max 4096 bytes.

  • cidr (str) – an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both supported.

  • ip_policy_id (str) – ID of the IP policy this IP policy rule will be attached to

  • action (str) – the action to apply to the policy rule, either allow or deny

https://ngrok.com/docs/api#api-ip-policy-rules-create

Return type:

IPPolicyRule

delete(id)[source]#

Delete an IP policy rule.

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-ip-policy-rules-delete

get(id)[source]#

Get detailed information about an IP policy rule by ID.

Parameters:

id (str) – a resource identifier

https://ngrok.com/docs/api#api-ip-policy-rules-get

Return type:

IPPolicyRule

list(before_id=None, limit=None)[source]#

List all IP policy rules on this account

Parameters:
  • before_id (Optional[str, None]) –

  • limit (Optional[str, None]) –

https://ngrok.com/docs/api#api-ip-policy-rules-list

Return type:

IPPolicyRuleList

update(id, description=None, metadata=None, cidr=None)[source]#

Update attributes of an IP policy rule by ID

Parameters:
  • id (str) –

  • description (Optional[str, None]) – human-readable description of the source IPs of this IP rule. optional, max 255 bytes.

  • metadata (Optional[str, None]) – arbitrary user-defined machine-readable data of this IP policy rule. optional, max 4096 bytes.

  • cidr (Optional[str, None]) – an IP or IP range specified in CIDR notation. IPv4 and IPv6 are both supported.

https://ngrok.com/docs/api#api-ip-policy-rules-update

Return type:

IPPolicyRule