v1.0.0
This commit is contained in:
@@ -6,12 +6,18 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// Request struct for get node annotations
|
||||
type GetNodeAnnotationsRequest struct {
|
||||
K8SID uint64 `url:"k8sId"`
|
||||
// Kubernetes cluster ID
|
||||
// Required: true
|
||||
K8SID uint64 `url:"k8sId"`
|
||||
|
||||
// Node ID
|
||||
// Required: true
|
||||
NodeID uint64 `url:"nodeId"`
|
||||
}
|
||||
|
||||
func (krq GetNodeAnnotationsRequest) Validate() error {
|
||||
func (krq GetNodeAnnotationsRequest) validate() error {
|
||||
if krq.K8SID == 0 {
|
||||
return errors.New("validation-error: field K8SID can not be empty or equal to 0")
|
||||
}
|
||||
@@ -22,8 +28,9 @@ func (krq GetNodeAnnotationsRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetNodeAnnotations gets kubernetes cluster worker node annotations
|
||||
func (k8s K8S) GetNodeAnnotations(ctx context.Context, req GetNodeAnnotationsRequest) (string, error) {
|
||||
err := req.Validate()
|
||||
err := req.validate()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user