Documentation
¶
Index ¶
- func Create(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func CreateRenewedToken(apiKey string, msg string, code int) ([]byte, error)
- func CreateUser(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func Delete(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func DeleteUser(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func GetUser(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func GetUserByID(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler)
- func List(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func ListOne(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func ListReady(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func ListStatus(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func ListUsers(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func NodeSet(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func NodeUnset(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func Options(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func RefreshToken(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func Update(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func UpdateDbConf(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func UpdateInfo(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func UpdateReady(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func UpdateStatus(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func UpdateTopology(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func UpdateUser(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)
- func ValidateTenantUsers(tenant Tenant, tenantCol *mongo.Collection) (string, int)
- type DetailsAMS
- type DetailsHDFS
- type Links
- type NodeAMS
- type ReadyCheck
- type ReadyChecks
- type SelfReference
- type StatusDetail
- type SyncDataHDFS
- type Tenant
- type TenantDbConf
- type TenantInfo
- type TenantReadyData
- type TenantReadyOut
- type TenantStatus
- type TenantUser
- type Token
- type TopologyInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create function is used to implement the create tenant request. The request is an http POST request with the tenant description provided as json structure in the request body
func CreateRenewedToken ¶ added in v1.14.3
CreateRenewedToken constructs a message resposne with the renewed token
func CreateUser ¶
CreateUser function is used to implement the create user request. The request is an http POST request with the user description provided as json structure in the request body
func DeleteUser ¶
DeleteUser implements deletion and removal of user from tenant
func GetUserByID ¶
GetUserByID returns user by id given
func HandleSubrouter ¶
func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler)
HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts handling each route with a different subrouter
func List ¶
List function that implements the http GET request that retrieves all avaiable tenant information
func ListOne ¶
ListOne function implement an http GET request that accepts a name parameter urlvar and retrieves information only for the specific tenant
func ListStatus ¶
ListStatus show tenant status
func ListUsers ¶
ListUsers function that implements the http GET request that retrieves all avaiable users in tenant
func RefreshToken ¶
Refresh token renews user's api key
func Update ¶
Update function used to implement update tenant request. This is an http PUT request that gets a specific tenant's name as a urlvar parameter input and a json structure in the request body in order to update the datastore document for the specific tenant
func UpdateDbConf ¶ added in v1.14.3
Update Db conf function used to update only the db_conf part of a tenant
func UpdateInfo ¶ added in v1.14.3
Update Info function used to update only the info part of a tenant
func UpdateReady ¶ added in v1.14.3
func UpdateStatus ¶
func UpdateTopology ¶ added in v1.14.3
UpdateTopology function used to update only the topology part of a tenant
func UpdateUser ¶
UpdateUser function is used to implement the update user request. The request is an http PUT request with the user description provided as json structure in the request body
func ValidateTenantUsers ¶ added in v1.14.3
func ValidateTenantUsers(tenant Tenant, tenantCol *mongo.Collection) (string, int)
validateTenantUsers validates the uniqueness of the tenant's users' keys
Types ¶
type DetailsAMS ¶
type DetailsHDFS ¶
type DetailsHDFS struct {
MetricData bool `bson:"metric_data" json:"metric_data"`
SyncData map[string]SyncDataHDFS `bson:"sync_data" json:"sync_data,omitempty"`
}
type ReadyCheck ¶ added in v1.14.3
type ReadyChecks ¶ added in v1.14.3
type ReadyChecks struct {
Data ReadyCheck `bson:"data" json:"data"`
Topology ReadyCheck `bson:"topology" json:"topology"`
Reports ReadyCheck `bson:"reports" json:"reports"`
LastCheck string `bson:"last_check" json:"last_check"`
}
type SelfReference ¶
SelfReference to hold links and id
type StatusDetail ¶
type StatusDetail struct {
TotalStatus bool `json:"total_status"`
AMS DetailsAMS `bson:"ams" json:"ams"`
HDFS DetailsHDFS `bson:"hdfs" json:"hdfs"`
EngineConfig bool `bson:"engine_config" json:"engine_config"`
LastCheck string `bson:"last_check" json:"last_check"`
}
type SyncDataHDFS ¶
type SyncDataHDFS struct {
AggregationProf bool `bson:"aggregation_profile" json:"aggregation_profile"`
Recomp bool `bson:"blank_recomputation" json:"blank_recomputation"`
ConfigProf bool `bson:"configuration_profile" json:"configuration_profile"`
Donwtimes bool `bson:"downtimes" json:"downtimes"`
GroupEndpoints bool `bson:"group_endpoints" json:"group_endpoints"`
GroupGroups bool `bson:"group_groups" json:"group_groups"`
MetricProf bool `bson:"metric_profile" json:"metric_profile"`
OpsProf bool `bson:"operations_profile" json:"operations_profile"`
Weight bool `bson:"weights" json:"weights"`
}
type Tenant ¶
type Tenant struct {
ID string `bson:"id" json:"id"`
Info TenantInfo `bson:"info" json:"info"`
DbConf []TenantDbConf `bson:"db_conf" json:"db_conf,omitempty"`
Topology TopologyInfo `bson:"topology" json:"topology"`
Users []TenantUser `bson:"users" json:"users,omitempty"`
Node bool `bson:"node" json:"node,omitempty"`
}
Tenant structure holds information about tenant information including db conf and users. Used in
type TenantDbConf ¶
type TenantDbConf struct {
Store string `bson:"store" json:"store"`
Server string `bson:"server" json:"server"`
Port int `bson:"port" json:"port"`
Database string `bson:"database" json:"database"`
Username string `bson:"username" json:"username"`
Password string `bson:"password" json:"password"`
}
TenantDbConf structure holds information about tenant's database configuration
type TenantInfo ¶
type TenantInfo struct {
Name string `bson:"name" json:"name"`
Email string `bson:"email" json:"email"`
Description string `bson:"description" json:"description"`
Image string `bson:"image" json:"image"`
Website string `bson:"website" json:"website"`
Created string `bson:"created" json:"created"`
Updated string `bson:"updated" json:"updated"`
}
TenantInfo struct holds information about tenant name, contact details
type TenantReadyData ¶ added in v1.14.3
type TenantReadyData struct {
ID string `bson:"id" json:"id"`
Info TenantInfo `bson:"info" json:"info"`
Ready ReadyChecks `bson:"ready" json:"ready,omitempty"`
}
type TenantReadyOut ¶ added in v1.14.3
type TenantReadyOut struct {
ID string `json:"id"`
Name string `json:"name"`
Ready bool `json:"ready"`
Data ReadyCheck `json:"data"`
Topology ReadyCheck `json:"topology"`
Reports ReadyCheck `json:"reports"`
LastCheck string `json:"last_check"`
}
type TenantStatus ¶
type TenantStatus struct {
ID string `bson:"id" json:"id"`
Info TenantInfo `bson:"info" json:"info"`
Status StatusDetail `bson:"status" json:"status,omitempty"`
}
type TenantUser ¶
type TenantUser struct {
ID string `bson:"id" json:"id"`
Name string `bson:"name" json:"name"`
Email string `bson:"email" json:"email"`
APIkey string `bson:"api_key" json:"api_key"`
Roles []string `bson:"roles,omitempty" json:"roles,omitempty"`
Component string `bson:"component,omitempty" json:"component,omitempty"`
}
TenantUser structure holds information about tenant's user
type TopologyInfo ¶
type TopologyInfo struct {
TopoType string `bson:"type" json:"type"`
Feed string `bson:"feed" json:"feed"`
}
TopologyInfo contains topology feed information