v1.16.4
This commit is contained in:
dayterr
2026-09-18 16:49:20 +03:00
parent b39021820a
commit bf932e5ef9
161 changed files with 2375 additions and 227 deletions

View File

@@ -26,6 +26,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/trunk"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vgpu"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vins"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vmfolder"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/zone"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/acsgroups"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/adrspools"
@@ -59,6 +60,7 @@ import (
tasks_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/tasks"
trunk_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/trunk"
vins_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vins"
vmfolder_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vmfolder"
zone_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/zone"
extnet_sdn "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/extnet"
@@ -379,6 +381,26 @@ func TestGetListCloudAPI(t *testing.T) {
t.Errorf("Can not test Storage policy get because Storage policy list is empty")
}
// Replication profile
// List
bytes, err = client.CloudAPI().StPolicy().ListReplicationProfileRaw(context.Background(), stpolicy.ListReplicationProfileRequest{})
if err != nil {
t.Error(err)
}
getResult("Replication profile list", bytes, stpolicy.ListReplicationProfiles{}, t)
// Get
listReplicationProfiles, _ := client.CloudAPI().StPolicy().ListReplicationProfile(context.Background(), stpolicy.ListReplicationProfileRequest{})
if len(listReplicationProfiles.Data) > 0 {
id := listReplicationProfiles.Data[0].ID
bytes, err = client.CloudAPI().StPolicy().GetReplicationProfileRaw(context.Background(), stpolicy.GetReplicationProfileRequest{ProfileID: id})
if err != nil {
t.Error(err)
}
getResult("Replication profile get", bytes, stpolicy.InfoReplicationProfile{}, t)
} else {
t.Errorf("Can not test Replication profile get because Replication profile list is empty")
}
// Security group
// List
bytes, err = client.CloudAPI().SecurityGroup().ListRaw(context.Background(), secgroup.ListRequest{})
@@ -459,6 +481,26 @@ func TestGetListCloudAPI(t *testing.T) {
t.Errorf("Can not test VINS get because VINS list is empty")
}
// VM folder
// List
bytes, err = client.CloudAPI().VMFolder().ListRaw(context.Background(), vmfolder.ListRequest{})
if err != nil {
t.Error(err)
}
getResult("VM folder list", bytes, vmfolder.ListVMFolder{}, t)
// Get
listVMFolders, _ := client.CloudAPI().VMFolder().List(context.Background(), vmfolder.ListRequest{})
if len(listVMFolders.Data) > 0 {
id := listVMFolders.Data[0].ID
bytes, err = client.CloudAPI().VMFolder().GetRaw(context.Background(), vmfolder.GetRequest{FolderID: id})
if err != nil {
t.Error(err)
}
getResult("VM folder get", bytes, vmfolder.RecordVMFolder{}, t)
} else {
t.Errorf("Can not test VM folder get because VM folder list is empty")
}
// VGPU
// List
bytes, err = client.CloudAPI().VGPU().ListRaw(context.Background(), vgpu.ListRequest{})
@@ -897,6 +939,26 @@ func TestGetListCloudbroker(t *testing.T) {
t.Errorf("Can not test Storage policy get because Storage policy list is empty")
}
// Replication profile
// List
bytes, err = client.CloudBroker().StPolicy().ListReplicationProfileRaw(context.Background(), stpolicy_cb.ListReplicationProfileRequest{})
if err != nil {
t.Error(err)
}
getResult("Replication profile list", bytes, stpolicy_cb.ListReplicationProfiles{}, t)
// Get
listReplicationProfiles, _ := client.CloudBroker().StPolicy().ListReplicationProfile(context.Background(), stpolicy_cb.ListReplicationProfileRequest{})
if len(listReplicationProfiles.Data) > 0 {
id := listReplicationProfiles.Data[0].ID
bytes, err = client.CloudBroker().StPolicy().GetReplicationProfileRaw(context.Background(), stpolicy_cb.GetReplicationProfileRequest{ProfileID: id})
if err != nil {
t.Error(err)
}
getResult("Replication profile get", bytes, stpolicy_cb.InfoReplicationProfile{}, t)
} else {
t.Errorf("Can not test Replication profile get because Replication profile list is empty")
}
// Tasks
// List
bytes, err = client.CloudBroker().Tasks().ListRaw(context.Background(), tasks_cb.ListRequest{})
@@ -945,6 +1007,26 @@ func TestGetListCloudbroker(t *testing.T) {
t.Errorf("Can not test VINS get because VINS list is empty")
}
// VM folder
// List
bytes, err = client.CloudBroker().VMFolder().ListRaw(context.Background(), vmfolder_cb.ListRequest{})
if err != nil {
t.Error(err)
}
getResult("VM folder list", bytes, vmfolder_cb.ListVMFolder{}, t)
// Get
listVMFolders, _ := client.CloudBroker().VMFolder().List(context.Background(), vmfolder_cb.ListRequest{})
if len(listVMFolders.Data) > 0 {
id := listVMFolders.Data[0].ID
bytes, err = client.CloudBroker().VMFolder().GetRaw(context.Background(), vmfolder_cb.GetRequest{FolderID: id})
if err != nil {
t.Error(err)
}
getResult("VM folder get", bytes, vmfolder_cb.RecordVMFolder{}, t)
} else {
t.Errorf("Can not test VM folder get because VM folder list is empty")
}
// Zone
// List
bytes, err = client.CloudBroker().Zone().ListRaw(context.Background(), zone_cb.ListRequest{})

View File

@@ -28,6 +28,7 @@ import (
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vfpool"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vgpu"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vins"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/vmfolder"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/zone"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/acsgroups"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/adrspools"
@@ -71,6 +72,7 @@ import (
vfpool_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vfpool"
vgpu_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vgpu"
vins_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vins"
vmfolder_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/vmfolder"
zone_cb "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudbroker/zone"
extnet_sdn "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/sdn/extnet"
@@ -434,8 +436,10 @@ func getRequestsMapCloudAPI() map[string]interface{} {
"/restmachine/cloudapi/tasks/list": tasks.ListRequest{},
// storage policy
"/restmachine/cloudapi/storage_policy/get": stpolicy.GetRequest{},
"/restmachine/cloudapi/storage_policy/list": stpolicy.ListRequest{},
"/restmachine/cloudapi/storage_policy/get": stpolicy.GetRequest{},
"/restmachine/cloudapi/storage_policy/list": stpolicy.ListRequest{},
"/restmachine/cloudapi/storage_policy/get_replication_profile": stpolicy.GetReplicationProfileRequest{},
"/restmachine/cloudapi/storage_policy/list_replication_profile": stpolicy.ListReplicationProfileRequest{},
// trunk
"/restmachine/cloudapi/trunk/get": trunk.GetRequest{},
@@ -485,6 +489,17 @@ func getRequestsMapCloudAPI() map[string]interface{} {
"/restmachine/cloudapi/vins/vnfdevRestart": vins.VNFDevRestartRequest{},
"/restmachine/cloudapi/vins/migrateToZone": vins.MigrateToZoneRequest{},
// VM folder
"/restmachine/cloudapi/vmfolder/create": vmfolder.CreateRequest{},
"/restmachine/cloudapi/vmfolder/computes_move": vmfolder.ComputesMoveRequest{},
"/restmachine/cloudapi/vmfolder/delete": vmfolder.DeleteRequest{},
"/restmachine/cloudapi/vmfolder/rename": vmfolder.RenameRequest{},
"/restmachine/cloudapi/vmfolder/move": vmfolder.MoveRequest{},
"/restmachine/cloudapi/vmfolder/get": vmfolder.GetRequest{},
"/restmachine/cloudapi/vmfolder/list": vmfolder.ListRequest{},
"/restmachine/cloudapi/vmfolder/add_acl_access": vmfolder.AddACLAccessRequest{},
"/restmachine/cloudapi/vmfolder/del_acl_access": vmfolder.DelACLAccessRequest{},
// zone
"/restmachine/cloudapi/zone/get": zone.GetRequest{},
"/restmachine/cloudapi/zone/list": zone.ListRequest{},
@@ -1030,15 +1045,22 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/session/list": session.ListRequest{},
// storage_policy
"/restmachine/cloudbroker/storage_policy/get": stpolicy_cb.GetRequest{},
"/restmachine/cloudbroker/storage_policy/list": stpolicy_cb.ListRequest{},
"/restmachine/cloudbroker/storage_policy/create": stpolicy_cb.CreateRequest{},
"/restmachine/cloudbroker/storage_policy/update": stpolicy_cb.UpdateRequest{},
"/restmachine/cloudbroker/storage_policy/add_pool": stpolicy_cb.AddPoolRequest{},
"/restmachine/cloudbroker/storage_policy/delete": stpolicy_cb.DeleteRequest{},
"/restmachine/cloudbroker/storage_policy/disable": stpolicy_cb.DisableRequest{},
"/restmachine/cloudbroker/storage_policy/enable": stpolicy_cb.EnableRequest{},
"/restmachine/cloudbroker/storage_policy/delete_pool": stpolicy_cb.DeletePoolRequest{},
"/restmachine/cloudbroker/storage_policy/get": stpolicy_cb.GetRequest{},
"/restmachine/cloudbroker/storage_policy/list": stpolicy_cb.ListRequest{},
"/restmachine/cloudbroker/storage_policy/create": stpolicy_cb.CreateRequest{},
"/restmachine/cloudbroker/storage_policy/update": stpolicy_cb.UpdateRequest{},
"/restmachine/cloudbroker/storage_policy/add_pool": stpolicy_cb.AddPoolRequest{},
"/restmachine/cloudbroker/storage_policy/delete": stpolicy_cb.DeleteRequest{},
"/restmachine/cloudbroker/storage_policy/disable": stpolicy_cb.DisableRequest{},
"/restmachine/cloudbroker/storage_policy/enable": stpolicy_cb.EnableRequest{},
"/restmachine/cloudbroker/storage_policy/delete_pool": stpolicy_cb.DeletePoolRequest{},
"/restmachine/cloudbroker/storage_policy/get_replication_profile": stpolicy_cb.GetReplicationProfileRequest{},
"/restmachine/cloudbroker/storage_policy/list_replication_profile": stpolicy_cb.ListReplicationProfileRequest{},
"/restmachine/cloudbroker/storage_policy/create_replication_profile": stpolicy_cb.CreateReplicationProfileRequest{},
"/restmachine/cloudbroker/storage_policy/update_replication_profile": stpolicy_cb.UpdateReplicationProfileRequest{},
"/restmachine/cloudbroker/storage_policy/delete_replication_profile": stpolicy_cb.DeleteReplicationProfileRequest{},
"/restmachine/cloudbroker/storage_policy/add_access_replication_profile": stpolicy_cb.AddAccessReplicationProfileRequest{},
"/restmachine/cloudbroker/storage_policy/revoke_access_replication_profile": stpolicy_cb.RevokeAccessReplicationProfileRequest{},
// tasks
"/restmachine/cloudbroker/tasks/get": tasks_cb.GetRequest{},
@@ -1124,6 +1146,17 @@ func getRequestsMapCloudbroker() map[string]interface{} {
"/restmachine/cloudbroker/vins/vnfdevStop": vins_cb.VNFDevStopRequest{},
"/restmachine/cloudbroker/vins/migrateToZone": vins_cb.MigrateToZoneRequest{},
// VM folder
"/restmachine/cloudbroker/vmfolder/create": vmfolder_cb.CreateRequest{},
"/restmachine/cloudbroker/vmfolder/computes_move": vmfolder_cb.ComputesMoveRequest{},
"/restmachine/cloudbroker/vmfolder/delete": vmfolder_cb.DeleteRequest{},
"/restmachine/cloudbroker/vmfolder/rename": vmfolder_cb.RenameRequest{},
"/restmachine/cloudbroker/vmfolder/move": vmfolder_cb.MoveRequest{},
"/restmachine/cloudbroker/vmfolder/get": vmfolder_cb.GetRequest{},
"/restmachine/cloudbroker/vmfolder/list": vmfolder_cb.ListRequest{},
"/restmachine/cloudbroker/vmfolder/add_acl_access": vmfolder_cb.AddACLAccessRequest{},
"/restmachine/cloudbroker/vmfolder/del_acl_access": vmfolder_cb.DelACLAccessRequest{},
// zone
"/restmachine/cloudbroker/zone/get": zone_cb.GetRequest{},
"/restmachine/cloudbroker/zone/list": zone_cb.ListRequest{},