Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VXC service provisioning times out - make configurable by callers #11

Closed
daveset opened this issue May 19, 2023 · 1 comment
Closed

Comments

@daveset
Copy link

daveset commented May 19, 2023

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.

@mega-alex
Copy link
Contributor

This is now available as a configurable option in the BuyVXCRequest in the latest v1.0.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants