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

Automate endpoint's resource href value links to non-existent resources #1276

Open
jrafanie opened this issue Jan 2, 2025 · 1 comment
Open

Comments

@jrafanie
Copy link
Member

jrafanie commented Jan 2, 2025

http://localhost:3000/api/automate/manageiq?depth=2

returns:

...
	"resources": [
		{
			"href": "http://localhost:3000/api/automate/79",
			"fqname": "/My-Custom-Domain",
			"domain_fqname": "/",
			"klass": "MiqAeDomain",
			"id": "79",
			"name": "My-Custom-Domain",
                        ...
		},
		{
			"href": "http://localhost:3000/api/automate/322",
			"fqname": "/ManageIQ",
			"domain_fqname": "/",
			"klass": "MiqAeDomain",
			"id": "322",
			"name": "ManageIQ",
                        ...
		}

"href": "http://localhost:3000/api/automate/322" returns:

{
	"error": {
		"kind": "bad_request",
		"message": "Invalid Automate Domain 322 specified",
		"klass": "Api::BadRequestError"
	}
}

This endpoint fails because api/automate is an API for virtual resources and was added for building trees.

The desired resource can be found at: http://localhost:3000/api/automate_domains/322

In fact, http://localhost:3000/api/automate/id convention found elsewhere is not valid here at all. I was only able to find these domains using the convention: http://localhost:3000/api/automate/name

@jrafanie jrafanie added the bug label Jan 2, 2025
@jrafanie jrafanie changed the title Automate endpoint's href value links to non-existent resources Automate endpoint's resource href value links to non-existent resources Jan 2, 2025
@jrafanie
Copy link
Member Author

jrafanie commented Jan 2, 2025

In discussions outside of here, possible solutions were to either remove the href field from resources or add the missing endpoints such as instances so we the virtual endpoint can link to the correct class's endpoint / id location.

EDIT, note, we can do both of these things as it's unlikely we'll add the missing endpoints right away so removing broken href fields seems proper until we can do them correctly.

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

No branches or pull requests

2 participants