Skip to content

Latest commit

 

History

History
481 lines (335 loc) · 16.1 KB

FunctionsAPI.md

File metadata and controls

481 lines (335 loc) · 16.1 KB

\FunctionsAPI

All URIs are relative to http://localhost

Method HTTP request Description
CreateFunction Post /api/{org_id}/functions CreateFunction
CreateUpdateEnrichmentTable Post /api/{org_id}/enrichment_tables/{table_name} CreateEnrichmentTable
DeleteFunction Delete /api/{org_id}/functions/{name} DeleteFunction
FunctionPipelineDependency Get /api/{org_id}/functions/{name} FunctionPipelineDependency
ListFunctions Get /api/{org_id}/functions ListFunctions
TestFunction Post /api/{org_id}/functions/test Test a Function
UpdateFunction Put /api/{org_id}/functions/{name} UpdateFunction

CreateFunction

HttpResponse CreateFunction(ctx, orgId).Transform(transform).Execute()

CreateFunction

Example

package main

import (
	"context"
	"fmt"
	"os"
	openobserve "github.com/rachzy/sdk-go-openobserve"
)

func main() {
	orgId := "orgId_example" // string | Organization name
	transform := *openobserve.NewTransform("Function_example") // Transform | Function data

	configuration := openobserve.NewConfiguration()
	apiClient := openobserve.NewAPIClient(configuration)
	resp, r, err := apiClient.FunctionsAPI.CreateFunction(context.Background(), orgId).Transform(transform).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.CreateFunction``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateFunction`: HttpResponse
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.CreateFunction`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name

Other Parameters

Other parameters are passed through a pointer to a apiCreateFunctionRequest struct via the builder pattern

Name Type Description Notes

transform | Transform | Function data |

Return type

HttpResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateUpdateEnrichmentTable

HttpResponse CreateUpdateEnrichmentTable(ctx, orgId, tableName).Execute()

CreateEnrichmentTable

Example

package main

import (
	"context"
	"fmt"
	"os"
	openobserve "github.com/rachzy/sdk-go-openobserve"
)

func main() {
	orgId := "orgId_example" // string | Organization name
	tableName := "tableName_example" // string | Table name

	configuration := openobserve.NewConfiguration()
	apiClient := openobserve.NewAPIClient(configuration)
	resp, r, err := apiClient.FunctionsAPI.CreateUpdateEnrichmentTable(context.Background(), orgId, tableName).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.CreateUpdateEnrichmentTable``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateUpdateEnrichmentTable`: HttpResponse
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.CreateUpdateEnrichmentTable`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name
tableName string Table name

Other Parameters

Other parameters are passed through a pointer to a apiCreateUpdateEnrichmentTableRequest struct via the builder pattern

Name Type Description Notes

Return type

HttpResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteFunction

HttpResponse DeleteFunction(ctx, orgId, name).Force(force).Execute()

DeleteFunction

Example

package main

import (
	"context"
	"fmt"
	"os"
	openobserve "github.com/rachzy/sdk-go-openobserve"
)

func main() {
	orgId := "orgId_example" // string | Organization name
	name := "name_example" // string | Function name
	force := true // bool | Force delete function regardless pipeline dependencies

	configuration := openobserve.NewConfiguration()
	apiClient := openobserve.NewAPIClient(configuration)
	resp, r, err := apiClient.FunctionsAPI.DeleteFunction(context.Background(), orgId, name).Force(force).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.DeleteFunction``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `DeleteFunction`: HttpResponse
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.DeleteFunction`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name
name string Function name

Other Parameters

Other parameters are passed through a pointer to a apiDeleteFunctionRequest struct via the builder pattern

Name Type Description Notes

force | bool | Force delete function regardless pipeline dependencies |

Return type

HttpResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FunctionPipelineDependency

FunctionList FunctionPipelineDependency(ctx, orgId, name).Execute()

FunctionPipelineDependency

Example

package main

import (
	"context"
	"fmt"
	"os"
	openobserve "github.com/rachzy/sdk-go-openobserve"
)

func main() {
	orgId := "orgId_example" // string | Organization name
	name := "name_example" // string | Function name

	configuration := openobserve.NewConfiguration()
	apiClient := openobserve.NewAPIClient(configuration)
	resp, r, err := apiClient.FunctionsAPI.FunctionPipelineDependency(context.Background(), orgId, name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.FunctionPipelineDependency``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `FunctionPipelineDependency`: FunctionList
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.FunctionPipelineDependency`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name
name string Function name

Other Parameters

Other parameters are passed through a pointer to a apiFunctionPipelineDependencyRequest struct via the builder pattern

Name Type Description Notes

Return type

FunctionList

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListFunctions

FunctionList ListFunctions(ctx, orgId).Execute()

ListFunctions

Example

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.FunctionsAPI.ListFunctions(context.Background(), orgId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.ListFunctions``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListFunctions`: FunctionList
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.ListFunctions`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name

Other Parameters

Other parameters are passed through a pointer to a apiListFunctionsRequest struct via the builder pattern

Name Type Description Notes

Return type

FunctionList

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TestFunction

HttpResponse TestFunction(ctx, orgId).TestVRLRequest(testVRLRequest).Execute()

Test a Function

Example

package main

import (
	"context"
	"fmt"
	"os"
	openobserve "github.com/rachzy/sdk-go-openobserve"
)

func main() {
	orgId := "orgId_example" // string | Organization name
	testVRLRequest := *openobserve.NewTestVRLRequest([]interface{}{nil}, "Function_example") // TestVRLRequest | Test run function

	configuration := openobserve.NewConfiguration()
	apiClient := openobserve.NewAPIClient(configuration)
	resp, r, err := apiClient.FunctionsAPI.TestFunction(context.Background(), orgId).TestVRLRequest(testVRLRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.TestFunction``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `TestFunction`: HttpResponse
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.TestFunction`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name

Other Parameters

Other parameters are passed through a pointer to a apiTestFunctionRequest struct via the builder pattern

Name Type Description Notes

testVRLRequest | TestVRLRequest | Test run function |

Return type

HttpResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateFunction

HttpResponse UpdateFunction(ctx, orgId, name).Transform(transform).Execute()

UpdateFunction

Example

package main

import (
	"context"
	"fmt"
	"os"
	openobserve "github.com/rachzy/sdk-go-openobserve"
)

func main() {
	orgId := "orgId_example" // string | Organization name
	name := "name_example" // string | Function name
	transform := *openobserve.NewTransform("Function_example") // Transform | Function data

	configuration := openobserve.NewConfiguration()
	apiClient := openobserve.NewAPIClient(configuration)
	resp, r, err := apiClient.FunctionsAPI.UpdateFunction(context.Background(), orgId, name).Transform(transform).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `FunctionsAPI.UpdateFunction``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateFunction`: HttpResponse
	fmt.Fprintf(os.Stdout, "Response from `FunctionsAPI.UpdateFunction`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
orgId string Organization name
name string Function name

Other Parameters

Other parameters are passed through a pointer to a apiUpdateFunctionRequest struct via the builder pattern

Name Type Description Notes

transform | Transform | Function data |

Return type

HttpResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]