List Contexts
Lists all contexts.
ContextsApi.listContexts([param1, param2, ...])
ContextsApi.list_contexts([param1, param2, ...])
ContextsApi.listContexts([param1, param2, ...])
successful operation
Not authorized to view contexts.
- Java
- Python
- JavaScript
import com.trendmicro.deepsecurity.ApiClient; import com.trendmicro.deepsecurity.Configuration; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.ApiException; import com.trendmicro.deepsecurity.api.ContextsApi; import com.trendmicro.deepsecurity.model.Contexts; public class ListContextsExample { public static void main(String[] args) { // Setup ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("YOUR HOST"); // Authentication ApiKeyAuth Legacy API Key = (ApiKeyAuth) defaultClient.getAuthentication("Legacy API Key"); Legacy API Key.setApiKey("YOUR API KEY"); try { defaultClient.trustAllCertificates(false); } catch (Exception e) { System.err.println("An exception occurred when calling ApiClient.trustAllCertificates"); e.printStackTrace(); } ApiKeyAuth Trend Micro Cloud One API Key = (ApiKeyAuth) defaultClient.getAuthentication("Trend Micro Cloud One API Key"); Trend Micro Cloud One API Key.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 ContextsApi instance = new ContextsApi(); String apiVersion = "YOUR VERSION"; try { // Please replace the parameter values with yours Contexts result = instance.listContexts(apiVersion); System.out.println(result); } catch (ApiException e) { System.err.println("An exception occurred when calling ContextsApi.listContexts"); e.printStackTrace(); } } }
- 200
{- "contexts": [
- {
- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true,
- "ID": 0
}
]
}
Create a Context
Create a new context.
ContextsApi.createContext([param1, param2, ...])
ContextsApi.create_context([param1, param2, ...])
ContextsApi.createContext([param1, param2, ...])
header Parameters
Request Body schema: application/json
The settings of the new context.
successful operation
Not authorized to create contexts.
- Payload
- Java
- Python
- JavaScript
{- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true
}
- 200
{- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true,
- "ID": 0
}
Describe a Context
Describe a context by ID.
ContextsApi.describeContext([param1, param2, ...])
ContextsApi.describe_context([param1, param2, ...])
ContextsApi.describeContext([param1, param2, ...])
successful operation
Not authorized to view contexts.
The context does not exist.
- Java
- Python
- JavaScript
import com.trendmicro.deepsecurity.ApiClient; import com.trendmicro.deepsecurity.Configuration; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.ApiException; import com.trendmicro.deepsecurity.api.ContextsApi; import com.trendmicro.deepsecurity.model.Context; public class DescribeContextExample { public static void main(String[] args) { // Setup ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("YOUR HOST"); // Authentication ApiKeyAuth Legacy API Key = (ApiKeyAuth) defaultClient.getAuthentication("Legacy API Key"); Legacy API Key.setApiKey("YOUR API KEY"); try { defaultClient.trustAllCertificates(false); } catch (Exception e) { System.err.println("An exception occurred when calling ApiClient.trustAllCertificates"); e.printStackTrace(); } ApiKeyAuth Trend Micro Cloud One API Key = (ApiKeyAuth) defaultClient.getAuthentication("Trend Micro Cloud One API Key"); Trend Micro Cloud One API Key.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 ContextsApi instance = new ContextsApi(); Integer contextID = 1; String apiVersion = "YOUR VERSION"; try { // Please replace the parameter values with yours Context result = instance.describeContext(contextID, apiVersion); System.out.println(result); } catch (ApiException e) { System.err.println("An exception occurred when calling ContextsApi.describeContext"); e.printStackTrace(); } } }
- 200
{- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true,
- "ID": 0
}
Modify a Context
Modify a context by ID. Any unset elements will be left unchanged.
ContextsApi.modifyContext([param1, param2, ...])
ContextsApi.modify_context([param1, param2, ...])
ContextsApi.modifyContext([param1, param2, ...])
path Parameters
header Parameters
Request Body schema: application/json
The settings of the context to modify.
successful operation
Not authorized to modify contexts or the requested modification is not permitted.
The context does not exist.
- Payload
- Java
- Python
- JavaScript
{- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true
}
- 200
{- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true,
- "ID": 0
}
Delete a Context
Delete a context by ID.
ContextsApi.deleteContext([param1, param2, ...])
ContextsApi.delete_context([param1, param2, ...])
ContextsApi.deleteContext([param1, param2, ...])
Request is successful.
Not authorized to delete contexts.
- Java
- Python
- JavaScript
import com.trendmicro.deepsecurity.ApiClient; import com.trendmicro.deepsecurity.Configuration; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.auth.ApiKeyAuth; import com.trendmicro.deepsecurity.ApiException; import com.trendmicro.deepsecurity.api.ContextsApi; public class DeleteContextExample { public static void main(String[] args) { // Setup ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("YOUR HOST"); // Authentication ApiKeyAuth Legacy API Key = (ApiKeyAuth) defaultClient.getAuthentication("Legacy API Key"); Legacy API Key.setApiKey("YOUR API KEY"); try { defaultClient.trustAllCertificates(false); } catch (Exception e) { System.err.println("An exception occurred when calling ApiClient.trustAllCertificates"); e.printStackTrace(); } ApiKeyAuth Trend Micro Cloud One API Key = (ApiKeyAuth) defaultClient.getAuthentication("Trend Micro Cloud One API Key"); Trend Micro Cloud One API Key.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 ContextsApi instance = new ContextsApi(); Integer contextID = 1; String apiVersion = "YOUR VERSION"; try { // Please replace the parameter values with yours instance.deleteContext(contextID, apiVersion); } catch (ApiException e) { System.err.println("An exception occurred when calling ContextsApi.deleteContext"); e.printStackTrace(); } } }
Search Contexts
Search for contexts using optional filters.
ContextsApi.searchContexts([param1, param2, ...])
ContextsApi.search_contexts([param1, param2, ...])
ContextsApi.searchContexts([param1, param2, ...])
header Parameters
Request Body schema: application/json
A collection of options used to filter the search results.
successful operation
Not authorized to view contexts.
- Payload
- Java
- Python
- JavaScript
{- "maxItems": 0,
- "searchCriteria": [
- {
- "fieldName": "string",
- "booleanTest": true,
- "numericTest": "less-than",
- "numericValue": 0,
- "numericValueList": [
- 0
], - "stringTest": "equal",
- "stringValue": "string",
- "stringWildcards": true,
- "choiceTest": "equal",
- "choiceValue": "string",
- "firstDateValue": 0,
- "firstDateInclusive": true,
- "lastDateValue": 0,
- "lastDateInclusive": true,
- "nullTest": true,
- "versionTest": "less-than",
- "versionValue": "string",
- "idValue": 0,
- "idTest": "less-than",
- "idValueList": [
- 0
]
}
], - "sortByObjectID": true
}
- 200
{- "contexts": [
- {
- "name": "string",
- "description": "string",
- "minimumAgentVersion": "string",
- "localConnectionsEnabled": true,
- "remoteConnectionsEnabled": true,
- "noConnectionEnabled": true,
- "noInternetEnabled": true,
- "restrictedInterfacesEnabled": true,
- "ID": 0
}
]
}