services

package
v0.2.0-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIKeyTemporaryVar = &APIKeyTemporary{}
View Source
var LoggedSessionVar = make(map[string]*LoggedSession)

Functions

func APIAuthentication

func APIAuthentication(c *gin.Context)

func AddDeviceVlan

func AddDeviceVlan(client *ent.Client, obj ent.Device) (response *ent.Device, err error)

func ChangePasswordAdministrator

func ChangePasswordAdministrator(client *ent.Client, obj ChangeAdminPassword) (response *ent.Administrator, e error)

func CheckNetworkOverlap added in v0.2.0

func CheckNetworkOverlap(client *ent.Client, d *ent.Device, ip_address *ent.IPAddress) bool

func CheckNilAdministrator

func CheckNilAdministrator(client *ent.Client) (status bool)

func CheckNotDuplicateIPAddress added in v0.2.0

func CheckNotDuplicateIPAddress(client *ent.Client, d *ent.Device, ip_address *ent.IPAddress) (*ent.IPAddress, error)

func CheckTimeout

func CheckTimeout(session *LoggedSession)

func CleanInterface

func CleanInterface(client *ent.Client, id int) (err error)

func Commit

func Commit(client *ent.Client, device_id int) (status interface{}, err error)

func CreateAdministrator

func CreateAdministrator(client *ent.Client, obj ent.Administrator) (response *ent.Administrator, err error)

func CreateDevice

func CreateDevice(client *ent.Client, obj ent.Device) (response *ent.Device, err error)

func CreateDeviceMap

func CreateDeviceMap(client *ent.Client, obj DeviceMapStruct) (response *ent.NetTopologyDeviceMap, err error)

func CreateDeviceType

func CreateDeviceType(client *ent.Client, obj ent.DeviceType) (response *ent.DeviceType, err error)

func CreateEdge

func CreateEdge(client *ent.Client, obj EdgeStruct) (response *ent.NetTopologyDeviceMap, err error)

func CreateIPRouting added in v0.2.0

func CreateIPRouting(client *ent.Client, obj ent.IPStaticRoutingTable) (response *ent.IPStaticRoutingTable, err error)

func CreateInterface

func CreateInterface(client *ent.Client, obj ent.NetInterface) (response *ent.NetInterface, err error)

func CreatePortChannelInterface added in v0.2.0

func CreatePortChannelInterface(client *ent.Client, obj ent.PortChannelInterface) (response *ent.PortChannelInterface, err error)

func CreateRangeInterface

func CreateRangeInterface(client *ent.Client, obj []ent.NetInterface) (response []*ent.NetInterface, err error)

func CreateTopology

func CreateTopology(client *ent.Client, obj ent.NetTopology) (response *ent.NetTopology, err error)

func CreateVlan

func CreateVlan(client *ent.Client, obj ent.Vlan) (response *ent.Vlan, err error)

func DeleteDevice

func DeleteDevice(client *ent.Client, id int) (err error)

func DeleteDeviceMap

func DeleteDeviceMap(client *ent.Client, id int) (err error)

func DeleteDeviceType

func DeleteDeviceType(client *ent.Client, id int) (err error)

func DeleteDeviceVlan

func DeleteDeviceVlan(client *ent.Client, id, vid int) error

func DeleteIPRouting added in v0.2.0

func DeleteIPRouting(client *ent.Client, id int) (err error)

func DeleteInterface

func DeleteInterface(client *ent.Client, id int) (err error)

func DeletePortChannelInterface added in v0.2.0

func DeletePortChannelInterface(client *ent.Client, id int) (err error)

func DeleteTopology

func DeleteTopology(client *ent.Client, id int) (err error)

func DeleteVlan

func DeleteVlan(client *ent.Client, id int) (err error)

func EditDeviceDetail

func EditDeviceDetail(client *ent.Client, obj ent.Device) (response *ent.Device, e error)

func EditDeviceTypeDetail

func EditDeviceTypeDetail(client *ent.Client, obj ent.DeviceType) (response *ent.DeviceType, e error)

func EditInterfaceDetail

