kibana_oapi

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSpaceAwarePath added in v0.13.0

func BuildSpaceAwarePath(spaceID, basePath string) string

BuildSpaceAwarePath constructs an API path with space awareness. If spaceID is empty or "default", returns the basePath unchanged. Otherwise, prepends "/s/{spaceID}" to the basePath.

func ConnectorConfigWithDefaults added in v0.11.18

func ConnectorConfigWithDefaults(connectorTypeID, plan string) (string, error)

func ConnectorResponseToModel added in v0.11.18

func ConnectorResponseToModel(spaceID string, connector *kbapi.ConnectorResponse) (*models.KibanaActionConnector, fwdiag.Diagnostics)

func CreateConnector added in v0.11.18

func CreateConnector(ctx context.Context, client *Client, connectorOld models.KibanaActionConnector) (string, fwdiag.Diagnostics)

func CreateDataView

CreateDataView creates a new data view.

func CreateExceptionList added in v0.13.0

CreateExceptionList creates a new exception list.

func CreateExceptionListItem added in v0.13.0

CreateExceptionListItem creates a new exception list item.

func CreateList added in v0.13.0

CreateList creates a new security list.

func CreateListIndex added in v0.13.0

func CreateListIndex(ctx context.Context, client *Client, spaceId string) (bool, diag.Diagnostics)

CreateListIndex creates the .lists and .items data streams for a space if they don't exist. This is required before any list operations can be performed. Returns true if acknowledged, and diagnostics if there was an error.

func CreateListItem added in v0.13.0

CreateListItem creates a new security list item.

func CreateMaintenanceWindow added in v0.11.18

CreateMaintenanceWindow creates a new maintenance window.

func DeleteConnector added in v0.11.18

func DeleteConnector(ctx context.Context, client *Client, connectorID string, spaceID string) fwdiag.Diagnostics

func DeleteDataView

func DeleteDataView(ctx context.Context, client *Client, spaceID string, viewID string) diag.Diagnostics

DeleteDataView deletes an existing data view.

func DeleteExceptionList added in v0.13.0

func DeleteExceptionList(ctx context.Context, client *Client, spaceId string, params *kbapi.DeleteExceptionListParams) diag.Diagnostics

DeleteExceptionList deletes an existing exception list.

func DeleteExceptionListItem added in v0.13.0

func DeleteExceptionListItem(ctx context.Context, client *Client, spaceId string, params *kbapi.DeleteExceptionListItemParams) diag.Diagnostics

DeleteExceptionListItem deletes an existing exception list item.

func DeleteList added in v0.13.0

func DeleteList(ctx context.Context, client *Client, spaceId string, params *kbapi.DeleteListParams) diag.Diagnostics

DeleteList deletes an existing security list.

func DeleteListIndex added in v0.13.0

func DeleteListIndex(ctx context.Context, client *Client, spaceId string) diag.Diagnostics

DeleteListIndex deletes the .lists and .items data streams for a space. Returns diagnostics if there was an error.

func DeleteListItem added in v0.13.0

func DeleteListItem(ctx context.Context, client *Client, spaceId string, params *kbapi.DeleteListItemParams) diag.Diagnostics

DeleteListItem deletes an existing security list item.

func DeleteMaintenanceWindow added in v0.11.18

func DeleteMaintenanceWindow(ctx context.Context, client *Client, spaceID string, maintenanceWindowID string) diag.Diagnostics

DeleteMaintenanceWindow deletes an existing maintenance window.

func GetConnector added in v0.11.18

func GetConnector(ctx context.Context, client *Client, connectorID, spaceID string) (*models.KibanaActionConnector, fwdiag.Diagnostics)

func GetDataView

func GetDataView(ctx context.Context, client *Client, spaceID string, viewID string) (*kbapi.DataViewsDataViewResponseObject, diag.Diagnostics)

GetDataView reads a specific data view from the API.

func GetDataViews

func GetDataViews(ctx context.Context, client *Client, spaceID string) ([]kbapi.GetDataViewsResponseItem, diag.Diagnostics)

GetDataViews reads all data views from the API.

func GetDefaultDataView added in v0.13.0

