argo-web-api: Index | Files

package reports

import ""


Package Files

reportsController.go reportsModel.go reportsView.go routing.go

func Create Uses

func Create(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Create function is used to implement the create report request. The request is an http POST request with the report description provided as json structure in the request body

func Delete Uses

func Delete(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Delete function used to implement remove report request

func GetMetricProfile Uses

func GetMetricProfile(input MongoInterface) (string, error)

GetMetricProfile is a function that takes a report struc element and returns the name of the metric profile (if exists)

func HandleSubrouter Uses

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 Uses

func List(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

List function that implements the http GET request that retrieves all available report information

func ListOne Uses

func ListOne(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

ListOne function that implements the http GET request that retrieves the specified report's information

func Options Uses

func Options(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

func ReportNotFound Uses

func ReportNotFound(contentType string) ([]byte, error)

ReportNotFound consructs marshals a response struct when the requested report is not found

func SubmitSuccesful Uses

func SubmitSuccesful(inserted MongoInterface, contentType string, link string) ([]byte, error)

SubmitSuccesful marshals a response struct when a report is successfully inserted in the database

func Update Uses

func Update(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Update function used to implement update report request. This is an http PUT request that gets a specific report'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 report

type Info Uses

type Info struct {
    Name        string `bson:"name,omitempty" json:"name" xml:"name"`
    Description string `bson:"description,omitempty" json:"description" xml:"description"`
    Created     string `bson:"created,omitempty" json:"created,omitempty" xml:"created,omitempty"`
    Updated     string `bson:"updated,omitempty" json:"updated,omitempty" xml:"updated,omitempty"`

Info contains info about a report and is used inside the main MongoInterface struct

type Message Uses

type Message struct {
    XMLName xml.Name `xml:"root"`
    Message string

Message struct for xml message response

type MongoInterface Uses

type MongoInterface struct {
    ID         string      `bson:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
    Tenant     string      `json:"tenant" xml:"tenant"`
    Weight     string      `bson:"weight,omitempty"  json:"weight,omitempty"  xml:"weight,omitempty"`
    Disabled   bool        `bson:"disabled" json:"disabled" xml:"disabled"`
    Info       Info        `bson:"info" json:"info" xml:"info"`
    Thresholds *Thresholds `bson:"thresholds,omitempty" json:"thresholds,omitempty" xml:"thresholds"`
    Topology   Topology    `bson:"topology_schema" json:"topology_schema" xml:"topology_schema"`
    Profiles   []Profile   `bson:"profiles" json:"profiles" xml:"profiles"`
    Tags       []Tag       `bson:"filter_tags" json:"filter_tags" xml:"filter_tags"`

MongoInterface is used as an interface to Marshal and Unmarshal from different formats

func (MongoInterface) DetermineGroupType Uses

func (report MongoInterface) DetermineGroupType(groupType string) string

DetermineGroupType looks into a report struct topology group pointers and determines whether a given groupType is a lesser_group or group or does not exist in the report.

func (MongoInterface) GetEndpointGroupType Uses

func (report MongoInterface) GetEndpointGroupType() string

GetEndpointGroupType retrieves the deepest type nested inside the group hierarchy

func (MongoInterface) GetGroupType Uses

func (report MongoInterface) GetGroupType() string

GetGroupType retrieves the first type nested inside the group hierarchy

func (*MongoInterface) ValidateProfiles Uses

func (report *MongoInterface) ValidateProfiles(db *mgo.Database) []respond.ErrorResponse

ValidateProfiles ensures that the profiles in a report actually exist in the database and corrects possible name inconsistencies

type Profile Uses

type Profile struct {
    XMLName xml.Name `bson:"-"          json:"-"     xml:"profile"`
    ID      string   `bson:"id"         json:"id"    xml:"id,attr"`
    Name    string   `bson:"name"       json:"name"  xml:"name,attr"`
    Type    string   `bson:"type"       json:"type"  xml:"type,attr"`

Profile holds info about the profiles included in a report definition

type RootXML Uses

type RootXML struct {
    XMLName xml.Name `xml:"root" json:"-"`
    Reports interface{}

RootXML struct to represent the root of the xml document

type Tag Uses

type Tag struct {
    XMLName xml.Name `bson:",omitempty" json:"-"     xml:"tag"`
    Name    string   `bson:"name"       json:"name"  xml:"name,attr"`
    Value   string   `bson:"value"      json:"value" xml:"value,attr"`
    Context string   `bson:"context"    json:"context" xml:"context,attr"`

Tag holds info about the tags used in filtering in a report definition

type Thresholds Uses

type Thresholds struct {
    Availabilty float32 `bson:"availability" json:"availability" xml:"availability"`
    Reliability float32 `bson:"reliability" json:"reliability" xml:"reliability"`
    Uptime      float32 `bson:"uptime" json:"uptime" xml:"uptime"`
    Unknown     float32 `bson:"unknown" json:"unknown" xml:"unknown"`
    Downtime    float32 `bson:"downtime" json:"downtime" xml:"downtime"`

Thresholds contains information about the percentage thresholds used to color report scores

type Topology Uses

type Topology struct {
    // Nesting int            `bson:"nesting" json:"nesting" xml:"nesting"`
    Group *TopologyLevel `bson:"group,omitempty" json:"group,omitempty" xml:"group,omitempty"`

Topology contains the topology used in this report and is used inside the main MongoInterface struct

type TopologyLevel Uses

type TopologyLevel struct {
    Type  string         `bson:"type" json:"type" xml:"type"`
    Group *TopologyLevel `bson:"group,omitempty" json:"group,omitempty" xml:"group,omitempty"`

TopologyLevel is used to create the multiple nesting levels for the Topology struct

Package reports imports 15 packages (graph) and is imported by 22 packages. Updated 2019-11-28. Refresh now. Tools for package owners.