v11.0.0
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// ComputeCISetRequest struct to set compute CI
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// ComputeCIUnsetRequest struct to unset compute CI
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// CreateCDROMImageRequest struct to create CD-ROM image
|
||||
@@ -18,10 +18,6 @@ type CreateCDROMImageRequest struct {
|
||||
// Required: true
|
||||
URL string `url:"url" json:"url" validate:"required,url"`
|
||||
|
||||
// Grid (platform) ID where this CD-ROM image should be create in
|
||||
// Required: true
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
|
||||
// Account ID to make the image exclusive
|
||||
// Required: false
|
||||
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// CreateRequest struct to create image
|
||||
@@ -18,10 +18,6 @@ type CreateRequest struct {
|
||||
// Required: true
|
||||
URL string `url:"url" json:"url" validate:"required,url"`
|
||||
|
||||
// Grid (platform) ID where this template should be create in
|
||||
// Required: true
|
||||
GID uint64 `url:"gid" json:"gid" validate:"required"`
|
||||
|
||||
// Boot type of image
|
||||
// Should be one of:
|
||||
// - bios
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// CreateVirtualRequest struct to create virtual image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// DeleteRequest struct to delete image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// DeleteCDROMImageRequest struct to delete CD-ROM image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// DeleteImagesRequest struct to delete images
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// DisableRequest struct to disable image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// EditRequest struct to edit image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// EnableRequest struct to enable image
|
||||
|
||||
@@ -29,7 +29,7 @@ var images = ListImages{
|
||||
Name: "u16",
|
||||
Password: "",
|
||||
Pool: "vmstor",
|
||||
PresentTo: []uint64{},
|
||||
PresentTo: map[string]uint64{},
|
||||
ProviderName: "",
|
||||
PurgeAttempts: 0,
|
||||
ReferenceID: "sample_reference_id_u16",
|
||||
@@ -72,7 +72,7 @@ var images = ListImages{
|
||||
Name: "alpine-virt-3.17",
|
||||
Password: "",
|
||||
Pool: "vmstor",
|
||||
PresentTo: []uint64{},
|
||||
PresentTo: map[string]uint64{},
|
||||
ProviderName: "",
|
||||
PurgeAttempts: 0,
|
||||
ReferenceID: "sample_reference_id_alpine",
|
||||
@@ -115,7 +115,7 @@ var images = ListImages{
|
||||
Name: "test",
|
||||
Password: "",
|
||||
Pool: "vmstor",
|
||||
PresentTo: []uint64{},
|
||||
PresentTo: map[string]uint64{},
|
||||
ProviderName: "",
|
||||
PurgeAttempts: 0,
|
||||
ReferenceID: "sample_reference_id_test",
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// GetRequest struct to get image details
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// GrantAccessRequest struct to share image with accounts
|
||||
@@ -16,7 +16,7 @@ type GrantAccessRequest struct {
|
||||
|
||||
// ID of the accounts for share image
|
||||
// Required: true
|
||||
AccountIDs []uint64 `url:"accounts" json:"accounts" validate:"required"`
|
||||
AccountIDs []int64 `url:"accounts" json:"accounts" validate:"required"`
|
||||
}
|
||||
|
||||
// GrantAccess shares specified image with specified accounts
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Lists all the images. A image is a template which can be used to deploy machines
|
||||
package image
|
||||
|
||||
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces"
|
||||
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces"
|
||||
|
||||
// Structure for creating request to image
|
||||
type Image struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// LinkRequest struct to link virtual image to another image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// ListRequest struct to get list of available images
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// ListStacksRequest struct to get list of stack
|
||||
|
||||
@@ -75,7 +75,7 @@ type RecordImage struct {
|
||||
Pool string `json:"pool"`
|
||||
|
||||
// Present to
|
||||
PresentTo []uint64 `json:"presentTo"`
|
||||
PresentTo map[string]uint64 `json:"presentTo"`
|
||||
|
||||
// Provider name
|
||||
ProviderName string `json:"provider_name"`
|
||||
@@ -201,7 +201,7 @@ type ItemImage struct {
|
||||
Pool string `json:"pool"`
|
||||
|
||||
// Present to
|
||||
PresentTo []uint64 `json:"presentTo"`
|
||||
PresentTo map[string]uint64 `json:"presentTo"`
|
||||
|
||||
// Provider name
|
||||
ProviderName string `json:"provider_name"`
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// RenameRequest struct to rename image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// RevokeAccessRequest struct to unshare image with accounts
|
||||
@@ -16,7 +16,7 @@ type RevokeAccessRequest struct {
|
||||
|
||||
// ID of the accounts for unshare image
|
||||
// Required: true
|
||||
AccountIDs []uint64 `url:"accounts" json:"accounts" validate:"required"`
|
||||
AccountIDs []int64 `url:"accounts" json:"accounts" validate:"required"`
|
||||
}
|
||||
|
||||
// RevokeAccess unshares specified image with specified accounts
|
||||
|
||||
@@ -3,7 +3,7 @@ package image
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// ShareRequest struct to share image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// SyncCreateRequest struct to sync create image
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators"
|
||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators"
|
||||
)
|
||||
|
||||
// UpdateNodesRequest struct to update nodes
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
package image
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
// UploadImageFileResponse struct to enable image
|
||||
type UploadImageFileResponse struct {
|
||||
// ImageFileUri
|
||||
ImageFileUri string `json:"image_file_uri"`
|
||||
}
|
||||
|
||||
// UploadImageFile uploads file image to platform
|
||||
func (i Image) UploadImageFile(ctx context.Context, filePath string) (string, error) {
|
||||
file, err := os.ReadFile(filePath)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("can not read file %v", err)
|
||||
}
|
||||
|
||||
url := "/cloudbroker/image/uploadImageFile"
|
||||
|
||||
res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, file)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
result := UploadImageFileResponse{}
|
||||
|
||||
err = json.Unmarshal(res, &result)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return result.ImageFileUri, nil
|
||||
}
|
||||
Reference in New Issue
Block a user