Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d82ae52951 | ||
|
|
5e5d90e24f |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,4 +1,4 @@
|
|||||||
## Version 14.7.0
|
## Version 14.9.0
|
||||||
|
|
||||||
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
Методы `Audits` в cloudapi/compute, cloudbroker/compute, cloudapi/account, cloudbroker/account, cloudapi/vins, cloudbroker/vins, cloudapi/rg и cloudbroker/rg стали deprecated и в следующих версиях будут удалены, вместо них необходимо использовать метод `List` в cloudapi/audit и cloudbroker/audit с соответствующими фильтрами
|
||||||
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
Методы `AccessGrant`, `AccessGrantToPool`, `AccessRevoke`, `AccessRevokeToPool` в cloudbroker/sep стали deprecated и в следующих версиях будут удалены
|
||||||
@@ -9,12 +9,7 @@
|
|||||||
|
|
||||||
### Добавлено
|
### Добавлено
|
||||||
|
|
||||||
#### SDN Hypervisors
|
#### vgpu
|
||||||
| Идентификатор<br>задачи | Описание |
|
| Идентификатор<br>задачи | Описание |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| BGOS-518 | Группа методов Hypervisors |
|
| BGOS-851 | Группа методов `cloudapi/vgpu` |
|
||||||
|
|
||||||
#### SDN Version
|
|
||||||
| Идентификатор<br>задачи | Описание |
|
|
||||||
| --- | --- |
|
|
||||||
| BGOS-838 | Группа методов Version |
|
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v14
|
|||||||
- `Trunk` - получение информации о транковых портах;
|
- `Trunk` - получение информации о транковых портах;
|
||||||
- `VFPool` - управление пулом виртуальных сетевых функций;
|
- `VFPool` - управление пулом виртуальных сетевых функций;
|
||||||
- `VINS` - управление виртуальными изолированными сетями;
|
- `VINS` - управление виртуальными изолированными сетями;
|
||||||
|
- `VGPU` - управление виртуальными графическими процессорами;
|
||||||
- `Zone` - управление зонами.
|
- `Zone` - управление зонами.
|
||||||
|
|
||||||
### Cloudbroker
|
### Cloudbroker
|
||||||
@@ -336,6 +337,7 @@ func main() {
|
|||||||
- `pkg/cloudapi/trunk` - для `Trunk`
|
- `pkg/cloudapi/trunk` - для `Trunk`
|
||||||
- `pkg/cloudapi/vfpool` - для `VFPool`
|
- `pkg/cloudapi/vfpool` - для `VFPool`
|
||||||
- `pkg/cloudapi/vins` - для `VINS`
|
- `pkg/cloudapi/vins` - для `VINS`
|
||||||
|
- `pkg/cloudapi/vgpu` - для `VGPU`
|
||||||
- `pkg/cloudapi/zone` - для `Zone`
|
- `pkg/cloudapi/zone` - для `Zone`
|
||||||
- **cloudbroker**:
|
- **cloudbroker**:
|
||||||
- `pkg/cloudbroker/account` - для `Account`
|
- `pkg/cloudbroker/account` - для `Account`
|
||||||
@@ -535,6 +537,7 @@ func main() {
|
|||||||
- `.Trunk()` - для работы с `Trunk`
|
- `.Trunk()` - для работы с `Trunk`
|
||||||
- `.VFPool()` - для работы с `VFPool`
|
- `.VFPool()` - для работы с `VFPool`
|
||||||
- `.VINS()` - для работы с `VINS`
|
- `.VINS()` - для работы с `VINS`
|
||||||
|
- `.VGPU()` - для работы с `VGPU`
|
||||||
- `.Zone()` - для работы с `Zone`
|
- `.Zone()` - для работы с `Zone`
|
||||||
|
|
||||||
Доступные методы для `.CloudBroker()`:
|
Доступные методы для `.CloudBroker()`:
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ type ItemLocation struct {
|
|||||||
|
|
||||||
// Is Zero Access enabled
|
// Is Zero Access enabled
|
||||||
ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
|
ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
|
||||||
|
|
||||||
|
// Is BRO enabled
|
||||||
|
BROEnabled bool `json:"bro_enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of locations
|
// List of locations
|
||||||
|
|||||||
8
pkg/cloudapi/vgpu.go
Normal file
8
pkg/cloudapi/vgpu.go
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package cloudapi
|
||||||
|
|
||||||
|
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/pkg/cloudapi/vgpu"
|
||||||
|
|
||||||
|
// Accessing the VGPU method group
|
||||||
|
func (ca *CloudAPI) VGPU() *vgpu.VGPU {
|
||||||
|
return vgpu.New(ca.client)
|
||||||
|
}
|
||||||
10
pkg/cloudapi/vgpu/ids.go
Normal file
10
pkg/cloudapi/vgpu/ids.go
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
package vgpu
|
||||||
|
|
||||||
|
// IDs gets array of VGPU IDs from ListVGPU struct
|
||||||
|
func (l ListVGPU) IDs() []uint64 {
|
||||||
|
res := make([]uint64, 0, len(l.Data))
|
||||||
|
for _, v := range l.Data {
|
||||||
|
res = append(res, v.ID)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
88
pkg/cloudapi/vgpu/list.go
Normal file
88
pkg/cloudapi/vgpu/list.go
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
package vgpu
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListRequest struct to get list of VGPU
|
||||||
|
type ListRequest struct {
|
||||||
|
// Find by id
|
||||||
|
// Required: false
|
||||||
|
ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`
|
||||||
|
|
||||||
|
// Find by vgpu status
|
||||||
|
// Required: false
|
||||||
|
Status string `url:"status,omitempty" json:"status,omitempty"`
|
||||||
|
|
||||||
|
// Find by vgpu type
|
||||||
|
// Required: false
|
||||||
|
Type string `url:"type,omitempty" json:"type,omitempty"`
|
||||||
|
|
||||||
|
// Find by vgpu mode
|
||||||
|
// Required: false
|
||||||
|
Mode string `url:"mode,omitempty" json:"mode,omitempty"`
|
||||||
|
|
||||||
|
// Find by id resgroup
|
||||||
|
// Required: false
|
||||||
|
RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"`
|
||||||
|
|
||||||
|
// Find by account id
|
||||||
|
// Required: false
|
||||||
|
AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`
|
||||||
|
|
||||||
|
// Find by compute id
|
||||||
|
// Required: false
|
||||||
|
ComputeID uint64 `url:"computeId,omitempty" json:"computeId,omitempty"`
|
||||||
|
|
||||||
|
// Find by pgpu id
|
||||||
|
// Required: false
|
||||||
|
PGPUID uint64 `url:"pgpuId,omitempty" json:"pgpuId,omitempty"`
|
||||||
|
|
||||||
|
// Sort by one of supported fields, format +|-(field)
|
||||||
|
// Required: false
|
||||||
|
SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`
|
||||||
|
|
||||||
|
// Page number
|
||||||
|
// Required: false
|
||||||
|
Page uint64 `url:"page,omitempty" json:"page,omitempty"`
|
||||||
|
|
||||||
|
// Page size
|
||||||
|
// Required: false
|
||||||
|
Size uint64 `url:"size,omitempty" json:"size,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List gets list of all VGPU as a ListVGPU struct
|
||||||
|
func (v VGPU) List(ctx context.Context, req ListRequest) (*ListVGPU, error) {
|
||||||
|
|
||||||
|
res, err := v.ListRaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
list := ListVGPU{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &list)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &list, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListRaw gets list of all VGPU as an array of bytes
|
||||||
|
func (v VGPU) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) {
|
||||||
|
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/cloudapi/vgpu/list"
|
||||||
|
|
||||||
|
res, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
69
pkg/cloudapi/vgpu/models.go
Normal file
69
pkg/cloudapi/vgpu/models.go
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
package vgpu
|
||||||
|
|
||||||
|
type ItemVGPU struct {
|
||||||
|
// Account ID
|
||||||
|
AccountID uint64 `json:"accountId"`
|
||||||
|
|
||||||
|
// Created time
|
||||||
|
CreatedTime uint64 `json:"createdTime"`
|
||||||
|
|
||||||
|
// Deleted time
|
||||||
|
DeletedTime uint64 `json:"deletedTime"`
|
||||||
|
|
||||||
|
//Grid ID
|
||||||
|
GID uint64 `json:"gid"`
|
||||||
|
|
||||||
|
// GUID
|
||||||
|
GUID uint64 `json:"guid"`
|
||||||
|
|
||||||
|
// VGPU ID
|
||||||
|
ID uint64 `json:"id"`
|
||||||
|
|
||||||
|
// Last claimed by
|
||||||
|
LastClaimedBy uint64 `json:"lastClaimedBy"`
|
||||||
|
|
||||||
|
// Last update time
|
||||||
|
LastUpdateTime uint64 `json:"lastUpdateTime"`
|
||||||
|
|
||||||
|
// Mode
|
||||||
|
Mode string `json:"mode"`
|
||||||
|
|
||||||
|
// Bus number
|
||||||
|
BusNumber int `json:"bus_number"`
|
||||||
|
|
||||||
|
// PCI Slot
|
||||||
|
PCISlot int `json:"pciSlot"`
|
||||||
|
|
||||||
|
// PGPUID
|
||||||
|
PGPUID uint64 `json:"pgpuid"`
|
||||||
|
|
||||||
|
// Profile ID
|
||||||
|
ProfileID uint64 `json:"profileId"`
|
||||||
|
|
||||||
|
// RAM
|
||||||
|
RAM uint64 `json:"ram"`
|
||||||
|
|
||||||
|
// Reference ID
|
||||||
|
ReferenceID string `json:"referenceId"`
|
||||||
|
|
||||||
|
// RGID
|
||||||
|
RGID uint64 `json:"rgId"`
|
||||||
|
|
||||||
|
// Status
|
||||||
|
Status string `json:"status"`
|
||||||
|
|
||||||
|
// Type
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
|
// VMID
|
||||||
|
VMID uint64 `json:"vmid"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of VGPU
|
||||||
|
type ListVGPU struct {
|
||||||
|
// Data
|
||||||
|
Data []ItemVGPU `json:"data"`
|
||||||
|
|
||||||
|
// Entry count
|
||||||
|
EntryCount uint64 `json:"entryCount"`
|
||||||
|
}
|
||||||
43
pkg/cloudapi/vgpu/serialize.go
Normal file
43
pkg/cloudapi/vgpu/serialize.go
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package vgpu
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/serialization"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||||
|
//
|
||||||
|
// In order to serialize with indent make sure to follow these guidelines:
|
||||||
|
// - First argument -> prefix
|
||||||
|
// - Second argument -> indent
|
||||||
|
func (l ListVGPU) Serialize(params ...string) (serialization.Serialized, error) {
|
||||||
|
if len(l.Data) == 0 {
|
||||||
|
return []byte{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(params) > 1 {
|
||||||
|
prefix := params[0]
|
||||||
|
indent := params[1]
|
||||||
|
|
||||||
|
return json.MarshalIndent(l, prefix, indent)
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Marshal(l)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.
|
||||||
|
//
|
||||||
|
// In order to serialize with indent make sure to follow these guidelines:
|
||||||
|
// - First argument -> prefix
|
||||||
|
// - Second argument -> indent
|
||||||
|
func (i ItemVGPU) Serialize(params ...string) (serialization.Serialized, error) {
|
||||||
|
if len(params) > 1 {
|
||||||
|
prefix := params[0]
|
||||||
|
indent := params[1]
|
||||||
|
|
||||||
|
return json.MarshalIndent(i, prefix, indent)
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.Marshal(i)
|
||||||
|
}
|
||||||
15
pkg/cloudapi/vgpu/vgpu.go
Normal file
15
pkg/cloudapi/vgpu/vgpu.go
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package vgpu
|
||||||
|
|
||||||
|
import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/interfaces"
|
||||||
|
|
||||||
|
// Structure for creating request to VGPU
|
||||||
|
type VGPU struct {
|
||||||
|
client interfaces.Caller
|
||||||
|
}
|
||||||
|
|
||||||
|
// Builder for VGPU endpoints
|
||||||
|
func New(client interfaces.Caller) *VGPU {
|
||||||
|
return &VGPU{
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -81,6 +81,21 @@ type RecordZone struct {
|
|||||||
|
|
||||||
// SSO URL
|
// SSO URL
|
||||||
SSOURL string `json:"sso_url"`
|
SSOURL string `json:"sso_url"`
|
||||||
|
|
||||||
|
// SSO type
|
||||||
|
SSOType string `json:"sso_type"`
|
||||||
|
|
||||||
|
// Ping address
|
||||||
|
PingAddr string `json:"ping_addr"`
|
||||||
|
|
||||||
|
// Broadcast address
|
||||||
|
BroadcastAddr string `json:"broadcast_addr"`
|
||||||
|
|
||||||
|
// Skip ssl verify
|
||||||
|
SSLSkipVerify bool `json:"ssl_skip_verify"`
|
||||||
|
|
||||||
|
// Domain
|
||||||
|
Domain string `json:"domain"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// A zone item from a list
|
// A zone item from a list
|
||||||
@@ -130,9 +145,24 @@ type ItemZone struct {
|
|||||||
// SSO URL
|
// SSO URL
|
||||||
SSOURL string `json:"sso_url"`
|
SSOURL string `json:"sso_url"`
|
||||||
|
|
||||||
|
// SSO type
|
||||||
|
SSOType string `json:"sso_type"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
// Updated timestamp
|
// Updated timestamp
|
||||||
UpdatedTime uint64 `json:"updatedTime"`
|
UpdatedTime uint64 `json:"updatedTime"`
|
||||||
|
|
||||||
|
// Ping address
|
||||||
|
PingAddr string `json:"ping_addr"`
|
||||||
|
|
||||||
|
// Broadcast address
|
||||||
|
BroadcastAddr string `json:"broadcast_addr"`
|
||||||
|
|
||||||
|
// Skip ssl verify
|
||||||
|
SSLSkipVerify bool `json:"ssl_skip_verify"`
|
||||||
|
|
||||||
|
// Domain
|
||||||
|
Domain string `json:"domain"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ type RecordGrid struct {
|
|||||||
|
|
||||||
// SDN support
|
// SDN support
|
||||||
SDNSupport bool `json:"sdn_support"`
|
SDNSupport bool `json:"sdn_support"`
|
||||||
|
|
||||||
|
// Is BRO enabled
|
||||||
|
BROEnabled bool `json:"bro_enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Information about grid
|
// Information about grid
|
||||||
@@ -132,6 +135,9 @@ type ItemGridList struct {
|
|||||||
|
|
||||||
// Is Zero Access enabled
|
// Is Zero Access enabled
|
||||||
ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
|
ZeroAccessEnabled bool `json:"zeroaccess_enabled"`
|
||||||
|
|
||||||
|
// Is BRO enabled
|
||||||
|
BROEnabled bool `json:"bro_enabled"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List Grids
|
// List Grids
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ type DRSCreateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
||||||
|
|
||||||
|
// SSO provider type
|
||||||
|
// Available values: bvs, decs3o
|
||||||
|
// Required: true
|
||||||
|
SSOType string `url:"sso_type" json:"sso_type" validate:"required,oneof=bvs decs3o"`
|
||||||
|
|
||||||
// Application ID
|
// Application ID
|
||||||
// Required: true
|
// Required: true
|
||||||
AppID string `url:"app_id" json:"app_id" validate:"required"`
|
AppID string `url:"app_id" json:"app_id" validate:"required"`
|
||||||
@@ -33,6 +38,30 @@ type DRSCreateRequest struct {
|
|||||||
// DRS name
|
// DRS name
|
||||||
// Required: true
|
// Required: true
|
||||||
DRSName string `url:"drs_name" json:"drs_name" validate:"required"`
|
DRSName string `url:"drs_name" json:"drs_name" validate:"required"`
|
||||||
|
|
||||||
|
// Username
|
||||||
|
// Required: false
|
||||||
|
Username string `url:"username,omitempty" json:"username,omitempty"`
|
||||||
|
|
||||||
|
// Password
|
||||||
|
// Required: false
|
||||||
|
Password string `url:"password,omitempty" json:"password,omitempty"`
|
||||||
|
|
||||||
|
// Broadcast address
|
||||||
|
// Required: false
|
||||||
|
BroadcastAddr string `url:"broadcast_addr,omitempty" json:"broadcast_addr,omitempty"`
|
||||||
|
|
||||||
|
// Ping address
|
||||||
|
// Required: false
|
||||||
|
PingAddr string `url:"ping_addr,omitempty" json:"ping_addr,omitempty"`
|
||||||
|
|
||||||
|
// Skip SSL certificate verification
|
||||||
|
// Required: false
|
||||||
|
SSLSkipVerify interface{} `url:"ssl_skip_verify,omitempty" json:"ssl_skip_verify,omitempty"`
|
||||||
|
|
||||||
|
// Domain
|
||||||
|
// Required: false
|
||||||
|
Domain string `url:"domain,omitempty" json:"domain,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DRSCreate creates a new DRS in the specified zone
|
// DRSCreate creates a new DRS in the specified zone
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ type DRSUpdateRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
ZoneID uint64 `url:"zone_id" json:"zone_id" validate:"required"`
|
||||||
|
|
||||||
|
// SSO provider type
|
||||||
|
// Available values: bvs, decs3o
|
||||||
|
// Required: true
|
||||||
|
SSOType string `url:"sso_type" json:"sso_type" validate:"required,oneof=bvs decs3o"`
|
||||||
|
|
||||||
// Application ID
|
// Application ID
|
||||||
// Required: false
|
// Required: false
|
||||||
AppID string `url:"app_id,omitempty" json:"app_id,omitempty"`
|
AppID string `url:"app_id,omitempty" json:"app_id,omitempty"`
|
||||||
@@ -33,6 +38,30 @@ type DRSUpdateRequest struct {
|
|||||||
// DRS name
|
// DRS name
|
||||||
// Required: false
|
// Required: false
|
||||||
DRSName string `url:"drs_name,omitempty" json:"drs_name,omitempty"`
|
DRSName string `url:"drs_name,omitempty" json:"drs_name,omitempty"`
|
||||||
|
|
||||||
|
// Username
|
||||||
|
// Required: false
|
||||||
|
Username string `url:"username,omitempty" json:"username,omitempty"`
|
||||||
|
|
||||||
|
// Password
|
||||||
|
// Required: false
|
||||||
|
Password string `url:"password,omitempty" json:"password,omitempty"`
|
||||||
|
|
||||||
|
// Broadcast address
|
||||||
|
// Required: false
|
||||||
|
BroadcastAddr string `url:"broadcast_addr,omitempty" json:"broadcast_addr,omitempty"`
|
||||||
|
|
||||||
|
// Ping address
|
||||||
|
// Required: false
|
||||||
|
PingAddr string `url:"ping_addr,omitempty" json:"ping_addr,omitempty"`
|
||||||
|
|
||||||
|
// Skip SSL certificate verification
|
||||||
|
// Required: false
|
||||||
|
SSLSkipVerify interface{} `url:"ssl_skip_verify,omitempty" json:"ssl_skip_verify,omitempty"`
|
||||||
|
|
||||||
|
// Domain
|
||||||
|
// Required: false
|
||||||
|
Domain string `url:"domain,omitempty" json:"domain,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DRSUpdate updates DRS configuration in the specified zone
|
// DRSUpdate updates DRS configuration in the specified zone
|
||||||
|
|||||||
@@ -81,6 +81,21 @@ type RecordZone struct {
|
|||||||
|
|
||||||
// SSO URL
|
// SSO URL
|
||||||
SSOURL string `json:"sso_url"`
|
SSOURL string `json:"sso_url"`
|
||||||
|
|
||||||
|
// SSO type
|
||||||
|
SSOType string `json:"sso_type"`
|
||||||
|
|
||||||
|
// Ping address
|
||||||
|
PingAddr string `json:"ping_addr"`
|
||||||
|
|
||||||
|
// Broadcast address
|
||||||
|
BroadcastAddr string `json:"broadcast_addr"`
|
||||||
|
|
||||||
|
// Skip ssl verify
|
||||||
|
SSLSkipVerify bool `json:"ssl_skip_verify"`
|
||||||
|
|
||||||
|
// Domain
|
||||||
|
Domain string `json:"domain"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// A zone item from a list
|
// A zone item from a list
|
||||||
@@ -130,9 +145,24 @@ type ItemZone struct {
|
|||||||
// SSO URL
|
// SSO URL
|
||||||
SSOURL string `json:"sso_url"`
|
SSOURL string `json:"sso_url"`
|
||||||
|
|
||||||
|
// SSO type
|
||||||
|
SSOType string `json:"sso_type"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
|
|
||||||
// Updated timestamp
|
// Updated timestamp
|
||||||
UpdatedTime uint64 `json:"updatedTime"`
|
UpdatedTime uint64 `json:"updatedTime"`
|
||||||
|
|
||||||
|
// Ping address
|
||||||
|
PingAddr string `json:"ping_addr"`
|
||||||
|
|
||||||
|
// Broadcast address
|
||||||
|
BroadcastAddr string `json:"broadcast_addr"`
|
||||||
|
|
||||||
|
// Skip ssl verify
|
||||||
|
SSLSkipVerify bool `json:"ssl_skip_verify"`
|
||||||
|
|
||||||
|
// Domain
|
||||||
|
Domain string `json:"domain"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package acsgroups
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
@@ -16,24 +15,19 @@ type DeleteRequest struct {
|
|||||||
GroupID string `url:"access_group_id" json:"access_group_id" validate:"required"`
|
GroupID string `url:"access_group_id" json:"access_group_id" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete a access groups
|
// Delete an access groups
|
||||||
func (i AccessGroups) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
func (i AccessGroups) Delete(ctx context.Context, req DeleteRequest) (string, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return "", validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/sdn/access_group/delete"
|
url := "/sdn/access_group/delete"
|
||||||
|
|
||||||
res, err := i.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
|
res, err := i.client.DecortApiCallCtype(ctx, http.MethodDelete, url, constants.MIMEJSON, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
result, err := strconv.ParseBool(string(res))
|
return string(res), nil
|
||||||
if err != nil {
|
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return result, nil
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,21 +11,18 @@ var testAccessGroups = AccessGroupList{
|
|||||||
DisplayName: "Developers",
|
DisplayName: "Developers",
|
||||||
Comment: "First group",
|
Comment: "First group",
|
||||||
CreatedAt: "2023-01-01",
|
CreatedAt: "2023-01-01",
|
||||||
CreatedBy: "admin",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ID: "group2",
|
ID: "group2",
|
||||||
DisplayName: "Admins",
|
DisplayName: "Admins",
|
||||||
Comment: "Second group",
|
Comment: "Second group",
|
||||||
CreatedAt: "2023-01-02",
|
CreatedAt: "2023-01-02",
|
||||||
CreatedBy: "admin",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ID: "group3",
|
ID: "group3",
|
||||||
DisplayName: "Users",
|
DisplayName: "Users",
|
||||||
Comment: "Third group",
|
Comment: "Third group",
|
||||||
CreatedAt: "2023-01-03",
|
CreatedAt: "2023-01-03",
|
||||||
CreatedBy: "admin",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ type AccessGroup struct {
|
|||||||
DisplayName string `json:"display_name"`
|
DisplayName string `json:"display_name"`
|
||||||
Comment string `json:"comment"`
|
Comment string `json:"comment"`
|
||||||
CreatedAt string `json:"created_at"`
|
CreatedAt string `json:"created_at"`
|
||||||
CreatedBy string `json:"created_by"`
|
|
||||||
UpdatedAt string `json:"updated_at"`
|
UpdatedAt string `json:"updated_at"`
|
||||||
UpdatedBy string `json:"updated_by"`
|
|
||||||
NetObjectAccessGroup NetObjectAccessGroup `json:"net_object_access_group"`
|
NetObjectAccessGroup NetObjectAccessGroup `json:"net_object_access_group"`
|
||||||
DefaultSecurityPolicy DefaultSecurityPolicy `json:"default_security_policy"`
|
DefaultSecurityPolicy DefaultSecurityPolicy `json:"default_security_policy"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ type RecordHypervisor struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
// Ports
|
// Ports
|
||||||
Ports []string `json:"ports"`
|
Ports Ports `json:"ports"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
@@ -29,3 +29,30 @@ type RecordHypervisor struct {
|
|||||||
|
|
||||||
// List of hypervisors
|
// List of hypervisors
|
||||||
type HypervisorsList []RecordHypervisor
|
type HypervisorsList []RecordHypervisor
|
||||||
|
|
||||||
|
// Hypervisor ports
|
||||||
|
type Ports struct {
|
||||||
|
Data []Port `json:"data"`
|
||||||
|
Info Info `json:"info"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info about a port
|
||||||
|
type Port struct {
|
||||||
|
// ID of a port
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// Unique ID of a port
|
||||||
|
UniqueIdentifier string `json:"unique_identifier"`
|
||||||
|
|
||||||
|
// Display name of a port
|
||||||
|
DisplayName string `json:"display_name"`
|
||||||
|
|
||||||
|
// Is a port up
|
||||||
|
UP bool `json:"up"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Port counters
|
||||||
|
type Info struct {
|
||||||
|
ActivePorts uint64 `json:"active_ports"`
|
||||||
|
TotalPorts uint64 `json:"total_ports"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package netobjgroups
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
|
||||||
@@ -24,18 +25,25 @@ type AttachExtNetPortsRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AttachExtNetPorts attaches external network ports to a network object group
|
// AttachExtNetPorts attaches external network ports to a network object group
|
||||||
func (nog NetworkObjectGroups) AttachExtNetPorts(ctx context.Context, req AttachExtNetPortsRequest) (bool, error) {
|
func (nog NetworkObjectGroups) AttachExtNetPorts(ctx context.Context, req AttachExtNetPortsRequest) (*RecordVersion, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/sdn/network_object_group/attach_external_network_ports"
|
url := "/sdn/network_object_group/attach_external_network_ports"
|
||||||
|
|
||||||
_, err = nog.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
res, err := nog.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, nil
|
info := RecordVersion{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package netobjgroups
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/constants"
|
||||||
@@ -26,6 +27,7 @@ type AttachLogicalPortsRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
PortBindings []PortBindings `url:"port_bindings" json:"port_bindings" validate:"required,dive"`
|
PortBindings []PortBindings `url:"port_bindings" json:"port_bindings" validate:"required,dive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PortBindings struct {
|
type PortBindings struct {
|
||||||
// ID of a logical port
|
// ID of a logical port
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -37,18 +39,25 @@ type PortBindings struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AttachLogicalPorts attaches logical ports to a network object group
|
// AttachLogicalPorts attaches logical ports to a network object group
|
||||||
func (nog NetworkObjectGroups) AttachLogicalPorts(ctx context.Context, req AttachLogicalPortsRequest) (bool, error) {
|
func (nog NetworkObjectGroups) AttachLogicalPorts(ctx context.Context, req AttachLogicalPortsRequest) (*RecordVersion, error) {
|
||||||
err := validators.ValidateRequest(req)
|
err := validators.ValidateRequest(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, validators.ValidationErrors(validators.GetErrors(err))
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
url := "/sdn/network_object_group/attach_logical_ports"
|
url := "/sdn/network_object_group/attach_logical_ports"
|
||||||
|
|
||||||
_, err = nog.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
res, err := nog.client.DecortApiCallCtype(ctx, http.MethodPost, url, constants.MIMEJSON, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, nil
|
info := RecordVersion{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ type CreateRequest struct {
|
|||||||
// Logical ports bindings
|
// Logical ports bindings
|
||||||
// Required: false
|
// Required: false
|
||||||
LogicalPortsBindings []LogicalPortsBindings `url:"logical_ports_binding,omitempty" json:"logical_ports_bindings,omitempty" validate:"omitempty,dive"`
|
LogicalPortsBindings []LogicalPortsBindings `url:"logical_ports_binding,omitempty" json:"logical_ports_bindings,omitempty" validate:"omitempty,dive"`
|
||||||
|
|
||||||
|
// L2 connection ports bindings
|
||||||
|
// Required: false
|
||||||
|
L2ConnectionPortsBindings []LogicalPortsBindings `url:"l2_connection_ports_binding,omitempty" json:"l2_connection_ports_bindings,omitempty" validate:"omitempty,dive"`
|
||||||
|
|
||||||
|
// Addresses
|
||||||
|
// Required: false
|
||||||
|
Addresses []NetAddressRequest `url:"addresses,omitempty" json:"addresses,omitempty" validate:"omitempty,dive"`
|
||||||
}
|
}
|
||||||
type LogicalPortsBindings struct {
|
type LogicalPortsBindings struct {
|
||||||
// Port ID
|
// Port ID
|
||||||
@@ -34,7 +42,7 @@ type LogicalPortsBindings struct {
|
|||||||
|
|
||||||
// Port version
|
// Port version
|
||||||
// Required: true
|
// Required: true
|
||||||
PortVersion int64 `url:"port_version" json:"port_version" validate:"required"`
|
PortVersion uint64 `url:"port_version" json:"port_version" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create creates a network object group
|
// Create creates a network object group
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DetachLogicalPortsRequest struct to detach an logical port from a network object group
|
// DetachLogicalPortsRequest struct to detach logical ports from a network object group
|
||||||
type DetachLogicalPortsRequest struct {
|
type DetachLogicalPortsRequest struct {
|
||||||
// ID of a network object group
|
// ID of a network object group
|
||||||
// Required: true
|
// Required: true
|
||||||
@@ -23,13 +23,19 @@ type DetachLogicalPortsRequest struct {
|
|||||||
// Required: true
|
// Required: true
|
||||||
VersionID uint64 `url:"version_id" json:"version_id" validate:"required"`
|
VersionID uint64 `url:"version_id" json:"version_id" validate:"required"`
|
||||||
|
|
||||||
|
// Port bindings
|
||||||
|
// Required: true
|
||||||
|
PortBindings []DetachLogicalPortBinding `url:"port_bindings" json:"port_bindings" validate:"required,dive"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DetachLogicalPortBinding struct {
|
||||||
// ID of a logical port
|
// ID of a logical port
|
||||||
// Required: true
|
// Required: true
|
||||||
LogicalPortID string `url:"logical_port_id" json:"logical_port_id" validate:"required"`
|
PortID string `url:"port_id" json:"port_id" validate:"required"`
|
||||||
|
|
||||||
// Version of a logical port
|
// Version of a logical port
|
||||||
// Required: true
|
// Required: true
|
||||||
LogicalPortVersion uint64 `url:"logical_port_version" json:"logical_port_version" validate:"required"`
|
PortVersion uint64 `url:"port_version" json:"port_version" validate:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DetachLogicalPorts detaches logical ports from a network object group
|
// DetachLogicalPorts detaches logical ports from a network object group
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ type RecordNetObjGroup struct {
|
|||||||
// Access group name
|
// Access group name
|
||||||
AccessGroupName string `json:"access_group_name"`
|
AccessGroupName string `json:"access_group_name"`
|
||||||
|
|
||||||
|
// Addresses
|
||||||
|
Addresses NetAddresses `json:"addresses"`
|
||||||
|
|
||||||
// Counters
|
// Counters
|
||||||
Counters Counter `json:"counters"`
|
Counters Counter `json:"counters"`
|
||||||
|
|
||||||
@@ -37,21 +40,36 @@ type RecordNetObjGroup struct {
|
|||||||
// ID of a network object group
|
// ID of a network object group
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// L2 connection ports attached to a network object group
|
||||||
|
L2ConnectionPorts L2ConnectionPorts `json:"l2_connection_ports"`
|
||||||
|
|
||||||
// Logical ports attached to a network object group
|
// Logical ports attached to a network object group
|
||||||
LogicalPorts LogicalPorts `json:"logical_ports"`
|
LogicalPorts LogicalPorts `json:"logical_ports"`
|
||||||
|
|
||||||
// Name of a network object group
|
// Name of a network object group
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Purpose of a network object group
|
||||||
|
Purpose string `json:"purpose"`
|
||||||
|
|
||||||
// Security policies of a network object group
|
// Security policies of a network object group
|
||||||
SecurityPolicies SecurityPolicies `json:"security_policies"`
|
SecurityPolicies SecurityPolicies `json:"security_policies"`
|
||||||
|
|
||||||
|
// Type of a network object group
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
// Version ID
|
// Version ID
|
||||||
VersionID uint64 `json:"version_id"`
|
VersionID uint64 `json:"version_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Info about counters
|
// Info about counters
|
||||||
type Counter struct {
|
type Counter struct {
|
||||||
|
// Amount of addresses
|
||||||
|
AddressesCount uint64 `json:"addresses_count"`
|
||||||
|
|
||||||
|
// Amount of L2 connection ports
|
||||||
|
L2ConnectionPortsCount uint64 `json:"l2_connection_ports_count"`
|
||||||
|
|
||||||
// Amount of logical ports
|
// Amount of logical ports
|
||||||
LogicalPortsCount uint64 `json:"logical_ports_count"`
|
LogicalPortsCount uint64 `json:"logical_ports_count"`
|
||||||
|
|
||||||
@@ -62,23 +80,133 @@ type Counter struct {
|
|||||||
SecurityRulesCount uint64 `json:"security_rules_count"`
|
SecurityRulesCount uint64 `json:"security_rules_count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of counters
|
// Info about a net address
|
||||||
type Counters []Counter
|
type NetAddress struct {
|
||||||
|
// ID
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
// Info about an external network port
|
// IP address
|
||||||
type ExternalNetworkPort struct {
|
IPAddr string `json:"ip_addr"`
|
||||||
|
|
||||||
|
// IP address range end
|
||||||
|
IPAddrRangeEnd string `json:"ip_addr_range_end"`
|
||||||
|
|
||||||
|
// IP prefix
|
||||||
|
IPPrefix string `json:"ip_prefix"`
|
||||||
|
|
||||||
|
// MAC address
|
||||||
|
MACAddr string `json:"mac_addr"`
|
||||||
|
|
||||||
|
// Net address type
|
||||||
|
NetAddressType string `json:"net_address_type"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of net addresses
|
||||||
|
type NetAddresses []NetAddress
|
||||||
|
|
||||||
|
// Request info about a net address
|
||||||
|
type NetAddressRequest struct {
|
||||||
|
// IP address
|
||||||
|
// Required: false
|
||||||
|
IPAddr string `url:"ip_addr" json:"ip_addr"`
|
||||||
|
|
||||||
|
// IP address range end
|
||||||
|
// Required: false
|
||||||
|
IPAddrRangeEnd string `url:"ip_addr_range_end" json:"ip_addr_range_end"`
|
||||||
|
|
||||||
|
// IP prefix
|
||||||
|
// Required: false
|
||||||
|
IPPrefix string `url:"ip_prefix" json:"ip_prefix"`
|
||||||
|
|
||||||
|
// MAC address
|
||||||
|
// Required: false
|
||||||
|
MACAddr string `url:"mac_addr" json:"mac_addr"`
|
||||||
|
|
||||||
|
// Net address type
|
||||||
|
// Required: true
|
||||||
|
NetAddressType string `url:"net_address_type" json:"net_address_type" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info about an L2 connection port
|
||||||
|
type L2ConnectionPort struct {
|
||||||
|
// Access group ID
|
||||||
|
AccessGroupID string `json:"access_group_id"`
|
||||||
|
|
||||||
|
// Created at
|
||||||
|
CreatedAt string `json:"created_at"`
|
||||||
|
|
||||||
|
// ID
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// L2 external network
|
||||||
|
L2ExternalNetwork L2ExternalNetwork `json:"l2_external_network"`
|
||||||
|
|
||||||
|
// Updated at
|
||||||
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
|
||||||
|
// Version ID
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of L2 connection ports
|
||||||
|
type L2ConnectionPorts []L2ConnectionPort
|
||||||
|
|
||||||
|
// Info about an L2 external network
|
||||||
|
type L2ExternalNetwork struct {
|
||||||
// Bridge network name
|
// Bridge network name
|
||||||
BridgeNetworkName string `json:"bridge_network_name"`
|
BridgeNetworkName string `json:"bridge_network_name"`
|
||||||
|
|
||||||
// Default gateaway for IPv4
|
// Created at
|
||||||
DefaultGateawayIPv4 string `json:"default_gateaway_ipv4"`
|
CreatedAt string `json:"created_at"`
|
||||||
|
|
||||||
// Default gateaway for IPv6
|
|
||||||
DefaultGateawayIPv6 string `json:"default_gateaway_ipv6"`
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// Display name
|
||||||
|
DisplayName string `json:"display_name"`
|
||||||
|
|
||||||
|
// Hypervisors
|
||||||
|
Hypervisors []string `json:"hypervisors"`
|
||||||
|
|
||||||
|
// ID
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// Updated at
|
||||||
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
|
||||||
|
// Version ID
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
|
||||||
|
// VLAN Tag
|
||||||
|
VLANTag *int `json:"vlan_tag"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info about an external network port
|
||||||
|
type ExternalNetworkPort struct {
|
||||||
|
// Access group ID
|
||||||
|
AccessGroupID string `json:"access_group_id"`
|
||||||
|
|
||||||
|
// Access group name
|
||||||
|
AccessGroupName string `json:"access_group_name"`
|
||||||
|
|
||||||
|
// Bridge network name
|
||||||
|
BridgeNetworkName string `json:"bridge_network_name"`
|
||||||
|
|
||||||
|
// Comment
|
||||||
|
Comment string `json:"comment"`
|
||||||
|
|
||||||
|
// Default gateway for IPv4
|
||||||
|
DefaultGatewayIPv4 string `json:"default_gateway_ipv4"`
|
||||||
|
|
||||||
|
// Default gateway for IPv6
|
||||||
|
DefaultGatewayIPv6 string `json:"default_gateway_ipv6"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// Is a logical port enabled
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
// Details of external network ports
|
// Details of external network ports
|
||||||
ExternalNetworkPorts ExternalNetworkPortsField `json:"external_network_ports"`
|
ExternalNetworkPorts ExternalNetworkPortsField `json:"external_network_ports"`
|
||||||
|
|
||||||
@@ -88,11 +216,14 @@ type ExternalNetworkPort struct {
|
|||||||
// ID of an external network port
|
// ID of an external network port
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// IP v4
|
||||||
|
IPv4 string `json:"ipv4"`
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
Status Status `json:"status"`
|
Status Status `json:"status"`
|
||||||
|
|
||||||
// Version ID
|
// Version ID
|
||||||
VersionID string `json:"version_id"`
|
VersionID uint64 `json:"version_id"`
|
||||||
|
|
||||||
// Subnet for V4
|
// Subnet for V4
|
||||||
SubnetV4 string `json:"subnet_v4"`
|
SubnetV4 string `json:"subnet_v4"`
|
||||||
@@ -107,7 +238,10 @@ type ExternalNetworkPort struct {
|
|||||||
UpdatedAt string `json:"updated_at"`
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
|
||||||
// VLAN Tag
|
// VLAN Tag
|
||||||
VLANTag string `json:"vlan_tag"`
|
VLANTag int `json:"vlan_tag"`
|
||||||
|
|
||||||
|
// MAC
|
||||||
|
MAC string `json:"mac"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List of external network ports
|
// List of external network ports
|
||||||
@@ -142,6 +276,9 @@ type LogicalPort struct {
|
|||||||
// Is a logical port enabled
|
// Is a logical port enabled
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
|
// Exclude firewall settings
|
||||||
|
ExcludeFirewall ExcludeFirewall `json:"exclude_firewall"`
|
||||||
|
|
||||||
// External network ID
|
// External network ID
|
||||||
ExternalNetworkID string `json:"external_network_id"`
|
ExternalNetworkID string `json:"external_network_id"`
|
||||||
|
|
||||||
@@ -151,6 +288,9 @@ type LogicalPort struct {
|
|||||||
// Hypervisor display name
|
// Hypervisor display name
|
||||||
HypervisorDisplayName string `json:"hypervisor_display_name"`
|
HypervisorDisplayName string `json:"hypervisor_display_name"`
|
||||||
|
|
||||||
|
// Labels
|
||||||
|
Labels Labels `json:"labels"`
|
||||||
|
|
||||||
// Live migration target HV
|
// Live migration target HV
|
||||||
LiveMigrationTargetHV string `json:"live_migration_target_hv"`
|
LiveMigrationTargetHV string `json:"live_migration_target_hv"`
|
||||||
|
|
||||||
@@ -170,9 +310,30 @@ type LogicalPort struct {
|
|||||||
VersionID uint64 `json:"version_id"`
|
VersionID uint64 `json:"version_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List a logical ports
|
// List of logical ports
|
||||||
type LogicalPorts []LogicalPort
|
type LogicalPorts []LogicalPort
|
||||||
|
|
||||||
|
// Info about exclude firewall settings
|
||||||
|
type ExcludeFirewall struct {
|
||||||
|
// Exclusion reason
|
||||||
|
ExclusionReason string `json:"exclusion_reason"`
|
||||||
|
|
||||||
|
// Is logical port addresses excluded
|
||||||
|
LogicalPortAddressesExcluded bool `json:"logical_port_addresses_excluded"`
|
||||||
|
|
||||||
|
// Is logical port excluded
|
||||||
|
LogicalPortExcluded bool `json:"logical_port_excluded"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Labels for a logical port
|
||||||
|
type Labels struct {
|
||||||
|
// VM ID
|
||||||
|
VMID string `json:"vm_id"`
|
||||||
|
|
||||||
|
// VM name
|
||||||
|
VMName string `json:"vm_name"`
|
||||||
|
}
|
||||||
|
|
||||||
// Info about a security policy
|
// Info about a security policy
|
||||||
type SecurityPolicy struct {
|
type SecurityPolicy struct {
|
||||||
// Access group ID
|
// Access group ID
|
||||||
@@ -181,8 +342,8 @@ type SecurityPolicy struct {
|
|||||||
// Access group name
|
// Access group name
|
||||||
AccessGroupName string `json:"access_group_name"`
|
AccessGroupName string `json:"access_group_name"`
|
||||||
|
|
||||||
// Applied to net object group ID
|
// Applied net object groups
|
||||||
AppliedToNetObjectGroupID string `json:"applied_to_net_object_group_id"`
|
AppliedNetObjectGroups AppliedNetObjectGroups `json:"applied_net_object_groups"`
|
||||||
|
|
||||||
// Created at
|
// Created at
|
||||||
CreatedAt string `json:"created_at"`
|
CreatedAt string `json:"created_at"`
|
||||||
@@ -211,6 +372,9 @@ type SecurityPolicy struct {
|
|||||||
// Status
|
// Status
|
||||||
Status Status `json:"status"`
|
Status Status `json:"status"`
|
||||||
|
|
||||||
|
// Type
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
// Version ID
|
// Version ID
|
||||||
VersionID uint64 `json:"version_id"`
|
VersionID uint64 `json:"version_id"`
|
||||||
|
|
||||||
@@ -221,6 +385,21 @@ type SecurityPolicy struct {
|
|||||||
// List of security policies
|
// List of security policies
|
||||||
type SecurityPolicies []SecurityPolicy
|
type SecurityPolicies []SecurityPolicy
|
||||||
|
|
||||||
|
// Info about an applied net object group in a security policy
|
||||||
|
type AppliedNetObjectGroup struct {
|
||||||
|
// ID
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// Version ID
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of applied net object groups
|
||||||
|
type AppliedNetObjectGroups []AppliedNetObjectGroup
|
||||||
|
|
||||||
// Details of external network ports field
|
// Details of external network ports field
|
||||||
type ExternalNetworkPortField struct {
|
type ExternalNetworkPortField struct {
|
||||||
// Access group ID
|
// Access group ID
|
||||||
@@ -261,11 +440,14 @@ type ExternalNetworkPortsField []ExternalNetworkPortField
|
|||||||
|
|
||||||
// Info about a status
|
// Info about a status
|
||||||
type Status struct {
|
type Status struct {
|
||||||
// Common
|
// Operation status
|
||||||
Common string `json:"common"`
|
OperationStatus string `json:"operation_status"`
|
||||||
|
|
||||||
// Info about hypervisors
|
// Info about hypervisors
|
||||||
Hypervisors HypervisorsInfo `json:"hypervisors"`
|
Hypervisors HypervisorsInfo `json:"hypervisors"`
|
||||||
|
|
||||||
|
// Hypervisor status
|
||||||
|
HypervisorStatus string `json:"hypervisor_status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config for IP v6
|
// Config for IP v6
|
||||||
@@ -396,9 +578,6 @@ type Bindings struct {
|
|||||||
// Is an address detected
|
// Is an address detected
|
||||||
AddressDetection bool `json:"address_detection"`
|
AddressDetection bool `json:"address_detection"`
|
||||||
|
|
||||||
// Is excluded from firewall
|
|
||||||
IsExcludedFromFirewall bool `json:"is_excluded_from_firewall"`
|
|
||||||
|
|
||||||
// Version ID
|
// Version ID
|
||||||
VersionID uint64 `json:"version_id"`
|
VersionID uint64 `json:"version_id"`
|
||||||
|
|
||||||
@@ -648,8 +827,8 @@ type RoutersInfo struct {
|
|||||||
|
|
||||||
// Info about a hypervisor
|
// Info about a hypervisor
|
||||||
type HypervisorInfo struct {
|
type HypervisorInfo struct {
|
||||||
// Status
|
// Operation status
|
||||||
Status string `json:"status"`
|
OperationStatus string `json:"operation_status"`
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -696,7 +875,128 @@ type LogicalPortAddress struct {
|
|||||||
// List of logical port addresses
|
// List of logical port addresses
|
||||||
type LogicalPortAddresses []LogicalPortAddress
|
type LogicalPortAddresses []LogicalPortAddress
|
||||||
|
|
||||||
// TODO
|
// Info about a security rule
|
||||||
type SecurityRule struct{}
|
type SecurityRule struct {
|
||||||
|
// Access group ID
|
||||||
|
AccessGroupID string `json:"access_group_id"`
|
||||||
|
|
||||||
|
// Action
|
||||||
|
Action string `json:"action"`
|
||||||
|
|
||||||
|
// Description
|
||||||
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// Destination net object
|
||||||
|
DestinationNetObject *SecurityRuleNetObject `json:"destination_net_object"`
|
||||||
|
|
||||||
|
// Direction
|
||||||
|
Direction string `json:"direction"`
|
||||||
|
|
||||||
|
// Display name
|
||||||
|
DisplayName string `json:"display_name"`
|
||||||
|
|
||||||
|
// Is enabled
|
||||||
|
Enabled bool `json:"enabled"`
|
||||||
|
|
||||||
|
// Filter
|
||||||
|
Filter *SecurityRuleFilter `json:"filter"`
|
||||||
|
|
||||||
|
// ID
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// Is log enabled
|
||||||
|
LogEnabled bool `json:"log_enabled"`
|
||||||
|
|
||||||
|
// Log name
|
||||||
|
LogName string `json:"log_name"`
|
||||||
|
|
||||||
|
// Log severity
|
||||||
|
LogSeverity string `json:"log_severity"`
|
||||||
|
|
||||||
|
// Priority
|
||||||
|
Priority int `json:"priority"`
|
||||||
|
|
||||||
|
// Security policy ID
|
||||||
|
SecurityPolicyID string `json:"security_policy_id"`
|
||||||
|
|
||||||
|
// Source net object
|
||||||
|
SourceNetObject *SecurityRuleNetObject `json:"source_net_object"`
|
||||||
|
|
||||||
|
// Is statistics enabled
|
||||||
|
StatisticsEnabled bool `json:"statistics_enabled"`
|
||||||
|
|
||||||
|
// Type
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
|
// Version ID
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List of security rules
|
||||||
type SecurityRules []SecurityRule
|
type SecurityRules []SecurityRule
|
||||||
|
|
||||||
|
// Info about a security rule net object
|
||||||
|
type SecurityRuleNetObject struct {
|
||||||
|
// Display name
|
||||||
|
DisplayName string `json:"display_name"`
|
||||||
|
|
||||||
|
// Net address pool ID
|
||||||
|
NetAddressPoolID string `json:"net_address_pool_id"`
|
||||||
|
|
||||||
|
// Net object group ID
|
||||||
|
NetObjectGroupID string `json:"net_object_group_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info about a security rule filter
|
||||||
|
type SecurityRuleFilter struct {
|
||||||
|
// Filters
|
||||||
|
Filters SecurityRuleFilters `json:"filters"`
|
||||||
|
|
||||||
|
// Name
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Security rule filters
|
||||||
|
type SecurityRuleFilters struct {
|
||||||
|
// Filter all traffic
|
||||||
|
All bool `json:"all"`
|
||||||
|
|
||||||
|
// Filter ARP traffic
|
||||||
|
ARP bool `json:"arp"`
|
||||||
|
|
||||||
|
// Filter DHCP traffic
|
||||||
|
DHCP bool `json:"dhcp"`
|
||||||
|
|
||||||
|
// Custom filter expression
|
||||||
|
Expression string `json:"expression"`
|
||||||
|
|
||||||
|
// Filter ICMP traffic
|
||||||
|
ICMP bool `json:"icmp"`
|
||||||
|
|
||||||
|
// Filter IP traffic
|
||||||
|
IP bool `json:"ip"`
|
||||||
|
|
||||||
|
// Filter IPv4 traffic
|
||||||
|
IPv4 bool `json:"ip_v4"`
|
||||||
|
|
||||||
|
// Filter IPv6 traffic
|
||||||
|
IPv6 bool `json:"ip_v6"`
|
||||||
|
|
||||||
|
// Keep tracking opened sessions
|
||||||
|
KeepOpenedSessions bool `json:"keep_opened_sessions"`
|
||||||
|
|
||||||
|
// Filter Neighbor Discovery traffic
|
||||||
|
ND bool `json:"nd"`
|
||||||
|
|
||||||
|
// Filter TCP traffic
|
||||||
|
TCP bool `json:"tcp"`
|
||||||
|
|
||||||
|
// List of TCP destination ports to filter
|
||||||
|
TCPDstPorts []string `json:"tcp_dst_ports"`
|
||||||
|
|
||||||
|
// Filter UDP traffic
|
||||||
|
UDP bool `json:"udp"`
|
||||||
|
|
||||||
|
// List of UDP destination ports to filter
|
||||||
|
UDPDstPorts []string `json:"udp_dst_ports"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,10 @@ type UpdateRequest struct {
|
|||||||
// Name of the network object group
|
// Name of the network object group
|
||||||
// Required: true
|
// Required: true
|
||||||
Name string `url:"name" json:"name" validate:"required"`
|
Name string `url:"name" json:"name" validate:"required"`
|
||||||
|
|
||||||
|
// Addresses
|
||||||
|
// Required: false
|
||||||
|
Addresses []NetAddressRequest `url:"addresses,omitempty" json:"addresses,omitempty" validate:"omitempty,dive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates a network object group
|
// Update updates a network object group
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ type CreateRequest struct {
|
|||||||
// DHCP IPv6
|
// DHCP IPv6
|
||||||
// Required: false
|
// Required: false
|
||||||
DHCPv6 *DHCPv6ConfigRequest `url:"-" json:"dhcp_v6,omitempty"`
|
DHCPv6 *DHCPv6ConfigRequest `url:"-" json:"dhcp_v6,omitempty"`
|
||||||
|
|
||||||
|
// Segment type
|
||||||
|
// Required: false
|
||||||
|
Type string `url:"type,omitempty" json:"type,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DHCPv4ConfigRequest struct {
|
type DHCPv4ConfigRequest struct {
|
||||||
|
|||||||
46
pkg/sdn/segments/get_faa.go
Normal file
46
pkg/sdn/segments/get_faa.go
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package segments
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
||||||
|
)
|
||||||
|
|
||||||
|
// GetFAARequest struct to get the floating/anycast IP address of a segment
|
||||||
|
type GetFAARequest struct {
|
||||||
|
// ID of segment
|
||||||
|
// Required: true
|
||||||
|
SegmentID string `url:"segment_id" json:"segment_id" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFAA gets the floating/anycast IP address info for a segment
|
||||||
|
func (s Segments) GetFAA(ctx context.Context, req GetFAARequest) (*GetFAAResponse, error) {
|
||||||
|
res, err := s.GetFAARaw(ctx, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
info := GetFAAResponse{}
|
||||||
|
|
||||||
|
err = json.Unmarshal(res, &info)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &info, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFAARaw gets the floating/anycast IP address info for a segment as an array of bytes
|
||||||
|
func (s Segments) GetFAARaw(ctx context.Context, req GetFAARequest) ([]byte, error) {
|
||||||
|
err := validators.ValidateRequest(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, validators.ValidationErrors(validators.GetErrors(err))
|
||||||
|
}
|
||||||
|
|
||||||
|
url := "/sdn/segment/get_faa"
|
||||||
|
|
||||||
|
res, err := s.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package segments
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"repository.basistech.ru/BASIS/dynamix-golang-sdk/v14/internal/validators"
|
|
||||||
)
|
|
||||||
|
|
||||||
// GetStatusRequest struct to get information about segment status
|
|
||||||
type GetStatusRequest struct {
|
|
||||||
// ID of segment
|
|
||||||
// Required: true
|
|
||||||
SegmentID string `url:"segment_id" json:"segment_id" validate:"required"`
|
|
||||||
|
|
||||||
// ID of version
|
|
||||||
// Required: false
|
|
||||||
VersionID uint64 `url:"version_id,omitempty" json:"version_id,omitempty"`
|
|
||||||
|
|
||||||
// Get detailed status or not
|
|
||||||
// Required: false
|
|
||||||
Detailed interface{} `url:"enabled,omitempty" json:"enabled,omitempty" validate:"omitempty,isBool"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetStatus gets segment status
|
|
||||||
func (s Segments) GetStatus(ctx context.Context, req GetStatusRequest) (string, error) {
|
|
||||||
type temp struct {
|
|
||||||
Status string `json:"status"`
|
|
||||||
}
|
|
||||||
|
|
||||||
err := validators.ValidateRequest(req)
|
|
||||||
if err != nil {
|
|
||||||
return "", validators.ValidationErrors(validators.GetErrors(err))
|
|
||||||
}
|
|
||||||
|
|
||||||
url := "/sdn/segment/get_status"
|
|
||||||
|
|
||||||
res, err := s.client.DecortApiCall(ctx, http.MethodGet, url, req)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
info := temp{}
|
|
||||||
err = json.Unmarshal(res, &info)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return info.Status, nil
|
|
||||||
}
|
|
||||||
@@ -59,6 +59,10 @@ type ListRequest struct {
|
|||||||
// Sort order (asc/desc)
|
// Sort order (asc/desc)
|
||||||
// Required: false
|
// Required: false
|
||||||
SortOrder string `url:"sort_order,omitempty" json:"sort_order,omitempty"`
|
SortOrder string `url:"sort_order,omitempty" json:"sort_order,omitempty"`
|
||||||
|
|
||||||
|
// Filter by operation status
|
||||||
|
// Required: false
|
||||||
|
OperationStatus string `url:"operation_status,omitempty" json:"operation_status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// List gets list of all available segments as a ListSegment struct
|
// List gets list of all available segments as a ListSegment struct
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ type SegmentResponse struct {
|
|||||||
// Created time
|
// Created time
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
|
||||||
// Detailed description of the router port
|
// Detailed description of the segment
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
|
|
||||||
// DHCP IPv4
|
// DHCP IPv4
|
||||||
@@ -34,6 +34,9 @@ type SegmentResponse struct {
|
|||||||
// ID of segment
|
// ID of segment
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// L2 connection port info
|
||||||
|
L2ConnectionPort *L2ConnectionPort `json:"l2_connection_port,omitempty"`
|
||||||
|
|
||||||
// Logical ports info
|
// Logical ports info
|
||||||
LogicalPortsInfo []EntityInfo `json:"logical_ports_info"`
|
LogicalPortsInfo []EntityInfo `json:"logical_ports_info"`
|
||||||
|
|
||||||
@@ -49,6 +52,9 @@ type SegmentResponse struct {
|
|||||||
// IPv6 subnet in CIDR notation
|
// IPv6 subnet in CIDR notation
|
||||||
SubnetV6 string `json:"subnet_v6"`
|
SubnetV6 string `json:"subnet_v6"`
|
||||||
|
|
||||||
|
// Segment type
|
||||||
|
Type string `json:"type"`
|
||||||
|
|
||||||
// Update time
|
// Update time
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
|
|
||||||
@@ -111,16 +117,16 @@ type EntityInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Status struct {
|
type Status struct {
|
||||||
// Common
|
// Operation status
|
||||||
Common string `json:"common"`
|
OperationStatus string `json:"operation_status"`
|
||||||
|
|
||||||
// Hypervisors status
|
// Hypervisors status
|
||||||
Hypervisors []HypervisorStatus `json:"hypervisors"`
|
Hypervisors []HypervisorStatus `json:"hypervisors"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type HypervisorStatus struct {
|
type HypervisorStatus struct {
|
||||||
// Status
|
// Operation status of the hypervisor
|
||||||
Status string `json:"status"`
|
OperationStatus string `json:"operation_status"`
|
||||||
|
|
||||||
// Name of hypervisor
|
// Name of hypervisor
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@@ -134,3 +140,75 @@ type HypervisorStatus struct {
|
|||||||
// Synced time
|
// Synced time
|
||||||
SyncedAt time.Time `json:"synced_at"`
|
SyncedAt time.Time `json:"synced_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// L2ConnectionPort holds information about the L2 connection port of a segment
|
||||||
|
type L2ConnectionPort struct {
|
||||||
|
// ID of the L2 connection port
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// Access group ID
|
||||||
|
AccessGroupID string `json:"access_group_id"`
|
||||||
|
|
||||||
|
// ID of version
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
|
||||||
|
// L2 external network details
|
||||||
|
L2ExternalNetwork L2ExternalNetwork `json:"l2_external_network"`
|
||||||
|
|
||||||
|
// Created time
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
|
||||||
|
// ID of the user who created the port
|
||||||
|
CreatedBy string `json:"created_by"`
|
||||||
|
|
||||||
|
// Updated time
|
||||||
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
|
|
||||||
|
// ID of the user who last updated the port
|
||||||
|
UpdatedBy string `json:"updated_by"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// L2ExternalNetwork holds information about an L2 external network
|
||||||
|
type L2ExternalNetwork struct {
|
||||||
|
// ID of the network
|
||||||
|
ID string `json:"id"`
|
||||||
|
|
||||||
|
// User-friendly name for the network
|
||||||
|
DisplayName string `json:"display_name"`
|
||||||
|
|
||||||
|
// Detailed description of the network
|
||||||
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// Bridge network name
|
||||||
|
BridgeNetworkName string `json:"bridge_network_name"`
|
||||||
|
|
||||||
|
// List of hypervisor IDs attached to the network
|
||||||
|
Hypervisors []string `json:"hypervisors"`
|
||||||
|
|
||||||
|
// VLAN tag
|
||||||
|
VLANTag uint64 `json:"vlan_tag"`
|
||||||
|
|
||||||
|
// ID of version
|
||||||
|
VersionID uint64 `json:"version_id"`
|
||||||
|
|
||||||
|
// Created time
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
|
||||||
|
// ID of the user who created the network
|
||||||
|
CreatedBy string `json:"created_by"`
|
||||||
|
|
||||||
|
// Updated time
|
||||||
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
|
|
||||||
|
// ID of the user who last updated the network
|
||||||
|
UpdatedBy string `json:"updated_by"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFAAResponse holds the floating/anycast IP address info for a segment
|
||||||
|
type GetFAAResponse struct {
|
||||||
|
// IPv4 address
|
||||||
|
IPv4Address string `json:"ipv4_address"`
|
||||||
|
|
||||||
|
// IPv6 address
|
||||||
|
IPv6Address string `json:"ipv6_address"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@ type UpdateRequest struct {
|
|||||||
// DHCP IPv6
|
// DHCP IPv6
|
||||||
// Required: false
|
// Required: false
|
||||||
DHCPv6 *DHCPv6ConfigRequest `url:"-" json:"dhcp_v6,omitempty"`
|
DHCPv6 *DHCPv6ConfigRequest `url:"-" json:"dhcp_v6,omitempty"`
|
||||||
|
|
||||||
|
// Segment type
|
||||||
|
// Required: false
|
||||||
|
Type string `url:"type,omitempty" json:"type,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update updates segment
|
// Update updates segment
|
||||||
|
|||||||
Reference in New Issue
Block a user