func ServerGroupFromRole(label string) ServerGroup {
	switch label {
	case ServerGroupSingleString:
		return ServerGroupSingle
	case ServerGroupAgentsString:
		return ServerGroupAgents
	case ServerGroupDBServersString:
		return ServerGroupDBServers
	case ServerGroupCoordinatorsString:
		return ServerGroupCoordinators
	case ServerGroupSyncMastersString:
		return ServerGroupSyncMasters
	case ServerGroupSyncWorkersString:
		return ServerGroupSyncWorkers
	default:
		return ServerGroupUnknown
	}
}
ServerGroupFromAbbreviatedRole returns ServerGroup from role
package v2alpha1
import (
	"encoding/json"
	"time"
)
type ServerGroup int
func (g *ServerGroup) UnmarshalJSON(bytes []byte) error {
	if bytes == nil {
		*g = ServerGroupUnknown
		return nil
	}
	{
		var s int
		if err := json.Unmarshal(bytes, &s); err == nil {
			*g = ServerGroupFromRole(ServerGroup(s).AsRole())
			return nil
		}
	}
	var s string
	if err := json.Unmarshal(bytes, &s); err != nil {
		return err
	}
	*g = ServerGroupFromRole(s)
	return nil
}
func (g ServerGroup) MarshalJSON() ([]byte, error) {
	return json.Marshal(g.AsRole())
}
const (
	ServerGroupUnknown        ServerGroup = 0
	ServerGroupSingle         ServerGroup = 1
	ServerGroupAgents         ServerGroup = 2
	ServerGroupDBServers      ServerGroup = 3
	ServerGroupCoordinators   ServerGroup = 4
	ServerGroupSyncMasters    ServerGroup = 5
	ServerGroupSyncWorkers    ServerGroup = 6
	ServerGroupImageDiscovery ServerGroup = -1
	ServerGroupSingleString         = "single"
	ServerGroupAgentsString         = "agent"
	ServerGroupDBServersString      = "dbserver"
	ServerGroupCoordinatorsString   = "coordinator"
	ServerGroupSyncMastersString    = "syncmaster"
	ServerGroupSyncWorkersString    = "syncworker"
	ServerGroupImageDiscoveryString = "imagediscovery"
	ServerGroupSingleAbbreviatedString         = "sngl"
	ServerGroupAgentsAbbreviatedString         = "agnt"
	ServerGroupDBServersAbbreviatedString      = "prmr"
	ServerGroupCoordinatorsAbbreviatedString   = "crdn"
	ServerGroupSyncMastersAbbreviatedString    = "syma"
	ServerGroupSyncWorkersAbbreviatedString    = "sywo"
	ServerGroupImageDiscoveryAbbreviatedString = "id"
)
var (
	AllServerGroups = []ServerGroup{
		ServerGroupAgents,
		ServerGroupSingle,
		ServerGroupDBServers,
		ServerGroupCoordinators,
		ServerGroupSyncMasters,
		ServerGroupSyncWorkers,
	}
)
func (g ServerGroup) AsRole() string {
	switch g {
	case ServerGroupSingle:
		return ServerGroupSingleString
	case ServerGroupAgents:
		return ServerGroupAgentsString
	case ServerGroupDBServers:
		return ServerGroupDBServersString
	case ServerGroupCoordinators:
		return ServerGroupCoordinatorsString
	case ServerGroupSyncMasters:
		return ServerGroupSyncMastersString
	case ServerGroupSyncWorkers:
		return ServerGroupSyncWorkersString
	default:
		return "?"
	}
}
func (g ServerGroup) AsRoleAbbreviated() string {
	switch g {
	case ServerGroupSingle:
		return ServerGroupSingleAbbreviatedString
	case ServerGroupAgents:
		return ServerGroupAgentsAbbreviatedString
	case ServerGroupDBServers:
		return ServerGroupDBServersAbbreviatedString
	case ServerGroupCoordinators:
		return ServerGroupCoordinatorsAbbreviatedString
	case ServerGroupSyncMasters:
		return ServerGroupSyncMastersAbbreviatedString
	case ServerGroupSyncWorkers:
		return ServerGroupSyncWorkersAbbreviatedString
	default:
		return "?"
	}
}
func (g ServerGroup) DefaultTerminationGracePeriod() time.Duration {
	switch g {
	case ServerGroupSingle:
		return time.Minute
	case ServerGroupAgents:
		return time.Minute
	case ServerGroupDBServers:
		return time.Hour
	default:
		return time.Second * 30
	}
}
func (g ServerGroup) IsStateless() bool {
	switch g {
	case ServerGroupCoordinators, ServerGroupSyncMasters, ServerGroupSyncWorkers:
		return true
	default:
		return false
	}
}
func (g ServerGroup) IsArangod() bool {
	switch g {
	case ServerGroupSingle, ServerGroupAgents, ServerGroupDBServers, ServerGroupCoordinators:
		return true
	default:
		return false
	}
}
func (g ServerGroup) IsArangosync() bool {
	switch g {
	case ServerGroupSyncMasters, ServerGroupSyncWorkers:
		return true
	default:
		return false
	}
}
func (g ServerGroup) IsExportMetrics() bool {
	switch g {
	case ServerGroupCoordinators, ServerGroupDBServers, ServerGroupSingle:
		return true
	default:
		return false
	}
}
func ServerGroupFromAbbreviatedRole(label string) ServerGroup {
	switch label {
	case ServerGroupSingleAbbreviatedString:
		return ServerGroupSingle
	case ServerGroupAgentsAbbreviatedString:
		return ServerGroupAgents
	case ServerGroupDBServersAbbreviatedString:
		return ServerGroupDBServers
	case ServerGroupCoordinatorsAbbreviatedString:
		return ServerGroupCoordinators
	case ServerGroupSyncMastersAbbreviatedString:
		return ServerGroupSyncMasters
	case ServerGroupSyncWorkersAbbreviatedString:
		return ServerGroupSyncWorkers
	default:
		return ServerGroupUnknown
	}
}