client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: UPL-1.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// URL to Cryostat's web server
	ServerURL *url.URL
	// Bearer token to authenticate with Cryostat
	AccessToken *string
	// Certificate of CA to trust, in PEM format
	CACertificate []byte
	// JMX authentication credentials
	JMXCredentials *JMXAuthCredentials
}

Config stores configuration options to connect to Cryostat's web server

type CryostatClient

type CryostatClient interface {
	ListRecordings(target *TargetAddress) ([]RecordingDescriptor, error)
	DumpRecording(target *TargetAddress, name string, seconds int, events []string) error
	StartRecording(target *TargetAddress, name string, events []string) error
	StopRecording(target *TargetAddress, name string) error
	DeleteRecording(target *TargetAddress, name string) error
	SaveRecording(target *TargetAddress, name string) (*string, error)
	ListSavedRecordings() ([]SavedRecording, error)
	DeleteSavedRecording(jfrFile string) error
	ListEventTypes(target *TargetAddress) ([]operatorv1beta1.EventInfo, error)
	ListTemplates(target *TargetAddress) ([]operatorv1beta1.TemplateInfo, error)
}

CryostatClient contains methods for interacting with Cryostats REST API

func NewHTTPClient

func NewHTTPClient(config *Config) (CryostatClient, error)

NewHTTPClient creates a client to communicate with Cryostat over HTTP(S)

type JMXAuthCredentials

type JMXAuthCredentials struct {
	// JMX authentication username
	Username string
	// JMX authentication password
	Password string
}

JMXAuthCredentials holds the JMX authentication credentials to send along with requests

type RecordingDescriptor

type RecordingDescriptor struct {
	// An identifier used by the JVM to uniquely identify a recording
	ID int64 `json:"id"`
	// Name of the recording specified during creation
	Name string `json:"name"`
	// State of the recording within its lifecycle
	State string `json:"state"`
	// Time when the recording first started, in milliseconds since Unix epoch
	StartTime int64 `json:"startTime"`
	// How long the recording was configured to run for, in milliseconds
	Duration int64 `json:"duration"`
	// Whether the recording was configured to record indefinitely
	Continuous bool `json:"continuous"`
	// Whether this recording was dumped to disk in the host containing the JVM
	ToDisk bool `json:"toDisk"`
	// The maximum configured size of the recording file
	MaxSize int64 `json:"maxSize"`
	// The maximum configured age of recorded events
	MaxAge int64 `json:"maxAge"`
	// URL to download the raw flight recording file
	DownloadURL string `json:"downloadUrl"`
	// URL to the automated analysis report for this recording
	ReportURL string `json:"reportUrl"`
}

RecordingDescriptor contains various metadata for a particular flight recording retrieved from the JVM

type SavedRecording

type SavedRecording struct {
	Name        string `json:"name"`
	DownloadURL string `json:"downloadUrl"`
	ReportURL   string `json:"reportUrl"`
}

SavedRecording represents a recording file that has been archived in persistent storage by Container JFR

type TargetAddress

type TargetAddress struct {
	Host string
	Port int32
}

TargetAddress contains an address that Container JFR can use to connect to a particular JVM

func (TargetAddress) String

func (target TargetAddress) String() string

Jump to

Keyboard shortcuts

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