routes

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const MAXVLAN int64 = 4096
View Source
const MINVLAN int64 = 1
View Source
const VLAN networkType = `vlan`
View Source
const VXLAN networkType = `vxlan`

Variables

View Source
var (
	ReqIDKey = "x-openstack-request-id"
	ClaimKey = "claims"
)

Functions

func AddRequestID

func AddRequestID(c *macaron.Context)

func ChecKPermissionWithErrorResp

func ChecKPermissionWithErrorResp(expectRole model.Role, c *macaron.Context) (uid, oid int64, err error)

func CheckResIfExistByUUID

func CheckResIfExistByUUID(table, UUID string) (result bool, id int64, err error)

func CheckResWithErrorResponse

func CheckResWithErrorResponse(table, uuid string, c *macaron.Context) (err error)

check resource whether existing if resource is not exist, return 404 error if resource is exist, save ID to data with UUID as key

func CheckRoleByUUID

func CheckRoleByUUID(uid, oid int64, expectRole model.Role) (passed bool, err error)

func Rest

func Rest() (m *macaron.Macaron)

func RunRest

func RunRest() (err error)

func TokenProcess

func TokenProcess(c *macaron.Context)

Types

type ErrorMsg

type ErrorMsg struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
	Title   string `json:"title"`
}

func JsonSchemeCheck

func JsonSchemeCheck(schemeName string, requestBody []byte) (e *ErrorMsg)

func (ErrorMsg) Error

func (e ErrorMsg) Error() string

type FlavorRest

type FlavorRest struct{}

func (*FlavorRest) Create

func (v *FlavorRest) Create(c *macaron.Context)

func (*FlavorRest) Delete

func (v *FlavorRest) Delete(c *macaron.Context)

func (*FlavorRest) GetFlavor

func (v *FlavorRest) GetFlavor(c *macaron.Context)

func (*FlavorRest) List

func (v *FlavorRest) List(c *macaron.Context) ([]*model.Flavor, error)

func (*FlavorRest) ListFlavors

func (v *FlavorRest) ListFlavors(c *macaron.Context)

func (*FlavorRest) ListFlavorsDetail

func (v *FlavorRest) ListFlavorsDetail(c *macaron.Context)

type ImageRest

type ImageRest struct{}

func (*ImageRest) Create

func (v *ImageRest) Create(c *macaron.Context)

func (*ImageRest) List

func (v *ImageRest) List(c *macaron.Context)

type NetworkAdmin

type NetworkAdmin struct{}

func (*NetworkAdmin) List

func (a *NetworkAdmin) List(orgID int64, offset, limit int64, order string) (total int64, networks []*model.Network, err error)

type NetworkRest

type NetworkRest struct{}

func (*NetworkRest) CreateNetwork

func (v *NetworkRest) CreateNetwork(c *macaron.Context)

func (*NetworkRest) DeleteNetwork

func (v *NetworkRest) DeleteNetwork(c *macaron.Context)

func (*NetworkRest) ListNetworks

func (v *NetworkRest) ListNetworks(c *macaron.Context)

type ResponseError

type ResponseError struct {
	ErrorMsg `json:"error"`
}

func NewResponseError

func NewResponseError(title, msg string, code int) *ResponseError

type SubnetRest

type SubnetRest struct{}

func (*SubnetRest) CreateSubnet

func (v *SubnetRest) CreateSubnet(c *macaron.Context)

CreateSubnet : create subnet in db with network id

func (*SubnetRest) DeleteSubnet

func (v *SubnetRest) DeleteSubnet(c *macaron.Context)

DeleteSubnet : delete subNet

func (*SubnetRest) ListSubnets

func (v *SubnetRest) ListSubnets(c *macaron.Context)

ListSubnets : list subnets

type Token

type Token struct{}

func (*Token) IssueTokenByPasswd

func (t *Token) IssueTokenByPasswd(c *macaron.Context)

type Versions

type Versions struct{}

func (*Versions) ListVersion

func (v *Versions) ListVersion(c *macaron.Context)

ListVersion : json home

Jump to

Keyboard shortcuts

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