Sie sind auf Seite 1von 38

Aticara AppStorm 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 AppStorm 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 AppStorm 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.

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.

Page 3
Aticara AppStorm API Reference
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.

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.

Page 4
Aticara AppStorm API Reference
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.

 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.

Page 5
Aticara AppStorm API Reference
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

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.

Page 6
Aticara AppStorm API Reference
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.

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.

Page 7
Aticara AppStorm API Reference
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:

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 ",

Page 8
Aticara AppStorm API Reference
"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.

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.

Page 9
Aticara AppStorm API Reference
Status Code Description

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).

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

Page 10
Aticara AppStorm API Reference
Status Code Description
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.

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.

Page 11
Aticara AppStorm API Reference
Status Code Description

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 CloudOpera 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
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

Page 12
Aticara AppStorm API Reference
Parameter Description Mandato Example
Name ry
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,
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.

Page 13
Aticara AppStorm API Reference
Parameter Name Description Mandato Example
ry
 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
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 14
Aticara AppStorm 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 15
Aticara AppStorm API Reference
2.PUT reserveports
Thi API is to reserve the unreserved Ports.

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

Page 16
Aticara AppStorm 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": 6,
"feature_id": 2,
"user_id": 99,
"num_ports": 2,
"port1": 2,
"port2": 3,
"latency": 0,
"test_time": 0,
"test_name": "AppStorm",
"chart_index": 89,
"test_stop_time": null,
"test_start_time": null
}
]

Page 17
Aticara AppStorm 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
"http://192.168.174.20:8080/createtestbed/" \
HEADERS --header "Content-Type: application/json" \
--data "{
\"test_id\": 1,
\"feature_id\": 1,
Content-Type \"user_id\": 99,
\"test_name\": \"AppStorm\"
application/json }"

BODY raw

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

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": " "
}
]

Page 18
Aticara AppStorm API Reference
6.PUT addportstotestbed
This API is used to add ports to testbed.
Request URL: Example Request
curl --location --request PUT
https://accessip:port/addportstotestbed/ "http://192.168.174.20:8080/addportstotestbed/" \
--header "Content-Type: application/json" \
HEADERS --data "{
\"port_id\": 3,
\"port_feature\": 2,
Content-Type \"port_test_id\": 6,
\"port_test_name\": \"AppStorm\"
application/json }
"
BODY raw
Example Response
{
"port_id": 2,
200 - OK
"port_feature": 2,
"port_test_id": 6, {
"port_test_name": "AppStorm" "port_id": 2,
} "port_name": "Port 2",
"port_status": 1,
"port_reserve": 1,
"port_feature": 2,
"port_test_id": 6,
"port_test_name": "AppStorm"
}

7.GET Selected Apps List:


Request URL: Example Request
curl --location --request GET
https://accessip:port/ selectapps/?testId=1 "https://accessip:port/selectapps/?testId=6"

Example Response:
PARAMS
200 - OK

testId [
{
1
"app_name": "Cab",
"track_id": 11,
"track_app": 1,
"app_id": 11,
"app_in_percentage": 33
}
]

Page 19
Aticara AppStorm API Reference
8.PUT Selectapps:
Request URL: Example Request:

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


"https://accessip:port/selectapps/?testId=6&AppsList=%5BP2p%5D"
HEADERS: \
--header "Content-Type: application/json" \
Content-Type --data ""
application/json
Example Response:
PARAMS: 200 - OK
testId {
"Message": "Successfully added Applications!"
1 }
AppsList
[P2p]

9.GET AppStormupdatetraffic
This API returns port configuration information.

Request URL: Example Request:

https://accessip:port/updatetraffic/?testId=1 curl --location --request GET


"https://accessip:port/updatetraffic/?testId=1"

Example Response :
PARAMS: 200 - OK

testId {
"Radio": [
1
{
"iheartradio": 100,
"Radio": 35
}
],
"P2p": [
{
"4shared": 25,
"P2p": 35,
"Bittorrent": 75
}
],
"Ecommerce": [
{

Page 20
Aticara AppStorm API Reference
"Amazon": 35,
"Ecommerce": 30,
"Zomato": 30,
"Ebay": 35
}
]
}

10.PUT Main_updatetraffic
REQUEST URL: Example Request:

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


