generated go client for grafanas http api, based on swagger-codegen

Go API client for go_client

The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources.

Overview

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

  • API version: 0.0.1
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.GoClientCodegen For more information, please visit https://grafana.com

Installation

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

import "./go_client"

Documentation for API Endpoints

All URIs are relative to http://localhost:10081/api

Class Method HTTP request Description
AdminApi GetSettings Get /admin/settings Fetch settings.
AdminApi GetStats Get /admin/stats Fetch Grafana Stats.
AdminApi PauseAllAlerts Post /admin/pause-all-alerts Pause/unpause all (legacy) alerts.
AdminLdapApi GetLDAPStatus Get /admin/ldap/status Attempts to connect to all the configured LDAP servers and returns information on whenever they're available or not.
AdminLdapApi GetLDAPUser Get /admin/ldap/{user_name} Finds an user based on a username in LDAP. This helps illustrate how would the particular user be mapped in Grafana when synced.
AdminLdapApi ReloadLDAP Post /admin/ldap/reload Reloads the LDAP configuration.
AdminLdapApi SyncLDAPUser Post /admin/ldap/sync/{user_id} Enables a single Grafana user to be synchronized against LDAP.
AdminProvisioningApi ReloadProvisionedAccessControl Post /admin/provisioning/accesscontrol/reload Reload access control provisioning configurations.
AdminProvisioningApi ReloadProvisionedAlertNotifiers Post /admin/provisioning/notifications/reload Reload legacy alert notifier provisioning configurations.
AdminProvisioningApi ReloadProvisionedDashboards Post /admin/provisioning/dashboards/reload Reload dashboard provisioning configurations.
AdminProvisioningApi ReloadProvisionedDatasources Post /admin/provisioning/datasources/reload Reload datasource provisioning configurations.
AdminProvisioningApi ReloadProvisionedPlugins Post /admin/provisioning/plugins/reload Reload plugin provisioning configurations.
AdminUsersApi CreateUser Post /admin/users Create new user.
AdminUsersApi DeleteUser Delete /admin/users/{user_id} Delete global User.
AdminUsersApi DisableUser Post /admin/users/{user_id}/disable Disable user.
AdminUsersApi EnableUser Post /admin/users/{user_id}/enable Enable user.
AdminUsersApi GetAuthTokens Get /admin/users/{user_id}/auth-tokens Return a list of all auth tokens (devices) that the user currently have logged in from.
AdminUsersApi GetUserQuota Get /admin/users/{user_id}/quotas Fetch user quota.
AdminUsersApi LogoutUser Post /admin/users/{user_id}/logout Logout user revokes all auth tokens (devices) for the user. User of issued auth tokens (devices) will no longer be logged in and will be required to authenticate again upon next activity.
AdminUsersApi RevokeAuthToken Post /admin/users/{user_id}/revoke-auth-token Revoke auth token for user.
AdminUsersApi SetPassword Put /admin/users/{user_id}/password Set password for user.
AdminUsersApi SetPermissions Put /admin/users/{user_id}/permissions Set permissions for user.
AdminUsersApi UpdateUserQuota Put /admin/users/{user_id}/quotas/{quota_target} Update user quota.
AnnotationsApi CreateAnnotation Post /annotations Create Annotation.
AnnotationsApi CreateGraphiteAnnotation Post /annotations/graphite Create Annotation in Graphite format.
AnnotationsApi DeleteAnnotation Delete /annotations/{annotation_id} Delete Annotation By ID.
AnnotationsApi GetAnnotationTags Get /annotations/tags Find Annotations Tags.
AnnotationsApi GetAnnotations Get /annotations Find Annotations.
AnnotationsApi MassDeleteAnnotations Post /annotations/mass-delete Delete multiple annotations.
AnnotationsApi PatchAnnotation Patch /annotations/{annotation_id} Patch Annotation
AnnotationsApi UpdateAnnotation Put /annotations/{annotation_id} Update Annotation.
ApikeysApi AddAPIkey Post /auth/keys Creates an API key.
ApikeysApi DeleteAPIkey Delete /auth/keys/{id} Delete API key.
ApikeysApi GetAPIkeys Get /auth/keys Get auth keys.
DashboardPermissionsApi GetDashboardPermissions Get /dashboards/id/{DashboardID}/permissions Gets all existing permissions for the given dashboard.
DashboardPermissionsApi PostDashboardPermissions Post /dashboards/id/{DashboardID}/permissions Updates permissions for a dashboard.
DashboardVersionsApi GetDashboardVersion Get /dashboards/id/{DashboardID}/versions/{DashboardVersionID} Get a specific dashboard version.
DashboardVersionsApi GetDashboardVersions Get /dashboards/id/{DashboardID}/versions Gets all existing versions for the dashboard.
DashboardVersionsApi RestoreDashboardVersion Post /dashboards/id/{DashboardID}/restore Restore a dashboard to a given dashboard version.
DashboardsApi CalcDashboardDiff Post /dashboards/calculate-diff Perform diff on two dashboards.
DashboardsApi DeleteDashboardByUID Delete /dashboards/uid/{uid} Delete dashboard by uid.
DashboardsApi GetDashboardByUID Get /dashboards/uid/{uid} Get dashboard by uid.
DashboardsApi GetDashboardTags Get /dashboards/tags Get all dashboards tags of an organisation.
DashboardsApi GetHomeDashboard Get /dashboards/home Get home dashboard.
DashboardsApi ImportDashboard Post /dashboards/import Import dashboard.
DashboardsApi PostDashboard Post /dashboards/db Create / Update dashboard
DashboardsApi TrimDashboard Post /dashboards/trim Trim defaults from dashboard.
DatasourcesApi AddDatasource Post /datasources Create a data source.
DatasourcesApi DatasourceProxyDELETEcalls Delete /datasources/proxy/{datasource_id}/{datasource_proxy_route} Data source proxy DELETE calls.
DatasourcesApi DatasourceProxyGETcalls Get /datasources/proxy/{datasource_id}/{datasource_proxy_route} Data source proxy GET calls.
DatasourcesApi DatasourceProxyPOSTcalls Post /datasources/proxy/{datasource_id}/{datasource_proxy_route} Data source proxy POST calls.
DatasourcesApi DeleteDatasourceByID Delete /datasources/{datasource_id} Delete an existing data source by id.
DatasourcesApi DeleteDatasourceByName Delete /datasources/name/{datasource_name} Delete an existing data source by name.
DatasourcesApi DeleteDatasourceByUID Delete /datasources/uid/{datasource_uid} Delete an existing data source by UID.
DatasourcesApi GetDatasourceByID Get /datasources/{datasource_id} Get a single data source by Id.
DatasourcesApi GetDatasourceByName Get /datasources/name/{datasource_name} Get a single data source by Name.
DatasourcesApi GetDatasourceByUID Get /datasources/uid/{datasource_uid} Get a single data source by UID.
DatasourcesApi GetDatasourceIdByName Get /datasources/id/{datasource_name} Get data source Id by Name.
DatasourcesApi GetDatasources Get /datasources Get all data sources.
DatasourcesApi QueryDatasource Post /tsdb/query Query metrics.
DatasourcesApi UpdateDatasource Put /datasources/{datasource_id} Update an existing data source.
FolderPermissionsApi GetFolderPermissions Get /folders/{folder_uid}/permissions Gets all existing permissions for the folder with the given `uid`.
FolderPermissionsApi UpdateFolderPermissions Post /folders/{folder_uid}/permissions Updates permissions for a folder. This operation will remove existing permissions if they’re not included in the request.
FoldersApi CreateFolder Post /folders Create folder.
FoldersApi DeleteFolder Delete /folders/{folder_uid} Delete folder.
FoldersApi GetFolderByID Get /folders/id/{folder_id} Get folder by id.
FoldersApi GetFolderByUID Get /folders/{folder_uid} Get folder by uid.
FoldersApi GetFolders Get /folders Get all folders.
FoldersApi UpdateFolder Put /folders/{folder_uid} Update folder.
LegacyAlertingApi GetAlertByID Get /alerts/{alert_id} Get alert by ID.
LegacyAlertingApi GetAlerts Get /alerts Get legacy alerts.
LegacyAlertingApi GetDashboardStates Get /alerts/states-for-dashboard Get alert states for a dashboard.
LegacyAlertingApi PauseAlert Post /alerts/{alert_id}/pause Pause/unpause alert by id.
LegacyAlertingApi TestAlert Post /alerts/test Test alert.
LegacyNotificationChannelsApi CreateAlertNotificationChannel Post /alert-notifications Create notification channel.
LegacyNotificationChannelsApi DeleteAlertNotificationChannel Delete /alert-notifications/{notification_channel_id} Delete alert notification by ID.
LegacyNotificationChannelsApi DeleteAlertNotificationChannelByUID Delete /alert-notifications/uid/{notification_channel_uid} Delete alert notification by UID.
LegacyNotificationChannelsApi GetAlertNotificationChannelByID Get /alert-notifications/{notification_channel_id} Get notification channel by ID.
LegacyNotificationChannelsApi GetAlertNotificationChannelByUID Get /alert-notifications/uid/{notification_channel_uid} Get notification channel by UID
LegacyNotificationChannelsApi GetAlertNotificationChannels Get /alert-notifications Get all notification channels.
LegacyNotificationChannelsApi LookupAlertNotificationChannels Get /alert-notifications/lookup Get all notification channels (lookup)
LegacyNotificationChannelsApi NotificationChannelTest Post /alert-notifications/test Test notification channel.
LegacyNotificationChannelsApi UpdateAlertNotificationChannel Put /alert-notifications/{notification_channel_id} Update notification channel by ID.
LegacyNotificationChannelsApi UpdateAlertNotificationChannelBYUID Put /alert-notifications/uid/{notification_channel_uid} Update notification channel by UID.
LibraryElementsApi CreateLibraryElement Post /library-elements Create library element.
LibraryElementsApi DeleteLibraryElementByUID Delete /library-elements/{library_element_uid} Delete library element.
LibraryElementsApi GetLibraryElementByName Get /library-elements/name/{library_element_name} Get library element by name.
LibraryElementsApi GetLibraryElementByUID Get /library-elements/{library_element_uid} Get library element by UID.
LibraryElementsApi GetLibraryElementConnections Get /library-elements/{library_element_uid}/connections/ Get library element connections.
LibraryElementsApi GetLibraryElements Get /library-elements Get all library elements.
LibraryElementsApi UpdateLibraryElement Patch /library-elements/{library_element_uid} Update library element.
OrgApi AddOrgUser Post /org/users Add a new user to the current organization
OrgApi DeleteOrgUser Delete /org/users/{user_id} Delete user in current organization
OrgApi GetOrg Get /org
OrgApi GetOrgUsers Get /org/users Get all users within the current organization.
OrgApi LookupOrgUsers Get /org/users/lookup Get all users within the current organization (lookup)
OrgApi UpdateOrg Put /org Update current Organization.
OrgApi UpdateOrgAddress Put /org/address Update current Organization's address.
OrgApi UpdateOrgUser Patch /org/users/{user_id} Updates the given user
OrgInvitesApi AddInvite Post /org/invites Add invite.
OrgInvitesApi GetInvites Get /org/invites Get pending invites.
OrgInvitesApi RevokeInvite Delete /org/{invitation_code}/invites Revoke invite.
OrgPreferencesApi GetOrgPreferences Get /org/preferences Get Current Org Prefs.
OrgPreferencesApi UpdateOrgPreferences Put /org/preferences Update Current Org Prefs.
OrgsApi AdminAddOrgUser Post /orgs/{org_id}/users Add a new user to the current organization
OrgsApi AdminDeleteOrg Delete /orgs/{org_id} Delete Organization.
OrgsApi AdminDeleteOrgUser Delete /orgs/{org_id}/users/{user_id} Delete user in current organization
OrgsApi AdminGetOrgUsers Get /orgs/{org_id}/users Get Users in Organization.
OrgsApi AdminUpdateOrg Put /orgs/{org_id} Update Organization.
OrgsApi AdminUpdateOrgAddress Put /orgs/{org_id}/address Update Organization's address.
OrgsApi AdminUpdateOrgUser Patch /orgs/{org_id}/users/{user_id} Update Users in Organization.
OrgsApi CreateOrg Post /orgs Create Organization.
OrgsApi GetOrgByID Get /orgs/{org_id} Get Organization by ID.
OrgsApi GetOrgByName Get /orgs/name/{org_name} Get Organization by ID.
OrgsApi GetOrgQuota Get /orgs/{org_id}/quotas Fetch Organization quota.
OrgsApi SearchOrg Get /orgs
OrgsApi UpdateOrgQuota Put /orgs/{org_id}/quotas/{quota_target} Update user quota.
SearchApi Search Get /search
SearchApi SearchSorting Get /search/sorting
SnapshotApi CreateSnapshot Post /snapshots When creating a snapshot using the API, you have to provide the full dashboard payload including the snapshot data. This endpoint is designed for the Grafana UI.
SnapshotApi DeleteSnapshotByDeleteKey Get /snapshots-delete/{deleteKey} Delete Snapshot by deleteKey.
SnapshotApi DeleteSnapshotByKey Delete /snapshots/{key} Delete Snapshot by Key.
SnapshotApi GetSnapshotByKey Get /snapshots/{key} Get Snapshot by Key.
SnapshotApi GetSnapshotSharingOptions Get /snapshot/shared-options Get snapshot sharing settings.
SnapshotApi GetSnapshots Get /dashboard/snapshots List snapshots.
TeamsApi AddTeamMember Post /teams/{team_id}/members Add Team Member.
TeamsApi CreateTeam Post /teams Add Team.
TeamsApi DeleteTeamByID Delete /teams/{team_id} Delete Team By ID.
TeamsApi GetTeam Get /teams/{team_id} Get Team By ID.
TeamsApi GetTeamMembers Get /teams/{team_id}/members Get Team Members.
TeamsApi GetTeamPreferences Get /teams/{team_id}/preferences Get Team Preferences.
TeamsApi RemoveTeamMember Delete /teams/{team_id}/members/{user_id} Remove Member From Team.
TeamsApi SearchTeams Get /teams/search Team Search With Paging.
TeamsApi UpdateTeam Put /teams/{team_id} Update Team.
TeamsApi UpdateTeamMember Put /teams/{team_id}/members/{user_id} Update Team Member.
TeamsApi UpdateTeamPreferences Put /teams/{team_id}/preferences Update Team Preferences.
UserApi ChangeUserPassword Put /user/password Change Password.
UserApi ClearHelpFlags Get /user/helpflags/clear Clear user help flag.
UserApi GetSignedInUser Get /user Get signed in User.
UserApi GetSignedInUserAuthTokens Get /user/auth-tokens Auth tokens of the actual User.
UserApi GetSignedInUserOrgList Get /user/orgs Organizations of the actual User.
UserApi GetSignedInUserTeamList Get /user/teams Teams that the actual User is member of.
UserApi GetUserQuotas Get /user/quotas Fetch user quota.
UserApi RevokeSignedINAuthTokenCmd Post /user/revoke-auth-token Revoke an auth token of the actual User.
UserApi SetHelpFlag Put /user/helpflags/{flag_id} Set user help flag.
UserApi StarDashboard Post /user/stars/dashboard/{dashboard_id} Star a dashboard.
UserApi UnstarDashboard Delete /user/stars/dashboard/{dashboard_id} Unstar a dashboard.
UserApi UpdateSignedInUser Put /user Update signed in User.
UserApi UserSetUsingOrg Post /user/using/{org_id} Switch user context for signed in user.
UserPreferencesApi GetUserPreferences Get /user/preferences Get user preferences.
UserPreferencesApi UpdateUserPreferences Put /user/preferences Update user preferences.
UsersApi GetUserByID Get /users/{user_id} Get user by id.
UsersApi GetUserByLoginOrEmail Get /users/lookup Get user by login or email.
UsersApi GetUserOrgList Get /users/{user_id}/orgs Get organizations for user.
UsersApi GetUserTeams Get /users/{user_id}/teams Get teams for user.
UsersApi SearchUsers Get /users Get users.
UsersApi SearchUsersWithPaging Get /users/search Get users with paging.
UsersApi UpdateUser Put /users/{user_id} Update user.

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
	Key: "APIKEY",
	Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

basic

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

[email protected]

Similar Resources

An Easy to use Go framework for Kubernetes based on kubernetes/client-go

k8devel An Easy to use Go framework for Kubernetes based on kubernetes/client-go, see examples dir for a quick start. How to test it ? Download the mo

Mar 25, 2022

System agent. Reports server status via HTTP API

sys-agent System agent is a simple service reporting server status via HTTP GET request. usage $ sys-agent -l :8080 -v "root:/" -v "data:/mnt/data" Ap

Dec 20, 2022

Package bright-golang is a client for the Bright App energy monitoring API.

Go client library for the Bright API Package bright-golang is a client for the Bright App energy monitoring API. Not all the API endpoints are impleme

Jan 5, 2022

A simple CLI and API client for One-Time Secret

OTS Go client otsgo is a simple CLI and API client for One-Time Secret written i

Dec 27, 2021

Using the Golang search the Marvel Characters. This project is a web based golang application that shows the information of superheroes using Marvel api.

Using the Golang search the Marvel Characters. This project is a web based golang application that shows the information of superheroes using Marvel api.

marvel-universe-web using the Golang search the Marvel Universe Characters About The Project This project is a web based golang application that shows

Oct 10, 2021

K8s controller implementing Multi-Cluster Services API based on AWS Cloud Map.

AWS Cloud Map MCS Controller for K8s Introduction AWS Cloud Map multi-cluster service discovery for Kubernetes (K8s) is a controller that implements e

Dec 17, 2022

Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021

A shields.io API for your youtube channel to protect your api key

A shields.io API for your youtube channel to protect your api key

Youtube-Channel-Badge A shields.io API for your youtube channel to protect your

Dec 23, 2021

Pokete api - An API to get (Pokete, Attack etc.) data from Pokete

Pokete API An API to get (Pokete, Attack etc.) data from Pokete. Usage To lauch

Jun 16, 2022
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)
OpenAPI Terraform Provider that configures itself at runtime with the resources exposed by the service provider (defined in a swagger file)

Terraform Provider OpenAPI This terraform provider aims to minimise as much as possible the efforts needed from service providers to create and mainta

Dec 26, 2022
A helm v3 plugin to adopt existing k8s resources into a new generated helm chart

helm-adopt Overview helm-adopt is a helm plugin to adopt existing k8s resources into a new generated helm chart, the idea behind the plugin was inspir

Dec 15, 2022
Bitrise step to parse a JaCoCo generated report and output the code coverage percentages to be used by other steps.

JaCoCo Report Parser This step parses a JaCoCo generated XML report in the jacoco_report_path and outputs the coverage percentages in a String format

