On This Page
Loading...

Packngo

COMMAND LINE

Copy to clipboard

Packngo

Welcome to packngo, the Equinix Metal™ Go API Client. This library is used by the Terraform provider, and the Equinix Metal CLI.

For more information about our API endpoints, please visit our API Documentation.

Installation

packngo can be installed with go get.

go get github.com/packethost/packngo

Authentication

To authenticate to the Equinix Metal API, you must have your API token exported in environment variable PACKET_AUTH_TOKEN.

export PACKET_AUTH_TOKEN=<your_api_token>

Usage Example

This code snippet initializes Equinix Metal API client, and lists your Projects.

package main

import (
    "log"

    "github.com/packethost/packngo"
)

func main() {
    c, err := packngo.NewClient()
    if err != nil {
        log.Fatal(err)
    }

    ps, _, err := c.Projects.List(nil)
    if err != nil {
        log.Fatal(err)
    }
    for _, p := range ps {
        log.Println(p.ID, p.Name)
    }
}

Routes and Methods

A complete list of the available routes and methods is in the packngo GitHub repository.

Frequently
asked questions

Slack

Still stuck?

Join us on Slack

Get support from our team and community members.

Frequently asked questions

What 3rd party Managed Services?

Neutra trust fund narwhal, palo santo bicycle rights live-edge stumptown health goth portland selfies kinfolk woke. ssss Echo park irony artisan vaporware typewriter. Next level pinterest drinking vinegar lyft mumblecore af small batch heirloom VHS. Fixie banh mi asymmetrical trust fund.

What 3rd party Managed Services?

Neutra trust fund narwhal, palo santo bicycle rights live-edge stumptown health goth portland selfies kinfolk woke. ssss Echo park irony artisan vaporware typewriter. Next level pinterest drinking vinegar lyft mumblecore af small batch heirloom VHS. Fixie banh mi asymmetrical trust fund.

What 3rd party Managed Services?

Neutra trust fund narwhal, palo santo bicycle rights live-edge stumptown health goth portland selfies kinfolk woke. ssss Echo park irony artisan vaporware typewriter. Next level pinterest drinking vinegar lyft mumblecore af small batch heirloom VHS. Fixie banh mi asymmetrical trust fund.

Copied code to clipboard