Sunteți pe pagina 1din 37

Aticara PcapStorm API Reference

Copyright © Aticara Technologies Pvt Ltd. 2019. All rights reserved.


No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent Aticara technologies .

Trademarks and Permissions

and other aticara trademarks are trademarks of Aticara Technologies PVT LTD
All other trademarks and trade names mentioned in this document are the property of their respective
holders.

Notice
The purchased products, services and features are stipulated by the contract made between Aticara and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every effort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.

Aticara Technologies Pvt Ltd


Bangalore-560084
India

http://www.aticara.com
support@aticara.com
Aticara PcapStorm API Reference
Aticara Django REST API Architecture
REST Web Service :

Representational State Transfer (REST) is a software architectural style that defines a set of
constraints to be used for creating Web services. Web services that conform to the REST architectural style,
called RESTful Web services (RWS), provide interoperability between computer systems on the Internet.

Web service APIs that adhere to the REST architectural constraints are called RESTful APIs. HTTP-based
RESTful APIs are defined with the following aspects:

 A base URI, such as http://api.example.com/collection/;


 standard HTTP methods (e.g., GET, POST, PUT, PATCH and DELETE);
 A media type that defines state transition data elements (e.g., Atom, microformats etc.).The
current representation tells the client how to compose requests for transitions to all the next
available application states. This could be as simple as a URI or as complex as a Java applet.

With REST, networked components are a resource you request access to -- a black box whose
implementation details are unclear. The presumption is that all calls are stateless; nothing can be retained
by the RESTful service between executions.

Because the calls are stateless, REST is useful in cloud applications. Stateless components can be freely
redeployed if something fails, and they can scale to accommodate load changes. This is because any
request can be directed to any instance of a component; there can be nothing saved that has to be
remembered by the next transaction.

About Django:

Django is a Python-based free and open-source web framework, which follows the model-
template-view (MTV) architectural pattern.

It is a lightweight and standalone web server for development and testing ,support for middleware classes
that can intervene at various stages of request processing and carry out custom functions ,an interface to
Python's built-in unit test framework.

Some well-known sites that use Django include the Public Broadcasting Service,Instagram,Mozilla, The
Washington Times,Disqus,Bitbucket,and Nextdoor.

Django can be run in conjunction with Apache, Nginx using WSGI, Gunicorn, or Cherokee using flup (a
Python module).Django also includes the ability to launch a FastCGI server, enabling use behind any web
server which supports FastCGI, such as Lighttpd or Hiawatha. It is also possible to use other WSGI-
compliant web servers.Django officially supports four database backends: PostgreSQL, MySQL, SQLite, and
Oracle. Microsoft SQL Server can be used with django-mssql on Microsoft operating systems,while similarly
external backends exist for IBM Db2,SQL Anywhere and Firebird.

Page 2
Aticara PcapStorm API Reference
Aticara Django REST APIs:

Aticara provides software based 1/10/25/40/50/100 Gbps traffic emulator which can match/beat any
expensive FPGA based traffic emulator in the market in terms of throughput, performance and cost per
port.It basically has features like Bytestorm,PcapStorm ,Webstorm,Quickstorm,DDOS etc which performs
various functionalities.

Aticara needs REST APIs to compute operations that are performed by these features without the aid of
User Interface. Hence Django REST APIs became an integral part of Aticara middleware.

Mechanism of Aticara Django REST APIs:

One of the main differences between DRF and other frameworks is that it allows developer to define URL
structure and not rely on an auto-generated one, while others automate much of the conversion from
Django models to REST endpoints, thus are less flexible. Moreover, Django REST Framework includes built-
in API browser for testing out newly developed API.

Mechanism is very simple and just like any other REST API , REST Automation User on REST Client Side will
be sending request as per his need with the help of specific URL and request pattern .Server running on the
other Side will receive this request and process it with the help of Django server which is nothing but
Aticara REST Automation Server which inturn will be connected to Aticara Backend [Aticara Dashboard
and MYSQL Database], Performs Required operation and responds back to the Client.

Django's configuration system allows third party code to be plugged into a regular project, provided that it
follows the reusable app conventions. More than 2500 packages are available to extend the framework's
original behavior, providing solutions to issues the original tool didn't tackle: registration, search, API
provision and consumption, CMS, etc.

Page 3
Aticara PcapStorm API Reference
1.1 API Communication Protocols
 APIs use the HTTPS v1.1 (RFC 2616) protocol.
 Access port ID

Port ID Description

26335 Indicates the access port ID of APIMLBService.

31943 Indicates the access port ID of ERService.

1.2 Coding Format


 Request and response packets use the JSON format (RFC4627).

Request packets received by APIs and response packets returned by APIs must be in the JSON format.
(The format of APIs for upload and download depends on the API definitions.)
 The MIME type is application/json.
 All APIs use the UTF-8 encoding format.

1.3 URL
CloudOpera APIs are designed based on the concepts of RESTful APIs.

REST, a network consists of resources. Resources are identified by Uniform Resource Identifiers (URIs)
across the network. Applications from a client obtains resources through Uniform Resource Locators
(URLs).

