Bulk Import Devices#1
Merged
Merged
Conversation
…mmands - Add industry as required field for location creation - Add industry to location get output and update command - Add location.industry to bulk import column mapping - Add -d/--data option to create/update commands for quick JSON testing: - locations create/update - devices create/update - users create/update - companies create/update - registry create
- Change primary_users array to user_id string - Remove timezone from location defaults (not required)
- Add --include-metadata flag to list command for fetching device metadata - Add -m, --metadata option to create command for key-value metadata pairs - Add -m, --metadata option to update command for updating metadata
- Add device.device_type_id mapping option to column mapper - Fetch device templates by ID and extract device attributes: - device_category from template.category - sensor_use from device_use where default=true - sensor_type from meta where key='device_type' - Update createDevice to use template values as fallbacks - Make sensor_type optional when device_type_id is mapped
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.
This pull request introduces major enhancements to the CLI commands for bulk import, devices, companies, and locations, focusing on improved flexibility, support for JSON input/output, and more robust error handling and validation. The changes enable users to provide complex data via JSON, override fields via CLI options, and include metadata and additional fields in device and company creation and updates.
Bulk Import Command Additions
bulk importcommand insrc/commands/bulk.tsfor importing locations and devices from CSV files, supporting interactive mapping, mapping file save/load, dry-run validation, CLI/default location fields, and JSON output.Device Command Enhancements
--data), device metadata (--metadata), and new device fields (user/company ID, sensor type/use, device category) to the device create/update commands. Individual CLI options override JSON fields, with validation for required fields. [1] [2]--include-metadataflag to the device list command to include device metadata in the response. [1] [2] [3]Company Command Enhancements
--data) for company creation and update, with CLI options overriding JSON fields. Validation ensures required fields are present, and error handling is improved for missing/invalid data. [1] [2] [3] [4]Location Command Enhancements
industryan explicit option (required unless using--data).industryfield in location details output.General Improvements