Documentation
¶
Index ¶
- func DataAvailabilityEndpoint(router *httprouter.Router, _ configuration.Config, wrapper *timescale.Wrapper, ...)
- func DocEndpoint(router *httprouter.Router, config configuration.Config, _ *timescale.Wrapper, ...)
- func DownloadEndpoints(router *httprouter.Router, config configuration.Config, ...)
- func GetDownload()
- func GetPrepareDownload()
- func LastMessageEndpoint(router *httprouter.Router, config configuration.Config, ...)
- func LastValuesEndpoint(router *httprouter.Router, config configuration.Config, ...)
- func PrepareDownloadEndpoints(router *httprouter.Router, config configuration.Config, _ *timescale.Wrapper, ...)
- func QueriesEndpoint(router *httprouter.Router, config configuration.Config, ...)
- func QueriesV2Endpoint(router *httprouter.Router, config configuration.Config, ...)
- func RawValueEndpoint(router *httprouter.Router, config configuration.Config, ...)
- func Router(config configuration.Config, wrapper *timescale.Wrapper, ...) http.Handler
- func Start(ctx context.Context, wg *sync.WaitGroup, config configuration.Config, ...) (err error)
- func UnauthenticatedRouter(config configuration.Config, wrapper *timescale.Wrapper, ...) http.Handler
- func UsageDevices()
- func UsageEndpoint(router *httprouter.Router, _ configuration.Config, wrapper *timescale.Wrapper, ...)
- func UsageExports()
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataAvailabilityEndpoint ¶
func DataAvailabilityEndpoint(router *httprouter.Router, _ configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, _ *cache.RemoteCache, _ *converter.Converter, _ deviceSelection.Client)
Query godoc @Summary query data availabilty @Description query data availabilty of a device @Accept json @Produce json @Security Bearer @Param device_id query string true "ID of requested device" @Success 200 {array} model.DataAvailabilityResponseElement @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /data-availability [GET]
func DocEndpoint ¶
func DocEndpoint(router *httprouter.Router, config configuration.Config, _ *timescale.Wrapper, _ *verification.Verifier, _ *cache.RemoteCache, _ *converter.Converter, _ deviceSelection.Client)
func DownloadEndpoints ¶
func DownloadEndpoints(router *httprouter.Router, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, remoteCache *cache.RemoteCache, converter *converter.Converter, _ deviceSelection.Client)
Query godoc @Summary download @Description downloads CSV file with previously prepared secret @Produce plain @Param secret path string true "secret" @Success 200 {file} CSV file @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /download/{secret} [GET]
func GetDownload ¶ added in v0.0.45
func GetDownload()
Query godoc @Summary download @Description download CSV @Accept json @Produce plain @Security Bearer @Param query query string true "JSON encoded QueriesRequestElement" @Param time_format query string false "Textual representation of the date 'Mon Jan 2 15:04:05 -0700 MST 2006'. Example: 2006-01-02T15:04:05.000Z07:00 would format timestamps as rfc3339 with ms precision. Find details here: https://golang.org/pkg/time/#Time.Format" @Success 200 {file} CSV file @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /download [GET]
func GetPrepareDownload ¶ added in v0.0.45
func GetPrepareDownload()
Query godoc @Summary prepare download @Description genartes a secret for later download. can be used in native browser downloads @Accept json @Produce plain @Security Bearer @Param query query string true "JSON encoded QueriesRequestElement" @Param time_format query string false "Textual representation of the date 'Mon Jan 2 15:04:05 -0700 MST 2006'. Example: 2006-01-02T15:04:05.000Z07:00 would format timestamps as rfc3339 with ms precision. Find details here: https://golang.org/pkg/time/#Time.Format" @Success 200 {string} Secret @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /prepare-download [GET]
func LastMessageEndpoint ¶ added in v0.0.45
func LastMessageEndpoint(router *httprouter.Router, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, remoteCache *cache.RemoteCache, converter *converter.Converter, _ deviceSelection.Client)
Query godoc @Summary Last Message @Produce json @Security Bearer @Param device_id query string true "device_id" @Param service_id query string true "service_id" @Success 200 {object} cache.Entry "The last message" @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /last-message [GET]
func LastValuesEndpoint ¶
func LastValuesEndpoint(router *httprouter.Router, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, remoteCache *cache.RemoteCache, converter *converter.Converter, _ deviceSelection.Client)
Query godoc @Summary last-values @Accept json @Produce json @Security Bearer @Param payload body []model.LastValuesRequestElement true "requested values" @Param time_format query string false "Textual representation of the date 'Mon Jan 2 15:04:05 -0700 MST 2006'. Example: 2006-01-02T15:04:05.000Z07:00 would format timestamps as rfc3339 with ms precision. Find details here: https://golang.org/pkg/time/#Time.Format" @Success 200 {array} model.LastValuesResponseElement @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /last-values [POST]
func PrepareDownloadEndpoints ¶
func PrepareDownloadEndpoints(router *httprouter.Router, config configuration.Config, _ *timescale.Wrapper, verifier *verification.Verifier, remoteCache *cache.RemoteCache, _ *converter.Converter, _ deviceSelection.Client)
func QueriesEndpoint ¶
func QueriesEndpoint(router *httprouter.Router, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, remoteCache *cache.RemoteCache, converter *converter.Converter, _ deviceSelection.Client)
Query godoc @Summary queries @deprecated @Accept json @Produce json @Security Bearer @Param payload body []model.QueriesRequestElement true "requested values" @Param format query string false "specifies output format. Use per_query (default) for a 3D array or table for a 2D array with merged timestamps" @Param order_column_index query string false "Column to order values by (includes time column). Only works in format table." @Param order_direction query string false "Direction to order values by. Allowed are 'asc' and 'desc'. Only works in format table." @Param time_format query string false "Textual representation of the date 'Mon Jan 2 15:04:05 -0700 MST 2006'. Example: 2006-01-02T15:04:05.000Z07:00 would format timestamps as rfc3339 with ms precision. Find details here: https://golang.org/pkg/time/#Time.Format" @Success 200 {array} interface{} "2D or 3D array" @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /queries [POST]
func QueriesV2Endpoint ¶ added in v0.0.2
func QueriesV2Endpoint(router *httprouter.Router, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, remoteCache *cache.RemoteCache, converter *converter.Converter, deviceSelectionClient deviceSelection.Client)
Query godoc @Summary last-values @Accept json @Produce json @Security Bearer @Param payload body []model.QueriesRequestElement true "requested values" @Param format query string false "specifies output format. Use per_query (default) for a 3D array or table for a 2D array with merged timestamps" @Param order_column_index query string false "Column to order values by (includes time column). Only works in format table." @Param order_direction query string false "Direction to order values by. Allowed are 'asc' and 'desc'. Only works in format table." @Param time_format query string false "Textual representation of the date 'Mon Jan 2 15:04:05 -0700 MST 2006'. Example: 2006-01-02T15:04:05.000Z07:00 would format timestamps as rfc3339 with ms precision. Find details here: https://golang.org/pkg/time/#Time.Format" @Param locate_lat query string false "Used to automatically select the clostest location on a multivalued import export. Only works with exportId set to an export of an import. User needs read access to the import type." @Param locate_lon query string false "Used to automatically select the clostest location on a multivalued import export. Only works with exportId set to an export of an import. User needs read access to the import type." @Param force_tz query string false "Calculate aggregations with the specified timezone instead of the default device timezone. Might increase calculation complexity and response time." @Success 200 {array} model.QueriesV2ResponseElement "requestIndex allows to match response and request elements (topmost array in request). If a device group is requested, each device will return its own time series. If multiple columns are requested, each will be return as a time series within the data field. If a criteria is selected and multiple paths match the criteria, all matching values will be part of the time series." @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /queries/v2 [POST]
func RawValueEndpoint ¶
func RawValueEndpoint(router *httprouter.Router, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, lastValueCache *cache.RemoteCache, converter *converter.Converter, _ deviceSelection.Client)
Query godoc @Summary Raw Value @Produce json @Security Bearer @Param export_id query string false "export_id" @Param device_id query string false "device_id" @Param service_id query string false "service_id" @Param column query string false "column" @Param source_characteristic_id query string false "source_characteristic_id" @Param target_characteristic_id query string false "target_characteristic_id" @Param concept_id query string false "concept_id" @Success 200 {object} any "the raw value" @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /raw-value [GET]
func Router ¶
func Router(config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, cache *cache.RemoteCache, converter *converter.Converter, deviceSelection deviceSelection.Client) http.Handler
GetRouter doc @title Timescale Wrapper API @version 0.1 @license.name Apache 2.0 @license.url http://www.apache.org/licenses/LICENSE-2.0.html @BasePath / @securityDefinitions.apikey Bearer @in header @name Authorization @description Type "Bearer" followed by a space and JWT token.
func Start ¶
func Start(ctx context.Context, wg *sync.WaitGroup, config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, cache *cache.RemoteCache, converter *converter.Converter, deviceSelection deviceSelection.Client) (err error)
func UnauthenticatedRouter ¶
func UnauthenticatedRouter(config configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, cache *cache.RemoteCache, converter *converter.Converter, deviceSelection deviceSelection.Client) http.Handler
func UsageDevices ¶ added in v0.0.45
func UsageDevices()
Query godoc @Summary Device Usage @Accept json @Produce json @Security Bearer @Param device_ids body []string true "device_ids" @Success 200 {array} model.Usage "usage" @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /usage/devices [GET]
func UsageEndpoint ¶
func UsageEndpoint(router *httprouter.Router, _ configuration.Config, wrapper *timescale.Wrapper, verifier *verification.Verifier, _ *cache.RemoteCache, _ *converter.Converter, _ deviceSelection.Client)
func UsageExports ¶ added in v0.0.45
func UsageExports()
Query godoc @Summary Export Usage @Accept json @Produce json @Security Bearer @Param export_ids body []string true "export_ids" @Success 200 {array} model.Usage "usage" @Failure 400 @Failure 401 @Failure 403 @Failure 404 @Failure 500 @Router /usage/exports [GET]