The RESTful URL of resources use the following format:

https://ip:port/{api-root}/{external-service-name}/{version}/{rest-path}

Table 1-1 Description of RESTful URLs

Element Description

ip:port Entry of the service interface.

api-root Service interface.

external-service-name Service name.

Page 4
Aticara PcapStorm API Reference
Element Description

version Version number.

rest-path Resource path in the service.

For example, the API for obtaining basic information about all rules is:
http://localhost:8086/rest/uam/v1/roles.

Table 1-2 describes the elements of the URL.

Table 1-2 Elements of the URL

Element Example Description

Entry of the service interface http://localhost:8086 Other services access the


service interface through
http://ip:port/rest/
interface.

Service interface ID /rest By default, /rest is used but


it is not required.
Adding /rest can distinguish
the service interface
resource from other
resources (for example,
static file resource) in the
same process. Other
character strings can be
used for non-service APIs,
for example, APIs for pages
can use /ui as the service
interface ID.

Service name /uam The value can be different


from the corresponding
service or microservice
name.

Version number /v1 The version number of the


service API is v1.

Resource path in the service /roles Path for basic information


about all roles.

Page 5
Aticara PcapStorm API Reference

 The URL can contain file path parameters, for example, in


https://localhost:8086/rest/uam/v1/roles/{parm1}/{parm2}, parm1 and parm2 are path
parameters. You can also add query conditions by using question marks (?) and ampersands (&).
For example, in
http://localhost:8086/rest/uam/v1/roles/{parm1}/{parm2}?parm3=value3&parm4=value4, parm3
and parm4 are query parameters, value3 and value4 are their corresponding values.
 The URL must not contain URL special characters (defined by the RFC1738 standard). Encode the
URL if special characters must be used.

1.4 API Authentication


The following describes the process of API authentication:

Step 1 Log in to the system through the URL /v3/auth/tokens.

There are two authentication modes for invoking APIs. Choose any one of them to perform authentication.

 Token authentication: Invokes requests through token authentication. For details about
the toke authentication, see section "Obtaining the User Token."
 AK/SK authentication: Invokes requests through Access Key ID (AK)/Secret Access Key
(SK) encryption. AK/SK authentication is more secure. For details, see section
"Obtaining a User Token Using an AK."
Step 2 A token value is returned after each successful login.

Step 3 Each request must use this token value for authentication.

1.5 Request
Request Methods
According to the REST specifications, all operations performed on resources must comply with the HTTP
specifications.

The key operations include the following: GET, PUT, POST, and DELETE. The operation performed on
resources can be classified into: create, retrieve, update, and delete (CRUD).

Table 1-3 Mapping between request methods and resources

Request Method Resource Operation

GET Obtaining resources

POST Creating resources

PUT Replacing existing resources

Page 6
Aticara PcapStorm API Reference
Request Method Resource Operation

DELETE Deleting existing resources

 If the requested URL does not support this operation, status code 405 (Method Not Allowed) is
returned.
 The PATCH request method is not supported.
For details about restrictions of each operation, see the following.

GET
[Use scenario] This method is used to obtain resources.

[Status code] If the request is successful, the status code 200 (OK) is returned.

[Restrictions] The request method meets security and idempotence requirements.

The security requirement means that the operation does not change the server status. The
idempotence requirement means that relative status change is not allowed for the resource.

POST
[Use scenario] This method is used to create resources in the scenario where operations cannot be
expressed by CRUD (non-CRUD).

[Status code] If the resource is created successfully, the status code 200 (OK) or 201 (Created) is returned.
In the non-CRUD scenario, the status code 200 (OK) is returned.

[Restrictions] The request method does not meet security and idempotence requirements.

PUT
[Use scenario] This method is used to fully update resources. If the object to be updated does not exist, the
object will be created.

For example, PUT /users/admin means to create one user whose id is admin and set the user attribute
information if user admin does not exist. If user admin already exists, then all of its information is
replaced.
[Status code] If the resource is created successfully, the status code 201 (Created) is returned. If the
resource is updated successfully, the status code 200 (OK) is returned.

[Restrictions] The request method meets idempotence requirements.

Page 7
Aticara PcapStorm API Reference
DELETE
[Use scenario] This method is used to delete resources.

[Status code] If the resource is deleted successfully, the status code 200 (OK) is returned. If the resource to
be deleted does not exist, the status code 204 (No Content) is returned. If a service receives the request
but the resource is not deleted immediately, the status code 202 (Accepted) is returned.

[Restrictions] The request method meets idempotence requirements.

Operation severity
Table 1-4 lists the operation severity in this document.

Table 1-4 Operation severity

Severity Description

Risk Corresponding to the deletion operation. This operation will cause


services or resources to be deleted. Exercise caution.

Minor Corresponding to operations except deletion and query. This


operation will not cause irreversible impact on services or resources.

Info Corresponding to the query operation. This operation does not


change services and resource data.

1.6 Response
Response Type
Unless otherwise specified, the returned result for each request is identified with a status code. For details,
see the description of status codes.

