Documentation ¶
Index ¶
- Constants
- Variables
- func AddRequestID(c *macaron.Context)
- func ChecKPermissionWithErrorResp(expectRole model.Role, c *macaron.Context) (uid, oid int64, err error)
- func CheckResIfExistByUUID(table, UUID string) (result bool, id int64, err error)
- func CheckResWithErrorResponse(table, uuid string, c *macaron.Context) (err error)
- func CheckRoleByUUID(uid, oid int64, expectRole model.Role) (passed bool, err error)
- func Rest() (m *macaron.Macaron)
- func RunRest() (err error)
- func TokenProcess(c *macaron.Context)
- type ErrorMsg
- type FlavorRest
- func (v *FlavorRest) Create(c *macaron.Context)
- func (v *FlavorRest) Delete(c *macaron.Context)
- func (v *FlavorRest) GetFlavor(c *macaron.Context)
- func (v *FlavorRest) List(c *macaron.Context) ([]*model.Flavor, error)
- func (v *FlavorRest) ListFlavors(c *macaron.Context)
- func (v *FlavorRest) ListFlavorsDetail(c *macaron.Context)
- type ImageRest
- type NetworkAdmin
- type NetworkRest
- type ResponseError
- type SubnetRest
- type Token
- type Versions
- type VersionsAdmin
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 CheckResIfExistByUUID ¶
func CheckResWithErrorResponse ¶
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 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 ¶
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) ListFlavors ¶
func (v *FlavorRest) ListFlavors(c *macaron.Context)
func (*FlavorRest) ListFlavorsDetail ¶
func (v *FlavorRest) ListFlavorsDetail(c *macaron.Context)
type NetworkAdmin ¶
type NetworkAdmin struct{}
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 VersionsAdmin ¶
type VersionsAdmin restModels.GetIdentityMultipleChoicesBody
Click to show internal directories.
Click to hide internal directories.