curl -X GET\
-H "Authorization: Bearer [[accessToken]]"\
-H "Accept: application/json"\
"http://localhost:8080/threat_models/{threat_model_id}/threats?limit=&offset=&sort=&name=&description=&threat_type=&severity=&priority=&status=&diagram_id=&cell_id=&score_gt=&score_lt=&score_eq=&score_ge=&score_le=&created_after=&created_before=&modified_after=&modified_before="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ThreatModelSubResourcesApi;
import java.io.File;
import java.util.*;
public class ThreatModelSubResourcesApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
Integer limit = 56; // Integer | Maximum number of threats to return
Integer offset = 56; // Integer | Number of threats to skip
String sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
String name = name_example; // String | Filter by threat name (partial match)
String description = description_example; // String | Filter by threat description (partial match)
String threatType = threatType_example; // String | Filter by threat type (exact match)
String severity = severity_example; // String | Filter by severity level (exact match)
String priority = priority_example; // String | Filter by priority (exact match)
String status = status_example; // String | Filter by status (exact match)
UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by diagram ID (exact match)
UUID cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by cell ID (exact match)
BigDecimal scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value
BigDecimal scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value
BigDecimal scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value
BigDecimal scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value
BigDecimal scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value
Date createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format)
Date createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format)
Date modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format)
Date modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format)
try {
array[Threat] result = apiInstance.getThreatModelThreats(threatModelId, limit, offset, sort, name, description, threatType, severity, priority, status, diagramId, cellId, scoreGt, scoreLt, scoreEq, scoreGe, scoreLe, createdAfter, createdBefore, modifiedAfter, modifiedBefore);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelThreats");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ThreatModelSubResourcesApi;
public class ThreatModelSubResourcesApiExample {
public static void main(String[] args) {
ThreatModelSubResourcesApi apiInstance = new ThreatModelSubResourcesApi();
UUID threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
Integer limit = 56; // Integer | Maximum number of threats to return
Integer offset = 56; // Integer | Number of threats to skip
String sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
String name = name_example; // String | Filter by threat name (partial match)
String description = description_example; // String | Filter by threat description (partial match)
String threatType = threatType_example; // String | Filter by threat type (exact match)
String severity = severity_example; // String | Filter by severity level (exact match)
String priority = priority_example; // String | Filter by priority (exact match)
String status = status_example; // String | Filter by status (exact match)
UUID diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by diagram ID (exact match)
UUID cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by cell ID (exact match)
BigDecimal scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value
BigDecimal scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value
BigDecimal scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value
BigDecimal scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value
BigDecimal scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value
Date createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format)
Date createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format)
Date modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format)
Date modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format)
try {
array[Threat] result = apiInstance.getThreatModelThreats(threatModelId, limit, offset, sort, name, description, threatType, severity, priority, status, diagramId, cellId, scoreGt, scoreLt, scoreEq, scoreGe, scoreLe, createdAfter, createdBefore, modifiedAfter, modifiedBefore);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ThreatModelSubResourcesApi#getThreatModelThreats");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
UUID *threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Unique identifier of the threat model (UUID)
Integer *limit = 56; // Maximum number of threats to return (optional) (default to 20)
Integer *offset = 56; // Number of threats to skip (optional) (default to 0)
String *sort = sort_example; // Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc) (optional) (default to created_at:desc)
String *name = name_example; // Filter by threat name (partial match) (optional)
String *description = description_example; // Filter by threat description (partial match) (optional)
String *threatType = threatType_example; // Filter by threat type (exact match) (optional)
String *severity = severity_example; // Filter by severity level (exact match) (optional)
String *priority = priority_example; // Filter by priority (exact match) (optional)
String *status = status_example; // Filter by status (exact match) (optional)
UUID *diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Filter by diagram ID (exact match) (optional)
UUID *cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // Filter by cell ID (exact match) (optional)
BigDecimal *scoreGt = 1.2; // Filter threats with score greater than this value (optional)
BigDecimal *scoreLt = 1.2; // Filter threats with score less than this value (optional)
BigDecimal *scoreEq = 1.2; // Filter threats with score equal to this value (optional)
BigDecimal *scoreGe = 1.2; // Filter threats with score greater than or equal to this value (optional)
BigDecimal *scoreLe = 1.2; // Filter threats with score less than or equal to this value (optional)
Date *createdAfter = 2013-10-20T19:20:30+01:00; // Filter threats created after this date (RFC3339 format) (optional)
Date *createdBefore = 2013-10-20T19:20:30+01:00; // Filter threats created before this date (RFC3339 format) (optional)
Date *modifiedAfter = 2013-10-20T19:20:30+01:00; // Filter threats modified after this date (RFC3339 format) (optional)
Date *modifiedBefore = 2013-10-20T19:20:30+01:00; // Filter threats modified before this date (RFC3339 format) (optional)
ThreatModelSubResourcesApi *apiInstance = [[ThreatModelSubResourcesApi alloc] init];
// List threats in a threat model
[apiInstance getThreatModelThreatsWith:threatModelId
limit:limit
offset:offset
sort:sort
name:name
description:description
threatType:threatType
severity:severity
priority:priority
status:status
diagramId:diagramId
cellId:cellId
scoreGt:scoreGt
scoreLt:scoreLt
scoreEq:scoreEq
scoreGe:scoreGe
scoreLe:scoreLe
createdAfter:createdAfter
createdBefore:createdBefore
modifiedAfter:modifiedAfter
modifiedBefore:modifiedBefore
completionHandler: ^(array[Threat] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var TmiThreatModelingImprovedApi = require('tmi__threat_modeling_improved_api');
var defaultClient = TmiThreatModelingImprovedApi.ApiClient.instance;
var api = new TmiThreatModelingImprovedApi.ThreatModelSubResourcesApi()
var threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // {{UUID}} Unique identifier of the threat model (UUID)
var opts = {
'limit': 56, // {{Integer}} Maximum number of threats to return
'offset': 56, // {{Integer}} Number of threats to skip
'sort': sort_example, // {{String}} Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
'name': name_example, // {{String}} Filter by threat name (partial match)
'description': description_example, // {{String}} Filter by threat description (partial match)
'threatType': threatType_example, // {{String}} Filter by threat type (exact match)
'severity': severity_example, // {{String}} Filter by severity level (exact match)
'priority': priority_example, // {{String}} Filter by priority (exact match)
'status': status_example, // {{String}} Filter by status (exact match)
'diagramId': 38400000-8cf0-11bd-b23e-10b96e4ef00d, // {{UUID}} Filter by diagram ID (exact match)
'cellId': 38400000-8cf0-11bd-b23e-10b96e4ef00d, // {{UUID}} Filter by cell ID (exact match)
'scoreGt': 1.2, // {{BigDecimal}} Filter threats with score greater than this value
'scoreLt': 1.2, // {{BigDecimal}} Filter threats with score less than this value
'scoreEq': 1.2, // {{BigDecimal}} Filter threats with score equal to this value
'scoreGe': 1.2, // {{BigDecimal}} Filter threats with score greater than or equal to this value
'scoreLe': 1.2, // {{BigDecimal}} Filter threats with score less than or equal to this value
'createdAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threats created after this date (RFC3339 format)
'createdBefore': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threats created before this date (RFC3339 format)
'modifiedAfter': 2013-10-20T19:20:30+01:00, // {{Date}} Filter threats modified after this date (RFC3339 format)
'modifiedBefore': 2013-10-20T19:20:30+01:00 // {{Date}} Filter threats modified before this date (RFC3339 format)
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getThreatModelThreats(threatModelId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getThreatModelThreatsExample
{
public void main()
{
var apiInstance = new ThreatModelSubResourcesApi();
var threatModelId = new UUID(); // UUID | Unique identifier of the threat model (UUID)
var limit = 56; // Integer | Maximum number of threats to return (optional) (default to 20)
var offset = 56; // Integer | Number of threats to skip (optional) (default to 0)
var sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc) (optional) (default to created_at:desc)
var name = name_example; // String | Filter by threat name (partial match) (optional)
var description = description_example; // String | Filter by threat description (partial match) (optional)
var threatType = threatType_example; // String | Filter by threat type (exact match) (optional)
var severity = severity_example; // String | Filter by severity level (exact match) (optional)
var priority = priority_example; // String | Filter by priority (exact match) (optional)
var status = status_example; // String | Filter by status (exact match) (optional)
var diagramId = new UUID(); // UUID | Filter by diagram ID (exact match) (optional)
var cellId = new UUID(); // UUID | Filter by cell ID (exact match) (optional)
var scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value (optional)
var scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value (optional)
var scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value (optional)
var scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value (optional)
var scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value (optional)
var createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format) (optional)
var createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format) (optional)
var modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format) (optional)
var modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format) (optional)
try
{
// List threats in a threat model
array[Threat] result = apiInstance.getThreatModelThreats(threatModelId, limit, offset, sort, name, description, threatType, severity, priority, status, diagramId, cellId, scoreGt, scoreLt, scoreEq, scoreGe, scoreLe, createdAfter, createdBefore, modifiedAfter, modifiedBefore);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ThreatModelSubResourcesApi.getThreatModelThreats: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiThreatModelSubResourcesApi();
$threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Unique identifier of the threat model (UUID)
$limit = 56; // Integer | Maximum number of threats to return
$offset = 56; // Integer | Number of threats to skip
$sort = sort_example; // String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
$name = name_example; // String | Filter by threat name (partial match)
$description = description_example; // String | Filter by threat description (partial match)
$threatType = threatType_example; // String | Filter by threat type (exact match)
$severity = severity_example; // String | Filter by severity level (exact match)
$priority = priority_example; // String | Filter by priority (exact match)
$status = status_example; // String | Filter by status (exact match)
$diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by diagram ID (exact match)
$cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // UUID | Filter by cell ID (exact match)
$scoreGt = 1.2; // BigDecimal | Filter threats with score greater than this value
$scoreLt = 1.2; // BigDecimal | Filter threats with score less than this value
$scoreEq = 1.2; // BigDecimal | Filter threats with score equal to this value
$scoreGe = 1.2; // BigDecimal | Filter threats with score greater than or equal to this value
$scoreLe = 1.2; // BigDecimal | Filter threats with score less than or equal to this value
$createdAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats created after this date (RFC3339 format)
$createdBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats created before this date (RFC3339 format)
$modifiedAfter = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified after this date (RFC3339 format)
$modifiedBefore = 2013-10-20T19:20:30+01:00; // Date | Filter threats modified before this date (RFC3339 format)
try {
$result = $api_instance->getThreatModelThreats($threatModelId, $limit, $offset, $sort, $name, $description, $threatType, $severity, $priority, $status, $diagramId, $cellId, $scoreGt, $scoreLt, $scoreEq, $scoreGe, $scoreLe, $createdAfter, $createdBefore, $modifiedAfter, $modifiedBefore);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ThreatModelSubResourcesApi->getThreatModelThreats: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ThreatModelSubResourcesApi;
my $api_instance = WWW::SwaggerClient::ThreatModelSubResourcesApi->new();
my $threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Unique identifier of the threat model (UUID)
my $limit = 56; # Integer | Maximum number of threats to return
my $offset = 56; # Integer | Number of threats to skip
my $sort = sort_example; # String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc)
my $name = name_example; # String | Filter by threat name (partial match)
my $description = description_example; # String | Filter by threat description (partial match)
my $threatType = threatType_example; # String | Filter by threat type (exact match)
my $severity = severity_example; # String | Filter by severity level (exact match)
my $priority = priority_example; # String | Filter by priority (exact match)
my $status = status_example; # String | Filter by status (exact match)
my $diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Filter by diagram ID (exact match)
my $cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; # UUID | Filter by cell ID (exact match)
my $scoreGt = 1.2; # BigDecimal | Filter threats with score greater than this value
my $scoreLt = 1.2; # BigDecimal | Filter threats with score less than this value
my $scoreEq = 1.2; # BigDecimal | Filter threats with score equal to this value
my $scoreGe = 1.2; # BigDecimal | Filter threats with score greater than or equal to this value
my $scoreLe = 1.2; # BigDecimal | Filter threats with score less than or equal to this value
my $createdAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threats created after this date (RFC3339 format)
my $createdBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threats created before this date (RFC3339 format)
my $modifiedAfter = 2013-10-20T19:20:30+01:00; # Date | Filter threats modified after this date (RFC3339 format)
my $modifiedBefore = 2013-10-20T19:20:30+01:00; # Date | Filter threats modified before this date (RFC3339 format)
eval {
my $result = $api_instance->getThreatModelThreats(threatModelId => $threatModelId, limit => $limit, offset => $offset, sort => $sort, name => $name, description => $description, threatType => $threatType, severity => $severity, priority => $priority, status => $status, diagramId => $diagramId, cellId => $cellId, scoreGt => $scoreGt, scoreLt => $scoreLt, scoreEq => $scoreEq, scoreGe => $scoreGe, scoreLe => $scoreLe, createdAfter => $createdAfter, createdBefore => $createdBefore, modifiedAfter => $modifiedAfter, modifiedBefore => $modifiedBefore);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ThreatModelSubResourcesApi->getThreatModelThreats: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.ThreatModelSubResourcesApi()
threatModelId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Unique identifier of the threat model (UUID)
limit = 56 # Integer | Maximum number of threats to return (optional) (default to 20)
offset = 56 # Integer | Number of threats to skip (optional) (default to 0)
sort = sort_example # String | Sort order (e.g., created_at:desc, name:asc, severity:desc, score:desc) (optional) (default to created_at:desc)
name = name_example # String | Filter by threat name (partial match) (optional)
description = description_example # String | Filter by threat description (partial match) (optional)
threatType = threatType_example # String | Filter by threat type (exact match) (optional)
severity = severity_example # String | Filter by severity level (exact match) (optional)
priority = priority_example # String | Filter by priority (exact match) (optional)
status = status_example # String | Filter by status (exact match) (optional)
diagramId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Filter by diagram ID (exact match) (optional)
cellId = 38400000-8cf0-11bd-b23e-10b96e4ef00d # UUID | Filter by cell ID (exact match) (optional)
scoreGt = 1.2 # BigDecimal | Filter threats with score greater than this value (optional)
scoreLt = 1.2 # BigDecimal | Filter threats with score less than this value (optional)
scoreEq = 1.2 # BigDecimal | Filter threats with score equal to this value (optional)
scoreGe = 1.2 # BigDecimal | Filter threats with score greater than or equal to this value (optional)
scoreLe = 1.2 # BigDecimal | Filter threats with score less than or equal to this value (optional)
createdAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threats created after this date (RFC3339 format) (optional)
createdBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threats created before this date (RFC3339 format) (optional)
modifiedAfter = 2013-10-20T19:20:30+01:00 # Date | Filter threats modified after this date (RFC3339 format) (optional)
modifiedBefore = 2013-10-20T19:20:30+01:00 # Date | Filter threats modified before this date (RFC3339 format) (optional)
try:
# List threats in a threat model
api_response = api_instance.get_threat_model_threats(threatModelId, limit=limit, offset=offset, sort=sort, name=name, description=description, threatType=threatType, severity=severity, priority=priority, status=status, diagramId=diagramId, cellId=cellId, scoreGt=scoreGt, scoreLt=scoreLt, scoreEq=scoreEq, scoreGe=scoreGe, scoreLe=scoreLe, createdAfter=createdAfter, createdBefore=createdBefore, modifiedAfter=modifiedAfter, modifiedBefore=modifiedBefore)
pprint(api_response)
except ApiException as e:
print("Exception when calling ThreatModelSubResourcesApi->getThreatModelThreats: %s\n" % e)