The APIs of Aticara CloudOpera Orchestrator can be classified into synchronous APIs and asynchronous
APIs.

Synchronous APIs
For synchronous APIs, a response is returned within 30 s, and the returned result is mainly identified by
HTTP status code. For details, see the description of the related APIs.

An example returned result is as follows:

Page 8
Aticara PcapStorm API Reference
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Content-Length: 298
{"operations" : [ {
"operation_id" : "31af59f1dc72437cb1c8f71e6e1b84a8",
"operation" : "Create",a
"result" : {
"result" : "success ",
"reason" : ""},
"user_id" : "89af59f1dc72437cb1c8f71e6e1b84by ",
"operation_content": "",
"progress" : "done",
"operate_at" : "1447259909284",
"finished_at" : "1447158572834"
"task_uri":
"/decomposer/v1/tasks/f912a4b3e1954ab5a34d1b544b4b209b"
}]}

Asynchronous APIs
Asynchronous APIs are used for operations that may take a long time, up to date “Asynchronous API” is
listed in Chapter 5.1. When receiving a request, the background service will initiate a task to perform the
expected operation, meanwhile the server end will immediately returns Status Code 202 with
“operation_id” included in the response body. The requester can initiate a GET operation with the specified
“operation _id” to obtain the execution progress of the task, the get API is described in chapter “2.1.6
Querying the operation of a service”.

There are two ways to tacking the specified operation task:

1. Initiate a polling task on the API

("https://accessip:port/rest/servicemanager/v1/services/{serviceID}/operations/{operationID}")

2. Using the callback URL to IES, please refer to Section “5 IES Async-Job Callback Service”

Timeout Period
The REST APIs of Aticara CloudOpera have a fixed timeout period of 30s.

Page 9
Aticara PcapStorm API Reference

Status Code
Status codes

Status Code Description

200 OK A request is successfully received, and the


request response header or data body will
be sent in the response.

2 201 Created For asynchronous APIs. When the POST or


PUT operation is successful, the status code
201 (Created) is returned with the URI in
the Location field of the new resource in
the message header.

202 Accepted A request has been processed, a new


resource has been provided as requested,
and the URI has been sent in the location
header information.

206 Partial Content The server has processed some GET


requests.

302 Found The requested resource resides temporarily


under a different URI. Since the redirection
might be altered on occasion, the client
should continue to use the URI for future
requests.

303 See Other The response to the request can be found


under another URI using a GET method.
When received in response to a POST (or
PUT/DELETE), the client should presume
that the server has received the data and
should issue a redirect with a separate GET
message.

304 Not Modified The resource has not been modified since
the version specified by the request
headers If-Modified-Since or If-None-
Match. In such case, there is no need to
retransmit the resource since the client still
has a previously downloaded copy.

400 Bad Request The server cannot or will not process the
request due to an apparent client error
(e.g., malformed request syntax, invalid
request message framing, or deceptive
request routing).

Page 10
Aticara PcapStorm API Reference
Status Code Description

401 Unauthorized Similar to 403 Forbidden, but specifically


for use when authentication is required and
has failed or has not yet been provided. The
response must include a WWW-
Authenticate header field containing a
challenge applicable to the requested
resource.

403 Forbidden The request was a valid request, but the


server is refusing to respond to it. 403 error
semantically means "unauthorized", i.e. the
user does not have the necessary
permissions for the resource. If the cause
cannot be disclosed, 404 NotFound is
returned.

404 Not Found The server has not found anything


matching the Request-URI. No indication is
given of whether the condition is
temporary or permanent. If the server does
not wish to make this information available
to the client, the status code 403
(Forbidden) can be used instead. The 410
(Gone) status code SHOULD be used if the
server knows, through some internally
configurable mechanism, that an old
resource is permanently unavailable and
has no forwarding address. This status code
is commonly used when the server does
not wish to reveal exactly why the request
has been refused, or when no other
response is applicable.

405 Moehod Not Allowed The method specified in the Request-Line is


not allowed for the resource identified by
the Request-URI. The response must
include an Allow header containing a list of
valid methods for the requested resource.
The PUT and DELETE methods will perform
write operations on the resources on the
server. However, most of the web servers
do not support the preceding method or
does not support the method in the default
configuration. Therefore, error 405 error is
always returned for this type of request.

Page 11
Aticara PcapStorm API Reference
Status Code Description
409 Conflict
The request could not be processed
because of conflict in the request, such as
an edit conflict between multiple
simultaneous updates.

414 Request-URI Too Long The URL can contain a maximum of 2083
characters.

429 Too Many Requests The user has sent too many requests in a
given amount of time.

500 Internal Server Error A generic error message, given when an


unexpected condition was encountered
and no more specific message is suitable.

502 Bad Gateway The server was acting as a gateway or proxy


and received an invalid response from the
upstream server.

503 Service Unavailable The server is currently unavailable (because


it is overloaded or down for maintenance).
Generally, this is a temporary state.

Timeout Period
The REST APIs of Aticara Cloud Opera Orchestrator have a pre-set timeout period of 30s.

1.7 Request Header


Parameter Description Mandato Example
Name ry