"https://accessip:port/updatetraffic/?testId=1" \
--header "Content-Type: application/json" \
HEADERS: --data "{
\"Radio\":\"35%\",
\"P2p\":\"35%\",
Content-Type \"Ecommerce\":\"30%\"
}"
application/json
PARAMS
Example Response:
testId 200 - OK
1 {
"Message": "Sucessfully updated traffic"
BODY raw }

{
"Radio":"35%",
"P2p":"35%",
"Ecommerce":"30%"
}

Page 21
Aticara AppStorm API Reference
11.PUT Subappupdate
REQUEST URL: Example Request:

curl --location --request PUT


https://accessip:port/subappupdate/?testId=1 "https://accessip:port/subappupdate/?testId=1" \
--header "Content-Type: application/json" \
--data "{
\"P2p\": \"33%\",
HEADERS: \"4shared\": \"25%\",
\"Bittorrent\": \"75%\"
Content-Type }"

application/json
Example Response:
PARAMS
200 - OK
{
testId "Message": "Successfully Updated Traffic!"
1 }

BODY raw

{
"P2p": "33%",
"4shared": "25%",
"Bittorrent": "75%"
}

Page 22
Aticara AppStorm API Reference
12.GET AppClientConfig
Example Request:
Request URL:
curl --location --request GET
https://accessip:port/clientconfig/?testId=1&portId=1 "https://accessip:port/clientconfig/?testId=1&portId=1"

PARAMS:
testId
1
portId
1

13.PUT AppClientConfig
REQUEST URL: Example Request

https://accessip:port/hostconfig/ curl --location --request PUT


"http://192.168.174.20:8080/appblasterconfigclient/" \
--header "Content-Type: application/json" \
HEADERS --data "{
Content-Type: application/json
\"port_id\": 1,
\"port_feature\": 2,
BODY raw \"test_id\": 1,
\"port_test_name\": \"AppStorm\",
\"clients\": 1234,
{ \"client_mac\": \"00:0c:29:fc:48:ee\",
"port_id": 1, \"loopback\": 1,
"port_feature": 2, \"gateway_cip\":\"10.0.0.3\",
"test_id": 1, \"client_vlan\": 2,
"port_test_name": "AppStorm", \"client_vlan_id\": 100,
"clients": 1234, \"client_ovlan_id\": 700,
"client_mac": "00:0c:29:fc:4 \"client_ivlan_id\": 2234,
8:ee", \"client_mask\": \"255.255.255.0\",
"loopback": 1, \"client_dhcp\": 1,
"gateway_cip":"10.0.0.3", \"client_sip\": \"10.0.0.8\"
"client_vlan": 2, }"
"client_vlan_id": 100,
"client_ovlan_id": 700, Example Response
"client_ivlan_id": 2234, 200 - OK
"client_mask": "255.255.255.0", {
"client_dhcp": 1, "Message": "Successfully Configured Host Configuration"
"client_sip": "10.0.0.8" }
}

Page 23
Aticara AppStorm API Reference
14.GET AppServerConfig
Example Request:
Request URL:
curl --location --request GET
https://accessip:port/appblasterconfigserver/?testId=3&portId "https://accessip:port/appblasterconfigserver/?testId=6&portId
=3 =3"

PARAMS: Example Response:


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

Page 24
Aticara AppStorm API Reference
15.PUT AppServerConfig
REQUEST URL: Example Request

https://accessip:port/appblasterconfigserver/ --header "Content-Type: application/json" \


