Skip to content

Go bindings for RIPE Atlas API

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

ogasser/ripeatlas

 
 

Repository files navigation

Go bindings for RIPE Atlas API

Build Status GoDoc

About

Go bindings for the RIPE Atlas API to retrieve measurements and other data, can read from JSON files or use the REST API. Will decode the data into Go objects and have helper functions to easily access the data within.

Atlaser

Atlaser is the interface to access RIPE Atlas and there are a few different ways to do so:

  • To read JSON files see File and examples/reader/main.go.
  • To use REST API see Http and examples/reader/main.go.
  • To use Streaming API see Stream and examples/streamer/main.go.

REST API

Implementation status of API calls described by https://atlas.ripe.net/docs/api/v2/reference/ .

anchor-measurements

anchors

credits

keys

measurements

Call Status Func
/api/v2/measurements/{pk}/latest/ Done Atlaser.MeasurementLatest()
/api/v2/measurements/{pk}/results/ Done Atlaser.MeasurementResults()

participation-requests

probes

Objects

Implementation status of objects (by type) decribed by https://atlas.ripe.net/docs/data_struct/ .

Type Fireware Status
dns 4610 to 4760 Done
ping 4610 to 4760 Done
traceroute 4610 to 4760 Done
http 4610 to 4760 Done
ntp 4610 to 4760 Done
sslcert 4610 to 4760 Done
wifi 4610 to 4760 Done (undocumented by RIPE)

Usage

import (
    "fmt"
    "github.com/DNS-OARC/ripeatlas"
)

// Read Atlas results from a file
a := ripeatlas.Atlaser(ripeatlas.NewFile())
c, err := a.MeasurementResults(ripeatlas.Params{"file": name})
if err != nil {
    ...
}
for r := range c {
    if r.ParseError != nil {
        ...
    }
    fmt.Printf("%d %s\n", r.MsmId(), r.Type())
}

// Read Atlas results using REST API
a := ripeatlas.Atlaser(ripeatlas.NewHttp())
c, err := a.MeasurementResults(ripeatlas.Params{"pk": id})
if err != nil {
    ...
}
for r := range c {
    if r.ParseError != nil {
        ...
    }
    fmt.Printf("%d %s\n", r.MsmId(), r.Type())
}

// Read DNS measurements using Streaming API
a := ripeatlas.Atlaser(ripeatlas.NewStream())
c, err := a.MeasurementResults(ripeatlas.Params{"type": "dns"})
if err != nil {
    ...
}
for r := range c {
    if r.ParseError != nil {
        ...
    }
    fmt.Printf("%d %s\n", r.MsmId(), r.Type())
}

Author(s)

Jerry Lundström [email protected]

Copyright

Copyright (c) 2017, OARC, Inc. All rights reserved.

This file is part of ripeatlas.

ripeatlas is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ripeatlas is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with ripeatlas. If not, see http://www.gnu.org/licenses/.

About

Go bindings for RIPE Atlas API

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.1%
  • Makefile 0.9%