Compare commits
1 Commits
v1.5.0-del
...
v1.5.0-eps
| Author | SHA1 | Date | |
|---|---|---|---|
| 0be4d8fb0c |
@@ -2,6 +2,7 @@ package kvmppc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Input data for cloud-init facility
|
// Input data for cloud-init facility
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -87,6 +88,11 @@ type CreateRequest struct {
|
|||||||
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateRequest struct {
|
||||||
|
CreateRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Create creates KVM PowerPC VM based on specified OS image
|
// Create creates KVM PowerPC VM based on specified OS image
|
||||||
func (k KVMPPC) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
func (k KVMPPC) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -96,9 +102,25 @@ func (k KVMPPC) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateRequest{
|
||||||
|
CreateRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudapi/kvmppc/create"
|
url := "/cloudapi/kvmppc/create"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmppc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -42,13 +43,18 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description
|
// Slice of structs with net interface description
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Text description of this VM
|
// Text description of this VM
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateBlankRequest struct {
|
||||||
|
CreateBlankRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateBlank creates KVM PowerPC VM from scratch
|
// CreateBlank creates KVM PowerPC VM from scratch
|
||||||
func (k KVMPPC) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
func (k KVMPPC) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -58,9 +64,25 @@ func (k KVMPPC) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateBlankRequest{
|
||||||
|
CreateBlankRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudapi/kvmppc/createBlank"
|
url := "/cloudapi/kvmppc/createBlank"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmx86
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Input data for cloud-init facility
|
// Input data for cloud-init facility
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -87,6 +88,11 @@ type CreateRequest struct {
|
|||||||
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateRequest struct {
|
||||||
|
CreateRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Create creates KVM x86 VM based on specified OS image
|
// Create creates KVM x86 VM based on specified OS image
|
||||||
func (k KVMX86) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
func (k KVMX86) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -96,9 +102,25 @@ func (k KVMX86) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateRequest{
|
||||||
|
CreateRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudapi/kvmx86/create"
|
url := "/cloudapi/kvmx86/create"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmx86
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -42,13 +43,18 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Text description of this VM
|
// Text description of this VM
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateBlankRequest struct {
|
||||||
|
CreateBlankRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateBlank creates KVM x86 VM from scratch
|
// CreateBlank creates KVM x86 VM from scratch
|
||||||
func (k KVMX86) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
func (k KVMX86) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -58,9 +64,25 @@ func (k KVMX86) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateBlankRequest{
|
||||||
|
CreateBlankRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudapi/kvmx86/createBlank"
|
url := "/cloudapi/kvmx86/createBlank"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmppc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Input data for cloud-init facility
|
// Input data for cloud-init facility
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -87,6 +88,11 @@ type CreateRequest struct {
|
|||||||
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
IPAType string `url:"ipaType,omitempty" json:"ipaType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateRequest struct {
|
||||||
|
CreateRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Create creates KVM PowerPC VM based on specified OS image
|
// Create creates KVM PowerPC VM based on specified OS image
|
||||||
func (k KVMPPC) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
func (k KVMPPC) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -96,9 +102,25 @@ func (k KVMPPC) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateRequest{
|
||||||
|
CreateRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/kvmppc/create"
|
url := "/cloudbroker/kvmppc/create"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmppc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -42,13 +43,18 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Text description of this VM
|
// Text description of this VM
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateBlankRequest struct {
|
||||||
|
CreateBlankRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateBlank creates KVM PowerPC VM from scratch
|
// CreateBlank creates KVM PowerPC VM from scratch
|
||||||
func (k KVMPPC) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
func (k KVMPPC) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -58,9 +64,25 @@ func (k KVMPPC) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateBlankRequest{
|
||||||
|
CreateBlankRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/kvmppc/createBlank"
|
url := "/cloudbroker/kvmppc/createBlank"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmx86
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ type CreateRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Input data for cloud-init facility
|
// Input data for cloud-init facility
|
||||||
// Required: false
|
// Required: false
|
||||||
@@ -99,6 +100,11 @@ type CreateRequest struct {
|
|||||||
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
Reason string `url:"reason,omitempty" json:"reason,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateRequest struct {
|
||||||
|
CreateRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Create creates KVM PowerPC VM based on specified OS image
|
// Create creates KVM PowerPC VM based on specified OS image
|
||||||
func (k KVMX86) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
func (k KVMX86) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -108,9 +114,25 @@ func (k KVMX86) Create(ctx context.Context, req CreateRequest) (uint64, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateRequest{
|
||||||
|
CreateRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/kvmx86/create"
|
url := "/cloudbroker/kvmx86/create"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package kvmx86
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@@ -42,13 +43,18 @@ type CreateBlankRequest struct {
|
|||||||
|
|
||||||
// Slice of structs with net interface description.
|
// Slice of structs with net interface description.
|
||||||
// Required: false
|
// Required: false
|
||||||
Interfaces []Interface `url:"interfaces,omitempty" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
Interfaces []Interface `url:"-" json:"interfaces,omitempty" validate:"omitempty,min=1,dive"`
|
||||||
|
|
||||||
// Text description of this VM
|
// Text description of this VM
|
||||||
// Required: false
|
// Required: false
|
||||||
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
Description string `url:"desc,omitempty" json:"desc,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type wrapperCreateBlankRequest struct {
|
||||||
|
CreateBlankRequest
|
||||||
|
Interfaces []string `url:"interfaces,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// CreateBlank creates KVM x86 VM from scratch
|
// CreateBlank creates KVM x86 VM from scratch
|
||||||
func (k KVMX86) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
func (k KVMX86) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
@@ -58,9 +64,25 @@ func (k KVMX86) CreateBlank(ctx context.Context, req CreateBlankRequest) (uint64
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interfaces := make([]string, 0, len(req.Interfaces))
|
||||||
|
|
||||||
|
for i := range req.Interfaces {
|
||||||
|
b, err := json.Marshal(req.Interfaces[i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
interfaces = append(interfaces, string(b))
|
||||||
|
}
|
||||||
|
|
||||||
|
reqWrapped := wrapperCreateBlankRequest{
|
||||||
|
CreateBlankRequest: req,
|
||||||
|
Interfaces: interfaces,
|
||||||
|
}
|
||||||
|
|
||||||
url := "/cloudbroker/kvmx86/createBlank"
|
url := "/cloudbroker/kvmx86/createBlank"
|
||||||
|
|
||||||
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
res, err := k.client.DecortApiCall(ctx, http.MethodPost, url, reqWrapped)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user