Host.it mette a disposizione un servizio di Cloud Object Storage S3 compatibile.
Il servizio consente al Partner di attivare e gestire in autonomia account S3 su uno o più cluster messi a disposizione da Host.
I cluster sono installati all’interno dei datacenter di Host o presso fornitori terzi selezionati.
Host fornisce un insieme di API pubbliche per consentire ai Partner di:
Le API sono accessibili tramite token JWT di autenticazione e sono disponibili sia in ambiente di test che in ambiente di produzione.
| Ambiente | URL | Descrizione |
|---|---|---|
| Test – Swagger | https://api.test.host.it/swagger-ui.html | Documentazione API interattiva |
| Test – Control Panel | https://control.test.host.it/ | Interfaccia web di controllo |
| Test – Autenticazione (SSO) | https://sso.test.host.it/ | Endpoint per ottenere il token JWT |
| Produzione – Swagger | https://api.host.it/swagger-ui.html | Documentazione API interattiva |
| Produzione – Control Panel | https://control.host.it/ | Interfaccia web di controllo |
| Produzione – Autenticazione (SSO) | https://sso.host.it/ | Endpoint per ottenere il token JWT |
Per utilizzare le API è necessario autenticarsi ed ottenere un token JWT attraverso il sistema di autenticazione SSO di Host.
curl -k -X POST https://sso.test.host.it/cas/v1/tickets -H 'Content-Type: application/x-www-form-urlencoded' -H 'cache-control: no-cache' -d 'token=true&username=<username>&password=<password>'
eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzdGVmYW5vLnJAaW5jb21lZGlhLmV1IiwiaWR1c2VyIjoiOTk2MTYiLCJpYXQiOjE2MDI1NzE1NzAsImp0aSI6IlNULTI5NDE1LW5za1otLWdGY3NHOHlkMW9lWXYzTW52YjNVOC0wNGI5NzJlZTEwNjIifQ...
Il token JWT deve essere incluso nell’header Authorization, preceduto dalla parola token:
curl --location --request GET 'https://api.test.host.it/v1/s3/reseller/clusters' --header 'Authorization: token <JWT>'
| Parametro | Descrizione |
|---|---|
| userId | ID utente interno fornito da Host |
| invoiceCustomerId | ID cliente commerciale fornito da Host |
| idItemMaster | ID del prodotto reseller fornito da Host |
| uid | ID univoco di un account S3 creato tramite API |
Di seguito un esempio di flusso operativo per la creazione e gestione di un account S3 tramite API.
Tutte le API illustrate sono documentate nel gruppo
hs-3-controllerdel Swagger ufficiale.
Per ottenere la lista dei cluster S3 attivi:
GET /v1/s3/reseller/clusters
Al momento è disponibile il cluster Torino (
trn-1).
GET /v1/s3/reseller/accounts/{userId}
All’inizio la lista sarà vuota se non sono ancora stati creati account.
POST /v1/s3/reseller/create-account
{
"purchase": {
"domainName": "account2",
"invoiceCustomerId": <invoiceCustomerId>,
"idItemMaster": <idItemMaster>,
"itemsRelated": [
{
"domainName": "account2",
"idItemRelated": 103020,
"units": 1
}
],
"productId": 103020,
"userId": <userId>
},
"additionalParams": {
"objectStorageClusterId": "trn-1",
"provisioning": true
}
}
{
"status": "OK",
"uid": "4305-987"
}
GET /v1/s3/reseller/get-account-details/{clusterId}/{uid}
{
"status": "OK",
"account": {
"tenant": "",
"userId": "4305-987",
"displayName": "amicis3",
"maxBuckets": 1000,
"accountKeys": [
{
"user": "4305-987",
"accessKey": "1YNS2HD0LYY54JQS0WAX",
"secretKey": "fyqqsz9Q24SjwCwPh0GaTXdLHouVBI2Fx51NPuaB"
}
]
}
}
POST /v1/s3/reseller/create-bucket
{
"bucketName": "<nomebucket>",
"clusterId": "trn-1",
"objectLock": {
"objectLockEnabled": true,
"objectLockRetentionMode": "GOVERNANCE",
"retentionUnit": "DAYS",
"retentionValue": 1
},
"uid": "<uid>",
"versioning": true
}
| Campo | Descrizione |
|---|---|
| bucketName | Nome del bucket da creare |
| uid | ID dell’account S3 in cui creare il bucket |
| objectLock / versioning | Parametri di configurazione del bucket |
GET /v1/s3/reseller/account/buckets/{clusterId}/{uid}/{maxPerPage}/{pageNumber}
| Parametro | Descrizione |
|---|---|
| clusterId | ID del cluster (es. trn-1) |
| uid | ID dell’account |
| maxPerPage | Numero massimo di risultati per pagina |
| pageNumber | Numero della pagina da visualizzare |
DELETE /v1/s3/reseller/account/bucket/{bucketName}/{clusterId}/{uid}
DELETE /v1/s3/reseller/delete-account/{clusterId}/{uid}
Una versione di test del pannello Control è disponibile all’indirizzo:
👉 https://control.test.host.it/
È possibile autenticarsi con username e password forniti da Host ed accedere alla sezione Partner S3 per:
| Funzione | Metodo | Endpoint |
|---|---|---|
| Login e token JWT | POST |
/cas/v1/tickets |
| Elenco cluster | GET |
/v1/s3/reseller/clusters |
| Elenco account | GET |
/v1/s3/reseller/accounts/{userId} |
| Creazione account | POST |
/v1/s3/reseller/create-account |
| Dettagli account | GET |
/v1/s3/reseller/get-account-details/{clusterId}/{uid} |
| Creazione bucket | POST |
/v1/s3/reseller/create-bucket |
| Lista bucket | GET |
/v1/s3/reseller/account/buckets/{clusterId}/{uid}/{maxPerPage}/{pageNumber} |
| Cancellazione bucket | DELETE |
/v1/s3/reseller/account/bucket/{bucketName}/{clusterId}/{uid} |
| Cancellazione account | DELETE |
/v1/s3/reseller/delete-account/{clusterId}/{uid} |
✅ Nota
Tutte le API sono accessibili solo previa autenticazione con token JWT valido.
Il token deve essere rigenerato periodicamente secondo le policy di sicurezza Host.it.
L'accesso alle API avviene solo da IP autorizzati da Host.it.