controllers

package
v0.0.0-...-b0707d2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpManager

type IpManager struct {
	AppPath    string
	ConfigPath string
	ConfStruct globals.Config
}

func (*IpManager) ChangeAccountPassword

func (i *IpManager) ChangeAccountPassword(c *gin.Context)

ChangeAccountPassowrd Change an account's password

@Summary		Change password
@Description	Change password
@Tags			user
@Accept			json
@Produce		json
@Param			name	path	string	true	"User name"
@Param			changePassword	body	model.PasswordChange	true	"Password data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/{name} [patch]

func (*IpManager) CreateDomain

func (i *IpManager) CreateDomain(c *gin.Context)

CreateDomain Add a domain

@Summary		Create a new domain
@Description	Create a new domain
@Tags			domain
@Accept			json
@Produce		json
@Param			domain	body	model.Domain	true	"Domain data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/domain [post]

func (*IpManager) CreateHost

func (i *IpManager) CreateHost(c *gin.Context)

CreateHost Register a host into the system

@Summary		Register host
@Description	Add a new host
@Tags			host
@Accept			json
@Produce		json
@Param			host	body	model.Host	true	"Host Data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/host [post]

func (*IpManager) CreateSubnet

func (i *IpManager) CreateSubnet(c *gin.Context)

CreateSubnet Register a subnet with the system

@Summary		Register subnet
@Description	Add a new subnet
@Tags			subnet
@Accept			json
@Produce		json
@Param			subnet	body	model.Subnet	true	"Subnet Data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/subnet [post]

func (*IpManager) CreateUser

func (i *IpManager) CreateUser(c *gin.Context)

CreateUser Register a user for authentication and authorization

@Summary		Register user
@Description	Add a new user
@Tags			user
@Accept			json
@Produce		json
@Param			user	body	model.ProposedUser	true	"User Data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user [post]

func (*IpManager) DeleteDomain

func (i *IpManager) DeleteDomain(c *gin.Context)

DeleteDomain Add a domain

@Summary		Delete a domain
@Description	Delete a domain
@Tags			domain
@Produce		json
@Param			domainname	path	string	true	"Domain name"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/domain/{domainname} [delete]

func (*IpManager) DeleteHostname

func (i *IpManager) DeleteHostname(c *gin.Context)

DeleteHostname Remove a host from the system

@Summary		Delete a host
@Description	Delete a host
@Tags			host
@Accept			json
@Produce		json
@Param			hostname	path	string	true	"Hostname"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/host/{hostname} [delete]

func (*IpManager) DeleteSubnet

func (i *IpManager) DeleteSubnet(c *gin.Context)

DeleteSubnet Remove a subnet

@Summary		Delete subnet
@Description	Delete a subnet
@Tags			subnet
@Accept			json
@Produce		json
@Param			networkname	path	string	true	"Network name"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/subnet/{networkname} [delete]

func (*IpManager) DeleteUser

func (i *IpManager) DeleteUser(c *gin.Context)

DeleteUser Remove a user for authentication and authorization

@Summary		Delete user
@Description	Delete a user
@Tags			user
@Accept			json
@Produce		json
@Param			name	path	string	true	"User name"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/{name} [delete]

func (*IpManager) GetAddressByHostName

func (i *IpManager) GetAddressByHostName(c *gin.Context)

func (*IpManager) GetAddressByHostNameId

func (i *IpManager) GetAddressByHostNameId(c *gin.Context)

func (*IpManager) GetAddressById

func (i *IpManager) GetAddressById(c *gin.Context)

func (*IpManager) GetAddressByIpAddress

func (i *IpManager) GetAddressByIpAddress(c *gin.Context)

func (*IpManager) GetAddresses

func (i *IpManager) GetAddresses(c *gin.Context)

func (*IpManager) GetAddressesByDomainId

func (i *IpManager) GetAddressesByDomainId(c *gin.Context)

func (*IpManager) GetAddressesByDomainName

func (i *IpManager) GetAddressesByDomainName(c *gin.Context)

func (*IpManager) GetAddressesBySubnetId

func (i *IpManager) GetAddressesBySubnetId(c *gin.Context)

func (*IpManager) GetAddressesBySubnetName

func (i *IpManager) GetAddressesBySubnetName(c *gin.Context)

func (*IpManager) GetDomainByDomainName

