Explorer
The Public Experimental Explorer APIs search and analyze PCE traffic flows for auditing, reporting, and troubleshooting. You can search for traffic flows between workloads or hosts, labeled workloads, or IP addresses, and you can restrict the search by specific port numbers and protocols.
There are three APIs for the traffic flow search:
Traffic Analysis Queries
This was the basic traffic analyzer for queries that is now deprecated:
Functionality | HTTP | URI |
---|---|---|
Search the PCE traffic data database to discover traffic patterns and write policies. |
|
|
Note
This API is now DERECATED and replaced with Asynchronous Queries for Traffic Flows, which has an additional parameter, query_name
, and the max-results
limit is raised from 100,000 to 200,000.
Create Traffic Analysis Queries
POST [api_version][org_href]/traffic_flows/traffic_analysis_queries
Properties
Property | Description | Type | Req |
---|---|---|---|
| Starting date for the query. If left empty, the default interpretation is “today,” which is “now” minus 24 hours. | Date-time string ( | Yes |
| Ending date for the query. If left empty, the default interpretation is “today,” which is “now” plus 24 hours. | Data-time string ( | Yes |
| Source labels, workloads, or IP addresses to include or exclude in the search. The response can contain up to five matching IP addresses. NOTE: The response returns Sources are treated as consumers for the purposes of the request; the response returns the source of an individual flow as src. Sub-properties:
| Object | Yes Yes |
| Target labels, workloads, or IP addresses to include or exclude in the search. The response returns Required sub-properties:
| Object | Yes Yes |
services | Services (5-tuple of port/to_port/proto/process/service) to include or exclude. Not all properties of the service subobjects are required. Required properties:
Properties of the
| Yes Yes | |
| Allows you to filter the query based on policy decision:
| Array of strings | Yes |
| Maximum number of flows to return | Integer | No |
| Exclude workload traffic when the IP List is provided either in the consumer or provider part of the traffic query. | Boolean | Default is: |
Response Properties
Property | Description | Type | Required |
---|---|---|---|
| Workloads (
| String String JSON list of strings | Yes |
| Workloads (
| String String JSON list of strings | Yes |
| Port, protocol, process, service name, and user_name of this flow Additional required properties:
| Object Integer Integer String String String | Yes |
| The number of traffic flows reported in the connection is as follows: | Integer | Yes |
| If there is a rule for the returned traffic data, this property indicates the policy decision for the flow. Indicates if the traffic flow was allowed, potentially blocked (but allowed), or blocked.
| String | Yes |
| Flow direction is inbound or outbound. | String | Yes |
| The transmission type is broadcast or multicast. | String | No |
| The time range during which the flows were reported in date-time format. Includes both of these sub-properties:
| String | Yes |
| State of the flow, which can be one of the following values:
| String | No |
| Bytes sent till now by the destination over the flow during the interval. | Integer | |
| Bytes have been received by the destination over the flow during the interval. | Integer | |
| ICMP type for the flow | Integer | |
| ICMP code for the flow | Integer | |
| PCE network on which this flow was observed. Additional properties:
| Object String String | Yes |
Filter for Managed Services
This API allows you to filter all managed services, such as workloads, virtual services, and so on.
Functionality | HTTP | URI |
---|---|---|
Get a list of Virtual Servers. |
|
|
Get a specified Virtual Serve.r |
|
|
Example Explorer Search
One preliminary method of creating policy is to make sure that different data center environments are segmented from each other, such as separating development and testing environments from production environments. Before writing policy rules to allow or block this traffic, determine if there are any traffic flows between them.
With Explorer, you can ask the PCE:
Were there any traffic flows between my development and production environments over any port besides port 80, excluding any Workloads that have a "Domain Controller" role label?
To construct this query, specify the following information:
sources
: In the JSON request,include
the HREF of the “Development” environment label andexclude
the HREF of the “Domain Controller” role label.targets
: In the JSON request,include
the HREF of the “Production” environment label andexclude
any workloads that do not have a role label assigned to them.ports
: Search for traffic over any port except port 80.
Curl Command to Search Traffic Data with Explorer
curl -i -X POST https://pce.my-company.com:8443/api/v2/orgs/7/traffic_flows/traffic_analysis_queries -H "Content-Type: application/json" -u $KEY:$TOKEN -T explorer-example.json
The above command lists the contents of explorer-example.json to specify the query.
The example should be similar to the following:
explorer-example.json
{ "sources": { "include": [ [ { "label": { "href": "/orgs/1/labels/20" } } ] ], "exclude": [ { "label": { "href": "/orgs/1/labels/21" } } ] }, "destinations": { "include": [ [ { "label": { "href": "/orgs/1/labels/202" } } ] ], "exclude": [ { "label": { "href": "/orgs/1/labels/205" } } ] }, "services": { "include": [ { "port": 80 } ], "exclude": [ { "port": 888 } ] }, "policy_decisions": ["allowed"], "max_results": 2 }
Response
The response shows a single traffic flow between your Development and Production Environment, the consumer of which is a workload identified by its IP address and labels, communicating with an unidentified IP address on TCP (number 6) over port 80.
{ "src": { "ip": "10.2.3.161", "workload": { "href": "/orgs/1/workloads/3a5f2482-1188-4449-b035-0c7880486a4f", "hostname": "johns-test-client5", "name": null, "os_type": linux, "labels": [{ "href": "/orgs/1/labels/144", "key": "app", "value": "test_app_1" }, { "href": "/orgs/1/labels/143", "key": "role", "value": "test_access_1" }] } }, "dst": { "ip": "10.2.3.165", "workload": { "href": "/orgs/1/workloads/87a10385-7466-488f-bce4-899de08974a0", "hostname": "johns-test-server-4", "name": null, "os_type": linux, "labels": [{ "href": "/orgs/1/labels/145", "key": "app", "value": "test_app_2" }, { "href": "/orgs/1/labels/151", "key": "env", "value": "test_env_2" }, { "href": "/orgs/1/labels/149", "key": "loc", "value": "test_place_1" }, { "href": "/orgs/1/labels/143", "key": "role", "value": "test_access_1" }] } }, "port": 14000, "proto": 17, "num_connections": 2, "policy_decision": "allowed", "timestamp_range": { "last_detected": "2020-03-03T00:38:12Z", "first_detected": "2020-03-03T00:38:12Z" } }, { "src": { "ip": "10.2.3.161", "workload": { "href": "/orgs/1/workloads/3a5f2482-1188-4449-b035-0c7880486a4f", "hostname": "johns-test-client5", "name": null, "os_type": linux, "labels": [{ "href": "/orgs/1/labels/144", "key": "app", "value": "test_app_1" ......... { "href": "/orgs/1/labels/143", "key": "role", "value": "test_access_1" }] } }, "dst": { "ip": "10.2.3.165", "workload": { "href": "/orgs/1/workloads/87a10385-7466-488f-bce4-899de08974a0", "hostname": "johns-test-server-4", "name": null, "os_type": linux, "labels": [{ "href": "/orgs/1/labels/145", "key": "app", "value": "test_app_2" .......... { "href": "/orgs/1/labels/143", "key": "role", "value": "test_access_1" }] } }, "port": 14000, "proto": 6, "num_connections": 6, "policy_decision": "allowed", "timestamp_range": { "last_detected": "2020-03-03T00:38:10Z", "first_detected": "2020-03-03T00:38:10Z" } }
Asynchronous Queries for Traffic Flows
This new API is very similar to the existing one, Traffic Analysis Query, but the new one has a new parameter, query_name
, while the max_results
limit is raised to 200,000. Currently, there is no change to POST[api_version][org_href]/traffic_flows/traffic_analysis_queries
, which will eventually be deprecated.
The maximum number of returned results in POST [api_version][org_href]/traffic_flows/traffic_analysis_queries is 100,000, which is a reasonable number a user can view in the UI. However, when Explorer captures all traffic flows into a CSV file to build rules offline, the queries take longer to return, traffic data contains more than 100,000 rows, and so on.
Explorer queries are required to support both the single-node and multi-node Explorer in the SuperCluster environment. Therefore, the limitation of 100,000 results was raised to 200,000 to support SuperCluster environments in Explorer better.
Async Queries API Methods
Functionality | HTTP | URI |
---|---|---|
Create a new async traffic query. |
|
|
Get a collection of async traffic queries. |
|
|
Download the completed async traffic query results. |
|
|
Update an async traffic query (request cancellation of the queued async query). |
|
|
Delete the completed async traffic quer.y |
|
|
Note
This new API is very similar to the existing one, Traffic Analysis Query, but the new one has a new parameter, query_name
, and the max-results
limit is raised to 200,000.
Parameters for GET [api_version][org_href] traffic_flows/async_queries
Property | Description | Type | Required |
---|---|---|---|
| Organization | Integer | Yes |
Parameters for POST [api_version][org_href] traffic_flows/async_queries
Property | Description | Type | Required |
---|---|---|---|
| Organization | Integer | Yes |
| Name of the query. | String | Yes |
| Source labels, workloads, and IP addresses to include or exclude. | Object | Yes |
| Services (5-tuple of port/to_port/proto/process/service) to include or exclude. | Object | Yes |
| Maximum number of flows to return. "minimum": 0, "maximum": 200000 | Integer | No |
| Query status | String | Yes |
| Starting date for query | String/date | No |
| Ending date for query | String/date | No |
| Object | Yes | |
| IP address value | String | Yes |
| List of boundary decisions | String |
Example Async Explorer Queries
Curl command for traffic_flows_async_queries_post
curl -i -u api_1195cf055cf8a834c:148afd87ecc980900eaf10d6c54e6c0f607b22e0dbf768dd007e51e731096282 https://devtest0.ilabs.io:8443/api/v2/orgs/1/traffic_flows/async_queries -H "Content-Type: application/json" -X POST -d '{"sources":{"include":[[{"workload":{"href":"/orgs/1/workloads/a3ffb374-f6c6-4cce-ac57-642c66f1498f"}}]],"exclude":[]},"destinations":{"include":[[]],"exclude":[]},"services":{"include":[],"exclude":[]},"sources_destinations_query_op":"and","start_date":"2016-01-29T17:04:03.149Z","end_date":"2021-01-29T17:06:03.151Z","policy_decisions":[],"max_results":1000,"query_name":"worklaod test"}'
Response:
HTTP/1.1 202 Accepted content-location: 7734501b-74a2-47a4-9ded-77bf4ceea938 content-type: application/json content-length: 615 x-request-id: 00c8fa00-dbd8-4a28-a5c7-354fb5ae3886 cache-control: no-store x-frame-options: DENY x-xss-protection: 1; mode=block x-content-type-options: nosniff {"status":"queued","href":"/orgs/1/traffic_flows/async_queries/ 7734501b-74a2-47a4-9ded-77bf4ceea938","created_by": {"href":"/users/1"},"query_parameters":{"sources":{"include":[ [{"workload":{"href":"/orgs/1/workloads/a3ffb374-f6c6-4cce-ac57-642c66f1498f"}}]], "exclude":[]},"destinations":{"include":[[]],"exclude":[]},"services": {"include":[],"exclude":[]},"sources_destinations_query_op":"and","start_date": "2016-01-29T17:04:03.149Z","end_date":"2021-01-29T17:06:03.151Z", "policy_decisions":[],"max_results":1000,"query_name":"worklaod test"}, "created_at":"2021-04-09T20:50:30Z","updated_at":"2021-04-09T20:50:30Z"}
Curl command for traffic_flows/async_queries_get
This query gets the collection of all async jobs for the current user, including anything that was already submitted.
curl -i -u api_1195cf055cf8a834c:148afd87ecc980900eaf10d6c54e6c0f607b22e0dbf768dd007e51e731096282 https://devtest0.ilabs.io:8443/api/v2/orgs/1/traffic_flows/async_queries
Response
HTTP/1.1 200 OK content-type: application/json content-length: 1510 x-request-id: fcf065e5-e465-4161-ba98-542182734c38 cache-control: no-store x-frame-options: DENY x-xss-protection: 1; mode=block x-content-type-options: nosniff [{"matches_count":1984,"flows_count":1000,"status":"completed","href":"/orgs/1/traffic_flows/async_queries/88675fbd-a88e-44bd-b358-2d6f2fc4f95a","result":"/orgs/1/traffic_flows/async_queries/88675fbd-a88e-44bd-b358-2d6f2fc4f95a/download","created_by":{"href":"/users/1"},"query_parameters":{"sources":{"include":[[{"workload":{"href":"/orgs/1/workloads/a3ffb374-f6c6-4cce-ac57-642c66f1498f"}}]],"exclude":[]},"destinations":{"include":[[]],"exclude":[]},"services":{"include":[],"exclude":[]},"sources_destinations_query_op":"and","start_date":"2016-01-29T17:04:03.149Z","end_date":"2021-01-29T17:06:03.151Z","policy_decisions":[],"max_results":1000,"query_name":"worklaod tesrrrrrt"},"created_at":"2021-04-09T20:50:19Z","updated_at":"2021-04-09T20:50:27Z"},{"matches_count":1984,"flows_count":1000,"status":"completed","href":"/orgs/1/traffic_flows/async_queries/7734501b-74a2-47a4-9ded-77bf4ceea938","result":"/orgs/1/traffic_flows/async_queries/7734501b-74a2-47a4-9ded-77bf4ceea938/download","created_by":{"href":"/users/1"},"query_parameters":{"sources":{"include":[[{"workload":{"href":"/orgs/1/workloads/a3ffb374-f6c6-4cce-ac57-642c66f1498f"}}]],"exclude":[]},"destinations":{"include":[[]],"exclude":[]},"services":{"include":[],"exclude":[]},"sources_destinations_query_op":"and","start_date":"2016-01-29T17:04:03.149Z","end_date":"2021-01-29T17:06:03.151Z","policy_decisions":[],"max_results":1000,"query_name":"worklaod test"},"created_at":"2021-04-09T20:50:30Z","updated_at":"2021-04-09T20:50:32Z"
Curl command for traffic_flows/async_queries/:uuid_get
This query gets a specific job included in the collection.
curl -i -u $KEY:$TOKEN https://devtest0.ilabs.io:8443/api/v2/orgs/1/traffic_flows/async_queries/88675fbd-a88e-44bd-b358-2d6f2fc4f95a
Response
HTTP/1.1 200 OK content-type: application/json content-length: 756 x-request-id: f328b845-8542-4b96-a128-43aefdf7ba5a cache-control: no-store x-frame-options: DENY x-xss-protection: 1; mode=block x-content-type-options: nosniff {"matches_count":1984,"flows_count":1000,"status":"completed", "href":"/orgs/1/traffic_flows/async_queries/88675fbd-a88e-44bd-b358-2d6f2fc4f95a", "result":"/orgs/1/traffic_flows/async_queries/88675fbd-a88e-44bd-b358-2d6f2fc4f95a/download", "created_by":{"href":"/users/1"},"query_parameters":{"sources":{"include":[[{"workload":{"href":"/orgs/1/workloads/a3ffb374-f6c6-4cce-ac57-642c66f1498f"}}]],"exclude":[]},"destinations":{"include":[[]],"exclude":[]},"services":{"include":[],"exclude":[]},"sources_destinations_query_op":"and","start_date":"2016-01-29T17:04:03.149Z","end_date":"2021-01-29T17:06:03.151Z","policy_decisions":[],"max_results":1000,"query_name":"worklaod tesrrrrrt"},"created_at":"2021-04-09T20:50:19Z","updated_at":"2021-04-09T20:50:27Z"}
Asynchronous Queries
Explorer provides a view to query traffic data to help users build segmentation / intra / extra scope rules. Previously, it caped the maximum number of returned results to 100,000, which is enough for the number of results a user can view in the UI. However, when you use Explorer to capture all traffic flows into a CSV file to build rules offline, the queries take longer to return, traffic data contains more than 100,000 rows, and so on.
To better support SuperCluster environments in Explorer, the limitation of 100,000 results requires a new approach to using Explorer queries. Explorer queries are required to support both the single-node and multi-node Explorer in the SuperCluster environment.
New APIs for asynchronous queries are introduced while there is no change to the existing APIs, which will be later deprecated.
Async Queries API Methods
Functionality | HTTP | URI |
---|---|---|
Create a new async traffic query. |
|
|
Get a collection of async traffic queries. |
|
|
Get an async traffic query. Asynchronous explorer query status. |
|
|
Update an async traffic query (request cancellation of the queued async query) |
|
|
Delete the completed async traffic query. |
|
|
Properties
Property | Description | Type | Required |
---|---|---|---|
| (GET) Query URI | String | Yes |
| (GET) Current query status | String | Yes |
| Timestamp in UTC when this query was created | date/time | Yes |
| The user who created this query | String Format URI | Yes |
| Explorer query parameters | Object | Yes |
| (GET, POST) Name of the query. | String | Yes |
| (GET, POST) Source labels, workloads, or IP addresses to include or exclude in the search. Sub-properties:
| Object | Yes |
| (GET, POST)Target labels, workloads, IP addresses, domain names, and transmission to include or exclude | Yes | |
| (GET, POST) Services (5-tuple of port/to_port/proto/process/service) to include or exclude | Object | Yes |
| (GET, POST) List of policy decisions | Array | Yes |
| (GET) Result from download URI, available only if the status is completed | String | No |
| Timestamp in UTC when this async query was last updated | date/time | No |
| (GET, POST) Starting date for the query | Data-time string ( | No |
| (GET, POST) Ending date for the query. | Data-time string ( | No |
| Query result count | Integer | No |
| Result count after query limits and RBAC filtering are applied. | Integer | No |
| (GET, POST) Query logical operator between sources and destinations. Default is "and" | String | No |
| Region-specific response metadata. Required properties:
| Integer | No |
| (GET, POST) Maximum number of flows to return. "minimum": 0, "maximum": 200000 | Integer | No |
| (GET, POST) Exclude workload traffic when the IP List is provided either in the consumer or provider part of the traffic query. Default is | Boolean | No |
| List of boundary decisions | String |
Database Metrics
This Public Experimental endpoint provides organization-specific insight into the current traffic database. It gives you the ability to monitor how big the traffic database is and how much data you can store. It also provides information about how many days of data is available.
Database Metrics API Method
Functionality | HTTP | URI |
---|---|---|
Returns the organization database usage metrics. Provides customers organization-specific insight into current traffic database size (#days, #GB). |
|
|
Parameters for Database Metrics
Property | Description | Type | Required |
---|---|---|---|
| Organization's total number of days of flow data | Integer | Yes |
| Organization's limit on the total number of days of flow data | Integer | Yes |
| Organization's oldest day of flow data (yyyy-mm-dd) | String, date | No |
| Organization's limit on the total number of gigabytes of flow data | Number | Yes |
| Organization's limit on the total number of gigabytes of flow data | Number | Yes |
| Timestamp in UTC when these flow metrics were generated | String, date/time | Yes |
Curl Command to get Database Metrics
curl -i -u api_1f0c3ebf44dcafb19:6de325a25e7e4383de1dea9d8c7ce230773ad4d8a5cbb62980e7d176254f263d https://test.mylab.io:8443/api/v2/orgs/1/traffic_flows/database_metrics
Response
{"flows_days":2,"flows_size_gb":0.2695770263671875,"flows_days_limit":90,"flows_size_gb_limit":26,"updated_at":"2021-11-17T20:50:45Z"}%