-
Notifications
You must be signed in to change notification settings - Fork 11
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
Css updates #754
Conversation
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. |
f79fb55
to
0693956
Compare
0693956
to
3a7ce65
Compare
269c19c
// Type of the cluster node to modify. | ||
NodeType string `json:"type" required:"true"` | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
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) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
1ba2fa3
45892d8
into
opentelekomcloud:devel
Adding CSS new functionalities: