chef-import-cli reference
chef-import-cli
Chef Utility - Import Service API
Options
-h--helphelp for chef-import-cli
Default value:
false
chef-import-cli completion
Generate the autocompletion script for the specified shell
Synopsis
Generate the autocompletion script for chef-import-cli for the specified shell. See each sub-command’s help for details on how to use the generated script.
Options
-h--helphelp for completion
Default value:
false
See also
- chef-import-cli completion bash
- chef-import-cli completion fish
- chef-import-cli completion powershell
- chef-import-cli completion zsh
chef-import-cli completion bash
Generate the autocompletion script for bash
Synopsis
Generate the autocompletion script for the bash shell.
This script depends on the ‘bash-completion’ package. If it is not installed already, you can install it via your OS’s package manager.
To load completions in your current shell session:
source <(chef-import-cli completion bash)
To load completions for every new session, execute once:
Linux:
chef-import-cli completion bash > /etc/bash_completion.d/chef-import-cli
macOS:
chef-import-cli completion bash > $(brew --prefix)/etc/bash_completion.d/chef-import-cli
You will need to start a new shell for this setup to take effect.
completion-bash package
You must have the bash-completion package installed on your computer to run the completion bash subcommand.
To install and configure the package, see the Chef 360 Platform CLI documentation.
Usage
chef-import-cli completion bashOptions
-h--helphelp for bash
Default value:
false--no-descriptionsdisable completion descriptions
Default value:
false
See also
chef-import-cli completion fish
Generate the autocompletion script for fish
Synopsis
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
chef-import-cli completion fish | source
To load completions for every new session, execute once:
chef-import-cli completion fish > ~/.config/fish/completions/chef-import-cli.fish
You will need to start a new shell for this setup to take effect.
Usage
chef-import-cli completion fish [flags]Options
-h--helphelp for fish
Default value:
false--no-descriptionsdisable completion descriptions
Default value:
false
See also
chef-import-cli completion powershell
Generate the autocompletion script for powershell
Synopsis
Generate the autocompletion script for powershell.
To load completions in your current shell session:
chef-import-cli completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command to your powershell profile.
Usage
chef-import-cli completion powershell [flags]Options
-h--helphelp for powershell
Default value:
false--no-descriptionsdisable completion descriptions
Default value:
false
See also
chef-import-cli completion zsh
Generate the autocompletion script for zsh
Synopsis
Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
To load completions in your current shell session:
source <(chef-import-cli completion zsh)
To load completions for every new session, execute once:
Linux:
chef-import-cli completion zsh > "${fpath[1]}/_chef-import-cli"
macOS:
chef-import-cli completion zsh > $(brew --prefix)/share/zsh/site-functions/_chef-import-cli
You will need to start a new shell for this setup to take effect.
Usage
chef-import-cli completion zsh [flags]Options
-h--helphelp for zsh
Default value:
false--no-descriptionsdisable completion descriptions
Default value:
false
See also
chef-import-cli deregister-device
De-register a device
Synopsis
Use this operation to de-register a device
Usage
chef-import-cli deregister-device [flags]Options
--forceforce remove profile from local list of profiles, even on error from server
Default value:
false-f--formatto print response in format
Default value:
json-h--helphelp for deregister-device
Default value:
false--profilename for the profile of the new api-token
Default value:
default-v--verboseto show debug logs
Default value:
false
See also
chef-import-cli get-default-profile
Get default profile for request
Usage
chef-import-cli get-default-profile [flags]Options
-h--helphelp for get-default-profile
Default value:
false
See also
chef-import-cli importservice
Commands related to importservice
Options
-h--helphelp for importservice
Default value:
false
See also
- chef-import-cli importservice complete-import-process
- chef-import-cli importservice complete-multipart-upload
- chef-import-cli importservice create-import-process
- chef-import-cli importservice generate-sha256
- chef-import-cli importservice get-import-process-status
- chef-import-cli importservice get-multipart-presigned-url
- chef-import-cli importservice initiate-multipart-upload
- chef-import-cli importservice update-import-process-stage
- chef-import-cli importservice upload-backup
chef-import-cli importservice complete-import-process
Complete import process
Synopsis
Summary
Marks an import process as complete with either a success or failure result. This endpoint should be called after all import stages have been processed.
Note
When the result is ‘failure’, the errors array should contain details about what went wrong during the import process.
Errors
400 (Bad Request)
The request payload is malformed or missing required fields
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to complete import processes
404 (Not Found)
The specified import process does not exist
422 (Unprocessable Content)
The request payload does not meet validation requirements (e.g., invalid result value)
Usage
chef-import-cli importservice complete-import-process [flags]Options
--body--body-filePath to file in the local system containing valid body parameter value
--body-formatFormat of the --body or --body-file, options: json, yaml, toml
Default value:
json-e--exampleto show example request body
Default value:
false-f--example-formatFormat of the --example, options: json, yaml, toml
Default value:
json-n--example-numberExample number ranges from 1 to the number of examples present. If value is 0, it will show all examples
Default value:
0--formatto print response in format
Default value:
json-h--helphelp for complete-import-process
Default value:
false--importIdThe unique identifier for the import process. This is returned when initiating an import via the POST /process/{importType} endpoint.
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
Examples
The following examples show request bodies that you can submit with this command.
- Failure
{ "errors": [ "Failed to restore organization: invalid org structure", "User data validation failed: missing required fields" ], "result": "failure" } - Success
{ "errors": [], "result": "success" }
See also
chef-import-cli importservice complete-multipart-upload
Complete a multipart upload
Synopsis
Summary
Finalizes the multipart upload by submitting the ETag for every uploaded part. The service passes all ETags to S3/MinIO, which verifies their integrity and assembles the parts into a single logical object. The file is then available for the import worker to begin processing.
Note
- All parts from 1 to totalParts must be included with no gaps
- Parts must be provided in ascending partNumber order
- ETags must exactly match the values returned by S3/MinIO during each part upload
- S3/MinIO does not physically merge parts; they are stored as-is and served as a single object
- After a successful response the import worker will automatically begin processing
Errors
400 (Bad Request)
The request payload is malformed, uploadId is invalid, parts are missing or out of order
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to access this import process
404 (Not Found)
The specified import process does not exist
422 (Unprocessable Content)
The request payload does not meet validation requirements (e.g., incorrect part count, invalid ETag format)
Usage
chef-import-cli importservice complete-multipart-upload [flags]Options
--body--body-filePath to file in the local system containing valid body parameter value
--body-formatFormat of the --body or --body-file, options: json, yaml, toml
Default value:
json-e--exampleto show example request body
Default value:
false-f--example-formatFormat of the --example, options: json, yaml, toml
Default value:
json--formatto print response in format
Default value:
json-h--helphelp for complete-multipart-upload
Default value:
false--importIdThe unique identifier for the import process. This is returned when initiating an import via the POST /process/{importType} endpoint.
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
Examples
The following examples show request bodies that you can submit with this command.
- Default example
{ "parts": [ { "etag": "\"d8e8fca2dc0f896fd7cb4cb0031ba249\"", "partNumber": 1 }, { "etag": "\"b026324c6904b2a9cb4b88d6d61c81d1\"", "partNumber": 2 } ], "uploadId": "2~iOcFyO7jExMJ2JzLnBmCaVGrxoEIEhkU" }
See also
chef-import-cli importservice create-import-process
Initiate data import process
Synopsis
Summary
Initiates a data import process for the specified import type. Returns a signed upload URL that can be used to upload the import tarball to the platform’s storage.
Note
The upload URL is time-limited based on the ‘durationSeconds’ parameter. If the URL expires before the upload is complete, you can request a new URL by providing the same ‘filename’ parameter.
Errors
400 (Bad Request)
The request payload is malformed or missing required fields
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to perform import operations
422 (Unprocessable Content)
The request payload does not meet validation requirements (e.g., invalid sha256sum format)
Usage
chef-import-cli importservice create-import-process [flags]Options
--body--body-filePath to file in the local system containing valid body parameter value
--body-formatFormat of the --body or --body-file, options: json, yaml, toml
Default value:
json-e--exampleto show example request body
Default value:
false-f--example-formatFormat of the --example, options: json, yaml, toml
Default value:
json--formatto print response in format
Default value:
json-h--helphelp for create-import-process
Default value:
false--importTypeThe type of import to process. This determines how the uploaded data will be handled by the platform. Supported import types: - 'dsm-import': Declarative State Management import for migrating DSM data into Chef 360
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
Examples
The following examples show request bodies that you can submit with this command.
- Default example
{ "durationSeconds": 3600, "filename": "dsm-backup-2024-12-17.tar.gz", "sha256sum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }
See also
chef-import-cli importservice generate-sha256
Generate SHA256 checksum for a backup file
Synopsis
Generate SHA256 checksum for a .tar.gz backup file. This command reads the file in chunks to avoid loading the entire file into memory. The generated checksum can be used with the create-import-process command.
Example: chef-import-cli importservice generate-sha256 –file /path/to/backup.tar.gz
Usage
chef-import-cli importservice generate-sha256 [flags]Options
--filePath to the .tar.gz file (required)
--formatOutput format: text, json, or yaml
Default value:
text-h--helphelp for generate-sha256
Default value:
false
See also
chef-import-cli importservice get-import-process-status
Get import process status
Synopsis
Summary
Retrieves the current status of an import process by its unique identifier.
Note
Use this endpoint to monitor the progress of an import operation after initiating it via the POST /process/{importType} endpoint.
Errors
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to view import process status
404 (Not Found)
The specified import process does not exist
Usage
chef-import-cli importservice get-import-process-status [flags]Options
--formatto print response in format
Default value:
json-h--helphelp for get-import-process-status
Default value:
false--importIdThe unique identifier for the import process. This is returned when initiating an import via the POST /process/{importType} endpoint.
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
See also
chef-import-cli importservice get-multipart-presigned-url
Get a presigned URL for a single upload part
Synopsis
Summary
Generates a fresh presigned URL for uploading a single part of an active multipart upload session. Call this endpoint once per part to obtain the URL, then immediately upload the part via HTTP PUT to that URL.
The ETag value returned in the HTTP PUT response header must be saved by the CLI and submitted along with all other part ETags when calling the complete endpoint.
Note
- Part numbers must be within the range 1 to totalParts from the initiate response
- Presigned URLs are short-lived; request a fresh URL close to when you intend to upload
- If a URL expires before the upload completes, call this endpoint again for the same part number to obtain a new URL and retry the upload
Errors
400 (Bad Request)
The request payload is malformed, uploadId is invalid, or partNumber is out of range
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to access this import process
404 (Not Found)
The specified import process does not exist
422 (Unprocessable Content)
The request payload does not meet validation requirements
Usage
chef-import-cli importservice get-multipart-presigned-url [flags]Options
--body--body-filePath to file in the local system containing valid body parameter value
--body-formatFormat of the --body or --body-file, options: json, yaml, toml
Default value:
json-e--exampleto show example request body
Default value:
false-f--example-formatFormat of the --example, options: json, yaml, toml
Default value:
json--formatto print response in format
Default value:
json-h--helphelp for get-multipart-presigned-url
Default value:
false--importIdThe unique identifier for the import process. This is returned when initiating an import via the POST /process/{importType} endpoint.
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
Examples
The following examples show request bodies that you can submit with this command.
- Default example
{ "partNumber": 7, "uploadId": "2~iOcFyO7jExMJ2JzLnBmCaVGrxoEIEhkU" }
See also
chef-import-cli importservice initiate-multipart-upload
Initiate a multipart upload for large backup files
Synopsis
Summary
Initiates a multipart upload session for backup files larger than 5 GB. Returns an upload session ID and the total number of parts, along with the actual part size the server will use.
Note
- Part numbers are 1-based (first part is part number 1)
- The last part will be smaller than partSizeBytes
- If a presigned URL expires before upload, call the presign endpoint again for that part number to obtain a fresh URL
- S3/MinIO assembles parts into a single object on complete; no merging occurs
Errors
400 (Bad Request)
The request payload is malformed or missing required fields
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to perform import operations
422 (Unprocessable Content)
The request payload does not meet validation requirements (e.g., invalid sha256sum, fileSizeBytes below minimum, unsupported importType)
Usage
chef-import-cli importservice initiate-multipart-upload [flags]Options
--body--body-filePath to file in the local system containing valid body parameter value
--body-formatFormat of the --body or --body-file, options: json, yaml, toml
Default value:
json-e--exampleto show example request body
Default value:
false-f--example-formatFormat of the --example, options: json, yaml, toml
Default value:
json--formatto print response in format
Default value:
json-h--helphelp for initiate-multipart-upload
Default value:
false--importTypeThe type of import to process. This determines how the uploaded data will be handled by the platform. Supported import types: - 'dsm-import': Declarative State Management import for migrating DSM data into Chef 360
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
Examples
The following examples show request bodies that you can submit with this command.
- Default example
{ "fileSizeBytes": 11811160064, "filename": "chef-server-backup.tar.gz", "sha256sum": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }
See also
chef-import-cli importservice update-import-process-stage
Update import process stage
Synopsis
Summary
Updates the current stage of an import process. This endpoint is used to track the progress of an import operation through its various stages.
Note
The stage should be updated sequentially as the import process progresses through each phase of the import workflow.
Errors
400 (Bad Request)
The request payload is malformed or missing required fields
401 (Unauthorized)
Authentication credentials are missing or invalid
403 (Forbidden)
The user does not have permission to update import process stage
404 (Not Found)
The specified import process does not exist
422 (Unprocessable Content)
The request payload does not meet validation requirements (e.g., invalid stage value)
Usage
chef-import-cli importservice update-import-process-stage [flags]Options
--body--body-filePath to file in the local system containing valid body parameter value
--body-formatFormat of the --body or --body-file, options: json, yaml, toml
Default value:
json-e--exampleto show example request body
Default value:
false-f--example-formatFormat of the --example, options: json, yaml, toml
Default value:
json--formatto print response in format
Default value:
json-h--helphelp for update-import-process-stage
Default value:
false--importIdThe unique identifier for the import process. This is returned when initiating an import via the POST /process/{importType} endpoint.
--profilename of the profile to be used for cmd
Default value:
default--verboseto show debug logs
Default value:
false
Examples
The following examples show request bodies that you can submit with this command.
- Default example
{ "stage": "extracting" }
See also
chef-import-cli importservice upload-backup
Upload a backup file to Chef 360 using multipart upload
Synopsis
Upload a .tar.gz backup file to Chef 360 for migration.
Uses S3/MinIO multipart upload to support files of any size including those larger than 5 GB. The command handles splitting, uploading each part, and finalizing the upload automatically.
Example:
chef-import-cli importservice upload-backup
–file /path/to/chef-server-backup.tar.gz
–import-type dsm-import
–profile default
Usage
chef-import-cli importservice upload-backup [flags]Options
--filePath to the .tar.gz backup file to upload (required)
-h--helphelp for upload-backup
Default value:
false--import-typeImport type (default: dsm-import)
Default value:
dsm-import--profileProfile name from credentials file
Default value:
default--verboseEnable debug logging
Default value:
false
See also
chef-import-cli list-profile-names
Get the list of profile names available
Usage
chef-import-cli list-profile-names [flags]Options
-h--helphelp for list-profile-names
Default value:
false
See also
chef-import-cli register-device
register a device and get api-token for device login
Usage
chef-import-cli register-device [flags]Options
--cafilepath to ca file
--device-namename of the device
Default value:
device-f--formatto print response in format
Default value:
json-h--helphelp for register-device
Default value:
false-i--insecureinsecure skip verify
Default value:
false--overwritethis flag is used to overwrite the old profile if the profile for profile name provided already exists
Default value:
false--profile-namename for the profile of the new api-token
--urltenant url
-v--verboseto show debug logs
Default value:
false
See also
chef-import-cli set-default-profile
Set default profile for request
Usage
chef-import-cli set-default-profile [flags]Options
-h--helphelp for set-default-profile
Default value:
false
See also
chef-import-cli version
Chef Import CLI version
Usage
chef-import-cli version [flags]Options
-h--helphelp for version
Default value:
false