Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Using Controller API

The following sections provide usage examples for the various APIs defined in the Controller API:

Note:

For usage examples of the Config API, see Configuring Controller API.

Tenant API Usage Examples

The following are usage examples for the Tenant API:

Usage Example 1 - Creating a Tenant

Usage Example 2 - Retrieving a Tenant

Usage Example 3 - Updating a Tenant

Usage Example 4 - Deleting a Tenant

Site API Usage Examples

The following are usage examples for the Site API:

Note:

APIs must include the authorization header based on the RestFul API user created through the Configuring Controller API.

Usage Example 1 - Creating a site

where:

  • feedSourceId is the Juniper ATP Cloud realm and its value is NULL during the POST operation. When a site is associated to realms, you can update the site with feedSourceId.

Usage Example 2 - Retrieving a site

Usage Example 3 - Updating a site based on siteId

Usage Example 4 - Deleting a site

Policy Enforcement Group API Usage Examples

The following are usage examples for the Policy Enforcement Group API:

Note:

APIs must include the authorization header based on the RestFul API user created through the Configuring Controller API.

Usage Example 1 - Creating a new Policy Enforcement Group

where:

  • sites and addressGroups are mutually exclusive.

  • The value of addressGroups can be a single IP, an IP range, or an IP subnet.

  • If the value of groupType is IP, addressGroups are populated; if the value is LOCATION, sites are populated.

Usage Example 2 - Retrieving a specific policy enforcement group based on policyGroupId

Usage Example 3 - Updating a specific policy enforcement group based on policyGroupId

Usage Example 4 - Retrieving the updated policy enforcement group to check if the updates are present

Usage Example 5 - Deleting a policy enforcement group

Threat Policy API Usage Examples

The following are usage examples for the Threat Policy API:

Note:

APIs must include the authorization header based on the RestFul API user created through the Configuring Controller API.

Usage Example 1 - Creating a new Threat Policy

where:

  • The value of action can be PERMIT, LOG, BLOCK_DROP, BLOCK_CLOSE, BLOCK_QUARANTINE, MONITOR.

  • The value of secondaryAction cab be LOG_ALL, LOG_BLOCKED, or NONE.

  • If you specify MALWARE as the feedType, SRX takes a single threat level threshold value, that is, it allows two actions — permit and block.

  • If you specify GEO_IP as the feedType, then the SRX Series device has no threshold and allows permit or block.

  • For deployStatus, you do not have to specify the values DRAFT, ANALYSIS_PROGRESS, READY_TO_DEPLOY, and DEPLOYED for POST and PUT operations.

Usage Example 2 - Updating a threat policy

Usage Example 3 - Retrieving a specific threat policy based on threatPolicyId

Usage Example 4 - Deleting a threat policy

Custom Feed API Usage Examples

The following are usage examples for the Custom Feed API:

Note:

APIs must include the authorization header based on the RestFul API user created through the Configuring Controller API.

Usage Example 1 - Creating a new CustomFeed with Local Files

where:

  • The value of feedType can be Blocklist, Allowlist, or Dynamic-Address.

  • The value of content can be a list of IP addresses, an IP range, or a subnet for a Blocklist, Allowlist and, Dynamic-Address.

  • The value of inputType can be an IP, URL or a domain for a Blocklist, Allowlist and, Dynamic-Address.

Usage Example 2- Creating a new CustomFeed with Infected-Host feedtype

where:

  • The value of feedType is Infected-Hosts.

  • The value of content can be a list of IP addresses.

  • The value of inputType can be and an IP address.

Usage Example 3- Creating a new Custom Feed with CC as feed type

Usage Example 4- Retrieving a specific custom feed based on CustomFeed Id

Usage Example 5- Retrieving a specific infected-host custom feed based on CustomFeed Id

Usage Example 6- Retrieving the list of custom feeds

Usage Example 7- Updating a custom feed

Usage Example 8- Deleting a custom feed

Usage Example 9- Creating Custom Feeds with Remote File Server

Geo IP API Usage Examples

The following are usage examples for Geo IP API:

Note:

APIs must include the authorization header based on the RestFul API user created through the Configuring Controller API.

Usage Example 1 - Creating a new Geo IP

where:

  • The value of action can be BLOCK_INBOUND, BLOCK_OUTBOUND, or BLOCK_BOTH.

  • The value of secondaryAction can be LOG or NONE.

Note:

The values for action and secondaryAction are only needed for SDSN.

Usage Example 2 - Retrieving a specific Geo IP based on geoIpId

Usage Example 3 - Retrieving the list of Geo IPs

Usage Example 4 - Deleting Geo IP

Log API Usage Examples

The following is a usage example for Log API:

Note:

APIs must include the authorization header based on the RestFul API user created through the Configuring Controller API.

Usage Example - Retrieving all log files in zip format