IP Lists Reference
This topic provides properties, parameters, and examples for IP lists.
Query parameters for IP lists
Parameter | Description | Type | Required |
---|---|---|---|
| Organization | Integer | Yes |
| Security Policy Version | String | Yes |
| Description of IP list(s) to return. Supports partial matches | String | No |
| The data source from which the resource originates. For example, if this workload information is stored in an external database. | String | No |
| A unique identifier within the external data source. For example, if this workload information is stored in an external database. | String | No |
| IP address matching the IP lists to return. Supports partial matches. | String | No |
| IP lists matching FQDN. Supports partial matches | String | No |
| The maximum number of results you want to return when using the GET method. The maximum limit for returned IP lists is 500. | Integer | No |
| Name of IP list(s) to return. Supports partial matches | String | No |
| IP list ID (for | String | Yes |
Properties for IP lists
Property | Description | Type | Required |
---|---|---|---|
| URI of the ip list | String | Yes |
| The name of the IP lists to return has to be unique. | String | Yes |
| Description of IP list(s) to return. Supports partial matches | String | No |
| The data source from which the resource originates. For example, if this workload information is stored in an external database. | String, Null | No |
| A unique identifier within the external data source. For example, if this workload information is stored in an external database. | String, Null | No |
| Collection of FQDNs. | Array. Required:
| No |
| IP list ID (for | String | Yes |
Curl Command to Get Collection of IP Lists
curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/3/sec_policy/draft/ip_lists -H "Accept: application/json" -u $KEY:$TOKEN
Response Body
{ { href: "/orgs/2/sec_policy/draft/ip_lists/309" id: 309 created_at: "2020-04-17T21:59:44Z" updated_at: "2020-04-17T21:59:44Z" deleted_at: null created_by: { href: "/users/76" } updated_by: { href: "/users/76" } deleted_by: null name: "Good IPs 2" description: null ip_ranges: [ { description: "My good IPs for web app" from_ip: "192.0.2.0" to_ip: null } ] }
Curl Command to Get an IP List
curl -i -X GET https://pce.my-company.com:8443/api/v2/orgs/3/sec_policy/draft/ip_lists/312 -H "Accept: application/json" -u $KEY:$TOKEN
Request Properties to create IP lists
Example JSON request body for a single IP list:
{ "name": "Good IPs", "ip_ranges": [ { "description": "Good IPs allowed to access app server", "from_ip": "192.0.2.0" } ] }
Curl Command to Create IP List
curl -i -X POST https://pce.my-company.com:8443/api/v2/orgs/3/sec_policy/draft/ip_lists -H "Accept: application/json" -u $KEY:$TOKEN -d '{"name": "Good IPs", "ip_ranges":[{"description": "Good IPs allowed to access app server", "from_ip": "192.0.2.0"}]}'
Response Body
{ href: "/orgs/2/sec_policy/draft/ip_lists/316" created_at: "2020-04-18T00:19:55Z" updated_at: "2020-04-18T00:19:55Z" deleted_at: null created_by: { href: "/users/11" } updated_by: { href: "/users/11" } deleted_by: null name: "Good IPs" description: null ip_ranges: [ { description: "Good IPs" from_ip: "192.0.2.0" to_ip: null } ] }
Update an IP List
This API updates a specific IP list identified by its HREF. Get a collection of IP lists to find IP list HREFs .
Example IP list HREF:
/orgs/2/sec_policy/draft/ip_lists/316
URI to Update an IP List
PUT [api_version][ip_list_href]
Example Request Body to Update an IP List
{ "name": "Better IPs", "list_type": "allow", "ip_ranges": [ { "description": "More allowed IPs for web app", "from_ip" : "192.0.2.0" "to_ip" : "24" } ] }
Curl Command to Update IP List
curl -i -X PUT https://pce.my-company.com:8443/api/v2/orgs/3/sec_policy/draft/ip_lists/312 -H "Content-Type: application/json" -u $KEY:$TOKEN -d '{ "name": "Better IPs", "list_type": "allow", "ip_ranges": [{"description": "Better IPs for web app", "from_ip": "192.0.2.0", "to_ip": "24"}]}'
Delete an IP List
This API removes an IP list from a organization:
URI to Delete an API List
DELETE [api_version][ip_list_href]
Curl Command to Delete IP List
curl -i -X DELETE https://pce.my-company.com:8443/api/v2/orgs/2/sec_policy/draft/ip_lists/316 -u $KEY:$TOKEN