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

OCM-7800 | Define and add pagination model to cloud_provider_inquiries #950

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cgiradkar
Copy link
Contributor

No description provided.

@cgiradkar cgiradkar force-pushed the OCM-7800-add-pagination-model branch 4 times, most recently from 89f6dbb to c2d28fc Compare June 26, 2024 17:23
*/

// Pagination contains the data which enables pagination on the response
struct Pagination {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not that big a fan of this as it is specific only for one model.
How do other models have the pagination implemented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

BreakGlassCredentialsListRequest has implemented pagination the request struct like this: https://github.com/openshift-online/ocm-sdk-go/blob/d6662dfa3e339336e2459a413289c5b867500131/clustersmgmt/v1/break_glass_credentials_client.go#L350
I think this way it's more pluggable to any struct that needs to implement pagination on the response.

@ziccardi
Copy link

lgtm

Copy link
Member

@vkareh vkareh left a comment

Choose a reason for hiding this comment

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

This seems wrong. We use a *_resource.model that automatically adds pagination components using method List. You might want to follow what's being done in https://github.com/openshift-online/ocm-api-model/blob/main/model/clusters_mgmt/v1/break_glass_credentials_resource.model#L20-L62 to support this.

@cgiradkar cgiradkar force-pushed the OCM-7800-add-pagination-model branch from c2d28fc to f392204 Compare July 12, 2024 16:52
@cgiradkar cgiradkar force-pushed the OCM-7800-add-pagination-model branch from f392204 to ad9b5cc Compare July 12, 2024 16:54
@vkareh vkareh self-requested a review July 12, 2024 17:52
Copy link
Member

@vkareh vkareh left a comment

Choose a reason for hiding this comment

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

This builds well now and generates the following files in the SDK:

clustersmgmt/v1/cloud_provider_data_client.go
clustersmgmt/v1/cloud_provider_data_resource_json.go
clustersmgmt/v1/cloud_providers_data_client.go
clustersmgmt/v1/cloud_providers_data_resource_json.go

Is there a specific endpoint in CS associated with this or does it expect the /{aws,gcp}_inquiries/* endpoints?

@cgiradkar
Copy link
Contributor Author

This builds well now and generates the following files in the SDK:

clustersmgmt/v1/cloud_provider_data_client.go
clustersmgmt/v1/cloud_provider_data_resource_json.go
clustersmgmt/v1/cloud_providers_data_client.go
clustersmgmt/v1/cloud_providers_data_resource_json.go

Is there a specific endpoint in CS associated with this or does it expect the /{aws,gcp}_inquiries/* endpoints?

The original task had broader consideration, but this PR only aims to add pagination structure to gcp_inquiries endpoints.

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.

4 participants