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
Log in to https://vstorage.console.vngcloud.vn
Select the Integration folder .
Select the vStorage API icon .
In the Authentication section , you need to fill in the necessary information to configure your vStorage API including:
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 .
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.
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
Endpoint: https://hcm04.vstorage.vngcloud.vn
For example:


Working with Bucket
These APIs allow you to manage buckets.
1. Basic APIs
Create Bucket : Create a new bucket.
Path:
PUT /<bucket-name>For example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucketOr Curl via command:

List Buckets : List all buckets belonging to the user.
Path:
GET /For example:
GEThttps://hcm04.vstorage.vngcloud.vn/Or Curl via command:

Delete Bucket : Delete a bucket (only if the bucket is empty).
Path:
DELETE /<bucket-name>For example:
DELETEhttps://hcm04.vstorage.vngcloud.vn/demobucketOr Curl via command:

GET Bucket (List Objects) : List objects in a bucket.
Path:
GET /<bucket-name>For example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucketOr Curl via command:

HEAD Bucket : Check for existence and access to bucket.
Path:
HEAD /<bucket-name>For example:
HEADhttps://hcm04.vstorage.vngcloud.vn/demobucketOr Curl via command:

2. Access Control APIs
Manage access rights for buckets and objects.
GET Bucket ACL : Get the bucket's access control list (ACL).
Path:
GET /<bucket-name>?aclFor example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucket?aclOr Curl via command:

PUT Bucket ACL : Set ACL for bucket.
Path:
PUT /<bucket-name>?aclFor example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucket?aclOr Curl via command:

GET Object ACL : Get the ACL of an object.
Path:
GET /<bucket-name>/<object-key>?aclOr Curl via command:

PUT Bucket Make Public: Set up a Public Bucket
Path:
GET /<bucket-name>/?publicAccessBlockOr Curl via command:

GET Bucket Make Public: Get public or private bucket information.
Path:
GET /<bucket-name>/?publicAccessBlockOr Curl via command:

3. Versioning API
Manage versions of objects in buckets.
PUT Bucket Versioning : Enable or disable versioning for the bucket.
Path:
PUT /<bucket-name>?versioningFor example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucket?versioningOr Curl via command:

GET Bucket Versioning : Check the bucket versioning status.
Path:
GET /<bucket-name>?versioningFor example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucket?versioningOr Curl via command:

GET Object Versions : List versions of objects in the bucket.
Path:
GET /<bucket-name>?versionsFor example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucket/?versionsOr Curl via command:

4. API Lifecycle
Lifecycle management for buckets and objects:
PUT Bucket Lifecycle : Initializes lifecycle expiration for a bucket.
Path:
PUT /<bucket-name>?lifecycleFor example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucket?lifecycleOr Curl via command:

GET Bucket Lifecycle : Get bucket lifecycle rule information.
Path:
GET /<bucket-name>?lifecycleFor example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucket?lifecycleOr Curl via command:

DELETE Bucket Lifecycle : Deletes the lifecycle rules set for the bucket.
Path:
DELETE /<bucket-name>?lifecycleFor example:
DELETEhttps://hcm04.vstorage.vngcloud.vn/demobucket?lifecycleOr Curl via command:

5. CORS API
Manage access and use S3 as a static website hosting service.
PUT Bucket Website : Set up the bucket as a static website.
Path:
PUT /<bucket-name>?corsFor example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucket?corsOr Curl via command:

GET Bucket Website : Get the bucket's website configuration.
Path:
GET /<bucket-name>?corsFor example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucket?corsOr Curl via command:

DELETE Bucket Website : Deletes the bucket's website configuration.
Path:
DELETE /<bucket-name>?websiteFor example:
DELETEhttps://hcm04.vstorage.vngcloud.vn/demobucket?corsOr Curl via command:

6. API Object Locked
Set Object Locked via API.
Update Object Locked Configuration: Used to upload objects into a bucket.
Path:
PUT /<bucket-name>?object-lockFor example:
PUThttps://hcm04.vstorage.vngcloud.vn/demoobjectlocked?object-lockOr Curl created via command:

Working with Objects
These are the basic APIs for manipulating objects (files) in S3.
PUT Object : Used to upload objects into a bucket.
Path:
PUT /<bucket-name>/<object-key>For example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucket/demoobject.txtOr Curl via command:

GET Object : Get an object from S3.
Path:
GET /<bucket-name>/<object-key>For example:
GEThttps://hcm04.vstorage.vngcloud.vn/demobucket/demoobject.txtOr Curl via command:

DELETE Object : Delete an object from S3.
Path:
DELETE /<bucket-name>/<object-key>For example:
DELETEhttps://hcm04.vstorage.vngcloud.vn/demobucket/demoobject.txtOr Curl via command:

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:
HEAD Object : Query object metadata without downloading content.
Path:
HEAD /<bucket-name>/<object-key>For example:
HEADhttps://hcm04.vstorage.vngcloud.vn/demobucket/demoobject.txtOr Curl via command:

COPY Object : Copy an object from one S3 location to another.
Request:
PUT /<destination-bucket>/<destination-object-key>with headerx-amz-copy-source.For example:
PUThttps://hcm04.vstorage.vngcloud.vn/demobucket01/demoobject.txtOr Curl via command:

Last updated

