package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Storage.PostStorageVolumes(ctx, operations.PostStorageVolumesStorageRequestBody{
Data: operations.PostStorageVolumesStorageData{
Type: operations.PostStorageVolumesStorageTypeVolumes,
Attributes: operations.PostStorageVolumesStorageAttributes{
Project: "proj_enPbqoZ6dA2MQ",
Name: "my-data",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"data": {
"id": "vol_Av9BVDavORm1W",
"type": "volumes",
"attributes": {
"name": "Rustic Aluminum Shoes",
"size_in_gb": 1500,
"created_at": "2026-01-14T15:57:08.000Z",
"namespace_id": null,
"connector_id": null,
"initiators": null,
"project": {
"id": "proj_enPbqoZ6dA2MQ",
"name": "Mediocre Aluminum Car",
"slug": "mediocre-aluminum-car",
"description": "Rustic Linen Shoes",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 1,
"virtual_machines": 0,
"vlans": 0
}
},
"team": {
"id": "team_geEQyBL2bJiVpXJgmw1YTgneKVb",
"name": "609 Team",
"slug": "609-team",
"description": "609 Team",
"address": "Apt. 590 415 Kirlin Pass, South Trenton, MT 96944",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
}
}
}
}Allows you to add persistent storage to a project. These volumes can be used to store data across your servers.
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.Storage.PostStorageVolumes(ctx, operations.PostStorageVolumesStorageRequestBody{
Data: operations.PostStorageVolumesStorageData{
Type: operations.PostStorageVolumesStorageTypeVolumes,
Attributes: operations.PostStorageVolumesStorageAttributes{
Project: "proj_enPbqoZ6dA2MQ",
Name: "my-data",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"data": {
"id": "vol_Av9BVDavORm1W",
"type": "volumes",
"attributes": {
"name": "Rustic Aluminum Shoes",
"size_in_gb": 1500,
"created_at": "2026-01-14T15:57:08.000Z",
"namespace_id": null,
"connector_id": null,
"initiators": null,
"project": {
"id": "proj_enPbqoZ6dA2MQ",
"name": "Mediocre Aluminum Car",
"slug": "mediocre-aluminum-car",
"description": "Rustic Linen Shoes",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {
"subscription_id": null,
"type": "Normal",
"method": "Normal"
},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 1,
"virtual_machines": 0,
"vlans": 0
}
},
"team": {
"id": "team_geEQyBL2bJiVpXJgmw1YTgneKVb",
"name": "609 Team",
"slug": "609-team",
"description": "609 Team",
"address": "Apt. 590 415 Kirlin Pass, South Trenton, MT 96944",
"status": "verified",
"currency": {
"id": "cur_AW6Q2D9lqKLpr",
"code": "BRL",
"name": "Brazilian Real",
"currency_id": null
}
}
}
}
}Was this page helpful?