Accept Indicates which content types, Yes text/xml,application/xml,application/xhtml


expressed as Multipurpose +xml,application/json
Internet Mail Extensions (MIME)
types, the client is able to
understand in the type/sub-type
format. Unless otherwise
specified, the value is
application/json for all APIs
described in this document.

Accept-Charset Indicates which character set the Yes utf8


client is able to understand. The
Content-Type response header

Page 12
Aticara PcapStorm API Reference
Parameter Description Mandato Example
Name ry
specifies the HTTPS body encoding
format, for example, charset=utf8.
Unless otherwise specified, the
value is utf8 for all APIs described
in this document.

Content-Type Indicates the media type of the Yes application/json


request. Unless otherwise
specified, the value is
application/json for all APIs
described in this document. If the
encoding format is not JSON, the
value is the actual packet type.

X-Auth-Token Indicates the authentication No eaaafd18-0fed-4b3a-81b4-663c99ec1cbb


token, which is used to
authenticate APIs. The API that
obtains the authentication token
does not require this parameter.

x-auth-type Indicates the authentication mode No token


which can be aksk and token. By
default, the value is token if this
header is not required.

Content-Length Indicates the bytes of the request No 1801


body sent to the recipient.

1.8 Response Header


Parameter Name Description Mandato Example
ry

Content-Type Indicates the object types sent by the Yes application/json;charset=utf8


browser that the web server responds
to. Unless otherwise specified, the value
is application/json;charset=utf8 for all
APIs described in this document. If the
encoding format is not JSON, the value
is the actual packet type.

Cache-Control Indicates the directives for caching No public


mechanisms in requests and responses.
The values are public, private, no-cache,

Page 13
Aticara PcapStorm API Reference
Parameter Name Description Mandato Example
ry
no-store, no-transform, must-
revalidate, proxy-revalidate, max-age,
min-fresh, and max-stale.
 public: Indicates that the response
may be cached by any cache.
 private: Indicates that the response
is intended for a single user and must
not be stored by a shared cache. The
server responds to only part of the
responses of a single user. The
responses are invalid to requests
from other users.
 no-cache: The requests or responses
cannot be cached.
 no-store: Important information is
prevented from being published
mistakenly. If this value is sent in
requests, the cache does not store
anything about the requests and
responses.
 no-transform: The proxy server is
forbidden from modifying Content-
Encoding, Content-Range, and
Content-Type.
 must-revalidate: If the client has
cached data, after the client obtains
the data, the client compares the
obtained data with the cached data
for verification even though the
cached data is still valid.
 proxy-revalidation: If the proxy
server has cached data, after the
client obtains the data, the proxy
server compares the obtained data
with the cached data for verification
even though the cached data is still
valid.
 max-age: Specifies the maximum
amount of time a resource will be
considered fresh in seconds.
 min-fresh: Indicates that the client
wants a response that will still be
fresh for at least the specified

Page 14
Aticara PcapStorm API Reference
Parameter Name Description Mandato Example
ry
number of seconds.
 max-stale: Indicates that the client is
willing to accept a response that has
exceeded its expiration time. If the
value of max-stale is specified, you
specify the time the response must
not be expired by.

Location Indicates the URI of the resource in the No /users/userxxx


Location field of the response after the
resource is successfully created by the
POST or PUT operation.

Content-Length Indicates the bytes of the response body No 1001


sent to the recipient.

Page 15
Aticara PcapStorm API Reference
1.GET reserveports
This API returns information about all the Ports that are reserved!
Request URL: Example Request:
https://accessip:port/reserveports/ Reserveports

curl --location --request GET


"https://accessip:port/reserveports/"

Example Response
200 - OK

[
{
"port_id": 0,
"port_name": "Port 0",
"port_status": 1,
"port_reserve": 0,
"port_mac": "00:0c:29:fc:48:02",
"port_user": "",
"port_user_id": 1,
"port_host": "localhost",
"port_flows": 100,
"port_streams": 1,
"port_data": 0,
"port_capture": 0,
"port_stats": 0,
"port_pci": "0",
"port_feature": 0,
"port_test_id": 0,
"port_test_name": "",
"port_arp": 0,
"port_icmp": 0,
"port_speed": 10000
},

Page 16
Aticara PcapStorm API Reference
2.PUT reserveports
Thi API is to reserve the unreserved Ports.

REQUEST URL:
curl --location --request PUT
https://accessip:port/reserveports/
"https://accessip:port/reserveports/" \
HEADERS
--header "Content-Type: application/json" \
--data "{
Content-Type \"port_id\":3,
\"port_name\": \"Port 3\",
application/json
\"port_status\": 1,
BODY raw \"port_reserve\": 1,
\"port_user\": \"test\",
{ \"port_user_id\": 99
"port_id": 1, }"
"port_reserve": 1,
"port_user": "test", Example Response
"port_user_id": 99
} {
"Error message": "Port is Already reserved"
}

Page 17
Aticara PcapStorm API Reference
3.GET createtestbed
This API returns the list of TestBeds that are created.

