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 public constant values for Redshift Cluster - ClusterStatus #2645

Closed
2 tasks done
gogingersnap777 opened this issue May 17, 2024 · 2 comments
Closed
2 tasks done
Assignees
Labels
feature-request A feature should be added or improved.

Comments

@gogingersnap777
Copy link

gogingersnap777 commented May 17, 2024

Describe the feature

Under service/redshift/types.go, for struct Cluster and member ClusterStatus. Add a constants and a array lookup for all the possible values, instead of just writing them in documentation.

Use Case

When writing a go program to check the status of Redshift clusters, I don't like that I need to hardcode the values that come back from the go sdk. I'd rather reference constants provided by the sdk.

Proposed Solution

I believe the solution should involve making these values constants. There may be more refactor, but I haven't looked too far. I wanted to get this issue up first.

Below is a proposal of changes to service/redshift/types/types.go

Note: The proposal only uses two possible values (available, and cancelling-resize), but their are others

// Enum values for ReservedNodeOfferingType
const (
	ClusterClusterStatusTypeAvailable    ClusterClusterStatusType = "available"
	ClusterClusterStatusTypeCancellingResize ClusterClusterStatusType = "cancelling-resize"
)

// Values returns all known values for ClusterClusterStatusType. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
//
// The ordering of this slice is not guaranteed to be stable across updates.
func (ClusterClusterStatusType) Values() []ClusterClusterStatusType {
	return []ClusterClusterStatusType{
		"available",
		"cancelling-resize",
	}
}

Other Information

Reference to docs with ClusterStatus values - https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/[email protected]/types#Cluster

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Go SDK V2 Module Versions Used

module example

go 1.22.3

require (
github.com/aws/aws-sdk-go-v2/config v1.27.15
github.com/aws/aws-sdk-go-v2/service/redshift v1.44.3
)

require (
github.com/aws/aws-sdk-go-v2 v1.27.0 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.17.15 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.9 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.20.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.24.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.28.9 // indirect
github.com/aws/smithy-go v1.20.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
)

Go version used

go version go1.22.3 darwin/amd64

@gogingersnap777 gogingersnap777 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels May 17, 2024
@gogingersnap777 gogingersnap777 changed the title Add public constants values from Redshift Cluster - ClusterStatus Add public constant values for Redshift Cluster - ClusterStatus May 17, 2024
@RanVaknin RanVaknin self-assigned this May 20, 2024
@RanVaknin
Copy link
Contributor

Hi @gogingersnap777 ,

Thanks for reaching out.
Unfortunately the SDK team cannot change the data type for any of the APIs. All of the AWS SDKs are code-generated from the model of each AWS service. In this case, the Redshift API is modeled with ClusterStatus as a string rather than an enum, and while I agree that it makes sense to model this as an enum (similar to other status fields that are modeled as enum), a change to a more restrictive type would be considered a backwards incompatible / breaking change from an API perspective so we are unable to upstream your request.

Thanks again,
Ran~

@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label May 20, 2024
@RanVaknin RanVaknin closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants