All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
GetKVValue | Get /api/{org_id}/kv/{key} | GetValue |
ListKVKeys | Get /api/{org_id}/kv | ListKeys |
RemoveKVValue | Delete /api/{org_id}/kv/{key} | RemoveValue |
SetKVValue | Post /api/{org_id}/kv/{key} | SetValue |
string GetKVValue(ctx, orgId, key).Execute()
GetValue
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
key := "key_example" // string | Key name
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.KVAPI.GetKVValue(context.Background(), orgId, key).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KVAPI.GetKVValue``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetKVValue`: string
fmt.Fprintf(os.Stdout, "Response from `KVAPI.GetKVValue`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
key | string | Key name |
Other parameters are passed through a pointer to a apiGetKVValueRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
string
- Content-Type: Not defined
- Accept: text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]string ListKVKeys(ctx, orgId).Prefix(prefix).Execute()
ListKeys
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
prefix := "prefix_example" // string | Key prefix (optional)
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.KVAPI.ListKVKeys(context.Background(), orgId).Prefix(prefix).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KVAPI.ListKVKeys``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListKVKeys`: []string
fmt.Fprintf(os.Stdout, "Response from `KVAPI.ListKVKeys`: %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 apiListKVKeysRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
prefix | string | Key prefix |
[]string
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string RemoveKVValue(ctx, orgId, key).Execute()
RemoveValue
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
key := "key_example" // string | Key name
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.KVAPI.RemoveKVValue(context.Background(), orgId, key).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KVAPI.RemoveKVValue``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `RemoveKVValue`: string
fmt.Fprintf(os.Stdout, "Response from `KVAPI.RemoveKVValue`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
key | string | Key name |
Other parameters are passed through a pointer to a apiRemoveKVValueRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
string
- Content-Type: Not defined
- Accept: text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string SetKVValue(ctx, orgId, key).Body(body).Execute()
SetValue
package main
import (
"context"
"fmt"
"os"
openobserve "github.com/rachzy/sdk-go-openobserve"
)
func main() {
orgId := "orgId_example" // string | Organization name
key := "key_example" // string | Key name
body := "body_example" // string | Value of the key
configuration := openobserve.NewConfiguration()
apiClient := openobserve.NewAPIClient(configuration)
resp, r, err := apiClient.KVAPI.SetKVValue(context.Background(), orgId, key).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KVAPI.SetKVValue``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SetKVValue`: string
fmt.Fprintf(os.Stdout, "Response from `KVAPI.SetKVValue`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
orgId | string | Organization name | |
key | string | Key name |
Other parameters are passed through a pointer to a apiSetKVValueRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
body | string | Value of the key |
string
- Content-Type: text/plain
- Accept: text/plain
[Back to top] [Back to API list] [Back to Model list] [Back to README]