Skip to content

rachzy/sdk-go-openobserve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for openapi

OpenObserve API documents https://openobserve.ai/docs/

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 0.14.5
  • Package version: 1.0.0
  • Generator version: 7.12.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://openobserve.ai/

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
go get github.com/rachzy/sdk-go-openobserve

Put the package under your project folder and add the following in import:

import openobserve "github.com/rachzy/sdk-go-openobserve"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value openapi.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value openapi.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using openapi.ContextOperationServerIndices and openapi.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AlertsAPI CreateAlert Post /api/v2/{org_id}/alerts CreateAlert
AlertsAPI CreateDestination Post /api/{org_id}/alerts/destinations CreateDestination
AlertsAPI DeleteAlert Delete /api/v2/{org_id}/alerts/{alert_id} DeleteAlert
AlertsAPI DeleteAlertDestination Delete /api/{org_id}/alerts/destinations/{destination_name} DeleteDestination
AlertsAPI DeleteAlert_0 Delete /api/{org_id}/{stream_name}/alerts/{alert_name} DeleteAlert
AlertsAPI EnableAlert Patch /api/v2/{org_id}/alerts/{alert_id}/enable EnableAlert
AlertsAPI EnableAlert_0 Put /api/{org_id}/{stream_name}/alerts/{alert_name}/enable EnableAlert
AlertsAPI GetAlert Get /api/v2/{org_id}/alerts/{alert_id} GetAlert
AlertsAPI GetAlert_0 Get /api/{org_id}/{stream_name}/alerts/{alert_name} GetAlertByName
AlertsAPI GetDestination Get /api/{org_id}/alerts/destinations/{destination_name} GetDestination
AlertsAPI ListAlerts Get /api/v2/{org_id}/alerts ListAlerts
AlertsAPI ListAlerts_0 Get /api/{org_id}/alerts ListAlerts
AlertsAPI ListDestinations Get /api/{org_id}/alerts/destinations ListDestinations
AlertsAPI ListStreamAlerts Get /api/{org_id}/{stream_name}/alerts ListStreamAlerts
AlertsAPI MoveAlerts Patch /api/v2/{org_id}/alerts/move MoveAlerts
AlertsAPI SaveAlert Post /api/{org_id}/{stream_name}/alerts CreateAlert
AlertsAPI TriggerAlert Patch /api/v2/{org_id}/alerts/{alert_id}/trigger TriggerAlert
AlertsAPI TriggerAlert_0 Put /api/{org_id}/{stream_name}/alerts/{alert_name}/trigger TriggerAlert
AlertsAPI UpdateAlert Put /api/v2/{org_id}/alerts/{alert_id} UpdateAlert
AlertsAPI UpdateAlert_0 Put /api/{org_id}/{stream_name}/alerts/{alert_name} UpdateAlert
AlertsAPI UpdateDestination Put /api/{org_id}/alerts/destinations/{destination_name} UpdateDestination
ClustersAPI ListClusters Get /api/clusters ListClusters
DashboardsAPI CreateAnnotations Post /api/{org_id}/dashboards/{dashboard_id}/annotations Create Timed Annotations
DashboardsAPI CreateDashboard Post /api/{org_id}/dashboards CreateDashboard
DashboardsAPI DeleteAnnotations Delete /api/{org_id}/dashboards/{dashboard_id}/annotations Delete Timed Annotations
DashboardsAPI DeleteDashboard Delete /api/{org_id}/dashboards/{dashboard_id} DeleteDashboard
DashboardsAPI GetAnnotations Get /api/{org_id}/dashboards/{dashboard_id}/annotations Get Timed Annotations
DashboardsAPI GetDashboard Get /api/{org_id}/dashboards/{dashboard_id} GetDashboard
DashboardsAPI ListDashboards Get /api/{org_id}/dashboards ListDashboards
DashboardsAPI MoveDashboard Put /api/{org_id}/folders/dashboards/{dashboard_id} MoveDashboard
DashboardsAPI MoveDashboards Patch /api/{org_id}/dashboards/move
DashboardsAPI RemoveTimedAnnotationFromPanel Delete /api/{org_id}/dashboards/{dashboard_id}/annotations/panels/{timed_annotation_id} Delete Timed Annotation Panels
DashboardsAPI UpdateAnnotations Put /api/{org_id}/dashboards/{dashboard_id}/annotations/{timed_annotation_id} Update Timed Annotations
DashboardsAPI UpdateDashboard Put /api/{org_id}/dashboards/{dashboard_id} UpdateDashboard
FoldersAPI CreateFolder Post /api/v2/{org_id}/folders/{folder_type} CreateFolder
FoldersAPI CreateFolder_0 Post /api/{org_id}/folders CreateFolder
FoldersAPI DeleteFolder Delete /api/v2/{org_id}/folders/{folder_type}/{folder_id} DeleteFolder
FoldersAPI DeleteFolder_0 Delete /api/{org_id}/folders/{folder_id} DeleteFolder
FoldersAPI GetFolder Get /api/v2/{org_id}/folders/{folder_type}/{folder_id} GetFolder
FoldersAPI GetFolderByName Get /api/v2/{org_id}/folders/{folder_type}/name/{folder_name} GetFolderByName
FoldersAPI GetFolderByName_0 Get /api/{org_id}/folders/name/{folder_name} GetFolderByName
FoldersAPI GetFolder_0 Get /api/{org_id}/folders/{folder_id} GetFolder
FoldersAPI ListFolders Get /api/v2/{org_id}/folders/{folder_type} ListFolders
FoldersAPI ListFolders_0 Get /api/{org_id}/folders ListFolders
FoldersAPI UpdateFolder Put /api/v2/{org_id}/folders/{folder_type}/{folder_id} UpdateFolder
FoldersAPI UpdateFolder_0 Put /api/{org_id}/folders/{folder_id} UpdateFolder
FunctionsAPI CreateFunction Post /api/{org_id}/functions CreateFunction
FunctionsAPI CreateUpdateEnrichmentTable Post /api/{org_id}/enrichment_tables/{table_name} CreateEnrichmentTable
FunctionsAPI DeleteFunction Delete /api/{org_id}/functions/{name} DeleteFunction
FunctionsAPI FunctionPipelineDependency Get /api/{org_id}/functions/{name} FunctionPipelineDependency
FunctionsAPI ListFunctions Get /api/{org_id}/functions ListFunctions
FunctionsAPI TestFunction Post /api/{org_id}/functions/test Test a Function
FunctionsAPI UpdateFunction Put /api/{org_id}/functions/{name} UpdateFunction
KVAPI GetKVValue Get /api/{org_id}/kv/{key} GetValue
KVAPI ListKVKeys Get /api/{org_id}/kv ListKeys
KVAPI RemoveKVValue Delete /api/{org_id}/kv/{key} RemoveValue
KVAPI SetKVValue Post /api/{org_id}/kv/{key} SetValue
LogsAPI LogsIngestionBulk Post /api/{org_id}/_bulk _bulk ES compatible ingestion API
LogsAPI LogsIngestionJson Post /api/{org_id}/{stream_name}/_json _json ingestion API
LogsAPI LogsIngestionMulti Post /api/{org_id}/{stream_name}/_multi _multi ingestion API
MetaAPI Healthz Get /healthz Healthz
MetricsAPI MetricsIngestionJson Post /api/{org_id}/ingest/metrics/_json _json ingestion API
MetricsAPI PrometheusFormatQuery Get /api/{org_id}/prometheus/api/v1/format_query prometheus formatting query expressions
MetricsAPI PrometheusLabelValues Get /api/{org_id}/prometheus/api/v1/label/{label_name}/values prometheus query label values
MetricsAPI PrometheusLabels Get /api/{org_id}/prometheus/api/v1/labels prometheus getting label names
MetricsAPI PrometheusMetadata Get /api/{org_id}/prometheus/api/v1/metadata prometheus query metric metadata
MetricsAPI PrometheusQuery Get /api/{org_id}/prometheus/api/v1/query prometheus instant queries
MetricsAPI PrometheusRangeQuery Get /api/{org_id}/prometheus/api/v1/query_range prometheus range queries
MetricsAPI PrometheusRemoteWrite Post /api/{org_id}/prometheus/api/v1/write prometheus remote-write endpoint for metrics
MetricsAPI PrometheusSeries Get /api/{org_id}/prometheus/api/v1/series prometheus finding series by label matchers
OrganizationsAPI CreateOrganizationUserRumIngestToken Post /api/{org_id}/rumtoken CreateRumIngestToken
OrganizationsAPI GetOrganizationSummary Get /api/{org_id}/summary GetOrganizationSummary
OrganizationsAPI GetOrganizationUserIngestToken Get /api/{org_id}/passcode GetIngestToken
OrganizationsAPI GetOrganizationUserRumIngestToken Get /api/{org_id}/rumtoken GetRumIngestToken
OrganizationsAPI GetUserOrganizations Get /api/organizations GetOrganizations
OrganizationsAPI OrganizationSettingCreate Post /api/{org_id}/settings Organization specific settings
OrganizationsAPI OrganizationSettingGet Get /api/{org_id}/settings Retrieve organization specific settings
OrganizationsAPI UpdateOrganizationUserIngestToken Put /api/{org_id}/passcode UpdateIngestToken
OrganizationsAPI UpdateOrganizationUserRumIngestToken Put /api/{org_id}/rumtoken UpdateRumIngestToken
RumAPI LogIngestionJson Post /rum/v1/{org_id}/logs Rum log ingestion API
RumAPI ReplayIngestionJson Post /rum/v1/{org_id}/replay Rum session-replay ingestion API
RumAPI RumIngestionMulti Post /rum/v1/{org_id}/rum Rum data ingestion API
SavedViewsAPI CreateSavedViews Post /api/{org_id}/savedviews
SavedViewsAPI DeleteSavedViews Delete /api/{org_id}/savedviews/{view_id}
SavedViewsAPI GetSavedView Get /api/{org_id}/savedviews/{view_id}
SavedViewsAPI ListSavedViews Get /api/{org_id}/savedviews
SavedViewsAPI UpdateSavedViews Put /api/{org_id}/savedviews/{view_id}
SearchAPI SearchAround Get /api/{org_id}/{stream_name}/_around SearchAround
SearchAPI SearchAroundV2 Post /api/{org_id}/{stream_name}/_around SearchAroundV2
SearchAPI SearchHistory Post /api/{org_id}/_search_history Search History
SearchAPI SearchPartition Post /api/{org_id}/_search_partition SearchStreamPartition
SearchAPI SearchSQL Post /api/{org_id}/_search SearchStreamData
SearchAPI SearchValues Get /api/{org_id}/{stream_name}/_values SearchTopNValues
ShortUrlAPI Retrieve Get /short/{org_id}/short/{short_id} Retrieve the original URL from a short_id
ShortUrlAPI Shorten Post /api/{org_id}/short Shorten a URL
StreamsAPI StreamDelete Delete /api/{org_id}/streams/{stream_name} DeleteStream
StreamsAPI StreamDeleteFields Put /api/{org_id}/streams/{stream_name}/delete_fields DeleteStreamFields
StreamsAPI StreamList Get /api/{org_id}/streams ListStreams
StreamsAPI StreamSchema Get /api/{org_id}/streams/{stream_name}/schema GetSchema
StreamsAPI StreamSettings Post /api/{org_id}/streams/{stream_name}/settings CreateStreamSettings
StreamsAPI UpdateStreamSettings Put /api/{org_id}/streams/{stream_name}/settings UpdateStreamSettings
SyslogRoutesAPI CreateSyslogRoute Post /api/{org_id}/syslog-routes CreateSyslogRoute
SyslogRoutesAPI DeleteSyslogRoute Delete /api/{org_id}/syslog-routes/{id} DeleteSyslogRoute
SyslogRoutesAPI ListSyslogRoutes Get /api/{org_id}/syslog-routes ListSyslogRoutes
SyslogRoutesAPI UpdateSyslogRoute Put /api/{org_id}/syslog-routes/{id} UpdateSyslogRoute
TemplatesAPI CreateTemplate Post /api/{org_id}/alerts/templates CreateTemplate
TemplatesAPI DeleteAlertTemplate Delete /api/{org_id}/alerts/templates/{template_name} DeleteTemplate
TemplatesAPI GetTemplate Get /api/{org_id}/alerts/templates/{template_name} GetTemplateByName
TemplatesAPI ListTemplates Get /api/{org_id}/alerts/templates ListTemplates
TemplatesAPI UpdateTemplate Put /api/{org_id}/alerts/templates/{template_name} UpdateTemplate
TracesAPI GetLatestTraces Get /api/{org_id}/{stream_name}/traces/latest GetLatestTraces
TracesAPI PostTraces Post /api/{org_id}/traces TracesIngest
UsersAPI AddUserToOrg Post /api/{org_id}/users/{email_id} AddUserToOrganization
UsersAPI RemoveUserFromOrg Delete /api/{org_id}/users/{email_id} RemoveUserFromOrganization
UsersAPI UserList Get /api/{org_id}/users ListUsers
UsersAPI UserSave Post /api/{org_id}/users CreateUser
UsersAPI UserUpdate Put /api/{org_id}/users/{email_id} UpdateUser

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

Authorization

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		openapi.ContextAPIKeys,
		map[string]openapi.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

hello@zinclabs.io