API Developers

Object Storage (HCM04) provides a range of APIs for managing data and interacting with your cloud storage resources. Here is a summary of the main types of APIs we provide:

  • vStorage API: you can use Service Account to authenticate and work with projects, buckets, objects, reports via API.

  • S3 API : you can use S3 keys to authenticate and work with buckets and objects via API.

vStorage API - Authentication

Follow the steps below to work with vStorage via Service Account

  1. Select the Integration folder .

  2. Select the vStorage API icon .

  3. In the Authentication section , you need to fill in the necessary information to configure your vStorage API including:

    1. Enter the Client ID . A Client ID is a string of characters used by the Service API to identify your application, and is also used to construct the "authorization URL" displayed to the user. You can create and manage Client IDs through the vIAM system. The Client ID is automatically generated when you create a new Service Account .

    2. Enter the Client Secret corresponding to the Client ID you just entered. The Client ID and Client Secret pair are created and managed by you through the vIAM system. You can select Click here to manage your Client ID. so we can navigate you to the vIAM system and in detail the Service Account management screens.

  4. Once you've finished selecting your authentication configuration , select Authentication to go to the Configuration screen . Here you can use the vStorage APIs directly, or you can use the API via Postman . You can always come back here to change your Authorization information , then select Authentication again to update the S3 Rest API list with your new parameters.

For details, please refer to https://docs.api.vngcloud.vn/service-docs/vstorage-hcm04-api.html .

S3 API - Authentication

  • Type: AWS Signature

  • Access Key: initialize and retrieve information on the vStorage Portal.

  • Secret Key: initialize and retrieve information on vStorage Portal.

  • Region: HCM04

For example:


Working with Bucket

These APIs allow you to manage buckets.

1. Basic APIs

2. Access Control APIs

Manage access rights for buckets and objects.

3. Versioning API

Manage versions of objects in buckets.

4. API Lifecycle

Lifecycle management for buckets and objects:

5. CORS API

Manage access and use S3 as a static website hosting service.


6. API Object Locked

Attention:

  • To set Object Locked for a bucket, when initializing the bucket, you need to add the parameter x-amz-bucket-object-lock-enabled = true

Set Object Locked via API.


Working with Objects

These are the basic APIs for manipulating objects (files) in S3.

Attention:

  • To delete a version object, you need to add the versionId param to this API. For example, to delete the test.txt object with version-id = "z3-o0S5HEC6-XsjEjuHoRwoE-F6X1IF", you can curl the following command:

Last updated