Archive Storage CLI
    • PDF

    Archive Storage CLI

    • PDF

    Article summary

    Available in Classic and VPC

    This guide describes initial settings and brief instructions for Archive Storage CLI, which is compatible with OpenStack swift CLI.

    Initial settings

    This describes how to install and authenticate the Archive Storage CLI.

    Installation

    The installation command is as follows:

    • For Python 3.9 and below:
    pip install python-keystoneclient==3.17.0
    pip install python-swiftclient==3.6.0
    
    • For Python 3.10 and above:
    pip install python-keystoneclient==5.1.0
    pip install python-swiftclient==4.3.0
    
    Note

    See the following for related documents.

    Authentication

    The following describes how to set the authentication information.

    • Requests

      swift --os-auth-url https://kr.archive.ncloudstorage.com:5000/v3 --auth-version 3 \
            --os-username {access_key_id} --os-password {secret_key} \
            --os-user-domain-id {domain_id} --os-project-id {project_id} \
            auth
      
    • Results

      export OS_STORAGE_URL=https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
      export OS_AUTH_TOKEN={token}
      
      • Using the export command shown in the result enables you to declare OS_STORAGE_URL and OS_AUTH_TOKEN as environment variables to make service requests without re-authentications.

        export OS_STORAGE_URL=https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id}
        export OS_AUTH_TOKEN={token}
        
        swift list
        
      • Entering --os-storage-url and --os-auth-token options enables you to use it without using environment variables.

        swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
              --os-auth-token {token} \
              list
        
      • Rather than storing the service URL and token, you can use it by going through the authentication process for every request.

        swift --os-auth-url https://kr.archive.ncloudstorage.com:5000/v3 --auth-version 3 \
              --os-username {access_key_id} --os-password {secret_key} \
              --os-user-domain-id {domain_id} --os-project-id {project_id} \
              list
        
        Note

        Since an authentication request must be processed before every service request, it is not recommended.

    Commands

    This describes the Archive Storage CLI.

    Search container list

    The following is the command to search the container list.

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          list
    
    Note

    In the case of a sub account, you cannot use the search container list command (swift list).

    Search object list

    The following is the command to search the object list.

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          list {container}
    

    Upload object

    The following is the command to upload an object.

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          upload {container} --object-name {object} {local_file_path}
    

    Upload large objects

    When uploading large objects, a segment container and a manifest container should be separately designated for each.
    The following is an example of a command that uploads manifest files onto container1 and segment files onto container2.

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          upload container1 --object-name {object} {local_file_path} --segment-size {size} --segment-container container2 [--use-slo]
    

    To download, download objects uploaded onto container1.

    Upload all local paths

    The command for recursively uploading all local paths is as follows:

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          upload {container} {local_file_path}
    

    Delete object

    The command to delete objects by entering one or more objects is as follows:

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          delete {container} {object} [...]
    

    To delete objects starting with a specified prefix using the --prefix option, run the following command.

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          delete {container} --prefix {prefix}
    

    Delete containers

    The command to delete all objects in a container and then delete the container at the end is as follows:

    swift --os-storage-url https://kr.archive.ncloudstorage.com/v1/AUTH_{project_id} \
          --os-auth-token {token} \
          delete {container}
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.