update go.mod and imports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/account"
|
||||
)
|
||||
|
||||
// Accessing the Account method group
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// API Actor API for managing account
|
||||
package account
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to account
|
||||
type Account struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for adding permission to access to account for a user
|
||||
|
||||
@@ -3,7 +3,7 @@ package account
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update resource types in account
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// List of method groups for the admin
|
||||
package cloudbroker
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to CloudBroker groups
|
||||
type CloudBroker struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/compute"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/compute"
|
||||
)
|
||||
|
||||
// Accessing the Compute method group
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add affinity rule
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for remove affinity rule
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add anti affinity rule
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for remove anti affinity rule
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set boot order
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// API Actor for managing Compute. This actor is a final API for admin to manage Compute
|
||||
package compute
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to compute
|
||||
type Compute struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for attach network
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update QOS
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for add port forward rule
|
||||
|
||||
@@ -3,7 +3,7 @@ package compute
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for grant access to compute
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update user access
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/disks"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/disks"
|
||||
)
|
||||
|
||||
// Accessing the Disks method group
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create disk
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// API Actor for managing Disk. This actor is a final API for admin to manage Disk
|
||||
package disks
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to disks
|
||||
type Disks struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package disks
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/extnet"
|
||||
)
|
||||
|
||||
// Accessing the ExtNet method group
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// API Actor for configure and use external networks
|
||||
package extnet
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to extnet
|
||||
type ExtNet struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package extnet
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cloudbroker
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/grid"
|
||||
|
||||
// Accessing the Grid method group
|
||||
func (cb *CloudBroker) Grid() *grid.Grid {
|
||||
|
||||
131
pkg/cloudbroker/grid/filter_test.go
Normal file
131
pkg/cloudbroker/grid/filter_test.go
Normal file
@@ -0,0 +1,131 @@
|
||||
package grid
|
||||
|
||||
import "testing"
|
||||
|
||||
var grids = ListGrids{
|
||||
{
|
||||
Resources: Resources{
|
||||
Current: RecordResource{
|
||||
CPU: 84,
|
||||
DiskSize: 976,
|
||||
DiskSizeMax: 1200,
|
||||
ExtIPs: 132,
|
||||
ExtTraffic: 0,
|
||||
GPU: 79500,
|
||||
RAM: 0,
|
||||
SEPs: map[string]map[string]DiskUsage{},
|
||||
},
|
||||
Reserved: RecordResource{
|
||||
CPU: 123,
|
||||
DiskSize: 976,
|
||||
DiskSizeMax: 1200,
|
||||
ExtIPs: 132,
|
||||
ExtTraffic: 0,
|
||||
GPU: 0,
|
||||
RAM: 152600,
|
||||
SEPs: map[string]map[string]DiskUsage{},
|
||||
},
|
||||
},
|
||||
Flag: "",
|
||||
GID: 212,
|
||||
GUID: 1,
|
||||
ID: 1,
|
||||
LocationCode: "alfa",
|
||||
Name: "alfa",
|
||||
},
|
||||
{
|
||||
Resources: Resources{
|
||||
Current: RecordResource{
|
||||
CPU: 84,
|
||||
DiskSize: 976,
|
||||
DiskSizeMax: 1200,
|
||||
ExtIPs: 132,
|
||||
ExtTraffic: 0,
|
||||
GPU: 79500,
|
||||
RAM: 0,
|
||||
SEPs: map[string]map[string]DiskUsage{},
|
||||
},
|
||||
Reserved: RecordResource{
|
||||
CPU: 123,
|
||||
DiskSize: 976,
|
||||
DiskSizeMax: 1200,
|
||||
ExtIPs: 132,
|
||||
ExtTraffic: 0,
|
||||
GPU: 0,
|
||||
RAM: 152600,
|
||||
SEPs: map[string]map[string]DiskUsage{},
|
||||
},
|
||||
},
|
||||
Flag: "",
|
||||
GID: 666,
|
||||
GUID: 2,
|
||||
ID: 2,
|
||||
LocationCode: "beta",
|
||||
Name: "beta",
|
||||
},
|
||||
{
|
||||
Resources: Resources{
|
||||
Current: RecordResource{
|
||||
CPU: 84,
|
||||
DiskSize: 976,
|
||||
DiskSizeMax: 1200,
|
||||
ExtIPs: 132,
|
||||
ExtTraffic: 0,
|
||||
GPU: 79500,
|
||||
RAM: 0,
|
||||
SEPs: map[string]map[string]DiskUsage{},
|
||||
},
|
||||
Reserved: RecordResource{
|
||||
CPU: 123,
|
||||
DiskSize: 976,
|
||||
DiskSizeMax: 1200,
|
||||
ExtIPs: 132,
|
||||
ExtTraffic: 0,
|
||||
GPU: 0,
|
||||
RAM: 152600,
|
||||
SEPs: map[string]map[string]DiskUsage{},
|
||||
},
|
||||
},
|
||||
Flag: "",
|
||||
GID: 777,
|
||||
GUID: 3,
|
||||
ID: 3,
|
||||
LocationCode: "gamma",
|
||||
Name: "gamma",
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := grids.FilterByID(2).FindOne()
|
||||
|
||||
if actual.ID != 2 {
|
||||
t.Fatal("expected ID 2, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := grids.FilterByName("gamma").FindOne()
|
||||
|
||||
if actual.Name != "gamma" {
|
||||
t.Fatal("expected Name 'gamma', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByLocationCode(t *testing.T) {
|
||||
actual := grids.FilterByLocationCode("alfa").FindOne()
|
||||
|
||||
if actual.LocationCode != "alfa" {
|
||||
t.Fatal("expected LocationCode 'alfa', found: ", actual.LocationCode)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := grids.FilterFunc(func(rg RecordGrid) bool {
|
||||
return rg.GID == 777
|
||||
}).
|
||||
FindOne()
|
||||
|
||||
if actual.GID != 777 {
|
||||
t.Fatal("expected GID 777, found: ", actual.GID)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
package grid
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
)
|
||||
|
||||
// Structure for creating request to grid
|
||||
|
||||
@@ -3,7 +3,7 @@ package grid
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/image"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/image"
|
||||
)
|
||||
|
||||
// Accessing the Image method group
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create CD-ROM image
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create image
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package image
|
||||
|
||||
// FilterById returns ListImages with specified ID.
|
||||
func (li ListImages) FilterById(id uint64) ListImages {
|
||||
func (li ListImages) FilterByID(id uint64) ListImages {
|
||||
predicate := func(ri RecordImage) bool {
|
||||
return ri.ID == id
|
||||
}
|
||||
|
||||
214
pkg/cloudbroker/image/filter_test.go
Normal file
214
pkg/cloudbroker/image/filter_test.go
Normal file
@@ -0,0 +1,214 @@
|
||||
package image
|
||||
|
||||
import "testing"
|
||||
|
||||
var images = ListImages{
|
||||
RecordImage{
|
||||
UNCPath: "",
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"osismodel",
|
||||
"cloudbroker",
|
||||
"image",
|
||||
1,
|
||||
},
|
||||
AccountID: 0,
|
||||
ACL: []ACL{},
|
||||
Architecture: "X86_64",
|
||||
BootType: "bios",
|
||||
Bootable: true,
|
||||
ComputeCIID: 0,
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
Drivers: []string{
|
||||
"KVM_X86",
|
||||
},
|
||||
Enabled: true,
|
||||
GID: 212,
|
||||
GUID: 9882,
|
||||
History: []History{},
|
||||
HotResize: true,
|
||||
ID: 9882,
|
||||
LastModified: 0,
|
||||
LinkTo: 0,
|
||||
Milestones: 363491,
|
||||
Name: "u16",
|
||||
Password: "",
|
||||
Pool: "vmstor",
|
||||
PresentTo: []uint64{},
|
||||
ProviderName: "",
|
||||
PurgeAttempts: 0,
|
||||
ReferenceID: "sample_reference_id_u16",
|
||||
ResID: "b321318-3214as-324-213-fdas",
|
||||
ResName: "templates/image_9882",
|
||||
RescueCD: false,
|
||||
SEPID: 2504,
|
||||
SharedWith: []uint64{},
|
||||
Size: 5,
|
||||
Status: "CREATED",
|
||||
TechStatus: "ALLOCATED",
|
||||
Type: "linux",
|
||||
URL: "http://sample_url:8000/u16",
|
||||
Username: "",
|
||||
Version: "",
|
||||
Virtual: false,
|
||||
},
|
||||
RecordImage{
|
||||
UNCPath: "",
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"osismodel",
|
||||
"cloudbroker",
|
||||
"image",
|
||||
1,
|
||||
},
|
||||
AccountID: 0,
|
||||
ACL: []ACL{},
|
||||
Architecture: "X86_64",
|
||||
BootType: "bois",
|
||||
Bootable: true,
|
||||
ComputeCIID: 0,
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
Drivers: []string{
|
||||
"KVM_X86",
|
||||
},
|
||||
Enabled: false,
|
||||
GID: 212,
|
||||
GUID: 9884,
|
||||
History: []History{},
|
||||
HotResize: false,
|
||||
ID: 9884,
|
||||
LastModified: 0,
|
||||
LinkTo: 0,
|
||||
Milestones: 363499,
|
||||
Name: "alpine-virt-3.17",
|
||||
Password: "",
|
||||
Pool: "vmstor",
|
||||
PresentTo: []uint64{},
|
||||
ProviderName: "",
|
||||
PurgeAttempts: 0,
|
||||
ReferenceID: "sample_reference_id_alpine",
|
||||
ResID: "31d1d410-74f1-4e09-866b-046a5a8433c3",
|
||||
ResName: "templates/image_9884",
|
||||
RescueCD: false,
|
||||
SEPID: 2504,
|
||||
SharedWith: []uint64{},
|
||||
Size: 1,
|
||||
Status: "CREATED",
|
||||
TechStatus: "ALLOCATED",
|
||||
Type: "linux",
|
||||
URL: "http://sample_url:8000/alpine-virt-3",
|
||||
Username: "",
|
||||
Version: "",
|
||||
Virtual: true,
|
||||
},
|
||||
RecordImage{
|
||||
UNCPath: "",
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"osismodel",
|
||||
"cloudbroker",
|
||||
"image",
|
||||
1,
|
||||
},
|
||||
AccountID: 1,
|
||||
ACL: []ACL{},
|
||||
Architecture: "X86_64",
|
||||
BootType: "bios",
|
||||
Bootable: true,
|
||||
ComputeCIID: 0,
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
Drivers: []string{
|
||||
"KVM_X86",
|
||||
},
|
||||
Enabled: true,
|
||||
GID: 212,
|
||||
GUID: 9885,
|
||||
History: []History{},
|
||||
HotResize: true,
|
||||
ID: 9885,
|
||||
LastModified: 0,
|
||||
LinkTo: 0,
|
||||
Milestones: 363513,
|
||||
Name: "test",
|
||||
Password: "",
|
||||
Pool: "vmstor",
|
||||
PresentTo: []uint64{},
|
||||
ProviderName: "",
|
||||
PurgeAttempts: 0,
|
||||
ReferenceID: "sample_reference_id_test",
|
||||
ResID: "1f53b815-1ac9-4a4b-af98-a0a3b69a34bb",
|
||||
ResName: "templates/image_9885",
|
||||
RescueCD: false,
|
||||
SEPID: 2505,
|
||||
SharedWith: []uint64{},
|
||||
Size: 4,
|
||||
Status: "DESTROYED",
|
||||
TechStatus: "ALLOCATED",
|
||||
Type: "linux",
|
||||
URL: "http://sample_url:8000/test",
|
||||
Username: "",
|
||||
Version: "",
|
||||
Virtual: false,
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := images.FilterByID(9885).FindOne()
|
||||
|
||||
if actual.ID != 9885 {
|
||||
t.Fatal("expected ID 9885, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := images.FilterByName("u16").FindOne()
|
||||
|
||||
if actual.Name != "u16" {
|
||||
t.Fatal("expected Name 'u16', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByStatus(t *testing.T) {
|
||||
actual := images.FilterByStatus("CREATED")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.Status != "CREATED" {
|
||||
t.Fatal("expected Status 'CREATED', found: ", item.Status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByBootType(t *testing.T) {
|
||||
actual := images.FilterByBootType("bios")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.BootType != "bios" {
|
||||
t.Fatal("expected BootType 'bios', found: ", item.BootType)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := images.FilterFunc(func(ri RecordImage) bool {
|
||||
return ri.Virtual == true
|
||||
})
|
||||
|
||||
if len(actual) != 1 {
|
||||
t.Fatal("expected 1 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
if actual[0].Virtual != true {
|
||||
t.Fatal("expected Virtual true, found false")
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Lists all the images. A image is a template which can be used to deploy machines
|
||||
package image
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to image
|
||||
type Image struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package image
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for sync create image
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/k8ci"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/k8ci"
|
||||
)
|
||||
|
||||
// Accessing the K8CI method group
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create K8CI instance
|
||||
|
||||
144
pkg/cloudbroker/k8ci/filter_test.go
Normal file
144
pkg/cloudbroker/k8ci/filter_test.go
Normal file
@@ -0,0 +1,144 @@
|
||||
package k8ci
|
||||
|
||||
import "testing"
|
||||
|
||||
var k8ciItems = ListK8CI{
|
||||
ItemK8CI{
|
||||
CreatedTime: 123902139,
|
||||
RecordK8CI: RecordK8CI{
|
||||
Description: "",
|
||||
GID: 0,
|
||||
GUID: 1,
|
||||
ID: 1,
|
||||
LBImageID: 5,
|
||||
MasterDriver: "KVM_X86",
|
||||
MasterImageID: 120,
|
||||
MaxMasterCount: 2,
|
||||
MaxWorkerCount: 3,
|
||||
Name: "purple_snake",
|
||||
SharedWith: []interface{}{},
|
||||
Status: "ENABLED",
|
||||
Version: "1",
|
||||
WorkerDriver: "KVM_X86",
|
||||
WorkerImageID: 120,
|
||||
},
|
||||
},
|
||||
ItemK8CI{
|
||||
CreatedTime: 123902232,
|
||||
RecordK8CI: RecordK8CI{
|
||||
Description: "",
|
||||
GID: 0,
|
||||
GUID: 2,
|
||||
ID: 2,
|
||||
LBImageID: 10,
|
||||
MasterDriver: "KVM_X86",
|
||||
MasterImageID: 121,
|
||||
MaxMasterCount: 3,
|
||||
MaxWorkerCount: 5,
|
||||
Name: "green_giant",
|
||||
SharedWith: []interface{}{},
|
||||
Status: "DISABLED",
|
||||
Version: "2",
|
||||
WorkerDriver: "KVM_X86",
|
||||
WorkerImageID: 121,
|
||||
},
|
||||
},
|
||||
ItemK8CI{
|
||||
CreatedTime: 123902335,
|
||||
RecordK8CI: RecordK8CI{
|
||||
Description: "",
|
||||
GID: 0,
|
||||
GUID: 3,
|
||||
ID: 3,
|
||||
LBImageID: 12,
|
||||
MasterDriver: "KVM_X86",
|
||||
MasterImageID: 98,
|
||||
MaxMasterCount: 5,
|
||||
MaxWorkerCount: 9,
|
||||
Name: "magenta_cloud",
|
||||
SharedWith: []interface{}{},
|
||||
Status: "ENABLED",
|
||||
Version: "3",
|
||||
WorkerDriver: "KVM_X86",
|
||||
WorkerImageID: 98,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := k8ciItems.FilterByID(2).FindOne()
|
||||
|
||||
if actual.ID != 2 {
|
||||
t.Fatal("expected ID 2, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := k8ciItems.FilterByName("magenta_cloud").FindOne()
|
||||
|
||||
if actual.Name != "magenta_cloud" {
|
||||
t.Fatal("expected Name 'magenta_cloud', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByStatus(t *testing.T) {
|
||||
actual := k8ciItems.FilterByStatus("ENABLED")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.Status != "ENABLED" {
|
||||
t.Fatal("expected Status 'ENABLED', found: ", item.Status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByWorkerImageID(t *testing.T) {
|
||||
actual := k8ciItems.FilterByWorkerImageID(98).FindOne()
|
||||
|
||||
if actual.WorkerImageID != 98 {
|
||||
t.Fatal("expected WorkerImageID 98, found: ", actual.WorkerImageID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByLBImageID(t *testing.T) {
|
||||
actual := k8ciItems.FilterByLBImageID(10).FindOne()
|
||||
|
||||
if actual.LBImageID != 10 {
|
||||
t.Fatal("expected LBImageID 10, found: ", actual.LBImageID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByMasterImageID(t *testing.T) {
|
||||
actual := k8ciItems.FilterByMasterImageID(120).FindOne()
|
||||
|
||||
if actual.MasterImageID != 120 {
|
||||
t.Fatal("expected MasterImageID 120, found: ", actual.MasterImageID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := k8ciItems.FilterFunc(func(ikc ItemK8CI) bool {
|
||||
return ikc.CreatedTime > 123902139
|
||||
})
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.CreatedTime < 123902139 {
|
||||
t.Fatal("expected CreatedTime greater than 123902139, found: ", item.CreatedTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSortingByCreatedTime(t *testing.T) {
|
||||
actual := k8ciItems.SortByCreatedTime(true)
|
||||
|
||||
if actual[0].CreatedTime != 123902335 && actual[2].CreatedTime != 123902139 {
|
||||
t.Fatal("expected inverse sort, found normal")
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
package k8ci
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
)
|
||||
|
||||
// Structure for creating request to K8CI
|
||||
|
||||
@@ -3,7 +3,7 @@ package k8ci
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/k8s"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/k8s"
|
||||
)
|
||||
|
||||
// Accessing the K8S method group
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package k8s
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
)
|
||||
|
||||
// Structure for creating request to K8S
|
||||
|
||||
@@ -3,7 +3,7 @@ package k8s
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cloudbroker
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/kvmppc"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/kvmppc"
|
||||
|
||||
// Accessing the KVMPPC method group
|
||||
func (cb *CloudBroker) KVMPPC() *kvmppc.KVMPPC {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// API to manage KVM PowerPC compute instances (PPC VMs)
|
||||
package kvmppc
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to KVMPPC
|
||||
type KVMPPC struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/kvmx86"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/kvmx86"
|
||||
)
|
||||
|
||||
// Accessing the KVMX86 method group
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// API to manage KVM x86 compute instances (x86 VMs)
|
||||
package kvmx86
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to KVMX86
|
||||
type KVMX86 struct {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cloudbroker
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/lb"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/lb"
|
||||
|
||||
// Accessing the LB method group
|
||||
func (cb *CloudBroker) LB() *lb.LB {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for create backend
|
||||
|
||||
151
pkg/cloudbroker/lb/filter_test.go
Normal file
151
pkg/cloudbroker/lb/filter_test.go
Normal file
@@ -0,0 +1,151 @@
|
||||
package lb
|
||||
|
||||
import "testing"
|
||||
|
||||
var lbs = ListLB{
|
||||
RecordLB{
|
||||
HAMode: true,
|
||||
CKey: "",
|
||||
Meta: []interface{}{},
|
||||
ACL: []interface{}{},
|
||||
Backends: []ItemBackend{},
|
||||
CreatedBy: "test_user_1",
|
||||
CreatedTime: 1636667448,
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
DPAPIPassword: "0000",
|
||||
DPAPIUser: "api_user",
|
||||
ExtNetID: 2522,
|
||||
Frontends: []ItemFrontend{},
|
||||
GID: 212,
|
||||
GUID: 1,
|
||||
ID: 1,
|
||||
ImageID: 2121,
|
||||
Milestones: 129000,
|
||||
Name: "k8s-lb-test-1",
|
||||
PrimaryNode: Node{},
|
||||
RGID: 25090,
|
||||
RGName: "",
|
||||
SecondaryNode: Node{},
|
||||
Status: "ENABLED",
|
||||
TechStatus: "STARTED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
VINSID: 101,
|
||||
},
|
||||
RecordLB{
|
||||
HAMode: false,
|
||||
CKey: "",
|
||||
Meta: []interface{}{},
|
||||
ACL: []interface{}{},
|
||||
Backends: []ItemBackend{},
|
||||
CreatedBy: "test_user_2",
|
||||
CreatedTime: 1636667506,
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
DPAPIPassword: "0000",
|
||||
DPAPIUser: "api_user_2",
|
||||
ExtNetID: 2524,
|
||||
Frontends: []ItemFrontend{},
|
||||
GID: 212,
|
||||
GUID: 2,
|
||||
ID: 2,
|
||||
ImageID: 2129,
|
||||
Milestones: 129013,
|
||||
Name: "k8s-lb-test-2",
|
||||
PrimaryNode: Node{},
|
||||
RGID: 25092,
|
||||
RGName: "",
|
||||
SecondaryNode: Node{},
|
||||
Status: "ENABLED",
|
||||
TechStatus: "STOPPED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
VINSID: 102,
|
||||
},
|
||||
RecordLB{
|
||||
HAMode: true,
|
||||
CKey: "",
|
||||
Meta: []interface{}{},
|
||||
ACL: []interface{}{},
|
||||
Backends: []ItemBackend{},
|
||||
CreatedBy: "te2t_user_3",
|
||||
CreatedTime: 1636667534,
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
DPAPIPassword: "0000",
|
||||
DPAPIUser: "api_user_3",
|
||||
ExtNetID: 2536,
|
||||
Frontends: []ItemFrontend{},
|
||||
GID: 212,
|
||||
GUID: 3,
|
||||
ID: 3,
|
||||
ImageID: 2139,
|
||||
Milestones: 129025,
|
||||
Name: "k8s-lb-test-3",
|
||||
PrimaryNode: Node{},
|
||||
RGID: 25106,
|
||||
RGName: "",
|
||||
SecondaryNode: Node{},
|
||||
Status: "DISABLED",
|
||||
TechStatus: "STOPPED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
VINSID: 118,
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := lbs.FilterByID(2).FindOne()
|
||||
|
||||
if actual.ID != 2 {
|
||||
t.Fatal("expected ID 2, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := lbs.FilterByName("k8s-lb-test-3").FindOne()
|
||||
|
||||
if actual.Name != "k8s-lb-test-3" {
|
||||
t.Fatal("expected Name 'k8s-lb-test-3', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByExtNetID(t *testing.T) {
|
||||
actual := lbs.FilterByExtNetID(2522).FindOne()
|
||||
|
||||
if actual.ExtNetID != 2522 {
|
||||
t.Fatal("expected ExtNetID 2522, found: ", actual.ExtNetID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByImageID(t *testing.T) {
|
||||
actual := lbs.FilterByImageID(2139).FindOne()
|
||||
|
||||
if actual.ImageID != 2139 {
|
||||
t.Fatal("expected ImageID 2139, found: ", actual.ImageID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := lbs.FilterFunc(func(rl RecordLB) bool {
|
||||
return rl.Status == "DISABLED"
|
||||
})
|
||||
|
||||
for _, item := range actual {
|
||||
if item.Status != "DISABLED" {
|
||||
t.Fatal("expected Status 'DISABLED', found: ", item.Status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSortByCreatedTime(t *testing.T) {
|
||||
actual := lbs.SortByCreatedTime(true)
|
||||
|
||||
if actual[0].CreatedTime != 1636667534 || actual[2].CreatedTime != 1636667448 {
|
||||
t.Fatal("expected descending order, found ascending")
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// API to manage load balancer instance
|
||||
package lb
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to load balancer
|
||||
type LB struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package lb
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cloudbroker
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/rg"
|
||||
|
||||
// Accessing the RG method group
|
||||
func (cb *CloudBroker) RG() *rg.RG {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for grant access to resource group
|
||||
|
||||
244
pkg/cloudbroker/rg/filter_test.go
Normal file
244
pkg/cloudbroker/rg/filter_test.go
Normal file
@@ -0,0 +1,244 @@
|
||||
package rg
|
||||
|
||||
import "testing"
|
||||
|
||||
var rgs = ListRG{
|
||||
{
|
||||
AccountID: 1,
|
||||
AccountName: "std",
|
||||
ACL: []ACL{
|
||||
{
|
||||
Explicit: true,
|
||||
GUID: "",
|
||||
Right: "ARCXDU",
|
||||
Status: "CONFIRMED",
|
||||
Type: "U",
|
||||
UserGroupID: "sample_user_1@decs3o",
|
||||
},
|
||||
},
|
||||
CreatedBy: "sample_user_1@decs3o",
|
||||
CreatedTime: 1676645305,
|
||||
DefNetID: 1,
|
||||
DefNetType: "NONE",
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
GID: 212,
|
||||
GUID: 7971,
|
||||
ID: 7971,
|
||||
LockStatus: "UNLOCKED",
|
||||
Milestones: 363459,
|
||||
Name: "rg_1",
|
||||
RegisterComputes: false,
|
||||
ResourceLimits: ResourceLimits{
|
||||
CUC: -1,
|
||||
CuD: -1,
|
||||
CUI: -1,
|
||||
CUM: -1,
|
||||
CUNP: -1,
|
||||
GPUUnits: -1,
|
||||
},
|
||||
Secret: "",
|
||||
Status: "CREATED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
VINS: []uint64{},
|
||||
VMs: []uint64{},
|
||||
ResTypes: []string{},
|
||||
UniqPools: []string{},
|
||||
},
|
||||
{
|
||||
AccountID: 2,
|
||||
AccountName: "std_2",
|
||||
ACL: []ACL{
|
||||
{
|
||||
Explicit: true,
|
||||
GUID: "",
|
||||
Right: "ARCXDU",
|
||||
Status: "CONFIRMED",
|
||||
Type: "U",
|
||||
UserGroupID: "sample_user_1@decs3o",
|
||||
},
|
||||
},
|
||||
CreatedBy: "sample_user_1@decs3o",
|
||||
CreatedTime: 1676645461,
|
||||
DefNetID: 2,
|
||||
DefNetType: "NONE",
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
GID: 212,
|
||||
GUID: 7972,
|
||||
ID: 7972,
|
||||
LockStatus: "UNLOCKED",
|
||||
Milestones: 363468,
|
||||
Name: "rg_2",
|
||||
RegisterComputes: false,
|
||||
ResourceLimits: ResourceLimits{
|
||||
CUC: -1,
|
||||
CuD: -1,
|
||||
CUI: -1,
|
||||
CUM: -1,
|
||||
CUNP: -1,
|
||||
GPUUnits: -1,
|
||||
},
|
||||
Secret: "",
|
||||
Status: "CREATED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
VINS: []uint64{},
|
||||
VMs: []uint64{},
|
||||
ResTypes: []string{},
|
||||
UniqPools: []string{},
|
||||
},
|
||||
{
|
||||
AccountID: 3,
|
||||
AccountName: "std_3",
|
||||
ACL: []ACL{
|
||||
{
|
||||
Explicit: true,
|
||||
GUID: "",
|
||||
Right: "ARCXDU",
|
||||
Status: "CONFIRMED",
|
||||
Type: "U",
|
||||
UserGroupID: "sample_user_2@decs3o",
|
||||
},
|
||||
},
|
||||
CreatedBy: "sample_user_2@decs3o",
|
||||
CreatedTime: 1676645548,
|
||||
DefNetID: 3,
|
||||
DefNetType: "NONE",
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
GID: 212,
|
||||
GUID: 7973,
|
||||
ID: 7973,
|
||||
LockStatus: "kjLOCKED",
|
||||
Milestones: 363471,
|
||||
Name: "rg_3",
|
||||
RegisterComputes: false,
|
||||
ResourceLimits: ResourceLimits{
|
||||
CUC: -1,
|
||||
CuD: -1,
|
||||
CUI: -1,
|
||||
CUM: -1,
|
||||
CUNP: -1,
|
||||
GPUUnits: -1,
|
||||
},
|
||||
Secret: "",
|
||||
Status: "DISABLED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
VINS: []uint64{},
|
||||
VMs: []uint64{
|
||||
48500,
|
||||
},
|
||||
ResTypes: []string{},
|
||||
UniqPools: []string{},
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := rgs.FilterByID(7972).FindOne()
|
||||
|
||||
if actual.ID != 7972 {
|
||||
t.Fatal("expected ID 2, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := rgs.FilterByName("rg_1").FindOne()
|
||||
|
||||
if actual.Name != "rg_1" {
|
||||
t.Fatal("expected Name 'rg_1', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByCreatedBy(t *testing.T) {
|
||||
actual := rgs.FilterByCreatedBy("sample_user_1@decs3o")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.CreatedBy != "sample_user_1@decs3o" {
|
||||
t.Fatal("expected CreatedBy 'sample_user_1@decs3o', found: ", item.CreatedBy)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByStatus(t *testing.T) {
|
||||
actual := rgs.FilterByStatus("CREATED")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.Status != "CREATED" {
|
||||
t.Fatal("expected Status 'ENABLED', found: ", item.Status)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByLockStatus(t *testing.T) {
|
||||
actual := rgs.FilterByLockStatus("UNLOCKED")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.LockStatus != "UNLOCKED" {
|
||||
t.Fatal("expected LockStatus 'UNLOCKED', found: ", item.LockStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByDefNetType(t *testing.T) {
|
||||
actual := rgs.FilterByDefNetType("NONE")
|
||||
|
||||
if len(actual) != 3 {
|
||||
t.Fatal("expected 3 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.DefNetType != "NONE" {
|
||||
t.Fatal("expected DefNetType 'NONE', found: ", item.DefNetType)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByDefNetID(t *testing.T) {
|
||||
actual := rgs.FilterByDefNetID(1).FindOne()
|
||||
|
||||
if actual.DefNetID != 1 {
|
||||
t.Fatal("expected DefNetID 1, found: ", actual.DefNetID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := rgs.FilterFunc(func(ir ItemRG) bool {
|
||||
return len(ir.VMs) > 0
|
||||
})
|
||||
|
||||
if len(actual) < 1 {
|
||||
t.Fatal("expected 1 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if len(item.VMs) < 1 {
|
||||
t.Fatal("expected VMs to contain at least 1 element, found empty")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestSortByCreatedTime(t *testing.T) {
|
||||
actual := rgs.SortByCreatedTime(true)
|
||||
|
||||
if actual[0].CreatedTime != 1676645548 || actual[2].CreatedTime != 1676645305 {
|
||||
t.Fatal("expected descending order, found ascending")
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
package rg
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
)
|
||||
|
||||
// Structure for creating request to resource group
|
||||
|
||||
@@ -3,7 +3,7 @@ package rg
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for set default network
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for update resource types in account
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cloudbroker
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/sep"
|
||||
|
||||
// Accessing the SEP method group
|
||||
func (cb *CloudBroker) SEP() *sep.SEP {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for edit config fields
|
||||
|
||||
184
pkg/cloudbroker/sep/filter_test.go
Normal file
184
pkg/cloudbroker/sep/filter_test.go
Normal file
@@ -0,0 +1,184 @@
|
||||
package sep
|
||||
|
||||
import "testing"
|
||||
|
||||
var seps = ListSEP{
|
||||
{
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"osismodel",
|
||||
"cloudbroker",
|
||||
"sep",
|
||||
1,
|
||||
},
|
||||
Config: map[string]interface{}{
|
||||
"API_IPs": []string{
|
||||
"10.212.3.61",
|
||||
"10.212.3.62",
|
||||
"10.212.3.63",
|
||||
},
|
||||
},
|
||||
ConsumedBy: []uint64{
|
||||
27,
|
||||
},
|
||||
Description: "",
|
||||
GID: 212,
|
||||
GUID: 1,
|
||||
ID: 1,
|
||||
Milestones: 278329,
|
||||
Name: "sep_1",
|
||||
ObjStatus: "CREATED",
|
||||
ProvidedBy: []uint64{
|
||||
24,
|
||||
35,
|
||||
29,
|
||||
},
|
||||
SharedWith: []uint64{},
|
||||
TechStatus: "ENABLED",
|
||||
Type: "DES",
|
||||
},
|
||||
{
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"osismodel",
|
||||
"cloudbroker",
|
||||
"sep",
|
||||
1,
|
||||
},
|
||||
Config: map[string]interface{}{
|
||||
"API_IPs": []string{
|
||||
"10.212.3.64",
|
||||
"10.212.3.65",
|
||||
"10.212.3.66",
|
||||
},
|
||||
},
|
||||
ConsumedBy: []uint64{
|
||||
32,
|
||||
26,
|
||||
},
|
||||
Description: "",
|
||||
GID: 212,
|
||||
GUID: 2,
|
||||
ID: 2,
|
||||
Milestones: 278337,
|
||||
Name: "sep_2",
|
||||
ObjStatus: "CREATED",
|
||||
ProvidedBy: []uint64{
|
||||
36,
|
||||
42,
|
||||
35,
|
||||
},
|
||||
SharedWith: []uint64{},
|
||||
TechStatus: "ENABLED",
|
||||
Type: "DES",
|
||||
},
|
||||
{
|
||||
CKey: "",
|
||||
Meta: []interface{}{
|
||||
"osismodel",
|
||||
"cloudbroker",
|
||||
"sep",
|
||||
1,
|
||||
},
|
||||
Config: map[string]interface{}{
|
||||
"API_IPs": []string{
|
||||
"10.212.3.67",
|
||||
"10.212.3.68",
|
||||
"10.212.3.69",
|
||||
},
|
||||
},
|
||||
ConsumedBy: []uint64{
|
||||
38,
|
||||
28,
|
||||
},
|
||||
Description: "",
|
||||
GID: 212,
|
||||
GUID: 3,
|
||||
ID: 3,
|
||||
Milestones: 278345,
|
||||
Name: "sep_3",
|
||||
ObjStatus: "DESTROYED",
|
||||
ProvidedBy: []uint64{
|
||||
49,
|
||||
48,
|
||||
41,
|
||||
},
|
||||
SharedWith: []uint64{},
|
||||
TechStatus: "DISABLED",
|
||||
Type: "DES",
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := seps.FilterByID(1).FindOne()
|
||||
|
||||
if actual.ID != 1 {
|
||||
t.Fatal("expected ID 1, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := seps.FilterByName("sep_2").FindOne()
|
||||
|
||||
if actual.Name != "sep_2" {
|
||||
t.Fatal("expected Name 'sep_2', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByObjStatus(t *testing.T) {
|
||||
actual := seps.FilterByObjStatus("CREATED")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.ObjStatus != "CREATED" {
|
||||
t.Fatal("expected ObjStatus 'CREATED', found: ", item.ObjStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByTechStatus(t *testing.T) {
|
||||
actual := seps.FilterByTechStatus("ENABLED")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.TechStatus != "ENABLED" {
|
||||
t.Fatal("expected TechStatus 'ENABLED', found: ", item.TechStatus)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByType(t *testing.T) {
|
||||
actual := seps.FilterByType("DES")
|
||||
|
||||
if len(actual) != 3 {
|
||||
t.Fatal("expected 3 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.Type != "DES" {
|
||||
t.Fatal("expected Type 'DES', found: ", item.Type)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := seps.FilterFunc(func(rs RecordSEP) bool {
|
||||
return len(rs.ConsumedBy) > 1
|
||||
})
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if len(item.ConsumedBy) <= 1 {
|
||||
t.Fatal("expected ConsumedBy to contain more than 1 element, found: ", len(item.ConsumedBy))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
package sep
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
)
|
||||
|
||||
// Structure for creating request to storage endpoint provider
|
||||
|
||||
@@ -3,7 +3,7 @@ package sep
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
|
||||
)
|
||||
|
||||
// Accessing the tasks method group
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// User API tasks interface
|
||||
package tasks
|
||||
|
||||
import "repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
import "repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
|
||||
// Structure for creating request to tasks
|
||||
type Tasks struct {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cloudbroker
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/pkg/cloudbroker/vins"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vins"
|
||||
)
|
||||
|
||||
// Accessing the VINS method group
|
||||
|
||||
201
pkg/cloudbroker/vins/filter_test.go
Normal file
201
pkg/cloudbroker/vins/filter_test.go
Normal file
@@ -0,0 +1,201 @@
|
||||
package vins
|
||||
|
||||
import "testing"
|
||||
|
||||
var vinsItems = ListVINS{
|
||||
{
|
||||
AccountID: 1,
|
||||
AccountName: "std",
|
||||
CreatedBy: "sample_user_1@decs3o",
|
||||
CreatedTime: 1676898844,
|
||||
DefaultGW: "",
|
||||
DefaultQOS: QOS{
|
||||
ERate: 0,
|
||||
GUID: "",
|
||||
InBurst: 0,
|
||||
InRate: 0,
|
||||
},
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
ExternalIP: "",
|
||||
GID: 212,
|
||||
GUID: 1,
|
||||
ID: 1,
|
||||
LockStatus: "UNLOCKED",
|
||||
ManagerID: 0,
|
||||
ManagerType: "",
|
||||
Milestones: 363485,
|
||||
Name: "vins01",
|
||||
NetMask: 24,
|
||||
Network: "192.168.1.0/24",
|
||||
PreReservationsNum: 32,
|
||||
PriVNFDevID: 29557,
|
||||
Redundant: false,
|
||||
RGID: 7971,
|
||||
RGName: "rg_01",
|
||||
SecVNFDevID: 0,
|
||||
Status: "ENABLED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
UserManaged: true,
|
||||
VNFs: ItemVNFs{
|
||||
DHCP: 51997,
|
||||
DNS: 0,
|
||||
FW: 0,
|
||||
GW: 0,
|
||||
NAT: 0,
|
||||
VPN: 0,
|
||||
},
|
||||
VXLANID: 3544,
|
||||
},
|
||||
{
|
||||
AccountID: 2,
|
||||
AccountName: "std2",
|
||||
CreatedBy: "sample_user_1@decs3o",
|
||||
CreatedTime: 1676898948,
|
||||
DefaultGW: "",
|
||||
DefaultQOS: QOS{
|
||||
ERate: 0,
|
||||
GUID: "",
|
||||
InBurst: 0,
|
||||
InRate: 0,
|
||||
},
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
ExternalIP: "",
|
||||
GID: 212,
|
||||
GUID: 2,
|
||||
ID: 2,
|
||||
LockStatus: "LOCKED",
|
||||
ManagerID: 0,
|
||||
ManagerType: "",
|
||||
Milestones: 363508,
|
||||
Name: "vins02",
|
||||
NetMask: 24,
|
||||
Network: "192.168.2.0/24",
|
||||
PreReservationsNum: 32,
|
||||
PriVNFDevID: 29558,
|
||||
Redundant: false,
|
||||
RGID: 7972,
|
||||
RGName: "rg_02",
|
||||
SecVNFDevID: 0,
|
||||
Status: "ENABLED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
UserManaged: true,
|
||||
VNFs: ItemVNFs{
|
||||
DHCP: 51998,
|
||||
DNS: 0,
|
||||
FW: 0,
|
||||
GW: 0,
|
||||
NAT: 0,
|
||||
VPN: 0,
|
||||
},
|
||||
VXLANID: 3545,
|
||||
},
|
||||
{
|
||||
AccountID: 3,
|
||||
AccountName: "std3",
|
||||
CreatedBy: "sample_user_2@decs3o",
|
||||
CreatedTime: 1676899026,
|
||||
DefaultGW: "",
|
||||
DefaultQOS: QOS{
|
||||
ERate: 0,
|
||||
GUID: "",
|
||||
InBurst: 0,
|
||||
InRate: 0,
|
||||
},
|
||||
DeletedBy: "",
|
||||
DeletedTime: 0,
|
||||
Description: "",
|
||||
ExternalIP: "",
|
||||
GID: 212,
|
||||
GUID: 3,
|
||||
ID: 3,
|
||||
LockStatus: "UNLOCKED",
|
||||
ManagerID: 0,
|
||||
ManagerType: "",
|
||||
Milestones: 363549,
|
||||
Name: "vins03",
|
||||
NetMask: 24,
|
||||
Network: "192.168.3.0/24",
|
||||
PreReservationsNum: 32,
|
||||
PriVNFDevID: 29559,
|
||||
Redundant: false,
|
||||
RGID: 7973,
|
||||
RGName: "rg_03",
|
||||
SecVNFDevID: 0,
|
||||
Status: "DISABLED",
|
||||
UpdatedBy: "",
|
||||
UpdatedTime: 0,
|
||||
UserManaged: true,
|
||||
VNFs: ItemVNFs{
|
||||
DHCP: 51999,
|
||||
DNS: 0,
|
||||
FW: 0,
|
||||
GW: 0,
|
||||
NAT: 0,
|
||||
VPN: 0,
|
||||
},
|
||||
VXLANID: 3546,
|
||||
},
|
||||
}
|
||||
|
||||
func TestFilterByID(t *testing.T) {
|
||||
actual := vinsItems.FilterByID(2).FindOne()
|
||||
|
||||
if actual.ID != 2 {
|
||||
t.Fatal("expected ID 2, found: ", actual.ID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByName(t *testing.T) {
|
||||
actual := vinsItems.FilterByName("vins01").FindOne()
|
||||
|
||||
if actual.Name != "vins01" {
|
||||
t.Fatal("expected Name 'vins01', found: ", actual.Name)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByAccountID(t *testing.T) {
|
||||
actual := vinsItems.FilterByAccountID(3).FindOne()
|
||||
|
||||
if actual.AccountID != 3 {
|
||||
t.Fatal("expected AccountID 3, found: ", actual.AccountID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterByCreatedBy(t *testing.T) {
|
||||
actual := vinsItems.FilterByCreatedBy("sample_user_1@decs3o")
|
||||
|
||||
if len(actual) != 2 {
|
||||
t.Fatal("expected 2 found, actual: ", len(actual))
|
||||
}
|
||||
|
||||
for _, item := range actual {
|
||||
if item.CreatedBy != "sample_user_1@decs3o" {
|
||||
t.Fatal("expected CreatedBy 'sample_user_1@decs3o', found: ", item.CreatedBy)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterFunc(t *testing.T) {
|
||||
actual := vinsItems.FilterFunc(func(iv ItemVINS) bool {
|
||||
return iv.RGID == 7971
|
||||
}).
|
||||
FindOne()
|
||||
|
||||
if actual.RGID != 7971 {
|
||||
t.Fatal("expected RGID 7971, found: ", actual.RGID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSortByCreatedTime(t *testing.T) {
|
||||
actual := vinsItems.SortByCreatedTime(false)
|
||||
|
||||
if actual[0].CreatedTime != 1676898844 || actual[2].CreatedTime != 1676899026 {
|
||||
t.Fatal("expected ascending order, found descending")
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/validators"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/validators"
|
||||
)
|
||||
|
||||
// Request struct for IP reserve
|
||||
|
||||
@@ -3,7 +3,7 @@ package vins
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/internal/serialization"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/internal/serialization"
|
||||
)
|
||||
|
||||
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package vins
|
||||
|
||||
import (
|
||||
"repos.digitalenergy.online/BASIS/decort-golang-sdk/interfaces"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/interfaces"
|
||||
)
|
||||
|
||||
// Structure for creating request to VINS
|
||||
|
||||
Reference in New Issue
Block a user