npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mplane_http_transport

v0.2.1

Published

mPlane HTTPS transport

Downloads

4

Readme

mplane_http_transport

mPlane

This library implements a nodejs module for transport of mPlane informational elements over HTTPS. All transaction can be secured using trusted certificates.

#REST API The implementation has a limited set of CRUD set of messages. In particular, for any of the mPlane informational elements, it is possible to Create and Read them between mPlane components.

##REGISTER The register keyword is the Create message for an element.

###Capability Use this message to register a list of capabilities.

URL: /register/capability
METHOD: POST
BODY: json array containing the capabilities.
ANSWER:
       + 200 OK. Operations completed. The body can contain a list of capabilityes not registered with some explanation
                Example: {"label1":{registered:"no", reason:"..."} , "label1":{registered:"ok"}})
       + 400 not a capability/wrong format
       + 401 not authorized
       + 500 server error

This is an example of the body format generated by a probe to register on a supervisor.

[ 
  { 
    "capability": "measure",
    "label": "pinger_TI_test",
    "metadata":
     { "System_type": "Pinger",
       "System_version": "0.1a",
       "System_ID": "Lab test machine" 
     },
    "link": "",
    "token": "c61ad8db5f9a4cc38e7ae8d8b5deae85ea93187b",
    "when": "now ... future / 1s",
    "resultvalues": [],
    "results": [ "delay.twoway" ],
    "parameters":{ 
        "destination.ip4": "192.168.0.1 ... 192.168.255.255",
        "number": "1 ... 10",
       "source.ip4": "192.168.0.1" 
    } 
  },
  { 
    "capability": "measure",
    "label": "tracer_TI_test",
    "metadata":{ 
        "System_type": "Tracer",
       "System_version": "0.1a",
       "System_ID": "Lab test machine" 
    },
    "link": "",
    "token": "361dcee90873ade735326ad411f87a995816ed20",
    "when": "now ... future / 1s",
    "resultvalues": [],
    "results": [ "delay.twoway", "hops.ip" ],
    "parameters":{ 
        "destination.ip4": "192.168.0.1 ... 192.168.255.255",
        "source.ip4": "192.168.0.1" 
     } 
  } 
]

###Result Use this message to register a result.

URL:/register/result
METHOD:POST
BODY: the result object
ANSWER:
    + 200 OK
    + 400 not a result/wrong format
    + 401 not authorized
    + 403 unexpected result. Usually this is due to no specification known for this result.
    + 500 server error
    

Following json snippet is an example of a result message generated by a probe after a measure.

{
    "result":"measure",
    "label":"tracer_TI_test",
    "metadata":{
        "System_type":"Tracer",
        "System_version":"0.1a",
        "System_ID":"Lab test machine",
        "eventTime":"2014-10-02T15:43:09.397Z",
        "specification_status":"queued"
     },
     "link":"",
     "token":"361dcee90873ade735326ad411f87a995816ed20",
     "when":"2014-09-29 10:19:26.765203 ... 2014-09-29 10:19:27.767020",
     "resultvalues":[[0.3,1]],
     "results":["delay.twoway","hops.ip"],
     "parameters":{
        "destination.ip4":"192.168.0.4",
        "source.ip4":"192.168.0.1"
     }
}

##Specification Use this message to register a specification for a component.

URL: /register/specification
METHOD: POST
BODY: {DistinguishedName:{specification}}. The distinguished name of the component you need to register a specification for
ANSWER:
    + 200 OK. The body will contain the receipt of the required specification
    + 400 not a specification/wrong format
    + 401 not authorized
    + 403 unrecognized specification. Usually this is due to no capability known for this specification.
    + 500 server error

Following code is an example of Specification message generated by a client to register a new Specification on a Supervisor for a specific registered probe (pinger1.TI.mplane.org)

{
    "pinger1.TI.mplane.org":{
            "specification":"measure",
            "label":"pinger_TI_test",
            "metadata":{
                "System_type":"Pinger",
                "System_version":"0.1a",
                "System_ID":"Lab test machine",
                "eventTime":"2014-10-02T15:47:07.634Z"},
                "link":"",
                "token":"c61ad8db5f9a4cc38e7ae8d8b5deae85ea93187b",
                "when":"now + 1s",
                "resultvalues":[],
                "results":["delay.twoway"],
                "parameters":{
                    "destination.ip4":"192.168.0.4",
                    "number":"5",
                    "source.ip4":"192.168.0.1"
                }
        }
}

##SHOW These set of messages is implemented to read information from specific mPlane component.

###Result Use this message to show result from a receipt.

URL:/show/result
METHOD:POST
BODY: redemption of the specification you need to know results.
ANSWER:
    + If the result is available
        200 OK + result 
    + If the Result is not available
        200 OK + receipt of the Specification
    + 401 not authorized
    + 403 unexpected redemption. Usually this is due to no Specification kwnon for the redeem provided.
    + 500 server error

###Capability Use this message to show capability kwnon by a component.

    URL:/show/capability
    METHOD:GET
    BODY: empty
    ANSWER:
           + 200 OK. The body contains the capabilities in the format {DN1:[capability1, capability2],…}
           + 401 not authorized
           + 500 server error
           
           

Following code is an example of json body generated by a Supervisor upon request of all the registered capabilities

{ 
    "pinger1.TI.mplane.org":
             [ 
                 { 
                       "capability": "measure",
                       "label": "pinger_TI_test",
                       "metadata": [Object],
                       "link": "",
                       "token": "c61ad8db5f9a4cc38e7ae8d8b5deae85ea93187b",
                       "when": "now ... future / 1s",
                       "resultvalues": [],
                       "results": [Object],
                       "parameters": [Object] 
                 },
                 { 
                    "capability": "measure",
                    "label": "tracer_TI_test",
                    "metadata": [Object],
                    "link": "",
                    "token": "361dcee90873ade735326ad411f87a995816ed20",
                    "when": "now ... future / 1s",
                    "resultvalues": [],
                    "results": [Object],
                    "parameters": [Object] 
                 } 
             ] 
}

###Specification This Api is needed to show Specification registered on a component.

    URL:/show/specification
    METHOD:GET
    BODY: empty
    ANSWER:
           + 200 OK. The body contains an array of specifications. Component can filter Specifications from the provided DN.
           + 401 not authorized
           + 428 not registered. This message is returned if the component needs to have at least a registered capability from the Component. 
                It is a way to inform all probes that a Supervisor lost all the capability (for example after a crash) and ask probes to register again. 
           + 500 server error