func EditInterfaceDetail(client *ent.Client, obj ent.NetInterface) (response *ent.NetInterface, err error)

func EditPortChannelInterface added in v0.2.0

func EditPortChannelInterface(client *ent.Client, obj ent.PortChannelInterface) (response *ent.PortChannelInterface, err error)

func EditTopologyDetail

func EditTopologyDetail(client *ent.Client, obj ent.NetTopology) (response *ent.NetTopology, e error)

func EditVlanDetail

func EditVlanDetail(client *ent.Client, obj ent.Vlan) (response *ent.Vlan, e error)

func GetAllAdministrator

func GetAllAdministrator(client *ent.Client) (response []*ent.Administrator, err error)

func GetAllDevice

func GetAllDevice(client *ent.Client) (response []*ent.Device, err error)

func GetAllDeviceType

func GetAllDeviceType(client *ent.Client) (response []*ent.DeviceType, err error)

func GetAllTopology

func GetAllTopology(client *ent.Client) (response []*ent.NetTopology, err error)

func GetAllVlan

func GetAllVlan(client *ent.Client) (response []*ent.Vlan, err error)

func GetCanBeStaticRouteOnDevice added in v0.2.0

func GetCanBeStaticRouteOnDevice(client *ent.Client, did int) (response []*ent.Device, err error)

func GetDevice

func GetDevice(client *ent.Client, id int) (response *ent.Device, err error)

func GetDevicePlatform

func GetDevicePlatform(client *ent.Client) (response []*ent.DevicePlatform, err error)

func GetDeviceType

func GetDeviceType(client *ent.Client, id int) (response *ent.DeviceType, err error)

func GetInterface

func GetInterface(client *ent.Client, id int) (response *ent.NetInterface, err error)

func GetInterfaceLayer added in v0.2.0

func GetInterfaceLayer(client *ent.Client) (response []*ent.NetInterfaceLayer, err error)

func GetInterfaceMode

func GetInterfaceMode(client *ent.Client) (response []*ent.NetInterfaceMode, err error)

func GetPingDevice

func GetPingDevice(client *ent.Client, id int) (response *netautomation.PingResponse, err error)

func GetPingTopology

func GetPingTopology(client *ent.Client, id int) (response []*netautomation.PingResponseDeviceMap, err error)

func GetPortChannelInterface added in v0.2.0

func GetPortChannelInterface(client *ent.Client, id int) (response *ent.PortChannelInterface, err error)

func GetTopology

func GetTopology(client *ent.Client, id int) (response *ent.NetTopology, err error)

func GetVlan

func GetVlan(client *ent.Client, id int) (response *ent.Vlan, err error)

func Logout

func Logout(session *LoggedSession)

Types

type APIKeyTemporary

type APIKeyTemporary struct {
	Username  string `json:"username"`
	APISecret string `json:"api_secret"`
}

type ChangeAdminPassword

type ChangeAdminPassword struct {
	Username    string `json:"username"`
	OldPassword string `json:"old_password"`
	NewPassword string `json:"new_password"`
}

type DeviceMapStruct

type DeviceMapStruct struct {
	PositionX  int `json:"position_x"`
	PositionY  int `json:"position_y"`
	TopologyID int `json:"topology_id"`
	DeviceID   int `json:"device_id"`
	EdgeToID   int `json:"edge_to_id,omitempty"`
}

type EdgeStruct

type EdgeStruct struct {
	MapID    int `json:"map_id"`
	ToNodeID int `json:"to_node_id"`
}

type LoggedSession

type LoggedSession struct {
	Username   string    `json:"username"`
	APISecret  string    `json:"api_secret"`
	Authorized bool      `json:"authorized"`
	AtDatetime time.Time `json:"at_datetime"`
	Reason     string    `json:"reason"`
}

func CheckSessionWithUsernameAndAPISecret

func CheckSessionWithUsernameAndAPISecret(obj ent.Administrator) (auth *LoggedSession, e error)

func FindLoggedSession

func FindLoggedSession(username string) (session *LoggedSession, err error)

func GetAuthentication

func GetAuthentication(client *ent.Client, obj ent.Administrator) (auth *LoggedSession, e error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL