Git Product home page Git Product logo

ecx-go's Introduction

Equinix Fabric Go client

Equinix Fabric client library written in Go.

Build Status Go Report Card GoDoc GitHub


Purpose

Equinix Fabric client library was written in Go for purpose of managing Fabric resources from Terraform provider plugin.

Library gives possibility to manage layer two connections and service profiles on Equinix Fabric and connect to any Cloud Service Provider, other Enterprise or between own ports.

Features

Client library consumes Equinix Fabric's REST API and allows to:

  • manage Fabric L2 connections
    • retrieve L2 connection details
    • create non redundant L2 connection
    • create redundant L2 connection
    • delete L2 connection
    • update L2 connection (name and speed)
  • manage Fabric L2 service profiles
  • retrieve list of Fabric user ports
  • retrieve list of Fabric L2 seller profiles

NOTE: scope of this library is limited to needs of Terraform provider plugin and it is not providing full capabilities of Equinix Fabric API

Usage

Code

  1. Add ecx-go module to import statement. In below example, Equinix oauth2-go module is imported as well

    import (
     "github.com/equinix/oauth2-go"
     "github.com/equinix/ecx-go"
    )
  2. Define baseURL that will be used in all REST API requests

    baseURL := "https://sandboxapi.equinix.com"
  3. Create oAuth configuration and oAuth enabled http.Client

    authConfig := oauth2.Config{
      ClientID:     "someClientId",
      ClientSecret: "someSecret",
      BaseURL:      baseURL}
    ctx := context.Background()
    authClient := authConfig.New(ctx)
  4. Create Equinix Fabric REST client with a given baseURL and oauth's http.Client

    var ecxClient ecx.Client = ecx.NewClient(ctx, baseURL, authClient)
  5. Use Equinix Fabric client to perform some operation i.e. fetch

    l2conn, err := ecxClient.GetL2Connection("myUUID")
    if err != nil {
      log.Printf("Error while fetching connection - %v", err)
    } else {
      log.Printf("Retrieved connection - %+v", l2conn)
    }

ecx-go's People

Contributors

displague avatar mikouaj avatar ocobles avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.