get_system_whitelist_ips

WhitelistIpsApi.get_system_whitelist_ips(role_id, protocol=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

List whitelisted IPs

Returns WAF whitelist addresses from SSM. Requires system-settings.view. Returns IPV-1002 if IP whitelisting is disabled for the environment. Omit protocol to return IPv4 and, when IPv6 is enabled, IPv6; otherwise IPV6Addresses is [].

Parameters:
  • role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Used for permission checks and audit logs. (required)

  • protocol (str) – Filter to one family. Compared lowercase. Allowed values ipv4 and ipv6 (IPV-1041 otherwise). ipv6 returns IPV-1002 when IPv6 is not enabled.

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

GetSystemWhitelistIpsResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /system-whitelist-ips

Success (HTTP 200)

Without protocol, IPV4Addresses always and IPV6Addresses when IPv6 is enabled (else []). protocol=ipv4 returns only IPV4Addresses. protocol=ipv6 returns only IPV6Addresses. Fields are not required because protocol omits the other family.

No protocol, IPv6 enabled

{
  "IPV4Addresses": [
    "203.0.113.10/32"
  ],
  "IPV6Addresses": [
    "2001:db8::1/128"
  ]
}

protocol=ipv4

{
  "IPV4Addresses": [
    "203.0.113.10/32"
  ]
}

Errors

Documented error codes: AUTH-1030, IPV-1002, IPV-1041, RTE-1001, EMF-1001.

HTTP 400

AUTH-1030 missing system-settings.view. IPV-1002 whitelisting or IPv6 disabled. IPV-1041 invalid protocol.

Whitelisting disabled

{
  "Message": "IPV-1002 - IP Address whitelisting is not enabled in this environment"
}

Invalid protocol

{
  "Message": "IPV-1041 - Invalid parameter - protocol, allowed values/keys are ['ipv4', 'ipv6']"
}

HTTP 500

Uncaught Exception is RTE-1001 via EMF-1001.

Uncaught Exception

{
  "Message": "RTE-1001 - Internal error."
}