Skip to content

Commit

Permalink
[EDU-4447] refactor: update Edge Storage operations (#1407)
Browse files Browse the repository at this point in the history
* refactor: update operations - Edge Storage EN

* refactor: update operations - Edge Storage PT
  • Loading branch information
MarianaAguilera authored Dec 20, 2024
1 parent ca519e1 commit 5c533a3
Show file tree
Hide file tree
Showing 2 changed files with 352 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,91 +88,226 @@ You can determine if the content is retrieved from the root of the bucket or fro

## Operations

An operation refers to any exchang of data between a client and **Edge Storage**. Any and all actions related to buckets and objects, such as create, delete, list, and update, is considered an operation. Each time one of these methods is used, either through the API or the S3 protocol, an operation is logged.
An operation refers to any data exchange between a client and **Edge Storage**. All actions related to buckets and objects, such as create, delete, list, and update, are considered an operation. Each time one of these methods is used, an operation is logged through the API or the S3 protocol.

All operations are available in the [Azion API](https://api.azion.com/#565230b1-5f75-49e5-b025-0dc9e271883d) documentation.
The current release of the **Edge Storage** offers operations listed below, depending on whether the [Azion API](#azion-api-operations) or the [S3 protocol](#s3-operations) is used.

### Azion API operations

:::tip
All the API operations are available in the [Azion API](https://api.azion.com/#565230b1-5f75-49e5-b025-0dc9e271883d) documentation.
:::

| Class | Operation name | HTTP method |
|-------|-----------------------|-------------|
| A | [ListObjects](#listobjects) | `GET` |
| A | [CreateBucket](#createbucket) | `POST` |
| A | [ListBuckets](#listbuckets) | `GET` |
| A | [UpdateBucket](#updatebucket) | `PATCH` |
| B | [GetObject](#getobject) | `GET` |
| C | [PostObject](#postobject) | `POST` |
| C | [PutObject](#putobject) | `PUT` |
| C | [DeleteObject](#deleteobject) | `DELETE` |
| C | [DeleteBucket](#deletebucket) | `DELETE` |

:::note
Class C operations are free. If an operation falls out of the scope of class C operations, it'll be billed to your account according to the established costs. For more information on operation and class charges, see the [Pricing](/en/documentation/products/pricing/) page.
Class C operations are free. If an operation falls out of the scope of class C operations, it'll be billed to your account according to the established costs. For more operation and class charges information, see the [Pricing](/en/documentation/products/pricing/) page.
:::

The current release of the **Edge Storage** offers the following operations:
#### ListObjects

| Class | Operation name | HTTP method | S3 capability |
| --- | --- | --- | --- |
| A | [ListObjects](#listobjects) | `GET` | `listFiles`<br />`listBuckets`* |
| A | [CreateBucket](#createbucket) | `POST` ||
| A | [ListBuckets](#listbuckets) | `GET` | `listAllBucketNames` |
| A | [UpdateBucket](#updatebucket) | `PATCH` ||
| B | [GetObject](#getobject) | `GET` | `readFiles` |
| C | [PostObject](#postobject) | `POST` ||
| C | [PutObject](#putobject) | `PUT` | `writeFiles` |
| C | [DeleteObject](#deleteobject) | `DELETE` | `deleteFiles` |
| C | [DeleteBucket](#deletebucket) | `DELETE` ||
Retrieves a list of objects loaded into a bucket.

> \* If `listBuckets` is enabled, when attempting to retrieve files that aren't in the bucket using an S3 credential, the proper `404 Not Found` status response returns instead of a `403 Forbidden` status. Find out more about S3 capabilities in [S3 protocol compatibility](#s3-protocol-compatibility).
This operation returns details of all objects in the bucket, including the size in bytes and the timestamp of the last modification.

### PostObject
#### CreateBucket
Creates a new bucket for an account.

Uploads an object to a bucket.
#### ListBuckets

Retrieves a list of buckets associated with an account.

#### UpdateBucket

Modifies bucket information.

Use this operation to change the access permissions to the objects in the bucket. Buckets cannot be renamed with this operation.

#### GetObject

Retrieves an object from a bucket.

:::tip
For API cURL requests, add the `-O -J` options to the command to download the object to your device using this operation.
:::

#### PostObject

Uploads an object to a bucket. Objects are limited to a maximum size of 20 MB.

:::tip
For API cURL requests, use the `--data-binary` option in the command to send raw binary data, such as images or complex files without undergoing URL encoding.
:::

For the **Azion API**, you can specify the MIME type of the object being sent in the body using the `Content-Type` header. For example, objects with the `.txt` extension should contain the `Content-Type: text/plain` header. If the MIME type isn't specified, **Edge Storage** will attempt to interpret the file type based on the file extension. Alternatively, use the `application/octet-stream` MIME type to indicate that the data is a binary stream and the server should handle it as raw binary data.

Sending a new object with an object key that already exists in the bucket will replace the previous object.
Sending a new object with an object key already in the bucket will replace the previous object.

### PutObject
#### PutObject

Uploads an object to a bucket.

Sending a new object with an object key that already existed in the bucket will replace the previous object.

### DeleteObject
#### DeleteObject

Removes an object from a bucket.

When you delete an object that is being served on the edge, it'll immediately stop being served and will no longer be listed in the bucket.
When you delete an object being served on the edge, it'll immediately stop being served and will no longer be listed in the bucket.

:::caution[warning]
For S3 credential access, this operation is allowed through the capability `deleteFiles`, which requires the `writeFiles` capability to be enabled.
:::

### DeleteBucket
#### DeleteBucket

Removes a bucket from an account.

Buckets that contain objects cannot be deleted. After removing the final object from a bucket, there is a 24-hour period before the bucket can be deleted.

### GetObject

Retrieves an object from a bucket.
### S3 operations

:::tip
For API cURL requests, add the `-O -J` options to the command to download the object to your device using this operation.
Read more on [How to access Edge Storage using the S3 protocol](/en/documentation/products/store/storage/s3-protocol-for-edge-storage/).
:::

### ListObjects
| Class | Operation name |
| --- | --- |
| A | [ListBuckets](#listbuckets) |
| A | [HeadBucket](#headbucket) |
| A | [ListMultipartUploads](#listmultipartuploads) |
| A | [ListObjects](#listobjects) |
| A | [ListObjectsV2](#listobjectsv2) |
| B | [CopyObject](#copyobject) |
| B | [GetObject](#getobject) |
| B | [HeadObject](#headobject) |
| C | [DeleteObject](#deletebbject) |
| C | [DeleteObjects](#deleteobjects) |
| C | [AbortMultipartUpload](#abortmultipartupload) |
| C | [CompleteMultipartUpload](#completemultipartupload) |
| C | [CopyObject](#copyobject) |
| C | [CreateMultipartUpload](#createmultipartupload) |
| C | [ListParts](#listparts) |
| C | [PutObject](#putobject) |
| C | [UploadPart](#uploadpart) |

Retrieves a list of objects loaded into a bucket.
:::note
Class C operations are free. If an operation falls out of the scope of class C operations, it'll be billed to your account according to the established costs. For more operation and class charges information, see the [Pricing](/en/documentation/products/pricing/) page.
:::

This operation returns details of all objects in the bucket, including the size in bytes and the timestamp of the last modification.
> If `listBuckets` is enabled, when attempting to retrieve files that aren't in the bucket using an S3 credential, the proper `404 Not Found` status response returns instead of a `403 Forbidden` status. Find out more about S3 capabilities in [S3 protocol compatibility](#s3-protocol-compatibility).
### ListBuckets
#### ListBuckets

Retrieves a list of buckets associated with an account.

### CreateBucket
S3cmd command: `s3cmd ls`

Creates a new bucket for an account.
#### HeadBucket

### UpdateBucket
Checks bucket existence and permissions, returning **200 OK** if it does exist or **404 Not Found** if it doesn't.

Modifies bucket information.
S3cmd command: `s3cmd info s3://BUCKET`

Use this operation to change the access permissions to the objects in the bucket. Buckets cannot be renamed with this operation.
#### ListMultipartUploads

Lists in progress multipart uploads in a bucket. It refers to a multipart upload that the S3 has initiated a `Create Multipart Upload` request but hasn't yet been completed or aborted.

S3cmd command: `s3cmd multipart s3://BUCKET`

#### ListObjects

Returns a list of up to 1,000 objects in the bucket, sorted alphabetically by key. You can use the query parameters to filter the search.

S3cmd command: `s3cmd ls s3://BUCKET`

For more than 1,000 results, it's recommended to use [ListObjectsV2](#listobjectsv2)

#### ListObjectsV2

Returns a list of up to 1,000 objects in the bucket, sorted alphabetically by key. You can use the query parameters to filter the search.

This limit is a default setup. However, if the search results in more than the maximum result set size, then the first set is returned in the initial response, the `<IsTruncated>` response element contains the value true and the `<NextContinuationToken>` element contains a token to retrieve the next set of results.

Use this token as the `continuation-token` query parameter in another request to retrieve the next set of results.

S3cmd command: `s3cmd ls s3://BUCKET`

#### CopyObject

Creates a copy of an object that is already stored.

S3cmd command: `s3cmd cp s3://BUCKET1/OBJECT1 s3://BUCKET2/OBJECT2`

#### GetObject

Retrieves an object from a bucket.

S3cmd command: `s3cmd get s3://BUCKET/OBJECT LOCAL_FILE`

#### HeadObject

Retrieves metadata from an object without returning the object itself.

S3cmd command: `s3cmd info s3://BUCKET/OBJECT`

#### DeleteObject

Removes an object from a bucket entirely.


S3cmd command: `s3cmd del s3://BUCKET/OBJECT`

#### DeleteObjects

Deletes multiple objects from a bucket in a single request. In the XML body, provide the object keys and, optionally, version IDs if you want to delete a specific object version.

S3cmd command: `s3cmd del s3://BUCKET/PREFIX --recursive`

#### AbortMultipartUpload
Aborts a multipart upload.

S3cmd command: `s3cmd abortmp s3://BUCKET/OBJECT Id`

#### CompleteMultipartUpload

Completes a `multipart upload` by assembling previously uploaded parts.

This operation is part of the S3 multipart upload process, being handled automatically as part of the put process when uploading large files once all parts are successfully uploaded.

#### CreateMultipartUpload

Initiates a `multipart upload` and returns a `uploadId`. This `uploadId` is used to associate all of the parts in the specific multipart upload.

This operation is part of the S3 multipart upload process, being handled automatically as part of the put process when uploading large files when you use the put command with a large file. There's no need to explicitly call this operation.

#### ListParts

Lists parts that have been uploaded for a given multipart upload.

This limit is a default setup. However, if the search results number is more than the maximum result set size, then the first set is returned in the initial response, the response element contains the value true and the element contains a token to retrieve the next set of results. Use this token as the part-number-marker query parameter in another request to retrieve the next set of results.

S3cmd command: `s3cmd listmp s3://BUCKET/OBJECT Id`

#### PutObject

Uploads an object to a bucket.

S3cmd command: `s3cmd put FILE s3://BUCKET/OBJECT`

#### UploadPart

Uploads a part of the file in a multipart upload. s3cmd automatically splits large files into parts and uploads them. You don't need to manage the parts or call this operation directly manually.

---

Expand Down
Loading

0 comments on commit 5c533a3

Please sign in to comment.