Documentation
ΒΆ
Overview ΒΆ
Package fleetcontrol provides commands for managing New Relic Fleet Control resources.
The fleetcontrol package allows users to manage fleets and their associated entities through the New Relic CLI. It supports operations such as creating, updating, and deleting fleets, as well as managing fleet members.
Package fleetcontrol Typed flag accessors for each command - provides type-safe, zero-hardcoded-string access to flags
IMPORTANT: This file is MANUALLY MAINTAINED following a strict pattern. When adding a new command: 1. Create the YAML config file in configs/ (e.g., fleet_foo_bar.yaml) 2. Create the handler file (e.g., fleet_foo_bar.go) 3. Add typed flag accessors here following the existing pattern:
- Create a <CommandName>Flags struct with fields matching your YAML flags
- Create a method on *FlagValues that returns the struct
- Use fv.GetString(), fv.GetStringSlice(), fv.GetBool(), etc. to retrieve values
4. Register the handler in command_fleet.go's appropriate init function
Example pattern:
type MyCommandFlags struct {
FlagName string
}
func (fv *FlagValues) MyCommand() MyCommandFlags {
return MyCommandFlags{
FlagName: fv.GetString("flag-name"),
}
}
Index ΒΆ
- Variables
- func BuildCommand(def CommandDefinition, handler CommandHandler) *cobra.Command
- func GetOrganizationID(providedOrgID string) string
- func MapConfigurationMode(modeStr string) (fleetcontrol.GetConfigurationMode, error)
- func MapManagedEntityType(typeStr string) (fleetcontrol.FleetControlManagedEntityType, error)
- func MapOperatingSystemType(osStr string) (fleetcontrol.FleetControlOperatingSystemType, error)
- func MapScopeType(typeStr string) (fleetcontrol.FleetControlEntityScope, error)
- func ParseAgentSpec(agentSpec string) (fleetcontrol.FleetControlAgentInput, error)
- func ParseTags(tagStrings []string) ([]fleetcontrol.FleetControlTagInput, error)
- func PrintConfigurationDeleteSuccess(id string) error
- func PrintConfigurationSuccess(result interface{}) error
- func PrintDeleteBulkSuccess(results []FleetDeleteResponseWrapper) error
- func PrintDeleteSuccess(id string) error
- func PrintDeploymentDeleteSuccess(id string) error
- func PrintDeploymentSuccess(result interface{}) error
- func PrintError(err error) error
- func PrintFleetListSuccess(fleets []FleetEntityOutput) error
- func PrintFleetSuccess(fleet *FleetEntityOutput) error
- func PrintMemberSuccess(result interface{}) error
- func ValidateAgentVersionsForFleet(fleetID string, agents []fleetcontrol.FleetControlAgentInput) error
- type AddMembersFlags
- type AddVersionFlags
- type CommandConfig
- type CommandDefinition
- type CommandHandler
- type ConfigurationDeleteResponseWrapper
- type ConfigurationResponseWrapper
- type CreateConfigurationFlags
- type CreateDeploymentFlags
- type CreateFlags
- type DeleteConfigurationFlags
- type DeleteDeploymentFlags
- type DeleteFlags
- type DeleteVersionFlags
- type DeployFlags
- type DeploymentDeleteResponseWrapper
- type DeploymentResponseWrapper
- type EntityOutput
- type ErrorResponse
- type FlagDefinition
- type FlagValues
- func (fv *FlagValues) AddMembers() AddMembersFlags
- func (fv *FlagValues) AddVersion() (AddVersionFlags, error)
- func (fv *FlagValues) Create() CreateFlags
- func (fv *FlagValues) CreateConfiguration() (CreateConfigurationFlags, error)
- func (fv *FlagValues) CreateDeployment() CreateDeploymentFlags
- func (fv *FlagValues) Delete() DeleteFlags
- func (fv *FlagValues) DeleteConfiguration() DeleteConfigurationFlags
- func (fv *FlagValues) DeleteDeployment() DeleteDeploymentFlags
- func (fv *FlagValues) DeleteVersion() DeleteVersionFlags
- func (fv *FlagValues) Deploy() DeployFlags
- func (fv *FlagValues) Get() GetFlags
- func (fv *FlagValues) GetBool(name string) bool
- func (fv *FlagValues) GetConfiguration() GetConfigurationFlags
- func (fv *FlagValues) GetFile(name string) (string, error)
- func (fv *FlagValues) GetInt(name string) int
- func (fv *FlagValues) GetManaged() GetManagedFlags
- func (fv *FlagValues) GetString(name string) string
- func (fv *FlagValues) GetStringArray(name string) []string
- func (fv *FlagValues) GetStringSlice(name string) []string
- func (fv *FlagValues) GetUnassigned() GetUnassignedFlags
- func (fv *FlagValues) GetVersions() GetVersionsFlags
- func (fv *FlagValues) Has(name string) bool
- func (fv *FlagValues) ListMembers() ListMembersFlags
- func (fv *FlagValues) RemoveMembers() RemoveMembersFlags
- func (fv *FlagValues) Search() SearchFlags
- func (fv *FlagValues) Update() UpdateFlags
- func (fv *FlagValues) UpdateDeployment() UpdateDeploymentFlags
- type FleetDeleteResponseWrapper
- type FleetEntityOutput
- type FleetListResponseWrapper
- type FleetMemberEntityWithoutTags
- type FleetMembersResultWithoutTags
- type FleetResponseWrapper
- type GetConfigurationFlags
- type GetFlags
- type GetManagedFlags
- type GetUnassignedFlags
- type GetVersionsFlags
- type ListMembersFlags
- type MemberResponseWrapper
- type RemoveMembersFlags
- type SearchFlags
- type UpdateDeploymentFlags
- type UpdateFlags
- type ValidationRules
Constants ΒΆ
This section is empty.
Variables ΒΆ
var ( // Command represents the fleetcontrol command Command = &cobra.Command{ Use: "fleetcontrol", Short: "Manage New Relic Fleet Control resources", Long: `The fleetcontrol command provides subcommands for managing Fleet Control resources. Fleet Control allows you to organize and manage collections of entities such as hosts and Kubernetes clusters.`, } )
Functions ΒΆ
func BuildCommand ΒΆ
func BuildCommand(def CommandDefinition, handler CommandHandler) *cobra.Command
BuildCommand creates a cobra command from a CommandDefinition This sets up all flags, validation, and wires up the handler
Parameters:
- def: The command definition from YAML
- handler: The function that implements the command logic
Returns:
- A fully configured cobra.Command
func GetOrganizationID ΒΆ
GetOrganizationID retrieves the organization ID from the provided value or fetches it from the API. This is used by commands that need an organization ID but make it optional in their flags.
Parameters:
- providedOrgID: The organization ID provided by the user (may be empty)
Returns:
- The organization ID (either provided or fetched)
func MapConfigurationMode ΒΆ
func MapConfigurationMode(modeStr string) (fleetcontrol.GetConfigurationMode, error)
MapConfigurationMode converts a validated mode string to the client library type. This function should ONLY be called after YAML validation has confirmed the value is allowed.
Parameters:
- modeStr: The mode string (already validated by framework)
Returns:
- The corresponding GetConfigurationMode
- Error if the mode is not recognized (should never happen after YAML validation)
func MapManagedEntityType ΒΆ
func MapManagedEntityType(typeStr string) (fleetcontrol.FleetControlManagedEntityType, error)
MapManagedEntityType converts a validated managed entity type string to the client library type. This function should ONLY be called after YAML validation has confirmed the value is allowed.
Parameters:
- typeStr: The managed entity type string (already validated by framework)
Returns:
- The corresponding FleetControlManagedEntityType
- Error if the type is not recognized (should never happen after YAML validation)
func MapOperatingSystemType ΒΆ
func MapOperatingSystemType(osStr string) (fleetcontrol.FleetControlOperatingSystemType, error)
MapOperatingSystemType converts a validated operating system type string to the client library type. This function should ONLY be called after YAML validation has confirmed the value is allowed.
Parameters:
- osStr: The operating system type string (already validated by framework)
Returns:
- The corresponding FleetControlOperatingSystemType
- Error if the type is not recognized (should never happen after YAML validation)
func MapScopeType ΒΆ
func MapScopeType(typeStr string) (fleetcontrol.FleetControlEntityScope, error)
MapScopeType converts a validated scope type string to the client library type. This function should ONLY be called after YAML validation has confirmed the value is allowed.
Parameters:
- typeStr: The scope type string (already validated by framework)
Returns:
- The corresponding FleetControlEntityScope
- Error if the type is not recognized (should never happen after YAML validation)
func ParseAgentSpec ΒΆ
func ParseAgentSpec(agentSpec string) (fleetcontrol.FleetControlAgentInput, error)
ParseAgentSpec parses an agent specification string into a FleetControlAgentInput struct. Agent specs are used to define agent configurations for deployments.
Format: "AgentType:Version:ConfigVersionID1,ConfigVersionID2,..."
- AgentType: The type of agent (e.g., NRInfra, NRDOT)
- Version: The agent version (e.g., 1.70.0, 2.0.0)
- ConfigVersionIDs: Comma-separated list of configuration version IDs
Parameters:
- agentSpec: Agent specification string to parse
Returns:
- FleetControlAgentInput struct
- Error if format is invalid
Example:
agent, err := ParseAgentSpec("NRInfra:1.70.0:version1,version2")
// Returns: {AgentType: "NRInfra", Version: "1.70.0", ConfigurationVersionList: [{ID: "version1"}, {ID: "version2"}]}
func ParseTags ΒΆ
func ParseTags(tagStrings []string) ([]fleetcontrol.FleetControlTagInput, error)
ParseTags converts tag strings in the format "key:value1,value2" into FleetControlTagInput structs. Tags are used to organize and categorize fleet resources.
Format: Each tag string should be "key:value1,value2" where:
- key: The tag key (required, cannot be empty)
- value1,value2: Comma-separated values for this key (required, cannot be empty)
Parameters:
- tagStrings: Array of tag strings to parse
Returns:
- Array of FleetControlTagInput structs
- Error if any tag has invalid format
Example:
tags, err := ParseTags([]string{"env:prod,staging", "team:platform"})
// Returns: [{Key: "env", Values: ["prod", "staging"]}, {Key: "team", Values: ["platform"]}]
func PrintConfigurationDeleteSuccess ΒΆ
PrintConfigurationDeleteSuccess outputs successful configuration delete operation with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- id: The ID of the deleted configuration
Returns:
- Error from printJSON (typically nil)
func PrintConfigurationSuccess ΒΆ
func PrintConfigurationSuccess(result interface{}) error
PrintConfigurationSuccess outputs successful configuration data wrapped with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- result: The configuration result to wrap and print
Returns:
- Error from printJSON (typically nil)
func PrintDeleteBulkSuccess ΒΆ
func PrintDeleteBulkSuccess(results []FleetDeleteResponseWrapper) error
PrintDeleteBulkSuccess outputs successful bulk delete operations as a list. Each element in the list has status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- results: The list of delete results to print
Returns:
- Error from printJSON (typically nil)
func PrintDeleteSuccess ΒΆ
PrintDeleteSuccess outputs successful delete operation with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- id: The ID of the deleted fleet
Returns:
- Error from printJSON (typically nil)
func PrintDeploymentDeleteSuccess ΒΆ
PrintDeploymentDeleteSuccess outputs successful deployment delete operation with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- id: The ID of the deleted deployment
Returns:
- Error from printJSON (typically nil)
func PrintDeploymentSuccess ΒΆ
func PrintDeploymentSuccess(result interface{}) error
PrintDeploymentSuccess outputs successful deployment data wrapped with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- result: The deployment result to wrap and print
Returns:
- Error from printJSON (typically nil)
func PrintError ΒΆ
PrintError outputs an error as JSON with "status" and "error" keys. This allows errors to be parsed by consumers expecting JSON output. Uses custom JSON marshaling to ensure field order: status first, then error.
Parameters:
- err: The error to print
Returns:
- Error from output.Print (typically nil)
func PrintFleetListSuccess ΒΆ
func PrintFleetListSuccess(fleets []FleetEntityOutput) error
PrintFleetListSuccess outputs a successful list of fleets wrapped with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- fleets: The list of fleet entities to wrap and print
Returns:
- Error from printJSON (typically nil)
func PrintFleetSuccess ΒΆ
func PrintFleetSuccess(fleet *FleetEntityOutput) error
PrintFleetSuccess outputs successful fleet data wrapped with status and error fields. This provides a consistent response structure: status="success", error="", <fleet fields> Uses custom JSON marshaling to preserve field order.
Parameters:
- fleet: The fleet entity output to wrap and print
Returns:
- Error from printJSON (typically nil)
func PrintMemberSuccess ΒΆ
func PrintMemberSuccess(result interface{}) error
PrintMemberSuccess outputs successful member operation data wrapped with status and error fields. Uses custom JSON marshaling to preserve field order.
Parameters:
- result: The member operation result to wrap and print
Returns:
- Error from printJSON (typically nil)
func ValidateAgentVersionsForFleet ΒΆ
func ValidateAgentVersionsForFleet(fleetID string, agents []fleetcontrol.FleetControlAgentInput) error
ValidateAgentVersionsForFleet validates that agent versions are compatible with the fleet type. The "*" wildcard version is only allowed for KUBERNETESCLUSTER fleets, not HOST fleets.
Parameters:
- fleetID: The ID of the fleet to validate against
- agents: The agent configurations to validate
Returns:
- Error if validation fails (e.g., "*" used with HOST fleet)
Types ΒΆ
type AddMembersFlags ΒΆ
AddMembersFlags provides typed access to 'add' (members) command flags
type AddVersionFlags ΒΆ
type AddVersionFlags struct {
ConfigurationID string
OrganizationID string
ConfigurationFilePath string // File content from path
ConfigurationContent string // Inline content
}
AddVersionFlags provides typed access to 'add' (configuration versions) command flags
type CommandConfig ΒΆ
type CommandConfig struct {
Commands []CommandDefinition `yaml:"commands"`
}
CommandConfig represents the entire command configuration It contains all command definitions loaded from YAML files
func LoadCommandConfig ΒΆ
func LoadCommandConfig() (*CommandConfig, error)
LoadCommandConfig loads and parses all command configuration YAML files This reads from the embedded configs directory Config file names match their handler file names (e.g., fleet_management_create.yaml)
Returns:
- CommandConfig containing all command definitions
- Error if loading or parsing fails
type CommandDefinition ΒΆ
type CommandDefinition struct {
Name string `yaml:"name"` // Command name (e.g., "create", "update")
Short string `yaml:"short"` // Short one-line description
Long string `yaml:"long"` // Detailed multi-line description
Example string `yaml:"example"` // Usage examples
Flags []FlagDefinition `yaml:"flags"` // Command flags
}
CommandDefinition represents a single command definition from YAML Each command has metadata (name, description, examples) and flag definitions
func GetCommandDefinition ΒΆ
func GetCommandDefinition(config *CommandConfig, name string) *CommandDefinition
GetCommandDefinition finds a command definition by name This is used to look up specific commands from the loaded configuration
Parameters:
- config: The loaded command configuration
- name: The command name to find
Returns:
- The command definition, or nil if not found
type CommandHandler ΒΆ
type CommandHandler func(cmd *cobra.Command, args []string, flags *FlagValues) error
CommandHandler is a function that handles command execution All command handlers must match this signature
Parameters:
- cmd: The cobra command being executed
- args: Positional arguments (rarely used in this CLI)
- flags: Validated flag values accessible through typed accessors
Returns:
- Error if command execution fails
type ConfigurationDeleteResponseWrapper ΒΆ
type ConfigurationDeleteResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
ID string `json:"id,omitempty"`
}
ConfigurationDeleteResponseWrapper wraps configuration delete result with consistent status and error fields.
type ConfigurationResponseWrapper ΒΆ
type ConfigurationResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
Result interface{} `json:"result,omitempty"`
}
ConfigurationResponseWrapper wraps configuration output with consistent status and error fields. Used for create, add-version, and get operations on configurations.
type CreateConfigurationFlags ΒΆ
type CreateConfigurationFlags struct {
Name string
AgentType string
ManagedEntityType string
OperatingSystem string
OrganizationID string
ConfigurationFilePath string // File content from path
ConfigurationContent string // Inline content
}
CreateConfigurationFlags provides typed access to 'create' (configuration) command flags
type CreateDeploymentFlags ΒΆ
type CreateDeploymentFlags struct {
FleetID string
Name string
Agent []string
AgentType string
AgentVersion string
ConfigurationVersionIDs []string
Description string
Tags []string
}
CreateDeploymentFlags provides typed access to 'create' (deployment) command flags
type CreateFlags ΒΆ
type CreateFlags struct {
Name string
ManagedEntityType string
Description string
Product string
OrganizationID string
OperatingSystem string
Tags []string
}
CreateFlags provides typed access to 'create' command flags
type DeleteConfigurationFlags ΒΆ
DeleteConfigurationFlags provides typed access to 'delete' (configuration) command flags
type DeleteDeploymentFlags ΒΆ
type DeleteDeploymentFlags struct {
DeploymentID string
}
DeleteDeploymentFlags provides typed access to 'delete' (deployment) command flags
type DeleteFlags ΒΆ
DeleteFlags provides typed access to 'delete' command flags
type DeleteVersionFlags ΒΆ
DeleteVersionFlags provides typed access to 'delete' (configuration versions) command flags
type DeployFlags ΒΆ
DeployFlags provides typed access to 'deploy' (deployment) command flags
type DeploymentDeleteResponseWrapper ΒΆ
type DeploymentDeleteResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
ID string `json:"id,omitempty"`
}
DeploymentDeleteResponseWrapper wraps deployment delete result with consistent status and error fields.
type DeploymentResponseWrapper ΒΆ
type DeploymentResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
Result interface{} `json:"result,omitempty"`
}
DeploymentResponseWrapper wraps deployment output with consistent status and error fields. Used for create and update operations on deployments.
type EntityOutput ΒΆ
type EntityOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Domain string `json:"domain"`
Tags []entities.EntityTag `json:"tags,omitempty"`
}
EntityOutput is a simplified representation of an entity
type ErrorResponse ΒΆ
ErrorResponse represents an error response with consistent field ordering. Status field comes first, followed by error message.
type FlagDefinition ΒΆ
type FlagDefinition struct {
Name string `yaml:"name"` // Flag name (e.g., "name", "id")
Type string `yaml:"type"` // Data type: string, int, bool, stringSlice, stringArray, file
Required bool `yaml:"required"` // Whether this flag is required
Default interface{} `yaml:"default"` // Default value if not provided
Description string `yaml:"description"` // Help text for this flag
Validation *ValidationRules `yaml:"validation,omitempty"` // Optional validation rules
}
FlagDefinition represents a single flag definition from YAML Flags define the command-line arguments a command accepts
type FlagValues ΒΆ
type FlagValues struct {
// contains filtered or unexported fields
}
FlagValues provides dynamic, validated access to flag values This is passed to command handlers and provides type-safe flag access
func (*FlagValues) AddMembers ΒΆ
func (fv *FlagValues) AddMembers() AddMembersFlags
AddMembers returns typed flags for the 'add' (members) command
func (*FlagValues) AddVersion ΒΆ
func (fv *FlagValues) AddVersion() (AddVersionFlags, error)
AddVersion returns typed flags for the 'add' (configuration versions) command
func (*FlagValues) Create ΒΆ
func (fv *FlagValues) Create() CreateFlags
Create returns typed flags for the 'create' command
func (*FlagValues) CreateConfiguration ΒΆ
func (fv *FlagValues) CreateConfiguration() (CreateConfigurationFlags, error)
CreateConfiguration returns typed flags for the 'create' (configuration) command
func (*FlagValues) CreateDeployment ΒΆ
func (fv *FlagValues) CreateDeployment() CreateDeploymentFlags
CreateDeployment returns typed flags for the 'create' (deployment) command
func (*FlagValues) Delete ΒΆ
func (fv *FlagValues) Delete() DeleteFlags
Delete returns typed flags for the 'delete' command
func (*FlagValues) DeleteConfiguration ΒΆ
func (fv *FlagValues) DeleteConfiguration() DeleteConfigurationFlags
DeleteConfiguration returns typed flags for the 'delete' (configuration) command
func (*FlagValues) DeleteDeployment ΒΆ
func (fv *FlagValues) DeleteDeployment() DeleteDeploymentFlags
DeleteDeployment returns typed flags for the 'delete' (deployment) command
func (*FlagValues) DeleteVersion ΒΆ
func (fv *FlagValues) DeleteVersion() DeleteVersionFlags
DeleteVersion returns typed flags for the 'delete' (configuration versions) command
func (*FlagValues) Deploy ΒΆ
func (fv *FlagValues) Deploy() DeployFlags
Deploy returns typed flags for the 'deploy' (deployment) command
func (*FlagValues) Get ΒΆ
func (fv *FlagValues) Get() GetFlags
Get returns typed flags for the 'get' command
func (*FlagValues) GetBool ΒΆ
func (fv *FlagValues) GetBool(name string) bool
GetBool retrieves a validated bool flag value by name Values are cached after first retrieval for performance
Parameters:
- name: The flag name
Returns:
- The bool value of the flag
func (*FlagValues) GetConfiguration ΒΆ
func (fv *FlagValues) GetConfiguration() GetConfigurationFlags
GetConfiguration returns typed flags for the 'get' (configuration) command
func (*FlagValues) GetFile ΒΆ
func (fv *FlagValues) GetFile(name string) (string, error)
GetFile retrieves file content from a file path (strict file reading only) This method requires a valid file path and errors if the file doesn't exist. For inline content, use separate -content flags with GetString instead. Values are cached after first retrieval for performance
Parameters:
- name: The flag name
Returns:
- The file content
- Error if file doesn't exist or reading fails
Example:
// User must provide a valid file path: // --configuration-file-path ./config.json (reads file) // For inline content, use --configuration-content flag instead
func (*FlagValues) GetInt ΒΆ
func (fv *FlagValues) GetInt(name string) int
GetInt retrieves a validated int flag value by name Values are cached after first retrieval for performance
Parameters:
- name: The flag name
Returns:
- The int value of the flag
func (*FlagValues) GetManaged ΒΆ
func (fv *FlagValues) GetManaged() GetManagedFlags
GetManaged returns typed flags for the 'get-managed' (entities) command
func (*FlagValues) GetString ΒΆ
func (fv *FlagValues) GetString(name string) string
GetString retrieves a validated string flag value by name Values are cached after first retrieval for performance
Parameters:
- name: The flag name
Returns:
- The string value of the flag
func (*FlagValues) GetStringArray ΒΆ
func (fv *FlagValues) GetStringArray(name string) []string
GetStringArray retrieves a validated string array flag value by name Values are cached after first retrieval for performance Note: stringArray type does NOT auto-split on commas (only splits when flag is repeated)
Parameters:
- name: The flag name
Returns:
- The string array value of the flag
func (*FlagValues) GetStringSlice ΒΆ
func (fv *FlagValues) GetStringSlice(name string) []string
GetStringSlice retrieves a validated string slice flag value by name Values are cached after first retrieval for performance Note: stringSlice type auto-splits on commas
Parameters:
- name: The flag name
Returns:
- The string slice value of the flag
func (*FlagValues) GetUnassigned ΒΆ
func (fv *FlagValues) GetUnassigned() GetUnassignedFlags
GetUnassigned returns typed flags for the 'get-unassigned' (entities) command
func (*FlagValues) GetVersions ΒΆ
func (fv *FlagValues) GetVersions() GetVersionsFlags
GetVersions returns typed flags for the 'list' (configuration versions) command
func (*FlagValues) Has ΒΆ
func (fv *FlagValues) Has(name string) bool
Has checks if a flag was explicitly provided by the user This is useful for distinguishing between a flag being omitted vs set to default value
Parameters:
- name: The flag name
Returns:
- true if the flag was provided, false otherwise
func (*FlagValues) ListMembers ΒΆ
func (fv *FlagValues) ListMembers() ListMembersFlags
ListMembers returns typed flags for the 'list' (members) command
func (*FlagValues) RemoveMembers ΒΆ
func (fv *FlagValues) RemoveMembers() RemoveMembersFlags
RemoveMembers returns typed flags for the 'remove' (members) command
func (*FlagValues) Search ΒΆ
func (fv *FlagValues) Search() SearchFlags
Search returns typed flags for the 'search' command
func (*FlagValues) Update ΒΆ
func (fv *FlagValues) Update() UpdateFlags
Update returns typed flags for the 'update' command
func (*FlagValues) UpdateDeployment ΒΆ
func (fv *FlagValues) UpdateDeployment() UpdateDeploymentFlags
UpdateDeployment returns typed flags for the 'update' (deployment) command
type FleetDeleteResponseWrapper ΒΆ
type FleetDeleteResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
ID string `json:"id,omitempty"`
}
FleetDeleteResponseWrapper wraps delete result with consistent status and error fields.
type FleetEntityOutput ΒΆ
type FleetEntityOutput struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type,omitempty"`
ManagedEntityType string `json:"managedEntityType,omitempty"`
OperatingSystem *fleetcontrol.FleetControlOperatingSystem `json:"operatingSystem,omitempty"`
Scope fleetcontrol.FleetControlScopedReference `json:"scope,omitempty"`
Tags []fleetcontrol.FleetControlTag `json:"tags,omitempty"`
Product []string `json:"product,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
}
FleetEntityOutput is a filtered representation of a fleet entity containing only user-relevant fields. This removes verbose metadata and internal structures that aren't useful for command output.
func FilterFleetEntity ΒΆ
func FilterFleetEntity(entity fleetcontrol.FleetControlFleetEntityResult) *FleetEntityOutput
FilterFleetEntity creates a filtered output from a fleet entity, removing verbose fields. This keeps only the fields that correspond to command flags or essential metadata.
Parameters:
- entity: The fleet entity from the API response
Returns:
- Filtered fleet entity output
func FilterFleetEntityFromEntityManagement ΒΆ
func FilterFleetEntityFromEntityManagement(entity fleetcontrol.EntityManagementFleetEntity, showTags bool) *FleetEntityOutput
FilterFleetEntityFromEntityManagement creates a filtered output from an EntityManagementFleetEntity. This is used for the get and search commands which use the EntityManagement API.
Parameters:
- entity: The fleet entity from EntityManagement API
- showTags: Whether to include tags in the output
Returns:
- Filtered fleet entity output
type FleetListResponseWrapper ΒΆ
type FleetListResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
Fleets []FleetEntityOutput `json:"fleets,omitempty"`
}
FleetListResponseWrapper wraps a list of fleet entities with consistent status and error fields.
type FleetMemberEntityWithoutTags ΒΆ
type FleetMemberEntityWithoutTags struct {
ID string `json:"id"`
Metadata fleetcontrol.FleetControlMetadata `json:"metadata"`
Name string `json:"name"`
Scope fleetcontrol.FleetControlScopedReference `json:"scope"`
Type string `json:"type"`
}
FleetMemberEntityWithoutTags is a filtered version of FleetControlFleetMemberEntityResult that excludes the Tags field, used when --include-tags is false
type FleetMembersResultWithoutTags ΒΆ
type FleetMembersResultWithoutTags struct {
Items []FleetMemberEntityWithoutTags `json:"items"`
NextCursor string `json:"nextCursor,omitempty"`
}
FleetMembersResultWithoutTags is the result structure without tags
type FleetResponseWrapper ΒΆ
type FleetResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
ManagedEntityType string `json:"managedEntityType,omitempty"`
OperatingSystem *fleetcontrol.FleetControlOperatingSystem `json:"operatingSystem,omitempty"`
Scope *fleetcontrol.FleetControlScopedReference `json:"scope,omitempty"`
Tags []fleetcontrol.FleetControlTag `json:"tags,omitempty"`
Product []string `json:"product,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt int64 `json:"createdAt,omitempty"`
UpdatedAt int64 `json:"updatedAt,omitempty"`
}
FleetResponseWrapper wraps fleet entity output with consistent status and error fields. Used to provide a uniform response structure across all fleet management commands.
type GetConfigurationFlags ΒΆ
type GetConfigurationFlags struct {
ConfigurationID string
OrganizationID string
Mode string
Version int
}
GetConfigurationFlags provides typed access to 'get' (configuration) command flags
type GetFlags ΒΆ
type GetFlags struct {
FleetID string
}
GetFlags provides typed access to 'get' command flags
type GetManagedFlags ΒΆ
GetManagedFlags provides typed access to 'get-managed' (entities) command flags
type GetUnassignedFlags ΒΆ
GetUnassignedFlags provides typed access to 'get-unassigned' (entities) command flags
type GetVersionsFlags ΒΆ
GetVersionsFlags provides typed access to 'list' (configuration versions) command flags
type ListMembersFlags ΒΆ
ListMembersFlags provides typed access to 'list' (members) command flags
type MemberResponseWrapper ΒΆ
type MemberResponseWrapper struct {
Status string `json:"status"`
Error string `json:"error"`
Result interface{} `json:"result,omitempty"`
}
MemberResponseWrapper wraps member operation output with consistent status and error fields. Used for add-members and remove-members operations.
type RemoveMembersFlags ΒΆ
RemoveMembersFlags provides typed access to 'remove' (members) command flags
type SearchFlags ΒΆ
SearchFlags provides typed access to 'search' command flags
type UpdateDeploymentFlags ΒΆ
type UpdateDeploymentFlags struct {
DeploymentID string
Name string
Description string
Agent []string
ConfigurationVersionIDs []string
Tags []string
}
UpdateDeploymentFlags provides typed access to 'update' (deployment) command flags
type UpdateFlags ΒΆ
UpdateFlags provides typed access to 'update' command flags
type ValidationRules ΒΆ
type ValidationRules struct {
AllowedValues []string `yaml:"allowed_values,omitempty"` // List of acceptable values
CaseInsensitive bool `yaml:"case_insensitive,omitempty"` // Whether to ignore case when validating
}
ValidationRules defines validation constraints for a flag These rules are enforced by the framework before the command handler runs
Source Files
ΒΆ
- command.go
- command_flags_generated.go
- command_fleet.go
- command_framework.go
- fleet_configuration_create.go
- fleet_configuration_delete.go
- fleet_configuration_get.go
- fleet_configuration_version_add.go
- fleet_configuration_version_delete.go
- fleet_configuration_version_list.go
- fleet_deployment_create.go
- fleet_deployment_delete.go
- fleet_deployment_deploy.go
- fleet_deployment_update.go
- fleet_entities_get_managed.go
- fleet_entities_get_unassigned.go
- fleet_management_create.go
- fleet_management_delete.go
- fleet_management_get.go
- fleet_management_search.go
- fleet_management_update.go
- fleet_members_add.go
- fleet_members_list.go
- fleet_members_remove.go
- helpers.go