--data " {
\"pb_test_id\": 2,
HEADERS \"pb_port\": 2,
Content-Type: application/json \"pb_csubnet\": 24,
\"pb_hosts\": 255,
BODY raw \"pb_mac_addr_type\": 1,
\"pb_ip_addr_type\": 1,
\"pb_src_mac_address\": \"00:0c:29:11:11:21\",
{ \"pb_dst_mac_address\": \"00:0c:29:22:22:22\",
"port_id": 3, \"pb_src_ip_address\": \"10.0.0.1\",
"port_feature": 2, \"pb_dst_ip_address\": \"20.0.0.2\",
"test_id": 3, \"pb_mac_addr_range\": \"\",
"port_test_name": "AppStorm", \"pb_ip_addr_range\": \"0\",
"server_mac": "00:0c:29:fc:48:f8" \"pb_ip_addr_increment_factor\": 1,
, \"pb_mac_addr_increment_factor\": 1,
"loopback": 1,
\"pb_gw\": 0,
"gateway_sip":"10.0.0.3",
\"pb_gw_ip_addr\": \"10.0.0.1\"
"server_vlan": 2,
}"
"server_vlan_id": 4096,
"server_ovlan_id": 700,
"server_ivlan_id": 800, Example Response
"server_mask": "255.255.255.0", 200 - OK
"server_dhcp": 0, {
"server_ip": "10.0.0.2" "Message": "Successfully Configured Host Configuration"
}
}

Page 25
Aticara AppStorm API Reference
16.GET Aditionalconfig
Request URL:
https://accessip:port/appconfigadditional/?testId=5&=
Example Request:

curl --location --request GET


HEADERS "https://accessip:port/appconfigadditional/?testId=6&=" \
--header "Content-Type: application/json"
Content-Type
application/json Example Response:
200 - OK
PARAMS:
[
testId {
5 "ip_port": 9,
"test_id": 6,
BODY raw "ip_addr": "20.0.11.95",
"retries": 9,
"payload": 0,
{ "pps": 37891,
"cps": 5, "rtt": 234,
"rtt": , "dst_port": 1,
"pps": , "nat": 2,
"nat": , "ttl": 255,
"ip_addr": , "src_port": 0,
"ip_port": , "cps": 2000,
"port": , "port": 2,
"src_port": , "mode": 1
"dst_port": , }
"mode": , ]
"retries": ,
"ttl": ,
"payload": ,
"test_id":
}

Page 26
Aticara AppStorm API Reference
17.PUT Aditionalconfig
REQUEST URL: Example Request

https://accessip:port/ appconfigadditional/?testId=5 --header "Content-Type: application/json" \


--data " {
\"pb_test_id\": 2,
HEADERS \"pb_port\": 2,
\"pb_csubnet\": 24,
\"pb_hosts\": 255,
Content-Type
\"pb_mac_addr_type\": 1,
application/json \"pb_ip_addr_type\": 1,
\"pb_src_mac_address\": \"00:0c:29:11:11:21\",
PARAMS
\"pb_dst_mac_address\": \"00:0c:29:22:22:22\",
\"pb_src_ip_address\": \"10.0.0.1\",
testId \"pb_dst_ip_address\": \"20.0.0.2\",
\"pb_mac_addr_range\": \"\",
5
\"pb_ip_addr_range\": \"0\",
BODY raw \"pb_ip_addr_increment_factor\": 1,
\"pb_mac_addr_increment_factor\": 1,
\"pb_gw\": 0,
{ \"pb_gw_ip_addr\": \"10.0.0.1\"
"cps": 2001, }"
"rtt": 234,
"pps": 37891, Example Response
"nat": 8, 200 - OK
"ip_addr": "20.0.11.95", {
"ip_port": 9, "Message": "Successfully Configured Host Configuration"
"port": 0, }
"src_port": 0,
"dst_port": 1,
"mode": 1 ,
"retries": 9,
"ttl": 255,
"payload": 0
}

Page 27
Aticara AppStorm API Reference
18.GET Load Profile
Request URL: Example Request:

https://accessip:port/pcapprofile/?testId=2 curl --location --request GET


"https://accessip:port/pcapprofile/?testId=2"
PARAMS
Example Response:
testId
2 200 - OK
{
"duration": 20,
"test_id": 2,
"iterations": 4,
"ramp_down": 5,
"ramp_up": 5
}

19. PUT Load Profile


This API is to create Testbed with appropriate name .

REQUEST URL: Example Request:

https://accessip:port/pcapprofile/
curl --location --request PUT "https://accessip:port/pcaploadprofileinfo/"
HEADERS \
--header "Content-Type: application/json" \
--data "{
Content-Type \"load_profile\" : 1,
\"duration\": 28,
application/json \"iterations\": 9,
\"ramp_down\": 6,
BODY raw
\"ramp_up\": 9,
\"test_id\":6
{ }"
"load_profile" : 1,
"duration": 28, Example Response:
"iterations": 9,
"ramp_down": 6, 200 - OK
"ramp_up": 9, {
"test_id":86 "Message": "Successfully set load profile!"
} }