func (i *IpManager) GetDomainByDomainName(c *gin.Context)

GetDomainByName Retrieve a domain by DomainName

@Summary		Retrieve a domain by DomainName
@Description	Retrieve a domain by DomainName
@Tags			domain
@Produce		json
@Param			domainname	path	string	true	"Domain name"
@Success		200	{object}	model.Domain
@Failure		400	{object}	model.FailureMsg
@Router			/domain/name/{domainname} [get]

func (*IpManager) GetDomainById

func (i *IpManager) GetDomainById(c *gin.Context)

GetDomainById Retrieve a domain by Id

@Summary		Retrieve a domain by Id
@Description	Retrieve a domain by Id
@Tags			domain
@Produce		json
@Param			domainid	path	string	true	"Domain Id"
@Success		200	{object}	model.Domain
@Failure		400	{object}	model.FailureMsg
@Router			/domain/id/{domainid} [get]

func (*IpManager) GetDomains

func (i *IpManager) GetDomains(c *gin.Context)

GetDomains Retrieve a list of domain

@Summary		Retrieve a list of domain
@Description	Retrieve a list of domain
@Tags			domain
@Produce		json
@Success		200	{object}	model.DomainList
@Failure		400	{object}	model.FailureMsg
@Router			/domains [get]

func (*IpManager) GetHostByHostName

func (i *IpManager) GetHostByHostName(c *gin.Context)

GetHostByHostName Retrieve a host by its hostname

@Summary		Retrieve a host by its hostname
@Description	Retrieve a host by its hostname
@Tags			host
@Produce		json
@Param			hostname	path	string	true	"hostname"
@Success		200	{object}	model.Host
@Failure		400	{object}	model.FailureMsg
@Router			/host/name/{hostname} [get]

func (*IpManager) GetHostById

func (i *IpManager) GetHostById(c *gin.Context)

GetHostById Retrieve a host by its Id

@Summary		Retrieve a host by its Id
@Description	Retrieve a host by its Id
@Tags			host
@Produce		json
@Param			hostid	path	string	true	"host Id"
@Success		200	{object}	model.Host
@Failure		400	{object}	model.FailureMsg
@Router			/host/id/{hostid} [get]

func (*IpManager) GetHosts

func (i *IpManager) GetHosts(c *gin.Context)

GetHosts Retrieve list of all hosts

@Summary		Retrieve list of all hosts
@Description	Retrieve list of all hosts
@Tags			host
@Produce		json
@Success		200	{object}	model.HostList
@Failure		400	{object}	model.FailureMsg
@Router			/hosts [get]

func (*IpManager) GetSubnetById

func (i *IpManager) GetSubnetById(c *gin.Context)

GetSubnetById Retrieve a subnet by its Id

@Summary		Retrieve a subnet by its Id
@Description	Retrieve a subnet by its Id
@Tags			subnet
@Produce		json
@Param			subnetid	path	string	true	"Subnet Id"
@Success		200	{object}	model.Subnet
@Failure		400	{object}	model.FailureMsg
@Router			/subnet/id/{subnetname} [get]

func (*IpManager) GetSubnetByNetworkName

func (i *IpManager) GetSubnetByNetworkName(c *gin.Context)

GetSubnetByNetworkName Retrieve a subnet by its network name

@Summary		Retrieve a subnet by its network name
@Description	Retrieve a subnet by its network name
@Tags			subnet
@Produce		json
@Param			subnetname	path	string	true	"Subnet name"
@Success		200	{object}	model.Subnet
@Failure		400	{object}	model.FailureMsg
@Router			/subnet/name/{subnetname} [get]

func (*IpManager) GetSubnets

func (i *IpManager) GetSubnets(c *gin.Context)

GetSubnets Retrieve list of all subnets

@Summary		Retrieve list of all subnets
@Description	Retrieve list of all subnets
@Tags			subnet
@Produce		json
@Success		200	{object}	model.Subnets
@Failure		400	{object}	model.FailureMsg
@Router			/subnets [get]

func (*IpManager) GetSubnetsByDomainId

func (i *IpManager) GetSubnetsByDomainId(c *gin.Context)

GetSubnetsByDomainId Retrieve the list of subnets assigned to a domain Id

