All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
CreateTemplate | Post /api/{org_id}/alerts/templates | CreateTemplate |
DeleteAlertTemplate | Delete /api/{org_id}/alerts/templates/{template_name} | DeleteTemplate |
GetTemplate | Get /api/{org_id}/alerts/templates/{template_name} | GetTemplateByName |
ListTemplates | Get /api/{org_id}/alerts/templates | ListTemplates |
UpdateTemplate | Put /api/{org_id}/alerts/templates/{template_name} | UpdateTemplate |
HttpResponse CreateTemplate(ctx, orgId).Template(template).Execute()
CreateTemplate
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
template := *openobserve.NewTemplate() // Template | Template data
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.CreateTemplate(context.Background(), orgId).Template(template).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.CreateTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateTemplate`: HttpResponse
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.CreateTemplate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name |
Other parameters are passed through a pointer to a apiCreateTemplateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
template | Template | Template data |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
HttpResponse DeleteAlertTemplate(ctx, orgId, templateName).Execute()
DeleteTemplate
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
templateName := "templateName_example" // string | Template name
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.DeleteAlertTemplate(context.Background(), orgId, templateName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.DeleteAlertTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteAlertTemplate`: HttpResponse
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.DeleteAlertTemplate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
templateName | string | Template name |
Other parameters are passed through a pointer to a apiDeleteAlertTemplateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Template GetTemplate(ctx, orgId, templateName).Execute()
GetTemplateByName
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
templateName := "templateName_example" // string | Template name
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.GetTemplate(context.Background(), orgId, templateName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.GetTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetTemplate`: Template
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.GetTemplate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
templateName | string | Template name |
Other parameters are passed through a pointer to a apiGetTemplateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Template ListTemplates(ctx, orgId).Execute()
ListTemplates
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.ListTemplates(context.Background(), orgId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.ListTemplates``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListTemplates`: []Template
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.ListTemplates`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name |
Other parameters are passed through a pointer to a apiListTemplatesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
HttpResponse UpdateTemplate(ctx, orgId, templateName).Template(template).Execute()
UpdateTemplate
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
templateName := "templateName_example" // string | Template name
template := *openobserve.NewTemplate() // Template | Template data
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.TemplatesAPI.UpdateTemplate(context.Background(), orgId, templateName).Template(template).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `TemplatesAPI.UpdateTemplate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateTemplate`: HttpResponse
fmt.Fprintf(os.Stdout, "Response from `TemplatesAPI.UpdateTemplate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
templateName | string | Template name |
Other parameters are passed through a pointer to a apiUpdateTemplateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
template | Template | Template data |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]