Add upload for a device or fleet - #32
Merged
Merged
Conversation
A file argument lands at its base name. A directory argument uploads its contents with paths relative to it, skipping hidden entries.
The server now serves no_space, rejected, failed, no_code, and updating in run_state alongside the run states, so the column is STATE and shows each value with spaces.
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.
Adds
superstack upload <imei|fleet_id> <file> ...and shows one device state indevice list.PUT /devices/{imei}/filesorPUT /fleets/{id}/filesas{"files": {"<path>": "<base64>"}}. The output says how many files went to which device, or to how many devices in the fleet, and that they arrive at the next check-in.RUN STATEcolumn is nowSTATE. It showsno space,rejected,failed,no code,updating,running,stopped,crashed, or-.--jsonpassesrun_statethrough unchanged.Evidence: built with
CGO_ENABLED=0.gofmt -l,go mod tidy -diff,go vet, andgo test ./...pass.TestUploadchecks the request body and the skipped hidden files, andTestDeviceListchecks every state in the table and in JSON.Needs the server change that adds the two routes and serves the states,
60a5c20ondev.