Create a Container

A container is a storage compartment that provides a way to organize the data that’s stored in Oracle Cloud Infrastructure Object Storage Classic.

Before you send REST API calls to Oracle Cloud Infrastructure Object Storage Classic, you need a valid authentication token. If you obtained a token less than 30 minutes ago, then you can use that token. Otherwise, to get a new token, see Get an Authentication Token.

  1. Send a PUT request, specifying the name of the container. Specify the authentication token in the x-auth-token header.

    Syntax

    curl -i -X PUT \
      {accountRestEndpointURL}/{containerName} \
      -H 'x-auth-token: {authToken}'

    Sample Command

    curl -i -X PUT \
      https://myaccount.ocm.rack01.example.com/v1/Storage-myaccount/mycontainer \
      -H 'x-auth-token: AUTH_tk10d7cf10041726fa2e64652d975bbab0'
  2. In the response, look for 201 Created.
    HTTP/1.1 201 Created
    Server: nginx/1.10.2
    Date: Thu, 02 Aug 2018 22:46:23 GMT
    Content-Length: 0
    Connection: close
    X-Last-Modified-Timestamp: 1533249983.19669
    X-Trans-Id: txc19a77366846429a93634-005b6389bfga