mc alias import
The mc alias import command imports an alias configuration from a JSON file or STDIN.
The command reads the configuration and adds it as a new alias or updates an existing one.
Syntax
The following command imports an alias configuration from a file:
mc alias import myaistor < myaistor.jsonYou can also pipe a configuration from another command:
cat myaistor.json | mc alias import myaistorThe mc alias import command has the following syntax:
mc [GLOBALFLAGS] alias import ALIAS [PATH]- Brackets
[]indicate optional parameters. - Parameters sharing a line are mutually dependent.
- Parameters separated using the pipe
|operator are mutually exclusive.
Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.
Parameters
ALIAS
Required
The name of the alias to assign to the imported configuration.
PATH
Optional
The full path to the JSON object representing the alias configuration to import.
Mutually exclusive with the STDIN parameter.
STDIN
Optional
If you omit PATH, the command reads the JSON object from the Standard Input (STDIN).
Mutually exclusive with the PATH parameter.
Global flags
This command supports any of the global flags.
Behavior
JSON format
The JSON object must have the following format:
{
"url" : "https://hostname:port",
"accessKey": "<STRING>",
"secretKey": "<STRING>",
"api": "s3v4",
"path": "auto"
}You can use the mc alias export command to export an existing alias from the local host configuration.
Alternatively, you can manually extract the necessary JSON fields from the mc configuration file.
Examples
Import an alias using standard input
The following example imports a custom alias for the myaistor.min.io sandbox. You can modify this example to use user credentials you have already created or validated as existing on the sandbox:
echo '
{
"url": "https://myaistor.min.io",
"accessKey": "minioadmin",
"secretKey": "minioadmin",
"api": "s3v4",
"path": "auto"
}' | mc alias import myaistor-minioadminS3 compatibility
The mc command-line tool is built for compatibility with the AWS S3 API and is tested with MinIO AIStor and AWS S3 for expected functionality and behavior.
MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.
While mc commands may work as documented, any such usage is at your own risk.