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

Update Resource Pool API to include type attribute #1248

Conversation

Guddetisandeep
Copy link

@Guddetisandeep Guddetisandeep commented Feb 19, 2024

@Guddetisandeep
Copy link
Author

The query returns only the resource pools associated with cloud management when the type attribute is used with the specified class (ManageIQ::Providers::CloudManager::ResourcePool)

curl -s -X GET -H "X-Auth-Token: $(miq_auth_token)" -H "Accept: application/json" "http://localhost:3000/api/resource_pools?type=ManageIQ::Providers::CloudManager::ResourcePool" | jq .
{
  "name": "resource_pools",
  "count": 142,
  "subcount": 1,
  "subquery_count": 1,
  "pages": 1,
  "resources": [
    {
      "href": "http://localhost:3000/api/resource_pools/162"
    }
  ],
  "actions": [
    {
      "name": "query",
      "method": "post",
      "href": "http://localhost:3000/api/resource_pools"
    }
  ],
  "links": {
    "self": "http://localhost:3000/api/resource_pools?type=ManageIQ::Providers::CloudManager::ResourcePool&offset=0",
    "first": "http://localhost:3000/api/resource_pools?type=ManageIQ::Providers::CloudManager::ResourcePool&offset=0",
    "last": "http://localhost:3000/api/resource_pools?type=ManageIQ::Providers::CloudManager::ResourcePool&offset=0"
  }
}

@miq-bot
Copy link
Member

miq-bot commented Feb 29, 2024

Checked commit Guddetisandeep@c7e65fe with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint
2 files checked, 1 offense detected

app/controllers/api/resource_pools_controller.rb

@Fryguy
Copy link
Member

Fryguy commented Apr 5, 2024

@Guddetisandeep - We found there's a better way to do this than using a type filter. Instead, the caller can pass a collection_class parameter at the same level as the filter. See #1256

Copy link
Member

@Fryguy Fryguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can close this PR, and the callers can use collection_class instead, which should already work for ResourcePools.

@Guddetisandeep
Copy link
Author

Closing this PR using collection_class instead of the type filter.

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

Successfully merging this pull request may close these issues.

4 participants