Documentation
¶
Overview ¶
Package statushelper provides helper functions for checking the status of various agent functionalities like IAM roles, package versions etc.
Index ¶
- func CheckAgentEnabledAndRunning(ctx context.Context, agentName string, osType string, ...) (isEnabled bool, isRunning bool, err error)
- func CheckIAMRoles(ctx context.Context, projectID string, requiredRoles []string) error
- func KernelVersion(ctx context.Context, osType string, exec commandlineexecutor.Execute) (*spb.KernelVersion, error)
- func LatestVersionArtifactRegistry(ctx context.Context, arClient ARClientInterface, projectName string, ...) (string, error)
- func PrintStatus(ctx context.Context, status *spb.AgentStatus, compact bool)
- type ARClientInterface
- type ArtifactRegistryClient
- type VersionIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAgentEnabledAndRunning ¶
func CheckAgentEnabledAndRunning(ctx context.Context, agentName string, osType string, exec commandlineexecutor.Execute) (isEnabled bool, isRunning bool, err error)
CheckAgentEnabledAndRunning returns the status of the agent service.
Returns a tuple as (isEnabled, isRunning, error).
func CheckIAMRoles ¶
CheckIAMRoles checks if the required IAM roles are present.
func KernelVersion ¶
func KernelVersion(ctx context.Context, osType string, exec commandlineexecutor.Execute) (*spb.KernelVersion, error)
KernelVersion returns the kernel version data for the system.
func LatestVersionArtifactRegistry ¶
func LatestVersionArtifactRegistry(ctx context.Context, arClient ARClientInterface, projectName string, repositoryLocation string, repositoryName string, packageName string) (string, error)
LatestVersionArtifactRegistry returns latest version of the agent package from artifact registry.
func PrintStatus ¶
func PrintStatus(ctx context.Context, status *spb.AgentStatus, compact bool)
PrintStatus prints the status of the agent and the configured services to the console with appropriate formatting and coloring.
Types ¶
type ARClientInterface ¶
type ARClientInterface interface {
ListVersions(ctx context.Context, req *arpb.ListVersionsRequest, opts ...gax.CallOption) VersionIterator
}
ARClientInterface is an interface for the Google Artifact Registry client.
type ArtifactRegistryClient ¶
type ArtifactRegistryClient struct {
Client *artifactregistry.Client
}
ArtifactRegistryClient is a wrapper for the Google Artifact Registry client.
func (*ArtifactRegistryClient) ListVersions ¶
func (arClient *ArtifactRegistryClient) ListVersions(ctx context.Context, req *arpb.ListVersionsRequest, opts ...gax.CallOption) VersionIterator
ListVersions lists the versions of a package in Artifact Registry.
type VersionIterator ¶
VersionIterator is an interface for the Google Artifact Registry client.