Example Request
Request URL:
curl --location --request GET
"https://accessip:port/createtestbed/"
https://accessip:port/createtestbed/

Example Response
200 - OK

[
{
"test_id": 5,
"feature_id": 3,
"user_id": 99,
"num_ports": 2,
"port1": 0,
"port2": 1,
"latency": 0,
"test_time": 0,
"test_name": "shalini",
"chart_index": 0,
"test_stop_time": null,
"test_start_time": null
}
]

Page 18
Aticara PcapStorm API Reference
4.POST createtestbed
This API is to create Testbed with appropriate name .

Example Request
Request URL:
createtestbed_200_ok
https://accessip:port/createtestbed/
curl --location --request POST
"https://accessip:port/createtestbed/" \
HEADERS --header "Content-Type: application/json" \
--data "{
\"test_id\": 1,
Content-Type \"feature_id\": 1,
application/json \"user_id\": 99,
\"test_name\": \"ByteStorm\"
BODY raw }"

{
"test_id": 1,
"feature_id": 3, Example Response
"user_id": 99,
"test_name": "PcapStorm" 201 - Created
}
{
"Message": "Testbed Created Successfully!",
"Test ID": 2
}

Page 19
Aticara PcapStorm API Reference
5.GET addportstotestbed
This API returns the list of ports that are added to testbed.

Request URL: Example Request


Addportstotestbed
https://accessip:port/addportstotestbed/

curl --location --request GET


"https://accessip:port/addportstotestbed/"

Example Response
200 - OK

[
{
"port_id": 0,
"port_name": "Port 0",
"port_status": 1,
"port_reserve": 0,
"port_feature": 0,
"port_test_id": 0,
"port_test_name": " "
},
{
"port_id": 1,
"port_name": "Port 1",
"port_status": 1,
"port_reserve": 0,
"port_feature": 0,
"port_test_id": 0,
"port_test_name": " "
}
]

Page 20
Aticara PcapStorm API Reference
6.PUT addportstotestbed
This API is used to add ports to testbed.
Request URL: Example Request

https://accessip:port/addportstotestbed/ addportstotestbed_200_ok

HEADERS
curl --location --request PUT
"https://accessip:port/addportstotestbed/" \
Content-Type --header "Content-Type: application/json" \
application/json --data "{
\"port_id\": 3,
BODY raw \"port_feature\": 1,
\"port_test_id\": 2,
\"port_test_name\": \"PcapStorm \"
{
}
"port_id": 1,
"
"port_feature": 3,
"port_test_id": 1,
"port_test_name": "PcapStorm" Example Response
}
200 - OK

{
"port_id": 3,
"port_name": "Port 3",
"port_status": 1,
"port_reserve": 1,
"port_feature": 1,
"port_test_id": 2,
"port_test_name": "ByteStorm"
}

Page 21
Aticara PcapStorm API Reference
7.GET selectedpcaps:
Request URL: Example Request
curl --location --request GET
https://accessip:port/ selectedpcaps/?testId=4 "http://192.168.174.20:8080/selectedpcaps/?testId=3"

Example Response:
PARAMS 200 - OK

testId {
"1": "Zomato",
4 "2": "Facebook_messenger",
"3": "Isoke_messenger_log_out.pcap",
"4": "Isoke_messenger_audio_call_not_reachable.pcap",
"5": "Isoke_messenger_voice_call_not_reachable.pcap",
"6": "Isoke_messenger_settings.pcap",
"7": "Isoke_audio_call.pcap",
"8": "Isoke_video_call.pcap",
"9": "Isoke_messenger_search_people.pcap",
"10": "Isoke_messeger_login.pcap",
"11": "Isoke_leave_group.pcap",
"12": "Isoke_messenger_rating_audio_call.pcap",
"13": "Isoke_messenger_report_problem.pcap",
"14": "Isoke_messenger_sending_messages.pcap",
"15": "Isoke_mute_notification.pcap"
}

Page 22
Aticara PcapStorm API Reference
8.PUT Selectapps:
Request URL: Example Request:

https://accessip:port/addpcap/?pcap=Zomato&testId= curl --location --request PUT


