Creating a Container

Creates a container in Oracle Cloud Infrastructure Object Storage Classic, and sets the metadata and container-level replication policy for the container.

Required Role: To complete this task, you must have the Storage_ReadWriteGroup or Storage_Administrator role. If one of these roles isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Syntax

java -jar ftmcli.jar create-container container [optional arguments] 

Parameters and Optional Arguments

The following parameters are specific to this command:

Parameter Description
container

The name of the container that you’re creating

The following optional arguments are specific to this command:

Argument Description

-R retries, --retries retries

Indicates the number of times that the request must be retried in case of failure. You can set the default value in the configuration file by updating the value of the variable retries. See Setting Up Configuration Files.

-a, --archive

Sets the storage class of the container to Archive. (Archive support not available on Oracle Cloud at Customer)

-e, --server-side-encryption

Enables server-side encryption for the container by setting the policy to BASE_ENCRYPTION.

You can enable server-side encryption for a container only at the time of creating it, not later.

-M metadata_name:metadata_value, --metadata metadata_name:metadata_value

Sets the container metadata. You can repeat the use of this option multiple times in a command to set or update multiple metadata headers.

You can set the container ACLs and quotas using this option.

-C custom_metadata_name:custom_metadata_value, --custom-metadata custom_metadata_name:custom_metadata_value

Sets the custom metadata for the container. You can repeat the use of this option multiple times in a command to set or update multiple custom metadata headers. FTM CLI adds a prefix X-Container-Meta- to the custom metadata name.

You can set the custom metadata headers and CORS headers using this option.

--source-region source_region

Indicates the primary DC code of your container.

--target-region target_region

Indicates the replication DC code of the container in the same region. You can repeat the use of this argument multiple times in a command to set multiple replication DCs.

--ext-source-region-url external_target_region_url

Indicates the URL of the container in an external region from which the objects would be replicated into your container. You can repeat the use of this argument multiple times in a command to set multiple external source DCs.

--ext-target-region-url external_target_region_url

Indicates the URL of the container in an external region into which the objects in your container must be replicated. You can repeat the use of this argument multiple times in a command to set multiple external target DCs.

When you run a command, you can either pass the authentication parameters with the command, or let the CLI pick up the required parameters from environment variables or the configuration file. See Authentication.

Examples

  • To create the container myTestArchiveContainer of the Archive storage class:

    java -jar ftmcli.jar create-container myTestArchiveContainer --archive
  • To create the container myTestContainer, and enable server-side encryption:

    java -jar ftmcli.jar create-container myTestContainer --server-side-encryption
  • For the example values of metadata to include the --metadata and --custom-metadata arguments in the command, see Setting Container Metadata.

  • For the example values to set the container-level replication policy, see Setting a Container-Specific Replication Policy.