fleet

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPackageNotFound = errors.New("package not found")
)

Functions

func AllEnrollmentTokens

func AllEnrollmentTokens(ctx context.Context, client *Client) ([]fleetapi.EnrollmentApiKey, diag.Diagnostics)

AllEnrollmentTokens reads all enrollment tokens from the API.

func AllPackages added in v0.11.0

func AllPackages(ctx context.Context, client *Client, prerelease bool) ([]fleetapi.SearchResult, diag.Diagnostics)

AllPackages returns information about the latest packages known to Fleet.

func CreateAgentPolicy

CreateAgentPolicy creates a new agent policy.

func CreateFleetServerHost

CreateFleetServerHost creates a new fleet server host.

func CreateOutput

CreateOutput creates a new output.

func CreatePackagePolicy added in v0.10.0

CreatePackagePolicy creates a new package policy.

func DeleteAgentPolicy

func DeleteAgentPolicy(ctx context.Context, client *Client, id string) diag.Diagnostics

DeleteAgentPolicy deletes an existing agent policy

func DeleteFleetServerHost

func DeleteFleetServerHost(ctx context.Context, client *Client, id string) diag.Diagnostics

DeleteFleetServerHost deletes an existing fleet server host.

func DeleteOutput

func DeleteOutput(ctx context.Context, client *Client, id string) diag.Diagnostics

DeleteOutput deletes an existing output

func DeletePackagePolicy added in v0.10.0

func DeletePackagePolicy(ctx context.Context, client *Client, id string, force bool) diag.Diagnostics

DeletePackagePolicy deletes an existing package policy.

func GetEnrollmentTokensByPolicy added in v0.11.5

func GetEnrollmentTokensByPolicy(ctx context.Context, client *Client, policyID string) ([]fleetapi.EnrollmentApiKey, diag.Diagnostics)

GetEnrollmentTokensByPolicy Get enrollment tokens by given policy ID

func InstallPackage added in v0.10.0

func InstallPackage(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics

InstallPackage installs a package.

func ReadAgentPolicy

func ReadAgentPolicy(ctx context.Context, client *Client, id string) (*fleetapi.AgentPolicy, diag.Diagnostics)

ReadAgentPolicy reads a specific agent policy from the API.

func ReadFleetServerHost

func ReadFleetServerHost(ctx context.Context, client *Client, id string) (*fleetapi.FleetServerHost, diag.Diagnostics)

ReadFleetServerHost reads a specific fleet server host from the API.

func ReadOutput

func ReadOutput(ctx context.Context, client *Client, id string) (*fleetapi.OutputCreateRequest, diag.Diagnostics)

ReadOutput reads a specific output from the API.

func ReadPackage added in v0.10.0

func ReadPackage(ctx context.Context, client *Client, name, version string) diag.Diagnostics

ReadPackage reads a specific package from the API.

func ReadPackagePolicy added in v0.10.0

func ReadPackagePolicy(ctx context.Context, client *Client, id string) (*fleetapi.PackagePolicy, diag.Diagnostics)

ReadPackagePolicy reads a specific package policy from the API.

func Uninstall added in v0.10.0

func Uninstall(ctx context.Context, client *Client, name, version string, force bool) diag.Diagnostics

Uninstall uninstalls a package.

func UpdateAgentPolicy

UpdateAgentPolicy updates an existing agent policy.

func UpdateFleetServerHost

UpdateFleetServerHost updates an existing fleet server host.

func UpdateOutput

UpdateOutput updates an existing output.

func UpdatePackagePolicy added in v0.10.0

UpdatePackagePolicy updates an existing package policy.

Types

type Client

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

Client provides an API client for Elastic Fleet.

func NewClient

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

NewClient creates a new Elastic Fleet 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 fleet client.

Jump to

Keyboard shortcuts

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