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

MINOR: Add edgeDeployment confirmation request. #61

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

jeremy-cxf
Copy link
Contributor

@jeremy-cxf jeremy-cxf commented Apr 24, 2024

Adds confirmation endpoint response from:
https://docs.fastly.com/en/ngwaf/edge-deployment

Would be useful for any CLI utility or internal lib to have the ability to query this using the package (e.g "do I already have a service mapped")

Implementation:

	edgeDeployment, err := sc.GetEdgeDeployment("jeremy", "mysite")
	if err != nil {
		return err
	}
	fmt.Printf("%+v\n\n\n\n", edgeDeployment)

	for _, edgeWAF := range edgeDeployment.ServicesAttached {
		fmt.Println(edgeWAF.ID)
		fmt.Println(edgeWAF.CreatedBy)
		fmt.Println(edgeWAF.Created)
		fmt.Println(edgeWAF.AccountID)
	}

Output:

{AgentHostName:moop.edgecompute.app ServicesAttached:[{ID:1KpBNBo1SqpppqIIZ1GRR3 AccountID:6u7fz9eLFkR1kMF2ediYJz Created:2024-04-24 16:05:21 +0000 UTC CreatedBy:meep@fastly.com}]}


1KpBNBo1SqpppqIIZ1GRR3
meep@fastly.com
2024-04-24 16:05:21 +0000 UTC
6u7fz9eLFkR1kMF2ediYJz

Did not add a test because I did not see tests for related endpoints, however can add those if time allows.

@jeremy-cxf jeremy-cxf requested a review from shawnps April 24, 2024 16:27
@jeremy-cxf jeremy-cxf changed the title add confirm call Add edgeDeployment confirmation request. Apr 24, 2024
@jeremy-cxf jeremy-cxf changed the title Add edgeDeployment confirmation request. MINOR: Add edgeDeployment confirmation request. Apr 24, 2024
api.go Outdated Show resolved Hide resolved
@shawnps shawnps merged commit 92ef742 into main Apr 25, 2024
1 check passed
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 this pull request may close these issues.

2 participants