Dec 6, 2021
A kubernetes operator demo generated by code-generator, it only watches cr's events

intro a small operator demo which only watches car cr's events. environment: ubuntu-20.04-amd64 k3s-1.21 docker-20.10.7 go-1.17 tools code-generator d

Dec 13, 2021
A kubernetes operator sample generated by kubebuilder , which run cmd in pod on specified time

init kubebuilder init --domain github.com --repo github.com/tonyshanc/sample-operator-v2 kubebuilder create api --group sample --version v1 --kind At

Jan 25, 2022
Kube - A simple Kubernetes client, based on client-go

kube A simple Kubernetes client, based on client-go.

Aug 9, 2022
Koios-rest-go-client - Go Client library for Koios API

Koios API Client Library for Go Koios API is Elastic Cardano Query Layer! A cons

Mar 18, 2022
crud is a cobra based CLI utility which helps in scaffolding a simple go based micro-service along with build scripts, api documentation, micro-service documentation and k8s deployment manifests

crud crud is a CLI utility which helps in scaffolding a simple go based micro-service along with build scripts, api documentation, micro-service docum

Nov 29, 2021
cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Oct 27, 2022
A K8s ClusterIP HTTP monitoring library based on eBPF

Owlk8s Seamless RED monitoring of k8s ClusterIP HTTP services. This library provides RED (rate,error,duration) monitoring for all(by default but exclu

Jun 16, 2022