Data-Object Operations

On This Page

To work with data, of any format, as a simple data object, first retrieve the container objects using the GET Container operation, and then use the following S3-like RESTful API object operations:

  • GET Object — retrieves an object from a container.

  • DELETE Object — deletes an object from a container.

  • PUT Object — adds a new object to a container, or appends data to an existing object. The option to append data is extension to the S3 PUT Object capabilities — see Appending Data.

  • POST Object — an alias of the PUT Object operation.

    Note
    Unlike S3, POST Object acts in the same way as PUT Object.

  • HEAD Object — retrieves the metadata of a data object.

Note
You can find examples of Simple Object Web-API data-object operation requests in the Ingesting and Consuming Files tutorial.

Appending Data

To append data to an existing container object, use a PUT Object operation (see PUT Object), and include the following header in the request:

Range: -1

Examples

The following example adds the string "The End" at the end of a "MyObject" object:

    PUT /mycontainer/MyObject HTTP/1.1
    Host: https://default-tenant.app.mycluster.iguazio.com:8443
    Content-Type: application/octet-stream
    X-v3io-session-key: e8bd4ca2-537b-4175-bf01-8c74963e90bf
    Range: -1
    
    "The End"
    
    import requests
    
    url = "https://default-tenant.app.mycluster.iguazio.com:8443/mycontainer/MyObject/"
    headers = {
                "Content-Type": "application-octet-stream",
                "X-v3io-session-key": "e8bd4ca2-537b-4175-bf01-8c74963e90bf",
                "Range": "-1"
              }
    payload = "The End"
    
    response = requests.put(url, data=payload, headers=headers)
    print(response.text)