1
0
mirror of https://github.com/minio/docs.git synced 2025-08-05 03:41:24 +03:00
Files
docs/source/reference/minio-mc/mc-alias-import.rst
Ravind Kumar 3a8768e85f DOCS-1071: mc.RELEASE.2023-11-15T22-45-58Z PARTIAL (#1075)
Partially addresses #1071 

Just documenting `mc alias import` and `mc alias export`, the former of
which we seem to have missed a year or so back.

Staged: 


http://192.241.195.202:9000/staging/DOCS-1071/linux/reference/minio-mc/mc-alias-import.html


http://192.241.195.202:9000/staging/DOCS-1071/linux/reference/minio-mc/mc-alias-export.html
2023-11-22 14:21:55 -05:00

2.9 KiB

mc alias import

minio

Table of Contents

mc alias import

Syntax

The mc alias import command imports an alias configuration from a JSON document.

You can use mc alias export to create the necessary JSON for import.

EXAMPLE

The following command imports an alias configuration from a JSON document:

mc alias import newalias ./credentials.json

Use mc alias list newalias <mc alias list> to confirm the import succeeded.

SYNTAX

The mc alias import command has the following syntax:

mc [GLOBALFLAGS] alias import ALIAS PATH|STDIN

Parameters

ALIAS

The name of the alias to assign to the imported configuration.

PATH

The full path to the JSON object representing the alias configuration to import.

Mutually exclusive with the ~mc alias import STDIN parameter.

STDIN

Directs the command to use the Standard Input (STDIN) as the source of the JSON object for import.

Mutually exclusive with the ~mc alias import PATH parameter.

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 <mc-configuration>.

Examples

Import an Alias Using Standard Input

The following example imports a custom alias for the play.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://play.min.io",
 "accessKey": "minioadmin",
 "secretKey": "minioadmin",
 "api": "s3v4",
 "path": "auto"
}' | mc alias import play-minioadmin

S3 Compatibility