Skip to content

Packet Interface

jassoncasey edited this page Oct 27, 2014 · 23 revisions

#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--> }
  }
}

Clone this wiki locally