Compare commits
2 Commits
main
...
v1.6.0-alf
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b3de4df7f | |||
| c0608d08b9 |
@@ -106,6 +106,10 @@ type CreateRequest struct {
|
|||||||
// Text description of this Kubernetes cluster
|
// Text description of this Kubernetes cluster
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
|
|
||||||
|
//Use only selected ExtNet for infrastructure connections
|
||||||
|
// Required: false
|
||||||
|
ExtNetOnly bool `url:"extnetOnly,omitempty" json:"extnetOnly,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a new Kubernetes cluster in the specified Resource Group
|
// Create creates a new Kubernetes cluster in the specified Resource Group
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package lb
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@@ -20,16 +21,16 @@ type CreateRequest struct {
|
|||||||
Name string `url:"name" json:"name" validate:"required"`
|
Name string `url:"name" json:"name" validate:"required"`
|
||||||
|
|
||||||
// External network to connect this load balancer to
|
// External network to connect this load balancer to
|
||||||
// Required: true
|
// Required: false
|
||||||
ExtNetID uint64 `url:"extnetId" json:"extnetId" validate:"required"`
|
ExtNetID uint64 `url:"extnetId" json:"extnetId"`
|
||||||
|
|
||||||
// Internal network (VINS) to connect this load balancer to
|
// Internal network (VINS) to connect this load balancer to
|
||||||
// Required: true
|
// Required: false
|
||||||
VINSID uint64 `url:"vinsId" json:"vinsId" validate:"required"`
|
VINSID uint64 `url:"vinsId" json:"vinsId"`
|
||||||
|
|
||||||
// Start now Load balancer
|
// Start now Load balancer
|
||||||
// Required: true
|
// Required: false
|
||||||
Start bool `url:"start" json:"start" validate:"required"`
|
Start bool `url:"start" json:"start"`
|
||||||
|
|
||||||
// Text description of this load balancer
|
// Text description of this load balancer
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -45,6 +46,10 @@ func (l LB) Create(ctx context.Context, req CreateRequest) (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.ExtNetID == 0 && req.VINSID == 0 {
|
||||||
|
return "", errors.New ("vinsId and extNetId cannot be both in the value 0")
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudapi/lb/create"
|
url := "/cloudapi/lb/create"
|
||||||
|
|
||||||
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := l.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
|||||||
Reference in New Issue
Block a user