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 BundlerBuilder
- type ConfigValidator
- type Discoverer
- type LicenseKeyFetcher
- type MockBundleInstaller
- type MockBundler
- type MockContext
- type MockLicenseKeyFetcher
- type Prompter
- type RecipeBundleInstaller
- type RecipeBundler
- type RecipeFileFetcher
- type RecipeFilterRunner
- type RecipeInstall
- type RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) Build() *RecipeInstall
- func (rib *RecipeInstallBuilder) WithAgentValidationError(e error) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithBundleInstaller(bundlerInstaller RecipeBundleInstaller) *RecipeInstallBuilder
- func (rib *RecipeInstallBuilder) WithBundler(bundler RecipeBundler) *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) 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) WithRecipeExecutionResult(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 RecipeRepository
- 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 BundlerBuilder ¶ added in v0.43.0
type BundlerBuilder struct {
// contains filtered or unexported fields
}
func NewBundlerBuilder ¶ added in v0.43.0
func NewBundlerBuilder() *BundlerBuilder
func (*BundlerBuilder) Build ¶ added in v0.43.0
func (bb *BundlerBuilder) Build() RecipeBundler
func (*BundlerBuilder) WithAdditionalRecipe ¶ added in v0.43.0
func (bb *BundlerBuilder) WithAdditionalRecipe(name string) *BundlerBuilder
func (*BundlerBuilder) WithCoreRecipe ¶ added in v0.43.0
func (bb *BundlerBuilder) WithCoreRecipe(name string) *BundlerBuilder
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 MockBundleInstaller ¶ added in v0.43.0
type MockBundleInstaller struct { Error error // contains filtered or unexported fields }
func NewMockBundleInstaller ¶ added in v0.43.0
func NewMockBundleInstaller() *MockBundleInstaller
func (*MockBundleInstaller) InstallContinueOnError ¶ added in v0.43.0
func (mbi *MockBundleInstaller) InstallContinueOnError(bundle *recipes.Bundle, assumeYes bool)
func (*MockBundleInstaller) InstallStopOnError ¶ added in v0.43.0
func (mbi *MockBundleInstaller) InstallStopOnError(bundle *recipes.Bundle, assumeYes bool) error
func (*MockBundleInstaller) InstalledRecipesCount ¶ added in v0.43.0
func (mbi *MockBundleInstaller) InstalledRecipesCount() int
type MockBundler ¶ added in v0.43.0
type MockBundler struct {
// contains filtered or unexported fields
}
func (*MockBundler) CreateAdditionalGuidedBundle ¶ added in v0.43.0
func (mb *MockBundler) CreateAdditionalGuidedBundle() *recipes.Bundle
func (*MockBundler) CreateAdditionalTargetedBundle ¶ added in v0.43.0
func (mb *MockBundler) CreateAdditionalTargetedBundle(names []string) *recipes.Bundle
func (*MockBundler) CreateCoreBundle ¶ added in v0.43.0
func (mb *MockBundler) CreateCoreBundle() *recipes.Bundle
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 RecipeBundleInstaller ¶ added in v0.43.0
type RecipeBundler ¶ added in v0.43.0
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) WithBundleInstaller ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithBundleInstaller(bundlerInstaller RecipeBundleInstaller) *RecipeInstallBuilder
func (*RecipeInstallBuilder) WithBundler ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithBundler(bundler RecipeBundler) *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) 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) WithRecipeExecutionResult ¶ added in v0.43.0
func (rib *RecipeInstallBuilder) WithRecipeExecutionResult(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 RecipeRepository ¶ added in v0.28.0
type RecipeRepository interface {
FindAll(m types.DiscoveryManifest) []types.OpenInstallationRecipe
}
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.