Deploy S3 via API¶
Let's check how we can create a public S3 storage using APIs (Application Programming Interface).
Tip
Using the DNS feature provided on the whitesky.cloud NV portal, you can simply create a publicly accessible S3 storage in less steps. However, this tutorial can help you understand how you can use reverse proxies with APIs.
Tip
To learn more about how you can use DNS on the whitesky.cloud NV portal, check the DNS Documentation.
Steps to create S3 storage using API¶
Tip
In the following steps, you will need to replace all the variables like <CUSTOMER_ID>, <CLOUDSPACE_ID>...etc. with their values.
-
Create your cloudspace using the following API endpoint and pass a payload that configures your cloudspace with your request.
-
External Network ID changes from one location to another. To get your External Network IP use the following API endpoint.
-
After your cloudspace is created, you can create an objectspace using the following API endpoint and pass the name and location of your objectspace as query parameters with your request (this endpoint does not take a JSON payload for these fields).
-
Use the following API endpoint to connect your new objectspace to your cloudspace, passing the objectspace ID as a query parameter.
-
Get your Private IP (cloudspaces => ip_address), Access Key and Secret using the following API endpoint.
-
Create a serverpool on your cloudspace using the following API endpoint and pass the serverpool name (and optionally a description) as query parameters with your request. Note that this endpoint no longer requires the
/alpha/prefix. -
Add your objectspace to the serverpool that we have just created using the following API endpoint and pass the address of your objectspace as a query parameter with your request.
-
Now we will use the following API endpoint to create a reverse proxy and associate our request with a payload that specifies the reverse proxy configuration. This is the only ingress endpoint that takes a JSON body.
Payload: { "name": "myrevproxy", "description": "string", "locked": false, "front_end": { "domain": "<DOMAIN-NAME>", "http_port": 80, "https_port": 443, "ip_address": "<IP-ADDRESS-TO-BIND-TO>", "scheme": "https", "letsencrypt": { "enabled": true, "email": "<EMAIL-ADDRESS>" } }, "back_end": { "scheme": "http", "serverpool_id": "fce65ea3447947689a0a15c82266853c", "target_port": 80, "options": { "sticky_session_cookie": { "name": "test", "secure": true, "http_only": true, "same_site": "true" }, "health_check": { "path": "/", "scheme": "http", "port": 80, "interval": 1000, "timeout": 1000 } } } }Tip
front_end.ip_addressis optional — if omitted, the reverse proxy listens on all IP addresses of the cloudspace's external network.
You can check how to access your objectspace from MinIO client, including how to share from external services to your objectspace.