"http://192.168.174.20:8080/addpcap/?pcap=Facebook_messenger&testId=3"
2
Example Response:
PARAMS:
200 - OK
pcap
{
Zomato "Message": "Successfully Selected related Pcaps!"
Select from the below list }
['Mediafire','Tweeter','Ebay','IMDB','Snapchat','Hotstar','ihe
artradio','Snapfish','BIGflix','Pinterest','DropBox','Instagram',
'Vimeo','Facebook_messenger','Uber','github','Veoh','Perisc
ope','howstuffsworks','Googleplay','LinkedIN','Tinder','4shar
ed','Amazon','Zomato','Tumblr','Facebook','Netflix','Bittorre
nt']

testId
2

9.PUT CreateFolder:
Request URL: Example Request:

curl --location --request PUT


https://accessip:port/createfolder/?foldername=test1 "http://192.168.174.20:8080/createfolder/?foldername=test2"

PARAMS Example Response:


200 - OK
foldername {
"Message": "Successfully created the folder!"
test1 }

Page 23
Aticara PcapStorm API Reference

.
10 DEL Deletefolder:
Request URL: Example Request:

curl --location --request DELETE


https://accessip:port/deletefolder/?foldername=sampl "http://192.168.174.20:8080/deletefolder/?foldername=test1"
e
Example Response:
PARAMS
200 - OK
{
"Message": "Successfully deleted the folder!"
foldername }
test1

11. DEL Deselect Folder:


Request URL: Example Request:

curl --location --request DELETE


https://accessip:port/ deselectpcaps/?pcapname=Is "http://192.168.174.20:8080/deselectpcaps/?pcapname=isooke_4shared_search
oke_Amz_singup.pcap&testId=1 .pcap&testId=5"

Example Response:
PARAMS
200 - OK
{
pcapname "Message": "Successfully Deselected related Pcap!"
}
Isoke_Amz_singup.pcap

testId

Page 24
Aticara PcapStorm API Reference
12.PUT Uploadpcap:
Request URL: Example Request:

curl --location --request PUT


https://accessip:port/ploadpcap/?path=C:\Users\iSOKE "http://192.168.174.20:8080/uploadpcap/?path=C:%5CUsers%5CiSOKE%5CDeskt
\Desktop\desktop_files\port_15_1_16_14_04_17_09_2019. op%5Cdesktop_files%5Cport_15_1_16_14_04_17_09_2019.pcap&foldername=t
est2"
pcap&foldername=sample
Example Response:
PARAMS 200 - OK
path {
"Message": "Successfully Uploaded Pcap file!"
C:\Users\iSOKE\Desktop\desktop_files\port_15_1_16_14_04_17_09_20 }
19.pcap

foldername

sample

13.GET PcapClientConfig
Example Request:
Request URL:
curl --location --request GET
https://accessip:port/clientconfig/?testId=1&portId=2 "https://accessip:port/clientconfig/?testId=3&portId=2"

Example Response:
200 - OK

PARAMS:
[
testId
{
"client_ovlan_id": 700,
2 "client_vlan": 2,
portId "client_eip": "10.0.11.95",
"client_ivlan_id": 800,
2 "client_sip": "10.0.0.2",
"clients": 258,
"client_port": 2,
"client_mask": "255.255.255.0",
"client_dhcp": 0,
"client_vlan_id": 100,
"client_mac": "00:0c:29:fc:48:ee"
}
]

Page 25
Aticara PcapStorm API Reference
14.PUT PcapClientConfig
REQUEST URL: Example Request

https://accessip:port/clientconfig/?testId=1&portId=2 curl --location --request PUT


"http://192.168.174.20:8080/clientconfig/?testId=3&portId=2"
\
HEADERS --header "Content-Type: application/json" \
Content-Type: application/json --data "{
\"clients\": 258,
\"client_mac\": \"00:0c:29:fc:48:ee\",
PARAMS: \"loopback\": 0,
\"gateway_cip\":\"10.0.0.3\",
testId \"client_vlan\": 2,
\"client_vlan_id\": 100,
1
\"client_ovlan_id\": 700,
\"client_ivlan_id\": 800,
portId
\"client_mask\": \"255.255.255.0\",
2
\"client_dhcp\": 0,
BODY raw \"client_sip\": \"10.0.0.8\",
\"csubnet\":26
}"

{
Example Response
"clients": 258,
200 - OK
"client_mac": "00:0c:29:fc:4 {
8:ee",
"Message": "Successfully Configured client Configuration"
"loopback": 0,
}
"gateway_cip":"10.0.0.3",
"client_vlan": 2,
"client_vlan_id": 100,
"client_ovlan_id": 700,
"client_ivlan_id": 800,
"client_mask": "255.255.255.0",
"client_dhcp": 0,
"client_sip": "10.0.0.8",
"csubnet":26
}

Page 26
Aticara PcapStorm API Reference
15.GET PcapServerConfig
REQUEST URL: Example Request
curl --location --request GET
"http://192.168.174.20:8080/serverconfig/?testId=5&portId=3"
https://accessip:port/serverconfig/?testId=1&portId=3
Example Response:
PARAMS
200 - OK