Page 28
Aticara AppStorm API Reference
20.GET summary of configured Parameters:
Request URL: Example Request:

curl --location --request GET


https://accessip:port/pcapprofile/?testId=2 "https://accessip:port/pcapprofile/?testId=2"

PARAMS Example Response:


200 - OK
testId {
"duration": 20,
2
"test_id": 2,
"iterations": 4,
"ramp_down": 5,
"ramp_up": 5
}

21. PUT StartTraffic:


This API starts the Traffic..

REQUEST URL: Example Request:

https://accessip:port/starttraffic/?TestId=2&port_data=
curl --location --request PUT
1 "https://accessip:port/starttraffic/?TestId=2&port_data=1" \
HEADERS --header "Content-Type: application/json"

Content-Type
application/json
Example Response:
PARAMS
304 - Not Modified
{
TestId "Message": "Traffic Started Already"
}
2
port_data
1

Always 1
BODY formdata

Page 29
Aticara AppStorm API Reference
22. PUT StartCapture
This API is to start Capturing the traffic.

REQUEST URL: Example Request:

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


"https://accessip:port/startcapture/?TestId=2&port_capture=1"
ure=1
PARAMS Example Response:
200 - OK
TestId {
"message": "Started capture Successfully"
2
}
port_capture
1
Always 1

23.GET Trafficstatus
This API returns the status of Traffic.

Request URL: Example Request:

https://accessip:port/trafficstatus/?portId=1&testId=5 trafficstatus_200ok

curl --location --request GET "https://accessip:port/trafficstatus/?portId=2&testId=6"


PARAMS
Example Response:
PARAMS 200 - OK
{
"port_id": "2",
port_1 "port_data": 0
}
0

port_2

Page 30
Aticara AppStorm API Reference
24. 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 }

25. 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

Page 31
Aticara AppStorm API Reference
26.POST displaystats
This API displays Statistics data of the test run..

REQUEST URL: Example Request:

curl --location --request GET


"https://accessip:port/displaystats/?port_1=0&port_2=1&TestId=4"
https://accessip:port/displaystats/?port_1=0&port_2=1&TestId=

Example Response:
PARAMS: 200 - OK

[
port_1
{
0 "Type": "Aggregate Statistics"
},
port_2
{
1 "tx_tpkts": 2087168,
"avg_txbits": 11645275,
TestId
"rx_tbits": 2802018853,
2 "tx_tbits": 1246044480,
"avg_txpkts": 19506,
"rx_tpkts": 2617955,
"avg_rxpkts": 24466,
"avg_rxbits": 26187092,
"port_id": 0
},
{
"tx_tpkts": 2617984,
"avg_txbits": 26181792,
"rx_tbits": 1250349904,
"tx_tbits": 2801451808,
"avg_txpkts": 24467,
"rx_tpkts": 2087180,
"avg_rxpkts": 19506,
"avg_rxbits": 11685513,
"port_id": 1
},
{
"Type": "Logs"
},
[
{
"prf_file": "port_3_1_06_37_17_21_10_2019.pcap",
"prf_date": "21/10/2019",
"prf_index": 3,
"prf_test_name": "ByteStorm",
"prf_time": "06:37:17",
"prf_user_id": 99
},

Page 32
Aticara AppStorm API Reference
{
"prf_file": "port_3_0_01_44_02_22_10_2019.pcap",
"prf_date": "22/10/2019",
"prf_index": 3,
"prf_test_name": "ByteStorm",
"prf_time": "01:44:02",
"prf_user_id": 99
},
{
"prf_file": "port_3_1_01_44_02_22_10_2019.pcap",
"prf_date": "22/10/2019",
"prf_index": 3,
"prf_test_name": "ByteStorm",
"prf_time": "01:44:02",
"prf_user_id": 99
},
{
"prf_file": "port_3_0_06_53_54_22_10_2019.pcap",
"prf_date": "22/10/2019",
"prf_index": 3,
"prf_test_name": "check",
"prf_time": "06:53:54",
"prf_user_id": 99
},
{
"prf_file": "port_3_1_06_53_54_22_10_2019.pcap",
"prf_date": "22/10/2019",
"prf_index": 3,
"prf_test_name": "check",
"prf_time": "06:53:54",
"prf_user_id": 99
},
{
"prf_file": "Report_check_2019_10_22_04_25_13.zip",
"prf_date": "22/10/2019",
"prf_index": 3,
"prf_test_name": "check",
"prf_time": "16:25:13",
"prf_user_id": 99
},
{
"prf_file": "Report_sample_2019_10_22_04_30_39.zip",
"prf_date": "22/10/2019",
"prf_index": 4,
"prf_test_name": "sample",
"prf_time": "16:30:39",
"prf_user_id": 99
},
{
"prf_file": "port_4_0_07_00_55_22_10_2019.pcap",
"prf_date": "22/10/2019",

Page 33
Aticara AppStorm API Reference
"prf_index": 4,
"prf_test_name": "sample",
"prf_time": "07:00:55",
"prf_user_id": 99
},
{
"prf_file": "port_4_1_07_00_55_22_10_2019.pcap",
"prf_date": "22/10/2019",
"prf_index": 4,
"prf_test_name": "sample",
"prf_time": "07:00:55",
"prf_user_id": 99
},
{
"prf_file": "Report_sample_2019_10_22_04_32_42.zip",
"prf_date": "22/10/2019",
"prf_index": 4,
"prf_test_name": "sample",
"prf_time": "16:32:42",
"prf_user_id": 99
}
]
]

