Documentation ¶
Overview ¶
Package server provides tools for manipulating the server database table and corresponding http handlers.
Index ¶
- Constants
- func AddWhereClauseAndQuery(tx *sql.Tx, q string, hostName string, physLocationID int, orderByStr string, ...) (*sql.Rows, error)
- func AssignDeliveryServicesToServerHandler(w http.ResponseWriter, r *http.Request)
- func AssignMultipleServersCapabilities(w http.ResponseWriter, r *http.Request)
- func Create(inf *api.APIInfo) (int, error, error)
- func Delete(inf *api.APIInfo) (int, error, error)
- func DeleteMultipleServersCapabilities(w http.ResponseWriter, r *http.Request)
- func GetDetailParamHandler(w http.ResponseWriter, r *http.Request)deprecated
- func GetServerUpdateStatusHandler(w http.ResponseWriter, r *http.Request)
- func InitServerUpdateStatusCache(interval time.Duration, db *sql.DB, timeout time.Duration)
- func InvalidStatusForDeliveryServicesAlertText(prefix, serverType string, dsIDs []int) string
- func QueueUpdateHandler(w http.ResponseWriter, r *http.Request)
- func Read(inf *api.APIInfo) (int, error, error)
- func Update(inf *api.APIInfo) (int, error, error)
- func UpdateHandler(w http.ResponseWriter, r *http.Request)deprecated
- func UpdateHandlerV4(w http.ResponseWriter, r *http.Request)
- func UpdateStatusHandler(w http.ResponseWriter, r *http.Request)
- func ValidateDSCapabilities(dsIDs []int, serverName string, tx *sql.Tx) (error, error, int)
- type DSTenant
- type TOServerServerCapability
- func (ssc *TOServerServerCapability) Create() (error, error, int)
- func (ssc *TOServerServerCapability) Delete() (error, error, int)
- func (ssc *TOServerServerCapability) DeleteQuery() string
- func (ssc *TOServerServerCapability) GetAuditName() string
- func (ssc TOServerServerCapability) GetKeyFieldsInfo() []api.KeyFieldInfo
- func (ssc TOServerServerCapability) GetKeys() (map[string]interface{}, bool)
- func (ssc *TOServerServerCapability) GetType() string
- func (ssc *TOServerServerCapability) NewReadObj() interface{}
- func (ssc *TOServerServerCapability) ParamColumns() map[string]dbhelpers.WhereColumnInfo
- func (ssc *TOServerServerCapability) Read(h http.Header, useIMS bool) ([]interface{}, error, error, int, *time.Time)
- func (v *TOServerServerCapability) SelectMaxLastUpdatedQuery(where, orderBy, pagination, tableName string) string
- func (ssc *TOServerServerCapability) SelectQuery() string
- func (ssc *TOServerServerCapability) SetKeys(keys map[string]interface{})
- func (ssc *TOServerServerCapability) SetLastUpdated(t tc.TimeNoMod)
- func (ssc TOServerServerCapability) Validate() (error, error)
- type TOServerServerCapabilityV5
- func (ssc *TOServerServerCapabilityV5) Create() (error, error, int)
- func (ssc *TOServerServerCapabilityV5) Delete() (error, error, int)
- func (ssc *TOServerServerCapabilityV5) DeleteQuery() string
- func (ssc *TOServerServerCapabilityV5) GetAuditName() string
- func (ssc TOServerServerCapabilityV5) GetKeyFieldsInfo() []api.KeyFieldInfo
- func (ssc TOServerServerCapabilityV5) GetKeys() (map[string]interface{}, bool)
- func (ssc *TOServerServerCapabilityV5) GetType() string
- func (ssc *TOServerServerCapabilityV5) NewReadObj() interface{}
- func (ssc *TOServerServerCapabilityV5) ParamColumns() map[string]dbhelpers.WhereColumnInfo
- func (ssc *TOServerServerCapabilityV5) Read(h http.Header, useIMS bool) ([]interface{}, error, error, int, *time.Time)
- func (v *TOServerServerCapabilityV5) SelectMaxLastUpdatedQuery(where, orderBy, pagination, tableName string) string
- func (ssc *TOServerServerCapabilityV5) SelectQuery() string
- func (ssc *TOServerServerCapabilityV5) SetKeys(keys map[string]interface{})
- func (ssc *TOServerServerCapabilityV5) SetLastUpdated(t tc.TimeNoMod)
- func (ssc TOServerServerCapabilityV5) Validate() (error, error)
Constants ¶
const ( ServerCapabilityQueryParam = "serverCapability" ServerQueryParam = "serverId" ServerHostNameQueryParam = "serverHostName" )
Variables ¶
This section is empty.
Functions ¶
func AddWhereClauseAndQuery ¶
func AddWhereClauseAndQuery(tx *sql.Tx, q string, hostName string, physLocationID int, orderByStr string, limitStr string) (*sql.Rows, error)
AddWhereClauseAndQuery adds a WHERE clause to the query given in `q` (does NOT check for existing WHERE clauses or that the end of the string is the proper place to put one!) that limits the query results to those with the given hostname and/or Physical Location ID and, with orderByStr and limitStr appended (in that order), returns the result of querying the given transaction. Use an empty string for the hostname to not filter by hostname, use -1 as physLocationID to not filter by Physical Location.
func AssignDeliveryServicesToServerHandler ¶
func AssignDeliveryServicesToServerHandler(w http.ResponseWriter, r *http.Request)
AssignDeliveryServicesToServerHandler is the handler for POST requests to /servers/{{ID}}/deliveryservices.
func AssignMultipleServersCapabilities ¶
func AssignMultipleServersCapabilities(w http.ResponseWriter, r *http.Request)
AssignMultipleServersCapabilities assigns multiple servers to a capability or multiple server capabilities to a server
func DeleteMultipleServersCapabilities ¶
func DeleteMultipleServersCapabilities(w http.ResponseWriter, r *http.Request)
DeleteMultipleServersCapabilities deletes multiple servers to a capability or multiple server capabilities to a server
func GetDetailParamHandler
deprecated
func GetDetailParamHandler(w http.ResponseWriter, r *http.Request)
GetDetailParamHandler handles GET requests to /servers/details (the name includes "Param" for legacy reasons).
Deprecated: This endpoint has been removed from APIv4.
func GetServerUpdateStatusHandler ¶
func GetServerUpdateStatusHandler(w http.ResponseWriter, r *http.Request)
func InvalidStatusForDeliveryServicesAlertText ¶
InvalidStatusForDeliveryServicesAlertText returns a string describing that setting a server to 'status' invalidates the Active delivery services identified in 'dsIDs'.
If 'dsIDs' is empty/nil, returns an empty string.
func QueueUpdateHandler ¶
func QueueUpdateHandler(w http.ResponseWriter, r *http.Request)
QueueUpdateHandler implements an http handler that sets a server's config update time value.
func UpdateHandler
deprecated
func UpdateHandler(w http.ResponseWriter, r *http.Request)
UpdateHandler implements an http handler that updates a server's upd_pending and reval_pending values.
Deprecated: As of V4, prefer to use UpdateHandlerV4. This provides legacy compatibility with V3 and lower.
func UpdateHandlerV4 ¶
func UpdateHandlerV4(w http.ResponseWriter, r *http.Request)
UpdateHandlerV4 implements an http handler that updates a server's config update and reval times.
func UpdateStatusHandler ¶
func UpdateStatusHandler(w http.ResponseWriter, r *http.Request)
UpdateStatusHandler is the handler for PUT requests to the /servers/{{ID}}/status API endpoint.
Types ¶
type TOServerServerCapability ¶
type TOServerServerCapability struct { api.APIInfoImpl `json:"-"` tc.ServerServerCapability }
func (*TOServerServerCapability) Create ¶
func (ssc *TOServerServerCapability) Create() (error, error, int)
func (*TOServerServerCapability) Delete ¶
func (ssc *TOServerServerCapability) Delete() (error, error, int)
func (*TOServerServerCapability) DeleteQuery ¶
func (ssc *TOServerServerCapability) DeleteQuery() string
func (*TOServerServerCapability) GetAuditName ¶
func (ssc *TOServerServerCapability) GetAuditName() string
func (TOServerServerCapability) GetKeyFieldsInfo ¶
func (ssc TOServerServerCapability) GetKeyFieldsInfo() []api.KeyFieldInfo
func (TOServerServerCapability) GetKeys ¶
func (ssc TOServerServerCapability) GetKeys() (map[string]interface{}, bool)
Need to satisfy Identifier interface but is a no-op as path does not have Update
func (*TOServerServerCapability) GetType ¶
func (ssc *TOServerServerCapability) GetType() string
func (*TOServerServerCapability) NewReadObj ¶
func (ssc *TOServerServerCapability) NewReadObj() interface{}
func (*TOServerServerCapability) ParamColumns ¶
func (ssc *TOServerServerCapability) ParamColumns() map[string]dbhelpers.WhereColumnInfo
func (*TOServerServerCapability) SelectMaxLastUpdatedQuery ¶
func (v *TOServerServerCapability) SelectMaxLastUpdatedQuery(where, orderBy, pagination, tableName string) string
func (*TOServerServerCapability) SelectQuery ¶
func (ssc *TOServerServerCapability) SelectQuery() string
func (*TOServerServerCapability) SetKeys ¶
func (ssc *TOServerServerCapability) SetKeys(keys map[string]interface{})
func (*TOServerServerCapability) SetLastUpdated ¶
func (ssc *TOServerServerCapability) SetLastUpdated(t tc.TimeNoMod)
func (TOServerServerCapability) Validate ¶
func (ssc TOServerServerCapability) Validate() (error, error)
Validate fulfills the api.Validator interface.
type TOServerServerCapabilityV5 ¶
type TOServerServerCapabilityV5 struct { api.APIInfoImpl `json:"-"` tc.ServerServerCapabilityV5 }
func (*TOServerServerCapabilityV5) Create ¶
func (ssc *TOServerServerCapabilityV5) Create() (error, error, int)
func (*TOServerServerCapabilityV5) Delete ¶
func (ssc *TOServerServerCapabilityV5) Delete() (error, error, int)
func (*TOServerServerCapabilityV5) DeleteQuery ¶
func (ssc *TOServerServerCapabilityV5) DeleteQuery() string
func (*TOServerServerCapabilityV5) GetAuditName ¶
func (ssc *TOServerServerCapabilityV5) GetAuditName() string
func (TOServerServerCapabilityV5) GetKeyFieldsInfo ¶
func (ssc TOServerServerCapabilityV5) GetKeyFieldsInfo() []api.KeyFieldInfo
func (TOServerServerCapabilityV5) GetKeys ¶
func (ssc TOServerServerCapabilityV5) GetKeys() (map[string]interface{}, bool)
Need to satisfy Identifier interface but is a no-op as path does not have Update
func (*TOServerServerCapabilityV5) GetType ¶
func (ssc *TOServerServerCapabilityV5) GetType() string
func (*TOServerServerCapabilityV5) NewReadObj ¶
func (ssc *TOServerServerCapabilityV5) NewReadObj() interface{}
func (*TOServerServerCapabilityV5) ParamColumns ¶
func (ssc *TOServerServerCapabilityV5) ParamColumns() map[string]dbhelpers.WhereColumnInfo
func (*TOServerServerCapabilityV5) SelectMaxLastUpdatedQuery ¶
func (v *TOServerServerCapabilityV5) SelectMaxLastUpdatedQuery(where, orderBy, pagination, tableName string) string
func (*TOServerServerCapabilityV5) SelectQuery ¶
func (ssc *TOServerServerCapabilityV5) SelectQuery() string
func (*TOServerServerCapabilityV5) SetKeys ¶
func (ssc *TOServerServerCapabilityV5) SetKeys(keys map[string]interface{})
func (*TOServerServerCapabilityV5) SetLastUpdated ¶
func (ssc *TOServerServerCapabilityV5) SetLastUpdated(t tc.TimeNoMod)
func (TOServerServerCapabilityV5) Validate ¶
func (ssc TOServerServerCapabilityV5) Validate() (error, error)
Validate fulfills the api.Validator interface.