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

Deploymentapi: Add missing GET parameters. #469

Merged
merged 3 commits into from
May 14, 2024

Conversation

gigerdo
Copy link
Member

@gigerdo gigerdo commented May 14, 2024

Implements some new fields in the deployment.get API that weren't supported yet by the SDK.

Description

Related Issues

Motivation and Context

How Has This Been Tested?

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@gigerdo gigerdo marked this pull request as ready for review May 14, 2024 10:09
@gigerdo gigerdo requested a review from a team as a code owner May 14, 2024 10:09
WithShowSettings(ec.Bool(params.ShowSettings)).
WithConvertLegacyPlans(ec.Bool(params.ConvertLegacyPlans)).
WithShowSystemAlerts(systemAlerts)
if params.ShowInstanceConfigurations {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we use the same style as for, e.g. ShowPlans? E.g.

.WithShowInstanceConfigurations(ec.Bool(params.ShowInstanceConfigurations))

instead of the explicit if?

Copy link
Member Author

@gigerdo gigerdo May 14, 2024

Choose a reason for hiding this comment

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

The difference is that the if only adds the parameter to the request if it is set to true (assuming the default in the API is false as well). The other parameters will be added to every request.

My reasoning behind it is that it will only add the parameter to the request when it is needed. So if you don't use the new params, nothing will change in the request being made.

Another option would be to make the parameters *bool and pass them straight in. Then it is still possible in the cloud-sdk-go api to decide to either set the parameter, or not set it and it will not be added.

Copy link
Contributor

@dimuon dimuon left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gigerdo gigerdo merged commit 417378b into elastic:master May 14, 2024
2 checks passed
@gigerdo gigerdo deleted the add-deployment-params branch May 14, 2024 14:56
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.

None yet

2 participants