Port Lists

List Port Lists

get/portlists

Lists all port lists.

Related SDK Methods:
Java

PortListsApi.listPortLists([param1, param2, ...])

Python

PortListsApi.list_port_lists([param1, param2, ...])

JavaScript

PortListsApi.listPortLists([param1, param2, ...])

Request
header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

successful operation

403

Not authorized to view port lists.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PortListsApi;
import com.trendmicro.deepsecurity.model.PortLists;


public class ListPortListsExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PortListsApi instance = new PortListsApi();
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			PortLists result = instance.listPortLists(apiVersion);
			System.out.println(result);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PortListsApi.listPortLists");
			e.printStackTrace();
		}
	}
}

Response samples
application/json
{
  • "portLists": [
    ]
}

Create a Port List

post/portlists

Create a new port list.

Related SDK Methods:
Java

PortListsApi.createPortList([param1, param2, ...])

Python

PortListsApi.create_port_list([param1, param2, ...])

JavaScript

PortListsApi.createPortList([param1, param2, ...])

Request
header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

The settings of the new port list.

description
string

Description of the port list. Searchable as String.

items
Array of strings

List of comma-delimited port numbers. Can contain single ports or port ranges (for example: "20-21").

name
string

Name of the port list. Searchable as String.

Responses
200

successful operation

403

Not authorized to create port lists.

Request samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "items": [
    ]
}
Response samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "items": [
    ],
  • "ID": 0
}

Search Port Lists

post/portlists/search

Search for port lists using optional filters.

Related SDK Methods:
Java

PortListsApi.searchPortLists([param1, param2, ...])

Python

PortListsApi.search_port_lists([param1, param2, ...])

JavaScript

PortListsApi.searchPortLists([param1, param2, ...])

Request
header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

A collection of options used to filter the search results.

maxItems
integer <int32>

Limits the number of objects returned. Default 5000.

Array of objects (searchCriteria)

Array of search critiera used to filter objects. Searching with multiple criteria returns results that satisfy all of the criteria. Searching with no criteria returns all objects.

sortByObjectID
boolean

If true, forces the response objects to be sorted by ID, overriding the default sort order. Default "false".

Responses
200

successful operation

403

Not authorized to view port lists.

Request samples
application/json
{
  • "maxItems": 0,
  • "searchCriteria": [
    ],
  • "sortByObjectID": true
}
Response samples
application/json
{
  • "portLists": [
    ]
}

Describe a Port List

get/portlists/{portListID}

Describe a port list by ID.

Related SDK Methods:
Java

PortListsApi.describePortList([param1, param2, ...])

Python

PortListsApi.describe_port_list([param1, param2, ...])

JavaScript

PortListsApi.describePortList([param1, param2, ...])

Request
path Parameters
portListID
required
integer <int32> \d+

The ID number of the port list to describe.

Example: 1
header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

successful operation

403

Not authorized to view port lists.

404

The port list does not exist.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PortListsApi;
import com.trendmicro.deepsecurity.model.PortList;


public class DescribePortListExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PortListsApi instance = new PortListsApi();
		Integer portListID = 1;
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			PortList result = instance.describePortList(portListID, apiVersion);
			System.out.println(result);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PortListsApi.describePortList");
			e.printStackTrace();
		}
	}
}

Response samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "items": [
    ],
  • "ID": 0
}

Modify a Port List

post/portlists/{portListID}

Modify a port list by ID. Any unset elements will be left unchanged.

Related SDK Methods:
Java

PortListsApi.modifyPortList([param1, param2, ...])

Python

PortListsApi.modify_port_list([param1, param2, ...])

JavaScript

PortListsApi.modifyPortList([param1, param2, ...])

Request
path Parameters
portListID
required
integer <int32> \d+

The ID number of the port list to modify.

Example: 1
header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Request Body schema: application/json

The settings of the port list to modify.

description
string

Description of the port list. Searchable as String.

items
Array of strings

List of comma-delimited port numbers. Can contain single ports or port ranges (for example: "20-21").

name
string

Name of the port list. Searchable as String.

Responses
200

successful operation

403

Not authorized to modify port lists or the requested modification is not permitted.

404

The port list does not exist.

Request samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "items": [
    ]
}
Response samples
application/json
{
  • "name": "string",
  • "description": "string",
  • "items": [
    ],
  • "ID": 0
}

Delete a Port List

delete/portlists/{portListID}

Delete a port list by ID.

Related SDK Methods:
Java

PortListsApi.deletePortList([param1, param2, ...])

Python

PortListsApi.delete_port_list([param1, param2, ...])

JavaScript

PortListsApi.deletePortList([param1, param2, ...])

Request
path Parameters
portListID
required
integer <int32> \d+

The ID number of the port list to delete.

Example: 1
header Parameters
api-version
required
string

The version of the api being called.

Example: YOUR VERSION
Responses
200

Request is successful.

403

Not authorized to delete port lists.

Request samples
import com.trendmicro.deepsecurity.ApiClient;
import com.trendmicro.deepsecurity.Configuration;
import com.trendmicro.deepsecurity.auth.ApiKeyAuth;
import com.trendmicro.deepsecurity.ApiException;
import com.trendmicro.deepsecurity.api.PortListsApi;


public class DeletePortListExample {
	
	public static void main(String[] args) {
		// Setup
		ApiClient defaultClient = Configuration.getDefaultApiClient();
		defaultClient.setBasePath("YOUR HOST");

		// Authentication
		ApiKeyAuth DefaultAuthentication = (ApiKeyAuth) defaultClient.getAuthentication("DefaultAuthentication");
		DefaultAuthentication.setApiKey("YOUR API KEY");
		try {
			defaultClient.trustAllCertificates(false);
		} catch (Exception e) {
			System.err.println("An exception occurred when calling ApiClient.trustAllCertificates");
			e.printStackTrace();
		}
		
		// Initialization
		// Set Any Required Values
		PortListsApi instance = new PortListsApi();
		Integer portListID = 1;
		String apiVersion = "YOUR VERSION";
		try {
			// Please replace the parameter values with yours
			instance.deletePortList(portListID, apiVersion);
		} catch (ApiException e) {
			System.err.println("An exception occurred when calling PortListsApi.deletePortList");
			e.printStackTrace();
		}
	}
}