func GetDefaultDataView(ctx context.Context, client *Client, spaceID string) (*string, diag.Diagnostics)

GetDefaultDataView reads the default data view from the API.

func GetExceptionList added in v0.13.0

GetExceptionList reads an exception list from the API by ID or list_id

func GetExceptionListItem added in v0.13.0

GetExceptionListItem reads an exception list item from the API by ID or item_id

func GetList added in v0.13.0

func GetList(ctx context.Context, client *Client, spaceId string, params *kbapi.ReadListParams) (*kbapi.SecurityListsAPIList, diag.Diagnostics)

GetList reads a security list from the API by ID

func GetListItem added in v0.13.0

func GetListItem(ctx context.Context, client *Client, spaceId string, params *kbapi.ReadListItemParams) (*kbapi.SecurityListsAPIListItem, diag.Diagnostics)

GetListItem reads a security list item from the API by ID or list_id and value The response can be a single item or an array, so we unmarshal from the body. When querying by ID, we expect a single item.

func GetMaintenanceWindow added in v0.11.18

func GetMaintenanceWindow(ctx context.Context, client *Client, spaceID string, maintenanceWindowID string) (*kbapi.GetMaintenanceWindowIdResponse, diag.Diagnostics)

GetMaintenanceWindow reads a maintenance window from the API by ID

func GetPrebuiltRulesStatus added in v0.13.0

func GetPrebuiltRulesStatus(ctx context.Context, client *Client, spaceID string) (*kbapi.ReadPrebuiltRulesAndTimelinesStatusResponse, diag.Diagnostics)

GetPrebuiltRulesStatus retrieves the status of prebuilt rules and timelines for a given space.

func InstallPrebuiltRules added in v0.13.0

func InstallPrebuiltRules(ctx context.Context, client *Client, spaceID string) diag.Diagnostics

InstallPrebuiltRules installs or updates prebuilt rules and timelines for a given space.

func ReadListIndex added in v0.13.0

func ReadListIndex(ctx context.Context, client *Client, spaceId string) (listIndex bool, listItemIndex bool, diags diag.Diagnostics)

ReadListIndex reads the status of .lists and .items data streams for a space. Returns the status of list_index and list_item_index separately, and diagnostics on error.

func SearchConnectors added in v0.11.18

func SearchConnectors(ctx context.Context, client *Client, connectorName, spaceID, connectorTypeID string) ([]*models.KibanaActionConnector, sdkdiag.Diagnostics)

func SetDefaultDataView added in v0.13.0

func SetDefaultDataView(ctx context.Context, client *Client, spaceID string, req kbapi.SetDefaultDatailViewDefaultJSONRequestBody) diag.Diagnostics

SetDefaultDataView sets the default data view.

func SpaceAwarePathRequestEditor added in v0.13.0

func SpaceAwarePathRequestEditor(spaceID string) func(ctx context.Context, req *http.Request) error

func UpdateConnector added in v0.11.18

func UpdateConnector(ctx context.Context, client *Client, connectorOld models.KibanaActionConnector) (string, fwdiag.Diagnostics)

func UpdateDataView

UpdateDataView updates an existing data view.

func UpdateExceptionList added in v0.13.0

UpdateExceptionList updates an existing exception list.

func UpdateExceptionListItem added in v0.13.0

UpdateExceptionListItem updates an existing exception list item.

func UpdateList added in v0.13.0

UpdateList updates an existing security list.

func UpdateListItem added in v0.13.0

UpdateListItem updates an existing security list item.

func UpdateMaintenanceWindow added in v0.11.18

func UpdateMaintenanceWindow(ctx context.Context, client *Client, spaceID string, maintenanceWindowID string, req kbapi.PatchMaintenanceWindowIdJSONRequestBody) diag.Diagnostics

UpdateMaintenanceWindow updates an existing maintenance window.

Types

type Client

type Client struct {
	URL  string
	HTTP *http.Client
	API  *kbapi.ClientWithResponses
}

Client provides an API client for Elastic Kibana.

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new Elastic Kibana API client.

type Config

type Config struct {
	URL      string
	Username string
	Password string
	APIKey   string
	Insecure bool
	CACerts  []string
}

Config is the configuration for the Kibana client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL