Code Monkey home page Code Monkey logo

megaportgo's Issues

[req] Support for the telemetry API

Will this library be extended to include support for other non-terraform related APIs such as telemetry or log data?

I was interested in finding (or writing) a megaport exporter for Prometheus and was hoping that the library exposed those API methods.

X-Auth Token End of Support

It looks like X-Auth token support, used by the current megaportgo (and terraform provider), will be disabled on September 30 2023.

Is there a plan to implement oauth2 before then?

VXC service provisioning times out - make configurable by callers

When provisioning a VXC circuit for Azure we regularly encounter timeouts requiring us to re-run our automation before it is completely provisioned. We would like the ability to specify a longer timeout than the hard-coded 15 minutes.

I'd propose adding a second function that accepts a context.Context that can be configured by the caller for an arbitrary timeout based on the caller's needs. I've also added a pollFrequency to specify how frequently it queries for the VxcDetails, currently hard-coded to 30 seconds.

func (v *VXC) WaitForVXCProvisioningCtx(ctx context.Context, pollFrequency time.Duration, vxcId string) (bool, error) { ...}

and

func (v *VXC) WaitForVXCUpdatedCtx(
	ctx context.Context, pollFrequency time.Duration, id string, name string, rateLimit int, aEndVLAN int, bEndVLAN int,
) (bool, error) { ... }

The existing functions can be modified to simply create a context with a 15 minute timeout and call the new functions, preserving the API and current behavior for existing users.

// WaitForVXCProvisioning waits up to 15 minutes for the VXC to reach the "LIVE" status.
// See WaitForVXCProvisioningCtx
func (v *VXC) WaitForVXCProvisioning(vxcId string) (bool, error) {
	ctx, cancelFunc := context.WithTimeout(context.Background(), 15*time.Minute)
	defer cancelFunc()
	return v.WaitForVXCProvisioningCtx(ctx, 30*time.Second, vxcId)
}

PR to follow.

A corresponding change will be proposed for the terraform-provider-megaport project to call the new APIs.

No `GetPorts` function

It would be nice to be able to get the list of ports with a simple function call.

Will submit a pair of PRs here shortly to add this functionality.

Remove dependency on terraform

vxc.go depends on github.com/hashicorp/terraform-plugin-sdk/helper/schema for reasons which are not clear to me.

I propose moving the MarshallMcrAEndConfig function to the downstream project terraform-provider-megaport.

I have written a couple of fairly trivial patches to both projects to make this happen.

Will submit PRs shortly. If this is undesirable for some reason please let me know.

Removing the dependency on terraform was not simply an aesthetic issue for me. I am in the process of generating a pulumi module from the megaport terraform module. Conflicting versions of terraform were causing difficulty for me and correcting them was made more difficult by the fact that this project also depends on terraform.

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.