27.GET Display Stats Per App:


Request URL: Example Request:
https://accessip:port/displaystatsperapp/?port_1=0&port_2=1 curl --location --request GET
"https://accessip:port/displaystatsperapp/?port_1=2&port_2=3&TestId=6"
&TestId=2

PARAMS
Example Response:
port_1 200 - OK

0
[
port_2
{
"latency_op": 0,
1
"checkbox": 1,
"rx_pkts": 0,
TestId
"file_name": "Uber",
2 "rx_pkts_op": 0,
"app_id": 1,
"tx_bytes_op": 0,
"err_pkts_op": 0,
"easttowest": 0,
"track_id": 11,
"westtoeast": 0,

Page 34
Aticara AppStorm API Reference
"file_path": "aticarapcaps/Uber",
"err_pkts": 0,
"latency": 0,
"rx_bytes_op": 0,
"file_index": 148,
"tx_bytes": 0,
"retries": 0,
"tx_pkts_op": 0,
"file_title": "Uber",
"rx_bytes": 0,
"pcap_id": 0,
"tx_pkts": 0
}
]

28. DEL deletestream


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

Request URL: Example Request:


https://accessip:port/deletestream/?testId=1&streamN
ame=Stream1 Summary_200Ok
curl --location --request GET
PARAMS "https://accessip:port/getsummary/?testId=3"

Example Response:
testId
200 - OK
2

[
{
"Number_of_Hosts": 254,
"IP_Address_incrementing_Factor": 1,
"Start_IP_Address": "10.0.0.2",
"IP_Address_Type": 1,
"Mac_Address_incrementing_Factor": 0,
"Mac_Address_Type": 1,
"Start_Mac_Address": "00:0c:29:fc:48:02"
}
]

Page 35
Aticara AppStorm API Reference
29. 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
PARAMS "https://accessip:port/removeportfromtestbed/?portId=2&testId=4"

portId
Example Response:
1 200 - OK
{
testId "Message": "Successfully Removed port from testbed"
2 }

30. 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 "https://accessip:port/deletetestbed/?testId=2&testName=ByteStorm"

=AppStorm

PARAMS: Example Response:


200 - OK
testId {
"Message": "Test Bed Successfully Deleted"
1 }

testName
ByteStorm

BODY formdata

Page 36
Aticara AppStorm API Reference
31. 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
}

32. DEL DeleteLogs


Request URL: Example Request:
curl --location --request DELETE
"http://192.168.174.20:8080/deletelogs/?filename=Report_AppStorm_2019_10_25_12
https://accessip:port/deletelogs/?filename=Report_AppStorm _26_38.zip"

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

Report_AppStorm_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
Aticara AppStorm API Reference

Page 38

Das könnte Ihnen auch gefallen