testId [[
1 {
"server_dhcp": 0,
portId "server_vlan_id": 100,
3 "server_port": 3,
"server_eip": "20.0.11.95",
"server_mac": "00:0c:29:fc:48:f8",
"server_vlan": 2,
"server_ip": "20.0.0.2",
"server_ovlan_id": 700,
"server_ivlan_id": 800,
"server_mask": "255.255.255.0"
}
]

Page 27
Aticara PcapStorm API Reference
16.PUT PcapServerConfig
Example Request:
Request URL:
https://accessip:port/serverconfig/?testId=1&portId=3 curl --location --request PUT
"http://192.168.174.20:8080/serverconfig/?testId=3&portI
d=3" \
PARAMS: --header "Content-Type: application/json" \
--data "{
\"server_mac\":
testId \"00:0c:29:fc:48:f8\",
\"loopback\": 0,
3
\"gateway_sip\":\"10.0.0.3\",
portId \"server_vlan\": 2,
\"server_vlan_id\": 100,
3
\"server_ovlan_id\": 700,
BODY raw \"server_ivlan_id\": 800,
\"server_mask\": \"255.255.255.0\",
\"server_dhcp\": 0,
{ \"server_ip\": \"10.0.0.2\"
"server_mac": "00:0c:29:fc:48:f8" }"
,
"loopback": 0, Example Response:
"gateway_sip":"10.0.0.3",
"server_vlan": 2, 200 - OK
"server_vlan_id": 100,
"server_ovlan_id": 700, {
"server_ivlan_id": 800, "Message": "Successfully Updated server configuration!"
"server_mask": "255.255.255.0", }

"server_dhcp": 0,
"server_ip": "10.0.0.2"
}

Page 28
Aticara PcapStorm API Reference
17.GET Aditionalconfig
Request URL:
https://accessip:port/additionalconfig/?testId=1 Example Request:

HEADERS: curl --location --request GET


"http://192.168.174.20:8080/additionalconfig/?testId=5&=" \
--header "Content-Type: application/json"
Content-Type

application/json
Example Response:
PARAMS: 200 - OK

testId [
1
{
"ip_port": 200,
"test_id": 5,
BODY raw
"ip_addr": "20.0.11.95",
"retries": 38,
"payload": 1,
{ "pps": 37891,
"cps": 5, "rtt": 234,
"rtt": , "dst_port": 1,
"pps": , "nat": 1,
"nat": , "ttl": 128,
"ip_addr": , "src_port": 0,
"ip_port": , "cps": 2000,
"port": , "port": 1,
"src_port": , "mode": 1
"dst_port": , }
"mode": , ]
"retries": ,
"ttl": ,
"payload": ,
"test_id":
}

Page 29
Aticara PcapStorm API Reference
18.PUT Aditionalconfig
REQUEST URL: Example Request

https://accessip:port/ additionalconfig/?testId=1 curl --location --request PUT


"http://192.168.174.20:8080/additionalconfig/?testId=5"
\
HEADERS --header "Content-Type: application/json" \
--data "{
\"cps\": 2001,
Content-Type
\"rtt\": 234,
application/json \"pps\": 37891,
\"nat\": 1,
PARAMS
\"ip_addr\": \"20.0.11.95\",
\"ip_port\": 201,
testId \"port\": 1,
\"src_port\": 0,
1
\"dst_port\": 1,
BODY raw \"mode\": 1 ,
\"retries\": 38,
\"ttl\": 128,
{ \"payload\": 1
"cps": 2001, }"
"rtt": 234,
"pps": 37891, Example Response
"nat": 1, 200 - OK
"ip_addr": "20.0.11.95", {
"Message": "Additional Configuration done Successfully!"
"ip_port": 201, }
"port": 1,
"src_port": 0,
"dst_port": 1,
"mode": 1 ,
"retries": 38,
"ttl": 128,
"payload": 1
}

Page 30
Aticara PcapStorm API Reference
19.GET PcapLoad Profile

Request URL: Example Request:

https://accessip:port/pcaploadprofileinfo/?testId=8 curl --location --request GET


"http://192.168.174.20:8080/pcaploadprofileinfo/?testId=7"
PARAMS
testId
Example Response:
8
200 - OK
{
"duration": 20,
"test_id": 7,
"iterations": 4,
"ramp_down": 5,
"ramp_up": 5
}

20. PUT PcapLoad Profile


This API is to create Testbed with appropriate name .

REQUEST URL: Example Request:

https://accessip:port/pcaploadprofileinfo/
curl --location --request PUT
"http://192.168.174.20:8080/pcaploadprofileinfo/" \
HEADERS --header "Content-Type: application/json" \
--data "{
\"load_profile\" : 1,
Content-Type
\"duration\": 22,
application/json \"iterations\": 4,
BODY raw
\"ramp_down\": 9,
\"ramp_up\": 7,
\"test_id\":5
{ }"
"load_profile" : 1,
"duration": 22,
"iterations": 4,
"ramp_down": 9, Example Response:
"ramp_up": 7,
"test_id":7 200 - OK
{
}
"Message": "Successfully set load profile!"
}

Page 31
Aticara PcapStorm API Reference
21.GET summary of configured Parameters:
Request URL: Example Request:

curl --location --request GET "http://192.168.174.20:8080/pcapsummary/?testId=5"

https://accessip:port/pcapsummary/?testId=4
Example Response:
PARAMS 200 - OK

{
testId "Subnet": 24,
4 "Server_IP": "20.0.0.2",
"RX_Port": 1,
"Port_Number": "Enabled",
"NAT": "One-To-One",
"Client_MAC": "00:0c:29:fc:48:02",
"Client_IP": "10.0.0.2",
"No_of_Clients": 258,
"Client_IVLAN_ID": 800,
"Server_OVLAN_ID": 700,
"RTT": 234,
"Load Profile Details": {
"Load_Profile": "Enabled",
"Iteration": 4,
"Ramp_Down": 9,
"Ramp_Up": 7
},
"TX_Port": 0,
"IP_Address": "20.0.11.95",
"Server_IVLAN_ID": 800,
"Server_MAC": "00:0c:29:fc:48:e4",
"Server_VLAN": "QinQ",
"IP_Mode_Server": "Manual",
"Mode": "Parallel",
"Destination_Port": 1,
"Client_OVLAN_ID": 700,
"Client_VLAN": "QinQ",
"IP_Mode_Client": "Manual",
"Source_Port": 0
}

