feat(fleetcontrol): Add a new package to support managing Fleet Control Ops#1794
Merged
pranav-new-relic merged 17 commits intomainfrom Feb 19, 2026
Merged
feat(fleetcontrol): Add a new package to support managing Fleet Control Ops#1794pranav-new-relic merged 17 commits intomainfrom
pranav-new-relic merged 17 commits intomainfrom
Conversation
…, configuration, deployments and more Adds complete fleet control functionality with a modular, YAML-driven command framework: Fleet Management: - Create, get, update, delete, and search fleet entities - Bulk delete support with --ids flag - Type-safe flag accessors and declarative validation Configuration Management: - Create, get, delete configurations - Add, list, and delete configuration versions - Split file flags: --configuration-file-path (recommended) and --configuration-content (testing) - Renamed --entity-guid to --configuration-guid in get-versions for clarity - Empty results validation with meaningful error messages Deployment & Members: - Create and update fleet deployments - Add and remove fleet members with ring support Response Format: - Consistent JSON output with status/error fields across all commands - Search and get-configuration return raw data for table formatting - Field ordering preserved (status first, error second) Framework Features: - YAML configs embedded at compile time with validation - Generated typed flag structs for compile-time safety - Shared helpers for output formatting and type mapping - Strict file reading (file type flags require valid file paths) Documentation: - Comprehensive README with command examples and jq usage - Validation testing guide with JSON response examples - Complete API reference for all commands Go Client Integration: - Uses local client via go.mod replace directive - Fixed delete operations to handle empty API responses
Restructured README.md to be more intuitive and user-friendly: - Added clear introduction with Fleet Control capabilities overview - Added comprehensive prerequisites section with: - Required environment variables (NEW_RELIC_API_KEY, NEW_RELIC_ACCOUNT_ID) - Step-by-step guide for getting credentials - Build and verification instructions - Added "Available Commands" quick reference section listing all commands - Reorganized content flow: 1. Introduction and directory structure 2. Commands quick reference 3. Prerequisites and setup 4. Detailed command reference 5. Response formats and jq usage 6. Validation rules 7. Troubleshooting - Added practical workflow examples for common use cases - Added debug mode instructions for troubleshooting - Added authentication error troubleshooting - Kept experimental commands (deployment and member management) clearly marked
Add new deployment delete command: - Created fleet_deployment_delete.yaml config - Created fleet_deployment_delete.go handler - Added DeleteDeploymentFlags to command_flags_generated.go - Added PrintDeploymentDeleteSuccess helper function - Registered command in command_fleet.go Enhanced README: - Added comprehensive table of contents with all sections - Updated command hierarchy to include delete deployment - Added documentation for delete deployment command - Updated directory structure listing
- Add individual command entries under each category in TOC - Update all command headers to include full syntax in backticks - Format: `fleetcontrol <resource> <action>` for better discoverability - All 20 commands now have consistent header formatting
0534250 to
3491c3d
Compare
Removed integration and unit tests that reference commands that no longer exist: - command_fleet_config_test.go (cmdFleetGetConfiguration, cmdFleetAddVersion) - command_fleet_test.go (cmdFleetAddMembers, cmdFleetRemoveMembers, cmdFleetCreateConfiguration) - command_configuration_integration_test.go - command_fleet_integration_test.go - command_deployment_members_integration_test.go - command_test.go These tests were causing build failures with undefined references.
…tag conversion
Changed from struct literal to direct type conversion when converting
EntityManagementTag to FleetControlTag, as both types have identical
structure. This resolves gosimple linter warning S1016.
- Before: fleetcontrol.FleetControlTag{Key: tag.Key, Values: tag.Values}
- After: fleetcontrol.FleetControlTag(tag)
shashank-reddy-nr
previously approved these changes
Feb 19, 2026
- Remove non-existent TOC entries (Building the CLI, For Developers, Recent Updates) - Condense Getting Your Credentials section for brevity - Add note about user capabilities in Verifying Setup section - Fix flag name: change --include-tags to --show-tags in fleet members list command
- Add missing periods at end of complete sentences in validation and optional flag descriptions - Improve consistency of punctuation throughout the document - No content changes, only punctuation fixes for better readability
nr-developer-toolkit
approved these changes
Feb 19, 2026
Contributor
nr-developer-toolkit
left a comment
There was a problem hiding this comment.
looks good to me too, @pranav-new-relic
Member
Author
|
Thank you @shashank-reddy-nr @nr-developer-toolkit ; shipping this 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a complete set of Fleet Control commands for managing New Relic's Fleet Management system, providing CLI access to fleets, configurations, deployments, and entity management.
🚀 Features
Core Command Structure
Implemented a new
fleetcontrolpackage with a YAML-driven command generation framework that provides:Command Categories
1. Fleet Management (
newrelic fleetcontrol fleet)create- Create a new fleet with name and optional descriptionget- Retrieve fleet details by GUIDupdate- Update fleet name and/or descriptiondelete- Delete a fleet by GUIDsearch- Search fleets with optional name filter2. Fleet Members (
newrelic fleetcontrol fleet members)add-members- Add entities to a fleetremove-members- Remove entities from a fleetlist-members- List all members of a fleet with filtering and pagination3. Configuration Management (
newrelic fleetcontrol configuration)create- Create fleet configuration with schema and variablesget- Retrieve configuration by GUID or entity GUIDdelete- Delete a configurationadd-version- Add new version to configurationlist-versions- List all versions of a configurationdelete-version- Delete a specific version4. Deployment Management (
newrelic fleetcontrol deployment)create- Create new deployment with agent type and version specificationupdate- Update deployment parametersdelete- Remove a deploymentdeploy- Execute deployment with confirmation/force options5. Entity Management (
newrelic fleetcontrol entities)get-managed- List entities managed by Fleet Controlget-unassigned- List entities not assigned to any fleetTechnical Highlights
YAML-Driven Command Framework
Commands are automatically generated from YAML definitions with:
📝 Documentation
README.md
Comprehensive documentation including: