server

package
v0.0.0-...-064bbc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateErrorLogEntry

func CreateErrorLogEntry(context *ctp.ApiContext, trigger *Trigger, errmsg string) *ctp.HttpError

func CreateNormalLogEntry

func CreateNormalLogEntry(context *ctp.ApiContext, trigger *Trigger, result *Result, tags []string) *ctp.HttpError

func HandleDELETEAccount

func HandleDELETEAccount(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleDELETEAsset

func HandleDELETEAsset(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleDELETEAttribute

func HandleDELETEAttribute(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleDELETEMeasurement

func HandleDELETEMeasurement(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleDELETEMetric

func HandleDELETEMetric(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleDELETEServiceView

func HandleDELETEServiceView(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleDELETETrigger

func HandleDELETETrigger(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETAccount

func HandleGETAccount(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETAsset

func HandleGETAsset(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETAttribute

func HandleGETAttribute(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETBaseURI

func HandleGETBaseURI(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

HandleGETBaseURI handles a request to the baseURI. It proceeds differently from other resources, which user the 'handler' paradigm.

func HandleGETCollection

func HandleGETCollection(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETLogEntry

func HandleGETLogEntry(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETMeasurement

func HandleGETMeasurement(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETMetric

func HandleGETMetric(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETServiceView

func HandleGETServiceView(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETTags

func HandleGETTags(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandleGETTrigger

func HandleGETTrigger(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTAccount

func HandlePOSTAccount(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTAsset

func HandlePOSTAsset(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTAttribute

func HandlePOSTAttribute(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTMeasurement

func HandlePOSTMeasurement(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTMetric

func HandlePOSTMetric(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTServiceView

func HandlePOSTServiceView(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePOSTTrigger

func HandlePOSTTrigger(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePUTMeasurement

func HandlePUTMeasurement(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func HandlePUTTags

func HandlePUTTags(w http.ResponseWriter, r *http.Request, context *ctp.ApiContext)

func IterateChildrenDelete

func IterateChildrenDelete(context *ctp.ApiContext, category string, selectorkey string, selectorvalue ctp.Base64Id, fn deletecb) bool

Types

type Account

type Account ctp.Account
func (account *Account) BuildLinks(context *ctp.ApiContext)

func (*Account) Create

func (account *Account) Create(context *ctp.ApiContext) *ctp.HttpError

func (*Account) Delete

func (account *Account) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*Account) Load

func (account *Account) Load(context *ctp.ApiContext) *ctp.HttpError

type Asset

type Asset struct {
	ctp.NamedResource `bson:",inline"`
	Attributes        ctp.Link `json:"attributes" bson:"-"`
	AssetClass        *string  `json:"assetClass" bson:"assetClass"`
}
func (asset *Asset) BuildLinks(context *ctp.ApiContext)

func (*Asset) Create

func (asset *Asset) Create(context *ctp.ApiContext) *ctp.HttpError

func (*Asset) Delete

func (asset *Asset) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*Asset) Load

func (asset *Asset) Load(context *ctp.ApiContext) *ctp.HttpError

type Attribute

type Attribute struct {
	ctp.NamedResource `bson:",inline"`
	Measurements      ctp.Link `json:"measurements" bson:"-"`
}
func (attribute *Attribute) BuildLinks(context *ctp.ApiContext)

func (*Attribute) Create

func (attribute *Attribute) Create(context *ctp.ApiContext) *ctp.HttpError

func (*Attribute) Delete

func (attribute *Attribute) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*Attribute) Load

func (attribute *Attribute) Load(context *ctp.ApiContext) *ctp.HttpError

type BaseURI

type BaseURI struct {
	ctp.NamedResource `bson:",inline"`
	Version           string   `json:"version"`
	Provider          string   `json:"provider"`
	ServiceViews      ctp.Link `json:"serviceViews"`
	Metrics           ctp.Link `json:"metrics"`
}
func (base *BaseURI) BuildLinks(context *ctp.ApiContext)

type Collection

type Collection struct {
	ctp.Resource     `bson:",inline"`
	CollectionLength int              `json:"collectionLength"`
	ReturnedLength   int              `json:"returnedLength"`
	CollectionType   string           `json:"collectionType"`
	Items            []CollectionItem `json:"collection"`
}

type CollectionItem

type CollectionItem struct {
	Link ctp.Link `json:"link"`
	Name string   `json:"name,omitempty"`
}

type CtpApiHandlerMux

type CtpApiHandlerMux struct {
	Configuration ctp.Configuration
}

func NewCtpApiHandlerMux

func NewCtpApiHandlerMux(conf ctp.Configuration) *CtpApiHandlerMux

func (*CtpApiHandlerMux) ServeHTTP

func (mux *CtpApiHandlerMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

type LogEntry

type LogEntry struct {
	ctp.Resource `bson:",inline"`
	Trigger      ctp.Link      `json:"trigger" bson:"trigger"`
	CreationTime ctp.Timestamp `json:"creationTime" bson:"creationTime"`
	Result       *Result       `json:"result,omitempty" bson:"result,omitempty"`
	Error        *string       `json:"error,omitempty" bson:"error,omitempty"`
	Tags         []string      `json:"tags" bson:"tags"`
}
func (log *LogEntry) BuildLinks(context *ctp.ApiContext)

func (*LogEntry) Create

func (log *LogEntry) Create(context *ctp.ApiContext) *ctp.HttpError

func (*LogEntry) Load

func (log *LogEntry) Load(context *ctp.ApiContext) *ctp.HttpError

type Measurement

type Measurement struct {
	ctp.NamedResource `bson:",inline"`
	Metric            ctp.Link             `json:"metric"          bson:"metric"`
	Result            *Result              `json:"result"          bson:"result"`
	Objective         *Objective           `json:"objective"       bson:"objective"`
	CreateTrigger     *ctp.Link            `json:"createTrigger"   bson:"createTrigger,omitempty"`
	UserActivated     bool                 `json:"userActivated"   bson:"userActivated"`
	State             ctp.MeasurementState `json:"state"           bson:"state"`
}
func (measurement *Measurement) BuildLinks(context *ctp.ApiContext)

func (*Measurement) Create

func (measurement *Measurement) Create(context *ctp.ApiContext) *ctp.HttpError

func (*Measurement) Delete

func (measurement *Measurement) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*Measurement) Load

func (measurement *Measurement) Load(context *ctp.ApiContext) *ctp.HttpError

func (*Measurement) Update

func (measurement *Measurement) Update(context *ctp.ApiContext, update ctp.ResourceUpdater) *ctp.HttpError

type MeasurementParameter

type MeasurementParameter struct {
	Name  string `json:"name"  bson:"name"`
	Type  string `json:"type"  bson:"type"`
	Value string `json:"value" bson:"value"`
}

type Metric

type Metric struct {
	ctp.NamedResource     `bson:",inline"`
	BaseMetric            string                 `json:"baseMetric"            bson:"baseMetric"`
	MeasurementParameters []MeasurementParameter `json:"measurementParameters" bson:"measurementParameters"`
	ResultFormat          []ResultColumnFormat   `json:"resultFormat"          bson:"resultFormat"`
}
func (metric *Metric) BuildLinks(context *ctp.ApiContext)

func (*Metric) Create

func (metric *Metric) Create(context *ctp.ApiContext) *ctp.HttpError

func (*Metric) Delete

func (metric *Metric) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*Metric) Load

func (metric *Metric) Load(context *ctp.ApiContext) *ctp.HttpError

type Objective

type Objective struct {
	Condition string      `json:"condition" bson:"condition"`
	Status    ctp.BoolErr `json:"status"    bson:"status"`
}

type Result

type Result struct {
	Value       []ResultRow   `json:"value" bson:"value"`
	UpdateTime  ctp.Timestamp `json:"updateTime" bson:"updateTime"`
	AuthorityId *string       `json:"authorityId" bson:"authorityId"`
	Signature   *string       `json:"signature" bson:"signature"`
}

type ResultColumnFormat

type ResultColumnFormat struct {
	Name string `json:"name" bson:"name"`
	Type string `json:"type" bson:"type"`
}

type ResultRow

type ResultRow map[string]interface{}

type ServiceView

type ServiceView struct {
	ctp.NamedResource `bson:",inline"`
	Provider          string   `json:"provider"         bson:"provider"`
	Dependencies      ctp.Link `json:"dependencies"     bson:"-"`
	Assets            ctp.Link `json:"assets"           bson:"-"`
	ServiceClass      *string  `json:"serviceClass"     bosn:"serviceClass"`
	Logs              ctp.Link `json:"logs"`
	Triggers          ctp.Link `json:"triggers"`
}
func (serviceview *ServiceView) BuildLinks(context *ctp.ApiContext)

func (*ServiceView) Create

func (serviceview *ServiceView) Create(context *ctp.ApiContext) *ctp.HttpError

func (*ServiceView) Delete

func (serviceview *ServiceView) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*ServiceView) Load

func (serviceview *ServiceView) Load(context *ctp.ApiContext) *ctp.HttpError

type TaggedResource

type TaggedResource ctp.Resource
func (res *TaggedResource) BuildLinks(context *ctp.ApiContext)

func (*TaggedResource) Load

func (res *TaggedResource) Load(context *ctp.ApiContext) *ctp.HttpError

func (*TaggedResource) Super

func (res *TaggedResource) Super() *ctp.Resource

func (*TaggedResource) Update

func (res *TaggedResource) Update(context *ctp.ApiContext, update ctp.ResourceUpdater) *ctp.HttpError

type Trigger

type Trigger struct {
	ctp.NamedResource `bson:",inline"`
	Measurement       ctp.Link      `json:"measurement" bson:"measurement"`
	Condition         string        `json:"condition" bson:"condition"`
	Notification      string        `json:"notification" bson:"notification"`
	GuardTime         uint          `json:"guardTime" bson:"guardTime"`
	Tags              []string      `json:"tags" bson:"tags"`
	Status            ctp.BoolErr   `json:"status" bson:"status"`
	StatusUpdateTime  ctp.Timestamp `json:"statusUpdateTime" bson:"statusUpdateTime"`
}
func (trigger *Trigger) BuildLinks(context *ctp.ApiContext)

func (*Trigger) Create

func (trigger *Trigger) Create(context *ctp.ApiContext) *ctp.HttpError

func (*Trigger) Delete

func (trigger *Trigger) Delete(context *ctp.ApiContext) *ctp.HttpError

func (*Trigger) Load

func (trigger *Trigger) Load(context *ctp.ApiContext) *ctp.HttpError

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL