-
Notifications
You must be signed in to change notification settings - Fork 12
Packet Interface
#List Packets Use this method to obtain a list of all packets stored on the server. The result is an array of strings.
##Error Types
- internal/server error
##REST Sequence
GET https://<host>[:<port>]/api/packet/ HTTP/1.1
<--empty-->
HTTP/1.1 200 Ok
{
value: {
names: [String]
}
}
HTTP/1.1 200 Ok
{
error: {
message: String,
details: { <--detailed error object--> }
}
}
#Get Packet Use this method to obtain a named packet object from the server. The result is an object that contains the: packet name, byte count of the packet, and an array of protocols. Each protocol provides its name, byte count, and an array of protocol fields. Each field provides its name and value.
##Error Types
- internal/server error
- packet does not exist
##REST Sequence
GET https://<host>[:<port>]/api/packet/<name> HTTP/1.1
<--empty-->
HTTP/1.1 200 Ok
{
value: {
name: String,
bytes: Integer,
protocols: [{
name: String,
bytes: Integer,
fields: {
<name>: String,
<name>: String,
...
}
}]
}
}
HTTP/1.1 200 Ok
{
error: {
message: String,
details: { <--detailed error object--> }
}
}
#Create Packet Use this method to create a named packet object on the server. The post contains the: packet name, byte count of the packet, and an array of protocols. Each protocol provides its name, byte count, and an array of protocol fields. Each field provides its name and value.
##Error Types
- internal/server error
- invalid packet name
- packet already exists
- invalid bytes
- protocol does not exist
- bad protocol sequence
- field does not exist
- bad value
##REST Sequence
POST https://<host>[:<port>]/api/packet/<name> HTTP/1.1
{
name: String,
bytes: Integer,
protocols: [{
name: String,
bytes: Integer,
fields: {
<name>: String,
<name>: String,
...
}
}]
}
HTTP/1.1 200 Ok
{
value: {}
}
HTTP/1.1 200 Ok
{
error: {
message: String,
details: { <--detailed error object--> }
}
}
#Update Packet Use this method to update a named packet object on the server. The post contains the: packet name, byte count of the packet, and an array of protocols. Each protocol provides its name, byte count, and an array of protocol fields. Each field provides its name and value.
##Error Types
- internal/server error
- packet does not exist
- invalid bytes
- protocol does not exist
- bad protocol sequence
- field does not exist
- bad value
##REST Sequence
PUT https://<host>[:<port>]/api/packet/<name> HTTP/1.1
{
name: String,
bytes: Integer,
protocols: [{
name: String,
bytes: Integer,
fields: {
<name>: String,
<name>: String,
...
}
}]
}
HTTP/1.1 200 Ok
{
value: {}
}
HTTP/1.1 200 Ok
{
error: {
message: String,
details: { <--detailed error object--> }
}
}
[Home] (https://github.com/flowgrammable/flowsim/wiki)
[Subscriber Module] (https://github.com/flowgrammable/flowsim/wiki/Subscriber-Module)
[Packet Module] (https://github.com/flowgrammable/flowsim/wiki/packet-module)
[Profile Module] (https://github.com/flowgrammable/flowsim/wiki/profile-module)
[Switch Module] (https://github.com/flowgrammable/flowsim/wiki/Switch-Module)
[Database Module] (https://github.com/flowgrammable/flowsim/wiki/Database-Result-and-Error)
[Server Module] (https://github.com/flowgrammable/flowsim/wiki/Server-Module)
[Function Results] (https://github.com/flowgrammable/flowsim/wiki/Function-Results)
[Development Guidelines] (https://github.com/flowgrammable/flowsim/wiki/General-Guidelines)