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

Css updates #754

Merged
merged 12 commits into from
Dec 20, 2024
Merged

Conversation

sattila1999
Copy link
Contributor

Adding CSS new functionalities:

  • Changing a Cluster Name
  • Restarting a Cluster
  • Changing a Password
  • Modifying Cluster Specifications
  • Changing the Specifications of a Specified Node Type
  • Scaling in a Cluster By Removing Specified Nodes
  • Removing Nodes of a Specific Type
  • Changing the Security Mode
  • Changing the Security Group
  • Adding Master and Client Nodes

artem-lifshits
artem-lifshits previously approved these changes Dec 3, 2024
acceptance/openstack/css/v1/clusters_test.go Outdated Show resolved Hide resolved
acceptance/openstack/css/v1/restart_cluster_test.go Outdated Show resolved Hide resolved
acceptance/openstack/css/v1/change_cluser_name_test.go Outdated Show resolved Hide resolved
acceptance/openstack/css/v1/change_password_test.go Outdated Show resolved Hide resolved
acceptance/openstack/css/v1/cluster_add_nodes_test.go Outdated Show resolved Hide resolved
acceptance/openstack/css/v1/cluster_update_flavor_test.go Outdated Show resolved Hide resolved
acceptance/openstack/css/v1/cluster_update_flavor_test.go Outdated Show resolved Hide resolved
openstack/css/v1/clusters/UpdateClusterFlavor.go Outdated Show resolved Hide resolved
openstack/css/v1/clusters/UpdateClusterFlavor.go Outdated Show resolved Hide resolved
openstack/css/v1/clusters/AddClusterNodes.go Outdated Show resolved Hide resolved
@artem-lifshits
Copy link
Member

Hello @sattila1999 will you continue to work on this css features? Or should I take over and finish your work?

@artem-lifshits artem-lifshits self-requested a review December 11, 2024 12:05
@sattila1999
Copy link
Contributor Author

Hello @sattila1999 will you continue to work on this css features? Or should I take over and finish your work?

Hi! The changes are already in progress. We would like to continue working on it, and may reach out to you for clarification.

artem-lifshits
artem-lifshits previously approved these changes Dec 18, 2024
Aloento
Aloento previously approved these changes Dec 18, 2024
// Type of the cluster node to modify.
NodeType string `json:"type" required:"true"`
}

Copy link
Member

@muneeb-jan muneeb-jan Dec 18, 2024

Choose a reason for hiding this comment

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

There is no method binding the interface to structs. At this point, there is no use of passing this explicitly. Furthermore, if two APIs are doing exact same thing, I would suggest choosing the one with fewer path params or one with finer control. Use one opts struct (explicitly) in function arguments. That would be helpful to the user.

Copy link
Member

Choose a reason for hiding this comment

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

@sattila1999 could you check this in actual doc?

Comment on lines 10 to 40
type ClusterFlavorOptsBuilder interface {
}

type ClusterFlavorOpts struct {
// Indicates whether to verify replicas.
NeedCheckReplica bool `json:"needCheckReplica"`
// ID of the new flavor.
NewFlavorID string `json:"newFlavorId" required:"true"`
}

type ClusterNodeFlavorOpts struct {
// Indicates whether to verify replicas.
NeedCheckReplica bool `json:"needCheckReplica"`
// ID of the new flavor.
NewFlavorID string `json:"newFlavorId" required:"true"`
// Type of the cluster node to modify.
NodeType string `json:"type" required:"true"`
}

func UpdateClusterFlavor(client *golangsdk.ServiceClient, clusterID string, opts ClusterFlavorOptsBuilder) error {
url := ""

switch options := opts.(type) {
case ClusterFlavorOpts:
url = client.ServiceURL("clusters", clusterID, "flavor")
case ClusterNodeFlavorOpts:
url = client.ServiceURL("clusters", clusterID, options.NodeType, "flavor")
default:
return fmt.Errorf("invalid options type provided: %T", opts)
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type ClusterFlavorOptsBuilder interface {
}
type ClusterFlavorOpts struct {
// Indicates whether to verify replicas.
NeedCheckReplica bool `json:"needCheckReplica"`
// ID of the new flavor.
NewFlavorID string `json:"newFlavorId" required:"true"`
}
type ClusterNodeFlavorOpts struct {
// Indicates whether to verify replicas.
NeedCheckReplica bool `json:"needCheckReplica"`
// ID of the new flavor.
NewFlavorID string `json:"newFlavorId" required:"true"`
// Type of the cluster node to modify.
NodeType string `json:"type" required:"true"`
}
func UpdateClusterFlavor(client *golangsdk.ServiceClient, clusterID string, opts ClusterFlavorOptsBuilder) error {
url := ""
switch options := opts.(type) {
case ClusterFlavorOpts:
url = client.ServiceURL("clusters", clusterID, "flavor")
case ClusterNodeFlavorOpts:
url = client.ServiceURL("clusters", clusterID, options.NodeType, "flavor")
default:
return fmt.Errorf("invalid options type provided: %T", opts)
}
type ClusterNodeFlavorOpts struct {
// Indicates whether to verify replicas.
NeedCheckReplica bool `json:"needCheckReplica"`
// ID of the new flavor.
NewFlavorID string `json:"newFlavorId" required:"true"`
// Type of the cluster node to modify.
NodeType string `json:"type" required:"true"`
}
func UpdateClusterFlavor(client *golangsdk.ServiceClient, clusterID string, opts ClusterNodeFlavorOpts) error {
url := client.ServiceURL("clusters", clusterID, opts.NodeType, "flavor")

@anton-sidelnikov anton-sidelnikov added the gate Merge PR label Dec 20, 2024
@anton-sidelnikov anton-sidelnikov merged commit 45892d8 into opentelekomcloud:devel Dec 20, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gate Merge PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants