This commit is contained in:
stSolo
2022-12-22 17:56:47 +03:00
parent 8712561853
commit d4b1ab7133
672 changed files with 28509 additions and 4419 deletions

View File

@@ -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
}