Page 32
Aticara PcapStorm API Reference
22. PUT StartTraffic
This API Is to starts the Traffic..

REQUEST URL: Example Request:

https://accessip:port/starttraffic/?TestId=2&port_data=1
curl --location --request PUT
"http://192.168.174.20:8080/starttraffic/?TestId=2&port_data=1" \
--header "Content-Type: application/json"
HEADERS
Content-Type
application/json Example Response:
PARAMS 304 - Not Modified
{
"Message": "Traffic Started Already"
TestId }

2
port_data
1

Always 1
BODY formdata

23. PUT StartCapture


This API is to start Capturing the traffic.

REQUEST URL: Example Request:

https://accessip:port/startcapture/?TestId=2&port_capture=1 curl --location --request PUT


"http://192.168.174.20:8080/startcapture/?TestId=2&port_capture=1"

PARAMS Example Response:


TestId
200 - OK
2 {
"message": "Started capture Successfully"
port_capture }
1
Always 1

Page 33
Aticara PcapStorm API Reference
24.GET Trafficstatus
This API returns the status of Traffic.

Request URL: Example Request:

https://accessip:port/trafficstatus/?portId=1&testId=5 curl --location --request GET


"http://192.168.174.20:8080/trafficstatus/?portId=1&testId=5"

PARAMS Example Response:

PARAMS 200 - OK
{
"port_id": "1",
"port_data": 0
port_1 }
0

port_2

25. PUT StopCapture


This API is to stop Capturing the traffic.

REQUEST URL: Example Request:

https://accessip:port/stopcapture/?TestId=2&port_capture=0 stopcapture_304

PARAMS curl --location --request PUT


"https://accessip:port/stopcapture/?TestId=2&port_capture=1"
TestId
2 Example Response:
port_capture 304 - Not Modified
{
0 "Message": "Port_capture cannot be One!!"
Always 0 }

Page 34
Aticara PcapStorm API Reference
26. PUT StopTraffic
This API is to stop the traffic.

REQUEST URL: Example Request:

https://accessip:port/stoptraffic/?TestId=1&port_data=0 stoptraffic_304
PARAMS:
curl --location --request PUT "https://accessip:port/stoptraffic/?TestId=1&port_data=0"

TestId
Example Response:
1
304 - Not Modified
port_data {
"Message": "Traffic Stopped Already"
0 }
Always 0

27. DEL removeportfromtestbed


THis API is to delete the stream from a particular testbed.

Request URL: Example Request:


removeportfromtestbed_200
https://accessip:port/removeportfromtestbed/?portId=1&testI

d=2
curl --location --request DELETE
"https://accessip:port/removeportfromtestbed/?portId=2&testId=2"
PARAMS:
Example Response:
portId
1 200 - OK
{
testId "Message": "Successfully Removed port from testbed"
}
2

Page 35
Aticara PcapStorm API Reference
28. DEL deletetestbed
This API is to delete the given testbed.

Request URL: Example Request:


curl --location --request DELETE
https://accessip:port/deletetestbed/?testId=1&testName=P "http://192.168.174.20:8080/deletetestbed/?testId=2&testName=Pcapstorm"

capstorm

Example Response:
PARAMS: 200 - OK
{
"Message": "Test Bed Successfully Deleted"
testId }

1
testName
Pcapstrom

BODY formdata

29. DEL Releaseport


This API is to release the reserved ports.

Request URL: Example Request:

https://accessip:port/releaseport/?portId=1 releaseport_200
curl --location --request DELETE
"https://accessip:port/releaseport/?portId=2"
PARAMS:
Example Response:
portId
200 - OK
1 {
"Message": "Released Port Successfully",
"Port Id": "2",
"Port Status": 1
}

Page 36
Aticara PcapStorm API Reference
30. DEL DeleteLogs
Request URL: Example Request:
curl --location --request DELETE
"http://192.168.174.20:8080/deletelogs/?filename=Report_PcapStorm_2019_10_25_1
https://accessip:port/deletelogs/?filename=Report_PcapStorm 2_26_38.zip"

_2019_10_25_12_26_38.zip
Example Response:
200 - OK
PARAMS: {
"Message": "Successfully deleted the prf_file!"
}
filename

Report_PcapStorm_2019_10_25_12_26_38.zip

CONTACT US:

demo@aticara.com
sales@aticara.com
www.aticara.com
©2019 Aticara Technologies & systems Pvt Ltd . All rights reserved. Aticara reserves the right to make design changes without notice. As we are
always seeking to improve our products, the information in this document gives only a general indication of the product capacity, performance and
suitability, none of which shall form part of any contract. All trademarks are acknowledged.

Page 37

S-ar putea să vă placă și