Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFireMike committed Nov 17, 2020
1 parent a1bf971 commit 85041ac
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 14 deletions.
6 changes: 3 additions & 3 deletions api/request_handler.go
Expand Up @@ -77,7 +77,7 @@ func StartAPI() {

// swagger:operation POST /check/identify check checkIdentify
// ---
// summary: Check mode for identify.
// summary: Checks if identify matches the expectations.
// consumes:
// - application/json
// - application/xml
Expand All @@ -104,7 +104,7 @@ func StartAPI() {

// swagger:operation POST /check/snmp check checkSNMP
// ---
// summary: Check mode for SNMP.
// summary: Checks SNMP availability.
// consumes:
// - application/json
// - application/xml
Expand Down Expand Up @@ -266,7 +266,7 @@ func StartAPI() {

// swagger:operation POST /read/count-interfaces read readCountInterfaces
// ---
// summary: Counts interface of a device.
// summary: Counts the interfaces of a device.
// consumes:
// - application/json
// - application/xml
Expand Down
6 changes: 5 additions & 1 deletion core/request/base_request.go
Expand Up @@ -285,7 +285,11 @@ func (r *BaseRequest) setupHTTPConnection() (*network.RequestDeviceConnectionHTT
return con, nil
}

// Base Response defines attributes every response has.
// BaseResponse
//
// BaseResponse defines attributes every response has.
//
// swagger:model
type BaseResponse struct {
}

Expand Down
4 changes: 4 additions & 0 deletions core/value/value.go
Expand Up @@ -7,7 +7,11 @@ import (
"strconv"
)

// Value
//
// Value represents a value that was read out from a device.
//
// swagger:model
type Value string

// New creates a new value
Expand Down
139 changes: 132 additions & 7 deletions doc/api_doc.json
Expand Up @@ -36,7 +36,7 @@
"tags": [
"check"
],
"summary": "Check mode for identify.",
"summary": "Checks if identify matches the expectations.",
"operationId": "checkIdentify",
"parameters": [
{
Expand Down Expand Up @@ -162,7 +162,7 @@
"tags": [
"check"
],
"summary": "Check mode for SNMP.",
"summary": "Checks SNMP availability.",
"operationId": "checkSNMP",
"parameters": [
{
Expand Down Expand Up @@ -372,7 +372,7 @@
"tags": [
"read"
],
"summary": "Counts interface of a device.",
"summary": "Counts the interfaces of a device.",
"operationId": "readCountInterfaces",
"parameters": [
{
Expand Down Expand Up @@ -504,8 +504,9 @@
"x-go-package": "github.com/inexio/thola/core/request"
},
"BaseResponse": {
"description": "BaseResponse defines attributes every response has.",
"type": "object",
"title": "Base Response defines attributes every response has.",
"title": "BaseResponse",
"x-go-package": "github.com/inexio/thola/core/request"
},
"CheckDeviceRequest": {
Expand Down Expand Up @@ -818,6 +819,23 @@
},
"x-go-package": "github.com/inexio/thola/core/network"
},
"DWDMInterface": {
"description": "DWDMInterface represents a DWDM interface",
"type": "object",
"properties": {
"rx_level": {
"type": "number",
"format": "double",
"x-go-name": "RXLevel"
},
"tx_level": {
"type": "number",
"format": "double",
"x-go-name": "TXLevel"
}
},
"x-go-package": "github.com/inexio/thola/core/device"
},
"Device": {
"description": "Device represents a device and has the same structure as Response.\nResponse can possibly be removed and replaced by Device.",
"type": "object",
Expand Down Expand Up @@ -852,6 +870,83 @@
},
"x-go-package": "github.com/inexio/thola/core/request"
},
"EthernetLikeInterface": {
"description": "EthernetLikeInterface represents an ethernet like interface",
"type": "object",
"properties": {
"dot3HCStatsFCSErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3HCStatsFCSErrors"
},
"dot3StatsAlignmentErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsAlignmentErrors"
},
"dot3StatsCarrierSenseErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsCarrierSenseErrors"
},
"dot3StatsDeferredTransmissions": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsDeferredTransmissions"
},
"dot3StatsExcessiveCollisions": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsExcessiveCollisions"
},
"dot3StatsFCSErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsFCSErrors"
},
"dot3StatsFrameTooLongs": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsFrameTooLongs"
},
"dot3StatsInternalMacReceiveErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsInternalMacReceiveErrors"
},
"dot3StatsInternalMacTransmitErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsInternalMacTransmitErrors"
},
"dot3StatsLateCollisions": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsLateCollisions"
},
"dot3StatsMultipleCollisionFrames": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsMultipleCollisionFrames"
},
"dot3StatsSQETestErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsSQETestErrors"
},
"dot3StatsSingleCollisionFrames": {
"type": "integer",
"format": "uint64",
"x-go-name": "Dot3StatsSingleCollisionFrames"
},
"etherStatsCRCAlignErrors": {
"type": "integer",
"format": "uint64",
"x-go-name": "EtherStatsCRCAlignErrors"
}
},
"x-go-package": "github.com/inexio/thola/core/device"
},
"HTTPConnectionData": {
"description": "HTTPConnectionData includes all http connection data for a device",
"type": "object",
Expand Down Expand Up @@ -1222,7 +1317,8 @@
},
"OutputMessage": {
"type": "object",
"title": "OutputMessage represents a message of the response.",
"description": "OutputMessage represents a message of the response. It contains a message and a status code.",
"title": "OutputMessage",
"properties": {
"message": {
"type": "string",
Expand Down Expand Up @@ -1313,6 +1409,33 @@
},
"x-go-package": "github.com/inexio/thola/core/device"
},
"RadioInterface": {
"description": "RadioInterface represents a radio interface",
"type": "object",
"properties": {
"level_in": {
"type": "integer",
"format": "int64",
"x-go-name": "LevelIn"
},
"level_out": {
"type": "integer",
"format": "int64",
"x-go-name": "LevelOut"
},
"maxbitrate_in": {
"type": "integer",
"format": "uint64",
"x-go-name": "MaxbitrateIn"
},
"maxbitrate_out": {
"type": "integer",
"format": "uint64",
"x-go-name": "MaxbitrateOut"
}
},
"x-go-package": "github.com/inexio/thola/core/device"
},
"ReadAvailableComponentsRequest": {
"description": "ReadAvailableComponentsRequest is a the request struct for the read available-components request.",
"type": "object",
Expand Down Expand Up @@ -1460,7 +1583,8 @@
},
"ResponseInfo": {
"type": "object",
"title": "ResponseInfo has all available information for a response.",
"description": "ResponseInfo has all available information for a response. It also contains the RawOutput.",
"title": "ResponseInfo",
"properties": {
"messages": {
"type": "array",
Expand Down Expand Up @@ -1612,8 +1736,9 @@
"x-go-package": "github.com/inexio/thola/core/device"
},
"Value": {
"description": "Value represents a value that was read out from a device.",
"type": "string",
"title": "Value represents a value that was read out from a device.",
"title": "Value",
"x-go-package": "github.com/inexio/thola/core/value"
}
},
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -9,7 +9,7 @@ require (
github.com/go-sql-driver/mysql v1.5.0
github.com/google/go-cmp v0.3.0
github.com/huandu/go-sqlbuilder v1.8.0
github.com/inexio/go-monitoringplugin v0.0.0-20201106104905-c348723557ba
github.com/inexio/go-monitoringplugin v0.0.0-20201117085742-ec06ef4904fe
github.com/jmoiron/sqlx v1.2.0
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -127,8 +127,8 @@ github.com/huandu/go-sqlbuilder v1.8.0 h1:1KP21dzROt03II0aoX/rD2Y6TX1VCIixSX5mvk
github.com/huandu/go-sqlbuilder v1.8.0/go.mod h1:cM38aLPrMXaGxsUkHFh1e2skthPnQRPK7h8//X5LQMc=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inexio/go-monitoringplugin v0.0.0-20201106104905-c348723557ba h1:FJo6aIyoUUrjdHj2zzjQk+DZToZY0IeV6z7R5HHvs4Y=
github.com/inexio/go-monitoringplugin v0.0.0-20201106104905-c348723557ba/go.mod h1:kzHRJGZ2iE/0IElB4NYI38h3h0HM5wqTTH7KyUCjkM8=
github.com/inexio/go-monitoringplugin v0.0.0-20201117085742-ec06ef4904fe h1:08N/oNUAKUjMFb406F4mcJUZwZsWy9NyKrpauWgGfyU=
github.com/inexio/go-monitoringplugin v0.0.0-20201117085742-ec06ef4904fe/go.mod h1:kzHRJGZ2iE/0IElB4NYI38h3h0HM5wqTTH7KyUCjkM8=
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
Expand Down

0 comments on commit 85041ac

Please sign in to comment.