Documentation ¶
Index ¶
- Constants
- func ASNExists(tx *sql.Tx, id string) (bool, error)
- func AddTenancyCheck(where string, queryValues map[string]interface{}, tenantColumnName string, ...) (string, map[string]interface{})
- func AppendWhere(where, extra string) string
- func BuildWhereAndOrderByAndPagination(parameters map[string]string, queryParamsToSQLCols map[string]WhereColumnInfo) (string, string, string, map[string]interface{}, []error)
- func CDNExists(cdnName string, tx *sql.Tx) (bool, error)
- func CacheGroupExists(tx *sql.Tx, name string) (bool, error)
- func CachegroupHasTopologyBasedDeliveryServicesOnCDN(tx *sql.Tx, cachegroupID int, CDNID int) (bool, error)
- func CachegroupParameterAssociationExists(id int, cachegroup int, tx *sql.Tx) (bool, error)
- func CheckIfCurrentUserCanModifyCDN(tx *sql.Tx, cdn, user string) (error, error, int)
- func CheckIfCurrentUserCanModifyCDNWithID(tx *sql.Tx, cdnID int64, user string) (error, error, int)
- func CheckIfCurrentUserCanModifyCDNs(tx *sql.Tx, cdns []string, user string) (error, error, int)
- func CheckIfCurrentUserCanModifyCDNsByID(tx *sql.Tx, cdns []int, user string) (error, error, int)
- func CheckIfCurrentUserCanModifyCachegroup(tx *sql.Tx, cachegroupID int, user string) (error, error, int)
- func CheckIfCurrentUserCanModifyCachegroups(tx *sql.Tx, cachegroupIDs []int, user string) (error, error, int)
- func CheckIfCurrentUserHasCdnLock(tx *sql.Tx, cdn, user string) (error, error, int)
- func CheckOriginServerInDSCG(tx *sql.Tx, dsID int, dsTopology string) (error, error, int)
- func CheckTopology(tx *sqlx.Tx, ds tc.DeliveryServiceV5) (int, error, error)
- func CheckTopologyOrgServerCGInDSCG(tx *sql.Tx, cdnIds []int, dsTopology string, topologyCGNames []string) (error, error, int)
- func CommitIf(tx *sql.Tx, doCommit *bool)
- func DSRExistsWithXMLID(xmlid string, tx *sql.Tx) (bool, error)
- func DeleteCoordinate(tx *sql.Tx, cacheGroupID int, coordinateID int) error
- func DequeueUpdateForServer(tx *sql.Tx, serverID int64) error
- func DequeueUpdateForServerWithCachegroupCDN(tx *sql.Tx, cgID int, cdnID int64) ([]tc.CacheName, error)
- func DequeueUpdateForServerWithTopologyCDN(tx *sql.Tx, topologyName tc.TopologyName, cdnId int64) error
- func DivisionExists(tx *sql.Tx, id string) (bool, error)
- func GetCDNDSes(tx *sql.Tx, cdn tc.CDNName) (map[string]struct{}, error)
- func GetCDNDomainFromName(tx *sql.Tx, cdnName tc.CDNName) (string, bool, error)
- func GetCDNIDFromFedID(id int, tx *sql.Tx) (int, bool, error)
- func GetCDNIDFromName(tx *sql.Tx, name tc.CDNName) (int, bool, error)
- func GetCDNIDsFromFedResolverID(id int, tx *sql.Tx) ([]int, bool, error)
- func GetCDNNameDomain(cdnID int, tx *sql.Tx) (string, string, error)
- func GetCDNNameFromDSXMLID(tx *sql.Tx, dsXMLID string) (string, error)
- func GetCDNNameFromID(tx *sql.Tx, id int64) (tc.CDNName, bool, error)
- func GetCDNNameFromProfileID(tx *sql.Tx, id int) (tc.CDNName, error)
- func GetCDNNameFromProfileName(tx *sql.Tx, profileName string) (tc.CDNName, error)
- func GetCDNNameFromServerID(tx *sql.Tx, serverId int64) (tc.CDNName, error)
- func GetCDNNamesFromDSIds(tx *sql.Tx, dsIds []int) ([]string, error)
- func GetCDNNamesFromProfileIDs(tx *sql.Tx, profileIDs []int64) ([]string, error)
- func GetCDNNamesFromServerIds(tx *sql.Tx, serverIds []int64) ([]string, error)
- func GetCDNs(tx *sql.Tx) (map[tc.CDNName]struct{}, error)
- func GetCacheGroupNameFromID(tx *sql.Tx, id int) (tc.CacheGroupName, bool, error)
- func GetCapabilitiesFromRoleID(tx *sql.Tx, roleID int) ([]string, error)
- func GetCapabilitiesFromRoleName(tx *sql.Tx, role string) ([]string, error)
- func GetCommonServerPropertiesFromV4(s tc.ServerV40, tx *sql.Tx) (tc.CommonServerProperties, error)
- func GetCoordinateID(tx *sql.Tx, id int) (*int, error)
- func GetDSCDNIdFromID(tx *sql.Tx, dsID int) (int, bool, error)
- func GetDSIDAndCDNFromName(tx *sql.Tx, xmlID string) (int, tc.CDNName, bool, error)
- func GetDSIDFromStaticDNSEntry(tx *sql.Tx, staticDNSEntryID int) (int, error)
- func GetDSIDFromXMLID(tx *sql.Tx, xmlID string) (int, bool, error)
- func GetDSNameAndCDNFromID(tx *sql.Tx, id int) (tc.DeliveryServiceName, tc.CDNName, bool, error)
- func GetDSNameFromID(tx *sql.Tx, id int) (tc.DeliveryServiceName, bool, error)
- func GetDSRequiredCapabilitiesFromID(id int, tx *sql.Tx) ([]string, error)
- func GetDSTenantIDFromXMLID(tx *sql.Tx, xmlid string) (int, bool, error)
- func GetDeliveryServiceCDNsByTopology(tx *sql.Tx, topology string) ([]int, error)
- func GetDeliveryServiceTypeAndCDNName(dsID int, tx *sql.Tx) (tc.DSType, string, bool, error)
- func GetDeliveryServiceTypeRequiredCapabilitiesAndTopology(dsID int, tx *sql.Tx) (tc.DSType, []string, *string, bool, error)
- func GetDeliveryServicesWithTopologies(tx *sql.Tx, dsIDs []int) ([]int, error)
- func GetFederationIDForUserIDByXMLID(tx *sql.Tx, userID int, xmlid string) (uint, bool, error)
- func GetFederationNameFromID(id int, tx *sql.Tx) (string, bool, error)
- func GetFederationResolversByFederationID(tx *sql.Tx, fedID int) ([]tc.FederationResolver, error)
- func GetGlobalParam(tx *sql.Tx, name string) (string, bool, error)
- func GetParam(tx *sql.Tx, name string, configFile string) (string, bool, error)
- func GetParamNameByID(tx *sql.Tx, id int) (string, bool, error)
- func GetPrivLevelFromRole(tx *sql.Tx, role string) (int, bool, error)
- func GetPrivLevelFromRoleID(tx *sql.Tx, id int) (int, bool, error)
- func GetProfileIDDesc(tx *sql.Tx, name string) (id int, desc string)
- func GetProfileIDFromName(name string, tx *sql.Tx) (int, bool, error)
- func GetProfileNameFromID(id int, tx *sql.Tx) (string, bool, error)
- func GetRegionNameFromID(tx *sql.Tx, regionID int) (string, bool, error)
- func GetRequiredCapabilitiesOfDeliveryServices(ids []int, tx *sql.Tx) (map[int][]string, error)
- func GetRoleIDFromName(tx *sql.Tx, roleName string) (int, bool, error)
- func GetSCInfo(tx *sql.Tx, name string) (bool, error)
- func GetServerCapabilitiesFromName(name string, tx *sql.Tx) ([]string, error)
- func GetServerCapabilitiesOfServers(names []string, tx *sql.Tx) (map[string][]string, error)
- func GetServerDSNamesByCDN(tx *sql.Tx, cdn string) (map[tc.CacheName][]string, error)
- func GetServerDetailFromV4(sd tc.ServerDetailV40, tx *sql.Tx) (tc.ServerDetail, error)
- func GetServerIDFromName(serverName string, tx *sql.Tx) (int, bool, error)
- func GetServerIDsFromCachegroupNames(tx *sql.Tx, cgID []string) ([]int64, error)
- func GetServerInfo(serverID int, tx *sql.Tx) (tc.ServerInfo, bool, error)
- func GetServerInfosFromHostNames(tx *sql.Tx, hostNames []string) ([]tc.ServerInfo, error)
- func GetServerInfosFromIDs(tx *sql.Tx, ids []int) ([]tc.ServerInfo, error)
- func GetServerNameFromID(tx *sql.Tx, id int64) (string, bool, error)
- func GetServersInterfaces(ids []int, tx *sql.Tx) (map[int]map[string]tc.ServerInterfaceInfoV40, error)
- func GetStatusByID(id int, tx *sql.Tx) (tc.StatusNullable, bool, error)
- func GetStatusByName(name string, tx *sql.Tx) (tc.StatusNullable, bool, error)
- func GetTopologyCachegroups(tx *sql.Tx, name string) ([]int, []string, error)
- func GetTypeIDByName(t string, tx *sql.Tx) (int, bool, error)
- func GetUserByEmail(email string, tx *sql.Tx) (tc.User, bool, error)
- func GetUserByID(id int, tx *sql.Tx) (tc.User, bool, error)
- func ParameterExists(tx *sql.Tx, id string) (bool, error)
- func PhysLocationExists(tx *sql.Tx, id string) (bool, error)
- func ProfileExists(tx *sql.Tx, id string) (bool, error)
- func ProfileParameterExists(tx *sql.Tx, profileID string, parameterID string) (bool, error)
- func QueueRevalForServer(tx *sql.Tx, serverID int64) error
- func QueueUpdateForServer(tx *sql.Tx, serverID int64) error
- func QueueUpdateForServerWithCachegroupCDN(tx *sql.Tx, cgID int, cdnID int64) ([]tc.CacheName, error)
- func QueueUpdateForServerWithTopologyCDN(tx *sql.Tx, topologyName tc.TopologyName, cdnId int64) error
- func RoleExists(tx *sql.Tx, roleID int) (bool, error)
- func ScanCachegroupsServerCapabilities(rows *sql.Rows) (map[string][]int, map[int]map[string]struct{}, map[int]int, error)
- func ServiceCategoryExists(tx *sql.Tx, name string) (bool, error)
- func SetApplyRevalForServer(tx *sql.Tx, serverID int64) error
- func SetApplyRevalForServerWithTime(tx *sql.Tx, serverID int64, applyRevalTime time.Time) error
- func SetApplyUpdateForServer(tx *sql.Tx, serverID int64) error
- func SetApplyUpdateForServerWithTime(tx *sql.Tx, serverID int64, applyUpdateTime time.Time) error
- func SetRevalFailedForServer(tx *sql.Tx, serverID int64, failed bool) error
- func SetUpdateFailedForServer(tx *sql.Tx, serverID int64, failed bool) error
- func TopologyExists(tx *sql.Tx, name string) (bool, error)
- func UpdateServerProfileTableForV3(id *int, newProfileId *int, origProfile string, tx *sql.Tx) error
- func UpdateServerProfilesForV4(id int, profile []string, tx *sql.Tx) error
- func UsernameExists(uname string, tx *sql.Tx) (bool, error)
- type WhereColumnInfo
Constants ¶
const BaseLimit = "\nLIMIT"
const BaseOffset = "\nOFFSET"
const BaseOrderBy = "\nORDER BY"
const BaseWhere = "\nWHERE"
Variables ¶
This section is empty.
Functions ¶
func AddTenancyCheck ¶
func AddTenancyCheck(where string, queryValues map[string]interface{}, tenantColumnName string, tenantIDs []int) (string, map[string]interface{})
AddTenancyCheck takes a WHERE clause (can be ""), the associated queryValues (can be empty), a tenantColumnName that should provide a bigint corresponding to the tenantID of the object being checked (this may require a CAST), and an array of the tenantIDs the user has access to; it returns a where clause and associated queryValues including filtering based on tenancy.
func AppendWhere ¶
AppendWhere appends 'extra' safely to the WHERE clause 'where'. What is returned is guaranteed to be a valid WHERE clause (including a blank string), provided the supplied 'where' and 'extra' clauses are valid.
func CacheGroupExists ¶
CacheGroupExists confirms whether the cache group exists, and an error (if one occurs).
func CachegroupHasTopologyBasedDeliveryServicesOnCDN ¶
func CachegroupHasTopologyBasedDeliveryServicesOnCDN(tx *sql.Tx, cachegroupID int, CDNID int) (bool, error)
CheckCachegroupHasTopologyBasedDeliveryServicesOnCDN returns true if the given cachegroup is assigned to any topologies with delivery services assigned on the given CDN.
func CachegroupParameterAssociationExists ¶
CachegroupParameterAssociationExists returns whether a cachegroup parameter association with the given parameter id exists, and any error.
func CheckIfCurrentUserCanModifyCDN ¶
CheckIfCurrentUserCanModifyCDN checks if the current user has the lock on the cdn that the requested operation is to be performed on. This will succeed if the either there is no lock by any user on the CDN, or if the current user has the lock on the CDN.
func CheckIfCurrentUserCanModifyCDNWithID ¶
CheckIfCurrentUserCanModifyCDNWithID checks if the current user has the lock on the cdn (identified by ID) that the requested operation is to be performed on. This will succeed if the either there is no lock by any user on the CDN, or if the current user has the lock on the CDN.
func CheckIfCurrentUserCanModifyCDNs ¶
CheckIfCurrentUserCanModifyCDNs checks if the current user has the lock on the list of cdns that the requested operation is to be performed on. This will succeed if the either there is no lock by any user on any of the CDNs, or if the current user has the lock on any of the CDNs.
func CheckIfCurrentUserCanModifyCDNsByID ¶
CheckIfCurrentUserCanModifyCDNs checks if the current user has the lock on the list of cdns(identified by ID) that the requested operation is to be performed on. This will succeed if the either there is no lock by any user on any of the CDNs, or if the current user has the lock on any of the CDNs.
func CheckIfCurrentUserCanModifyCachegroup ¶
func CheckIfCurrentUserCanModifyCachegroup(tx *sql.Tx, cachegroupID int, user string) (error, error, int)
CheckIfCurrentUserCanModifyCachegroup checks if the current user has the lock on the cdns that are associated with the provided cachegroup ID. This will succeed if no other user has a hard lock on any of the CDNs that relate to the cachegroup in question.
func CheckIfCurrentUserCanModifyCachegroups ¶
func CheckIfCurrentUserCanModifyCachegroups(tx *sql.Tx, cachegroupIDs []int, user string) (error, error, int)
CheckIfCurrentUserCanModifyCachegroups checks if the current user has the lock on the cdns that are associated with the provided cachegroup IDs. This will succeed if no other user has a hard lock on any of the CDNs that relate to the cachegroups in question.
func CheckIfCurrentUserHasCdnLock ¶
CheckIfCurrentUserHasCdnLock checks if the current user has the lock on the cdn that the requested operation is to be performed on. This will succeed if the either there is no lock by any user on the CDN, or if the current user has the lock on the CDN.
func CheckOriginServerInDSCG ¶
CheckOriginServerInDSCG checks if a DS has ORG server and if it does, to make sure the cachegroup is part of DS
func CheckTopology ¶
CheckTopology returns an error if the given Topology does not exist or if one of the Topology's Cache Groups is empty with respect to the Delivery Service's CDN. Note that this can panic if ds does not have a properly set CDNID.
func CheckTopologyOrgServerCGInDSCG ¶
func CheckTopologyOrgServerCGInDSCG(tx *sql.Tx, cdnIds []int, dsTopology string, topologyCGNames []string) (error, error, int)
CheckTopologyOrgServerCGInDSCG checks if ORG server are part of DS. IF they are then the user is not allowed to remove the ORG servers from the associated DS's topology
func CommitIf ¶
CommitIf commits if doCommit is true at the time of execution. This is designed as a defer helper.
Example:
tx, err := db.Begin() txCommit := false defer dbhelpers.CommitIf(tx, &txCommit) if err := tx.Exec("select ..."); err != nil { return errors.New("executing: " + err.Error()) } txCommit = true return nil
func DSRExistsWithXMLID ¶
DSRExistsWithXMLID returns whether or not an **open** Delivery Service Request with the given xmlid exists, and any error that occurred.
func DeleteCoordinate ¶
DeleteCoordinate deletes coordinate by id, and an error (if one occurs)
func DequeueUpdateForServer ¶
DequeueUpdateForServer sets the config update time equal to the config apply time, thereby effectively dequeueing any pending updates for the server specified.
func DequeueUpdateForServerWithCachegroupCDN ¶
func DequeueUpdateForServerWithCachegroupCDN(tx *sql.Tx, cgID int, cdnID int64) ([]tc.CacheName, error)
DequeueUpdateForServerWithCachegroupCDN sets the config update time equal to the config apply time, thereby effectively dequeueing any pending updates for the servers specified by the cachegroup (id) and the cdn (id).
func DequeueUpdateForServerWithTopologyCDN ¶
func DequeueUpdateForServerWithTopologyCDN(tx *sql.Tx, topologyName tc.TopologyName, cdnId int64) error
DequeueUpdateForServerWithTopologyCDN sets the config update time equal to the config apply time, thereby effectively dequeueing any pending updates for the servers specified by the topology (name) and the cdn (id).
func DivisionExists ¶
DivisionExists confirms whether the division exists, and an error (if one occurs).
func GetCDNDomainFromName ¶
GetCDNDomainFromName returns the domain, whether the cdn exists, and any error.
func GetCDNIDFromFedID ¶
GetCDNIDFromFedID returns the ID of the CDN for the current federation.
func GetCDNIDFromName ¶
GetCDNIDFromName returns the ID of the CDN if a CDN with the name exists
func GetCDNIDsFromFedResolverID ¶
GetCDNIDFromFedResolverID returns the IDs of the CDNs that the fed resolver is associated with.
func GetCDNNameDomain ¶
GetCDNNameDomain returns the name and domain for a given CDN ID.
func GetCDNNameFromDSXMLID ¶
GetCDNNameFromDSXMLID returns the CDN name of the DS associated with the supplied XML ID
func GetCDNNameFromID ¶
GetCDNNameFromID gets the CDN name from the given CDN ID.
func GetCDNNameFromProfileID ¶
GetCDNNameFromProfileID returns the cdn name for the provided profile ID.
func GetCDNNameFromProfileName ¶
GetCDNNameFromProfileName returns the cdn name for the provided profile name.
func GetCDNNameFromServerID ¶
GetCDNNameFromServerID gets the CDN name for the server with the given ID.
func GetCDNNamesFromDSIds ¶
GetCDNNamesFromDSIds returns a list of cdn names for a list of DS IDs.
func GetCDNNamesFromProfileIDs ¶
GetCDNNamesFromProfileIDs returns a list of cdn names for a list of profile IDs.
func GetCDNNamesFromServerIds ¶
GetCDNNamesFromServerIds returns a list of cdn names for a list of server IDs.
func GetCacheGroupNameFromID ¶
GetCacheGroupNameFromID Get Cache Group name from a given ID
func GetCapabilitiesFromRoleID ¶
GetCapabilitiesFromRoleID returns the capabilities for the supplied role ID.
func GetCapabilitiesFromRoleName ¶
GetCapabilitiesFromRoleName returns the capabilities for the supplied role name.
func GetCommonServerPropertiesFromV4 ¶
GetCommonServerPropertiesFromV4 converts ServerV40 to CommonServerProperties struct.
func GetCoordinateID ¶
GetCoordinateID obtains coordinateID, and an error (if one occurs)
func GetDSCDNIdFromID ¶
GetDSCDNIdFromID loads the DeliveryService's cdn ID from the database, from the delivery service ID. Returns whether the delivery service was found, and any error.
func GetDSIDAndCDNFromName ¶
GetDSIDAndCDNFromName returns the delivery service ID and cdn name given from the delivery service name, whether a result existed, and any error.
func GetDSIDFromStaticDNSEntry ¶
GetDSIDFromStaticDNSEntry returns the delivery service ID associated with the static DNS entry
func GetDSIDFromXMLID ¶
GetDSNameFromID loads the DeliveryService's xml_id from the database, from the ID. Returns whether the delivery service was found, and any error.
func GetDSNameAndCDNFromID ¶
returns returns the delivery service name and cdn, whether it existed, and any error.
func GetDSNameFromID ¶
GetDSNameFromID loads the DeliveryService's xml_id from the database, from the ID. Returns whether the delivery service was found, and any error.
func GetDSRequiredCapabilitiesFromID ¶
GetDSRequiredCapabilitiesFromID returns the server's capabilities.
func GetDSTenantIDFromXMLID ¶
GetDSTenantIDFromXMLID fetches the ID of the Tenant to whom the Delivery Service identified by the the provided XMLID belongs. It returns, in order, the requested ID (if one could be found), a boolean indicating whether or not a Delivery Service with the provided xmlid could be found, and an error for logging in case something unexpected goes wrong.
func GetDeliveryServiceCDNsByTopology ¶
GetDeliveryServiceCDNsByTopology returns a slice of CDN IDs for all delivery services assigned to the given topology.
func GetDeliveryServiceTypeAndCDNName ¶
GetDeliveryServiceTypeAndCDNName returns the type and the CDN name of the deliveryservice.
func GetDeliveryServiceTypeRequiredCapabilitiesAndTopology ¶
func GetDeliveryServiceTypeRequiredCapabilitiesAndTopology(dsID int, tx *sql.Tx) (tc.DSType, []string, *string, bool, error)
GetDeliveryServiceTypeRequiredCapabilitiesAndTopology returns the type of the deliveryservice and the name of its topology.
func GetDeliveryServicesWithTopologies ¶
GetDeliveryServicesWithTopologies returns a list containing the delivery services in the given dsIDs list that have a topology assigned. An error indicates unexpected errors that occurred when querying.
func GetFederationIDForUserIDByXMLID ¶
GetFederationIDForUserIDByXMLID retrieves the ID of the Federation assigned to the user defined by userID on the Delivery Service identified by xmlid. If no such federation exists, the boolean returned will be 'false', while the error indicates unexpected errors that occurred when querying.
func GetFederationNameFromID ¶
GetFederationNameFromID returns the federation's name, whether a federation with ID exists, or any error.
func GetFederationResolversByFederationID ¶
GetFederationResolversByFederationID fetches all of the federation resolvers currently assigned to a federation. In the event of an error, it will return an empty slice and the error.
func GetGlobalParam ¶
GetGlobalParams returns the value of the global param, whether it existed, or any error
func GetParamNameByID ¶
GetParamNameByID returns the name of the param, whether it existed, or any error.
func GetPrivLevelFromRole ¶
GetPrivLevelFromRole returns the priv_level associated with a role, whether it exists, and any error. This method exists on a temporary basis. After priv_level is fully deprecated and capabilities take over, this method will not only no longer be needed, but the corresponding new privilege check should be done via the primary database query for the users endpoint. The users json response will contain a list of capabilities in the future, whereas now the users json response currently does not contain privLevel. See the wiki page on the roles/capabilities as a system: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=68715910
func GetPrivLevelFromRoleID ¶
GetPrivLevelFromRoleID returns the priv_level associated with a role, whether it exists, and any error. This method exists on a temporary basis. After priv_level is fully deprecated and capabilities take over, this method will not only no longer be needed, but the corresponding new privilege check should be done via the primary database query for the users endpoint. The users json response will contain a list of capabilities in the future, whereas now the users json response currently does not contain privLevel. See the wiki page on the roles/capabilities as a system: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=68715910
func GetProfileIDDesc ¶
GetProfileIDDesc gets profile ID and desc for V3 servers
func GetProfileIDFromName ¶
GetProfileIDFromName returns the profile's ID, whether a profile with name exists, or any error.
func GetProfileNameFromID ¶
GetProfileNameFromID returns the profile's name, whether a profile with ID exists, or any error.
func GetRegionNameFromID ¶
GetRegionNameFromID returns the name of the region associated with the supplied ID.
func GetRequiredCapabilitiesOfDeliveryServices ¶
GetRequiredCapabilitiesOfDeliveryServices gets all of the required capabilities of the given delivery service IDs.
func GetRoleIDFromName ¶
GetRoleIDFromName returns the ID of the role associated with the supplied name.
func GetSCInfo ¶
GetSCInfo confirms whether the server capability exists, and an error (if one occurs).
func GetServerCapabilitiesFromName ¶
GetServerCapabilitiesFromName returns the server's capabilities.
func GetServerCapabilitiesOfServers ¶
GetServerCapabilitiesOfServers gets all of the server capabilities of the given server hostnames.
func GetServerDSNamesByCDN ¶
GetServerDSNamesByCDN returns a map of ONLINE/REPORTED/ADMIN_DOWN cache names to slice of strings which are the XML IDs of the active, non-ANYMAP delivery services to which the cache is assigned in the given CDN.
func GetServerDetailFromV4 ¶
GetServerDetailFromV4 function converts server details from V4 to V3
func GetServerIDFromName ¶
GetServerIDFromName gets server id from a given name
func GetServerIDsFromCachegroupNames ¶
GetServerIDsFromCachegroupNames returns a list of servers IDs for a list of cachegroup IDs.
func GetServerInfo ¶
GetServerInfo returns a ServerInfo struct, whether the server exists, and an error (if one occurs).
func GetServerInfosFromHostNames ¶
GetServerInfosFromHostNames returns the ServerInfo structs of the given server host names or an error if any occur.
func GetServerInfosFromIDs ¶
GetServerInfosFromIDs returns the ServerInfo structs of the given server IDs or an error if any occur.
func GetServersInterfaces ¶
func GetServersInterfaces(ids []int, tx *sql.Tx) (map[int]map[string]tc.ServerInterfaceInfoV40, error)
GetServerInterfaces, given the IDs of one or more servers, returns all of their network interfaces mapped by their ids, or an error if one occurs during retrieval.
func GetStatusByID ¶
GetStatusByID returns a Status struct, a bool for whether or not a status of the given ID exists, and an error (if one occurs).
func GetStatusByName ¶
GetStatusByName returns a Status struct, a bool for whether or not a status of the given name exists, and an error (if one occurs).
func GetTopologyCachegroups ¶
GetTopologyCachegroups returns an array of cachegroup IDs and an array of cachegroup names for the given topology, or any error.
func GetTypeIDByName ¶
GetTypeIDByName reports the id of the type and whether or not a type exists with the given name.
func GetUserByEmail ¶
GetUserByEmail retrieves the user with the given email. If no such user exists, the boolean returned will be 'false', while the error indicates unexpected errors that occurred when querying.
func GetUserByID ¶
GetUserByID returns the user with the requested ID if one exists. The second return value is a boolean indicating whether said user actually did exist, and the third contains any error encountered along the way.
func ParameterExists ¶
ParameterExists confirms whether the Parameter exists, and an error (if one occurs).
func PhysLocationExists ¶
PhysLocationExists confirms whether the PhysLocation exists, and an error (if one occurs).
func ProfileExists ¶
ProfileExists confirms whether the profile exists, and an error (if one occurs).
func ProfileParameterExists ¶
ProfileParameterExists confirms whether the ProfileParameter exists, and an error (if one occurs).
func QueueRevalForServer ¶
QueueRevalForServer sets the revalidate update time for the server to now.
func QueueUpdateForServer ¶
QueueUpdateForServer sets the config update time for the server to now.
func QueueUpdateForServerWithCachegroupCDN ¶
func QueueUpdateForServerWithCachegroupCDN(tx *sql.Tx, cgID int, cdnID int64) ([]tc.CacheName, error)
QueueUpdateForServerWithCachegroupCDN sets the config update time for all servers belonging to the specified cachegroup (id) and cdn (id).
func QueueUpdateForServerWithTopologyCDN ¶
func QueueUpdateForServerWithTopologyCDN(tx *sql.Tx, topologyName tc.TopologyName, cdnId int64) error
QueueUpdateForServerWithTopologyCDN sets the config update time for all servers within the specific topology (name) and cdn (id).
func RoleExists ¶
RoleExists returns whether or not the role with the given roleName exists, and any error that occurred.
func ScanCachegroupsServerCapabilities ¶
func ScanCachegroupsServerCapabilities(rows *sql.Rows) (map[string][]int, map[int]map[string]struct{}, map[int]int, error)
ScanCachegroupsServerCapabilities, given rows of (server ID, CDN ID, cachegroup name, server capabilities), returns a map of cachegroup names to server IDs, a map of server IDs to a map of their capabilities, a map of server IDs to CDN IDs, and an error (if one occurs).
func ServiceCategoryExists ¶
ServiceCategoryExists confirms whether the service category exists, and an error (if one occurs).
func SetApplyRevalForServer ¶
SetApplyRevalForServer sets the revalidate apply time for the server to now.
func SetApplyRevalForServerWithTime ¶
SetApplyRevalForServerWithTime sets the revalidate apply time for the server to the provided time.
func SetApplyUpdateForServer ¶
SetApplyUpdateForServer sets the config apply time for the server to now.
func SetApplyUpdateForServerWithTime ¶
SetApplyUpdateForServerWithTime sets the config apply time for the server to the provided time.
func SetRevalFailedForServer ¶
SetRevalFailedForServer sets the reval failed flag for the server.
func SetUpdateFailedForServer ¶
SetUpdateFailedForServer sets the update failed flag for the server.
func TopologyExists ¶
TopologyExists checks if a Topology with the given name exists. Returns whether or not the Topology exists, along with any encountered error.
func UpdateServerProfileTableForV3 ¶
func UpdateServerProfileTableForV3(id *int, newProfileId *int, origProfile string, tx *sql.Tx) error
UpdateServerProfileTableForV3 updates CommonServerPropertiesV40 struct and server_profile table via Update (server) function for API v3.
func UpdateServerProfilesForV4 ¶
UpdateServerProfilesForV4 updates server_profile table via update function for APIv4.
func UsernameExists ¶
UsernameExists reports whether or not the the given username exists as a user in the database to which the passed transaction refers. If anything goes wrong when checking the existence of said user, the error is directly returned to the caller. Note that in that case, no real meaning should be assigned to the returned boolean value.