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

add empty input warning to catalystcenter_*_settings resources #181

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

kuba-mazurkiewicz
Copy link
Collaborator

There is undocumented API issue that throws following error:

 Failed to delete object (PUT), got error: HTTP Request failed: StatusCode 400, {"response":{"errorCode":"NCND01090","message":"NCND01090: Empty input - the groupUuid is null or
│ empty","href":"/intent/api/v1/sites/4c06e542-8bc8-4c34-988a-b98030e46229/aaaSettings"},"version":"1.0"}

when trying to remove settings from Global level.

To bypass this I added following code block under DELETE method:

		errorCode := res.Get("response.errorCode").String()
		if errorCode == "NCND01090" {
			// Log a warning and continue execution when Empty input - the groupUuid is null or empty
			failureReason := res.Get("response.failureReason").String()
			resp.Diagnostics.AddWarning("Empty input Warning", fmt.Sprintf("Empty input detected (error code: %s, reason %s).", errorCode, failureReason))
		} else {
			resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Failed to delete object (%s), got error: %s, %s", "PUT", err, res.String()))
			return
		}

…pass issue with API errors when removing settings from Global level
@kuba-mazurkiewicz
Copy link
Collaborator Author

I also fixed pipeline with acceptance tests for settings

@danischm danischm merged commit 0fde79d into CiscoDevNet:main Feb 27, 2025
4 checks 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