Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/equinix/ne-go
Network Edge client library in Go
https://github.com/equinix/ne-go
equinix equinix-platform network-edge nfv sdn
Last synced: about 1 month ago
JSON representation
Network Edge client library in Go
- Host: GitHub
- URL: https://github.com/equinix/ne-go
- Owner: equinix
- License: mit
- Created: 2020-07-30T07:14:03.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T23:46:39.000Z (3 months ago)
- Last Synced: 2024-09-12T09:36:21.929Z (3 months ago)
- Topics: equinix, equinix-platform, network-edge, nfv, sdn
- Language: Go
- Homepage:
- Size: 349 KB
- Stars: 3
- Watchers: 10
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Equinix Network Edge Go client
Equinix Network Edge (NE) client library written in Go.
[![Build Status](https://travis-ci.com/equinix/ne-go.svg?branch=master)](https://travis-ci.com/github/equinix/ne-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/equinix/ne-go)](https://goreportcard.com/report/github.com/equinix/ne-go)
[![GoDoc](https://godoc.org/github.com/equinix/ne-go?status.svg)](https://godoc.org/github.com/equinix/ne-go)
![GitHub](https://img.shields.io/github/license/equinix/ne-go)---
## Purpose
Equinix Network Edge client library was written in Go for purpose of managing NE
resources from Terraform provider plugin.Library gives possibility to manage virtual network devices and associated network
services.**NOTE**: Scope of this library is limited to needs of Terraform provider plugin
and it is not providing full capabilities of Equinix Network Edge API## Usage
### Code
1. Add ne-go module to import statement.
In below example, Equinix `oauth2-go` module is imported as well```go
import (
"github.com/equinix/oauth2-go"
"github.com/equinix/ne-go"
)
```2. Define baseURL that will be used in all REST API requests
```go
baseURL := "https://api.equinix.com"
```3. Create oAuth configuration and oAuth enabled `http.Client`
```go
authConfig := oauth2.Config{
ClientID: "someClientId",
ClientSecret: "someSecret",
BaseURL: baseURL}
ctx := context.Background()
authClient := authConfig.New(ctx)
```4. Create NE REST client with a given `baseURL` and oauth's `http.Client`
```go
var neClient ne.Client = ne.NewClient(ctx, baseURL, authClient)
```5. Use NE client to perform some operation i.e. **get device** details
```go
device, err := neClient.GetDevice("existingDeviceUUID")
if err != nil {
log.Printf("Error while fetching device - %v", err)
} else {
log.Printf("Retrieved device - %+v", device)
}
```