Documentation
¶
Index ¶
- Variables
- func NewPrompter() *ux.PromptUIPrompter
- type AgentValidator
- type BundleInstaller
- func (bi *BundleInstaller) InstallBundleRecipe(bundleRecipe *recipes.BundleRecipe, assumeYes bool) error
- func (bi *BundleInstaller) InstallContinueOnError(bundle *recipes.Bundle, assumeYes bool)
- func (bi *BundleInstaller) InstallStopOnError(bundle *recipes.Bundle, assumeYes bool) error
- func (bi *BundleInstaller) InstalledRecipesCount() int
- type ConfigValidator
- type Discoverer
- type LicenseKeyFetcher
- type MockContext
- type MockLicenseKeyFetcher
- type MockRecipeDetector
- type Prompter
- type RecipeBundleInstaller
- type RecipeBundler
- type RecipeDetectionResult
- type RecipeFileFetcher
- type RecipeFilterRunner
- type RecipeInstall
- type RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) Build() *RecipeInstall
- func (rib *RecipeInstallBuilder) WithAgentValidationError(e error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithConfigValidatorError(err error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithDiscovererError(err error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithDiscovererValidatorError(err error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithFetchRecipesVal(fetchRecipesVal []*types.OpenInstallationRecipe) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithLibraryVersion(libraryVersion string) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithLicenseKeyFetchResult(result error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithOutput(value string) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithProgressIndicator(i *ux.SpinnerProgressIndicator) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithRecipeDetectionResult(detectionResult *recipes.RecipeDetectionResult) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithRecipeExecutionError(err error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithRecipeValidationError(e error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithRecipeVarValues(vars map[string]string, err error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithStatusReporter(statusReporter *execution.MockStatusSubscriber) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithTargetRecipeName(name string) *RecipeInstallBuilder
- type RecipeInstallFunc
- type RecipeInstaller
- type RecipeStatusDetector
- type RecipeValidator
- type RecipeVarPreparer
- type ServiceLicenseKeyFetcher
- type StatusReporter
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "install", Short: "Install New Relic.", PreRun: client.RequireClient, RunE: func(cmd *cobra.Command, args []string) error { ic := types.InstallerContext{ AssumeYes: assumeYes, LocalRecipes: localRecipes, RecipeNames: recipeNames, RecipePaths: recipePaths, } logLevel := configAPI.GetLogLevel() config.InitFileLogger(logLevel) err := assertProfileIsValid() if err != nil { log.Fatal(err) return nil } i := NewRecipeInstaller(ic, client.NRClient) if err := i.Install(); err != nil { if err == types.ErrInterrupt { return nil } if _, ok := err.(*types.UpdateRequiredError); ok { return nil } if e, ok := err.(*nrErrors.PaymentRequiredError); ok { return e } fallbackErrorMsg := fmt.Sprintf("\nWe encountered an issue during the installation: %s.", err) fallbackHelpMsg := "If this problem persists, visit the documentation and support page for additional help here at https://one.newrelic.com/-/06vjAeZLKjP." fmt.Println(fallbackErrorMsg) fmt.Println(fallbackHelpMsg) fmt.Print("\n\n") log.Debug(fallbackErrorMsg) } return nil }, }
Command represents the install command.
Functions ¶
func NewPrompter ¶ added in v0.43.0
func NewPrompter() *ux.PromptUIPrompter
Types ¶
type AgentValidator ¶ added in v0.43.0
type BundleInstaller ¶ added in v0.43.0
type BundleInstaller struct {
// contains filtered or unexported fields
}
func NewBundleInstaller ¶ added in v0.43.0
func NewBundleInstaller(ctx context.Context, manifest *types.DiscoveryManifest, recipeInstallerInterface RecipeInstaller, statusReporter StatusReporter) *BundleInstaller
func (*BundleInstaller) InstallBundleRecipe ¶ added in v0.43.0
func (bi *BundleInstaller) InstallBundleRecipe(bundleRecipe *recipes.BundleRecipe, assumeYes bool) error
func (*BundleInstaller) InstallContinueOnError ¶ added in v0.43.0
func (bi *BundleInstaller) InstallContinueOnError(bundle *recipes.Bundle, assumeYes bool)
func (*BundleInstaller) InstallStopOnError ¶ added in v0.43.0
func (bi *BundleInstaller) InstallStopOnError(bundle *recipes.Bundle, assumeYes bool) error
func (*BundleInstaller) InstalledRecipesCount ¶ added in v0.43.0
func (bi *BundleInstaller) InstalledRecipesCount() int
type ConfigValidator ¶ added in v0.28.0
type Discoverer ¶ added in v0.28.0
type Discoverer interface {
Discover(context.Context) (*types.DiscoveryManifest, error)
}
Discoverer is responsible for discovering information about the host system.
type LicenseKeyFetcher ¶ added in v0.20.6
func NewServiceLicenseKeyFetcher ¶ added in v0.20.6
func NewServiceLicenseKeyFetcher(client recipes.NerdGraphClient) LicenseKeyFetcher
type MockContext ¶ added in v0.43.0
type MockContext struct { }
func (MockContext) Deadline ¶ added in v0.43.0
func (m MockContext) Deadline() (deadline time.Time, ok bool)
func (MockContext) Done ¶ added in v0.43.0
func (m MockContext) Done() <-chan struct{}
func (MockContext) Err ¶ added in v0.43.0
func (m MockContext) Err() error
func (MockContext) Value ¶ added in v0.43.0
func (m MockContext) Value(key interface{}) interface{}
type MockLicenseKeyFetcher ¶ added in v0.20.6
func NewMockLicenseKeyFetcher ¶ added in v0.20.6
func NewMockLicenseKeyFetcher() *MockLicenseKeyFetcher
func (*MockLicenseKeyFetcher) FetchLicenseKey ¶ added in v0.20.6
func (f *MockLicenseKeyFetcher) FetchLicenseKey(ctx context.Context) (string, error)
type MockRecipeDetector ¶ added in v0.49.11
type MockRecipeDetector struct { Err error // contains filtered or unexported fields }
func (*MockRecipeDetector) AddRecipeDetectionResult ¶ added in v0.49.11
func (mrd *MockRecipeDetector) AddRecipeDetectionResult(detectionResult *recipes.RecipeDetectionResult)
func (*MockRecipeDetector) GetDetectedRecipes ¶ added in v0.49.11
func (mrd *MockRecipeDetector) GetDetectedRecipes() (recipes.RecipeDetectionResults, recipes.RecipeDetectionResults, error)
type RecipeBundleInstaller ¶ added in v0.43.0
type RecipeBundler ¶ added in v0.43.0
type RecipeDetectionResult ¶ added in v0.49.11
type RecipeDetectionResult struct { Recipe *types.OpenInstallationRecipe Status execution.RecipeStatusType DurationMs int64 }
type RecipeFileFetcher ¶ added in v0.28.0
type RecipeFileFetcher interface { FetchRecipeFile(recipeURL *url.URL) (*types.OpenInstallationRecipe, error) LoadRecipeFile(filename string) (*types.OpenInstallationRecipe, error) }
type RecipeFilterRunner ¶ added in v0.28.0
type RecipeFilterRunner interface { RunFilterAll(ctx context.Context, r []types.OpenInstallationRecipe, m *types.DiscoveryManifest) []types.OpenInstallationRecipe EnsureDoesNotFilter(ctx context.Context, r []types.OpenInstallationRecipe, m *types.DiscoveryManifest) error }
type RecipeInstall ¶ added in v0.43.0
type RecipeInstall struct { types.InstallerContext // contains filtered or unexported fields }
func NewRecipeInstaller ¶
func NewRecipeInstaller(ic types.InstallerContext, nrClient *newrelic.NewRelic) *RecipeInstall
func (*RecipeInstall) Install ¶ added in v0.43.0
func (i *RecipeInstall) Install() error
type RecipeInstallBuilder ¶ added in v0.43.0
type RecipeInstallBuilder struct {
// contains filtered or unexported fields
}
func NewRecipeInstallBuilder ¶ added in v0.43.0
func NewRecipeInstallBuilder() *RecipeInstallBuilder
func (*RecipeInstallBuilder) Build ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) Build() *RecipeInstall
func (*RecipeInstallBuilder) WithAgentValidationError ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithAgentValidationError(e error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithConfigValidatorError ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithConfigValidatorError(err error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithDiscovererError ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithDiscovererError(err error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithDiscovererValidatorError ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithDiscovererValidatorError(err error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithFetchRecipesVal ¶ added in v0.49.0
func (rib *RecipeInstallBuilder) WithFetchRecipesVal(fetchRecipesVal []*types.OpenInstallationRecipe) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithLibraryVersion ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithLibraryVersion(libraryVersion string) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithLicenseKeyFetchResult ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithLicenseKeyFetchResult(result error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithOutput ¶ added in v0.47.0
func (rib *RecipeInstallBuilder) WithOutput(value string) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithProgressIndicator ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithProgressIndicator(i *ux.SpinnerProgressIndicator) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithRecipeDetectionResult ¶ added in v0.49.11
func (rib *RecipeInstallBuilder) WithRecipeDetectionResult(detectionResult *recipes.RecipeDetectionResult) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithRecipeExecutionError ¶ added in v0.49.11
func (rib *RecipeInstallBuilder) WithRecipeExecutionError(err error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithRecipeValidationError ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithRecipeValidationError(e error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithRecipeVarValues ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithRecipeVarValues(vars map[string]string, err error) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithStatusReporter ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithStatusReporter(statusReporter *execution.MockStatusSubscriber) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithTargetRecipeName ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithTargetRecipeName(name string) *RecipeInstallBuilder
type RecipeInstallFunc ¶ added in v0.28.0
type RecipeInstallFunc func(ctx context.Context, i *RecipeInstall, m *types.DiscoveryManifest, r *types.OpenInstallationRecipe, recipes []types.OpenInstallationRecipe) error
type RecipeInstaller ¶
type RecipeInstaller interface { Install() error // contains filtered or unexported methods }
RecipeInstaller wrapper responsible for performing recipe validation, installation, and reporting install status
type RecipeStatusDetector ¶ added in v0.49.11
type RecipeStatusDetector interface {
GetDetectedRecipes() (recipes.RecipeDetectionResults, recipes.RecipeDetectionResults, error)
}
type RecipeValidator ¶ added in v0.28.0
type RecipeValidator interface {
ValidateRecipe(context.Context, types.DiscoveryManifest, types.OpenInstallationRecipe, types.RecipeVars) (entityGUID string, err error)
}
RecipeValidator validates installation of a recipe.
type RecipeVarPreparer ¶ added in v0.28.0
type RecipeVarPreparer interface {
Prepare(m types.DiscoveryManifest, r types.OpenInstallationRecipe, assumeYes bool, licenseKey string) (types.RecipeVars, error)
}
type ServiceLicenseKeyFetcher ¶ added in v0.20.6
type ServiceLicenseKeyFetcher struct { LicenseKey string // contains filtered or unexported fields }
relies on the Nerdgraph service
func (*ServiceLicenseKeyFetcher) FetchLicenseKey ¶ added in v0.20.6
func (f *ServiceLicenseKeyFetcher) FetchLicenseKey(ctx context.Context) (string, error)
type StatusReporter ¶ added in v0.43.0
type StatusReporter interface {
ReportStatus(status execution.RecipeStatusType, event execution.RecipeStatusEvent)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.