Documentation ¶
Index ¶
- type Client
- func (c *Client) Abort(ctx context.Context) error
- func (c *Client) CheckBandwidth(ctx context.Context, req *validationpb.CheckBandwidthRequest) (*validationpb.CheckBandwidthResponse, error)
- func (c *Client) CheckDisks(ctx context.Context, req *validationpb.CheckDisksRequest) (*validationpb.CheckDisksResponse, error)
- func (c *Client) CheckPorts(ctx context.Context, req *validationpb.CheckPortsRequest) (*validationpb.CheckPortsResponse, error)
- func (c *Client) Close() error
- func (c *Client) Command(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, ...) error
- func (c *Client) GetCurrentTime(ctx context.Context) (*time.Time, error)
- func (c *Client) GetRuntimeConfig(ctx context.Context) (*pb.RuntimeConfig, error)
- func (c *Client) GetSystemInfo(ctx context.Context) (storage.System, error)
- func (c *Client) GetVersion(ctx context.Context) (*pb.Version, error)
- func (c *Client) GravityCommand(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, ...) error
- func (c *Client) Shutdown(ctx context.Context, req *pb.ShutdownRequest) error
- func (c *Client) Validate(ctx context.Context, req *validationpb.ValidateRequest) ([]*agentpb.Probe, error)
- type Config
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the RPC client
func New ¶
New establishes connection to remote gRPC server note that if connection is unavailable, it will try to establish it until context provided expires
func NewFromConn ¶
func NewFromConn(conn *grpc.ClientConn) *Client
NewFromConn creates a new client based on existing connection conn
func (*Client) CheckBandwidth ¶
func (c *Client) CheckBandwidth(ctx context.Context, req *validationpb.CheckBandwidthRequest) (*validationpb.CheckBandwidthResponse, error)
CheckBandwidth executes a network bandwidth test
func (*Client) CheckDisks ¶
func (c *Client) CheckDisks(ctx context.Context, req *validationpb.CheckDisksRequest) (*validationpb.CheckDisksResponse, error)
CheckDisks executes disk performance test.
func (*Client) CheckPorts ¶
func (c *Client) CheckPorts(ctx context.Context, req *validationpb.CheckPortsRequest) (*validationpb.CheckPortsResponse, error)
CheckPorts executes a network port test
func (*Client) Command ¶
func (c *Client) Command(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, args ...string) error
Command executes the command specified with args on remote node
func (*Client) GetCurrentTime ¶
GetCurrentTime returns agent's current time as UTC timestamp
func (*Client) GetRuntimeConfig ¶
GetRuntimeConfig returns agent's runtime configuration
func (*Client) GetSystemInfo ¶
GetSystemInfo queries remote system information
func (*Client) GetVersion ¶
GetVersion returns agent's version information
func (*Client) GravityCommand ¶
func (c *Client) GravityCommand(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, args ...string) error
GravityCommand executes the gravity command specified with args on remote node. The command uses the same gravity binary that runs the agent.
func (*Client) Validate ¶
func (c *Client) Validate(ctx context.Context, req *validationpb.ValidateRequest) ([]*agentpb.Probe, error)
Validate validates the node against the specified manifest and profile. Returns the list of failed probes
type Config ¶
type Config struct { // Credentials specifies connect credentials Credentials credentials.TransportCredentials // ServerAddr specifies the address of the remote node as host:port ServerAddr string }
Config defines configuration to connect to a remote RPC agent
type Interface ¶
type Interface interface { // Command executes the command specified with args remotely Command(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, args ...string) error // GravityCommand executes the gravity command specified with args remotely GravityCommand(ctx context.Context, log logrus.FieldLogger, stdout, stderr io.Writer, args ...string) error // Validate validates the node against the specified manifest and profile. // Returns the list of failed probes Validate(ctx context.Context, req *validationpb.ValidateRequest) ([]*agentpb.Probe, error) // GetSystemInfo queries remote system information GetSystemInfo(context.Context) (storage.System, error) // GetRuntimeConfig returns agent's runtime configuration GetRuntimeConfig(context.Context) (*pb.RuntimeConfig, error) // GetCurrentTime returns agent's current time as UTC timestamp GetCurrentTime(context.Context) (*time.Time, error) // GetVersion returns agent's version information GetVersion(context.Context) (*pb.Version, error) // CheckPorts executes a network port test CheckPorts(context.Context, *validationpb.CheckPortsRequest) (*validationpb.CheckPortsResponse, error) // CheckBandwidth executes a network bandwidth test CheckBandwidth(context.Context, *validationpb.CheckBandwidthRequest) (*validationpb.CheckBandwidthResponse, error) // CheckDisks executes disk performance test CheckDisks(context.Context, *validationpb.CheckDisksRequest) (*validationpb.CheckDisksResponse, error) // Shutdown requests remote agent to shut down Shutdown(context.Context, *pb.ShutdownRequest) error // Abort requests remote agent to uninstall Abort(context.Context) error // Close will close communication with remote agent Close() error }
Interface is high level RPC agent interface