@Summary		Retrieve a list of subnets assigned to a domain Id
@Description	Retrieve a list of subnets assigned to a domain Id
@Tags			subnet
@Produce		json
@Param			domainname	path	string	true	"Domain name"
@Success		200	{object}	model.Subnets
@Failure		400	{object}	model.FailureMsg
@Router			/subnets/domain/id/{domainid} [get]

func (*IpManager) GetSubnetsByDomainName

func (i *IpManager) GetSubnetsByDomainName(c *gin.Context)

GetSubnetsByDomainName Retrieve the list of subnets assigned to a domain name

@Summary		Retrieve a list of subnets assigned to a domain name
@Description	Retrieve a list of subnets assigned to a domain name
@Tags			subnet
@Produce		json
@Param			domainname	path	string	true	"Domain name"
@Success		200	{object}	model.Subnets
@Failure		400	{object}	model.FailureMsg
@Router			/subnets/domain/name/{domainname} [get]

func (*IpManager) GetUserById

func (i *IpManager) GetUserById(c *gin.Context)

GetUserById Retrieve a user by their Id

@Summary		Retrieve a user by their Id
@Description	Retrieve a user by their Id
@Tags			user
@Produce		json
@Param			id	path int true "User ID"
@Success		200	{object}	SafeUser
@Failure		400	{object}	model.FailureMsg
@Router			/user/id/{id} [get]

func (*IpManager) GetUserByUserName

func (i *IpManager) GetUserByUserName(c *gin.Context)

GetUserByName Retrieve a user by their UserName

@Summary		Retrieve a user by their UserName
@Description	Retrieve a user by their UserName
@Tags			user
@Produce		json
@Param			name	path	string	true	"User name"
@Success		200	{object}	SafeUser
@Failure		400	{object}	model.FailureMsg
@Router			/user/name/{name} [get]

func (*IpManager) GetUserStatus

func (i *IpManager) GetUserStatus(c *gin.Context)

GetUserStatus Retrieve the active status of a user. Can be either 'enabled' or 'locked'

@Summary		Retrieve a user's active status. Can be either 'enabled' or 'locked'
@Description	Retrieve a user's active status
@Tags			user
@Accept			json
@Produce		json
@Param			name	path	string	true	"User name"
@Security		BasicAuth
@Success		200	{object}	model.UserStatusMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/{name}/status [get]

func (*IpManager) GetUsers

func (i *IpManager) GetUsers(c *gin.Context)

GetUsers Retrieve list of all users

@Summary		Retrieve list of all users
@Description	Retrieve list of all users
@Tags			user
@Produce		json
@Success		200	{object}	model.UsersList
@Failure		400	{object}	model.FailureMsg
@Router			/users [get]

func (*IpManager) ModifySubnet

func (i *IpManager) ModifySubnet(c *gin.Context)

ModifySubnet Change a subnet's network information

@Summary		Change subnet network information
@Description	Change subnet network information
@Tags			subnet
@Accept			json
@Produce		json
@Param			networkname	path	string	true	"Network name"
@Param			subnetUpdate	body	model.SubnetUpdate	true	"Subnet data"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/subnet/{networkname} [patch]

func (*IpManager) SetUserStatus

func (i *IpManager) SetUserStatus(c *gin.Context)

SetUserStatus Set the active status of a user. Can be either 'enabled' or 'locked'

@Summary		Set a user's active status. Can be either 'enabled' or 'locked'
@Description	Set a user's active status
@Tags			user
@Accept			json
@Produce		json
@Param			user	body	model.User.UserName	true	"User Data"
@Param			name	path	string	true "User name"
@Security		BasicAuth
@Success		200	{object}	model.UserStatusMsg
@Failure		400	{object}	model.FailureMsg
@Router			/user/{name}/status [patch]

func (*IpManager) UpdateMacAddresses

func (i *IpManager) UpdateMacAddresses(c *gin.Context)

UpdateMacAddresses Update a host's MAC address list

@Summary		Update MAC address list
@Description	Update MAC address list
@Tags			host
@Accept			json
@Produce		json
@Param			hostname	path	string	true	"Hostname"
@Param			updateMacAddresses	body	model.MacAddressList	true	"MAC address list"
@Security		BasicAuth
@Success		200	{object}	model.SuccessMsg
@Failure		400	{object}	model.FailureMsg
@Router			/host/{hostname} [patch]

type SafeUser

type SafeUser struct {
	Id           int
	UserName     string
	CreationDate string
}

Jump to

Keyboard shortcuts

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