Story #894
Updated by bmbouter over 9 years ago
This is designed to come after story #892, but this represents a consolidation of the The bindings and CLI which is independent of throughout the changes required different plugins needs to have the CLI work be integration with story #892. h3. The Plan One main area of work is getting plugins out of the business of needing to implement anything specific for uploads. The CLI code in platform Platform will provide a single command for "upload" that is not provided by plugins. plugins at all, but by the core platform. It will take the same options as the /import_upload API allows. Plugins will have a way to manifest the content names allows, and optional parameters the user is required to specify, along with help text docs for each of the to be used by the CLI. Plugin writers are not expected to provide any code for this, just manifests which will be used by platform. Each plugin type will document the content types it supports will document the way to use those fields specific to that content type. This single command will upload a file, using chunking if necessary. If all chunks are received correctly, then it performs the /import_upload automatically. A separate command to import a completed upload_id will not be provided by the CLI, but a recipe will CLI (but it could be documented where an done by using the same file and upload_id can be specified with a different repo name and the normal upload/offset/fast-forward behavior will allow the previously uploaded content to be imported into a separate repository without much data exchanged. API directly). If an unrecoverable error occurs, the user is shown a output of a command they can specify to attempt to restart a failed ID by upload_id. That takes the file and blindly uploads it again to that upload_id, and relies on the server to tell it the offset it should fast-forward to. Attempting to resume an upload_id that doesn't exist shows a reasonable error message to the user. h3. Benefits * Uploading becomes a single command that supports resume transparently. * All plugins will not have to do anything to support upload outside of the normal interfaces they need to make anyway, and specifying the content type upload manifest. anyway * The CLI will become more consistent and the code will be de-duplicated as its moved to platform. This will resolve problems that we have currently such as the upload commands for puppet and rpm are very different from each other for no good reason.