v1.0.0
This commit is contained in:
@@ -7,11 +7,14 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Request struct for get console URL
|
||||
type GetConsoleURLRequest struct {
|
||||
// ID of compute instance to get console for
|
||||
// Required: true
|
||||
ComputeID uint64 `url:"computeId"`
|
||||
}
|
||||
|
||||
func (crq GetConsoleURLRequest) Validate() error {
|
||||
func (crq GetConsoleURLRequest) validate() error {
|
||||
if crq.ComputeID == 0 {
|
||||
return errors.New("validation-error: field ComputeID can not be empty or equal to 0")
|
||||
}
|
||||
@@ -19,8 +22,9 @@ func (crq GetConsoleURLRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetConsoleURL gets computes console URL
|
||||
func (c Compute) GetConsoleURL(ctx context.Context, req GetConsoleURLRequest) (string, error) {
|
||||
err := req.Validate()
|
||||
err := req.validate()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user