Risorse
Questa pagina è il riferimento esaustivo per ogni wrapper di risorsa nel pacchetto pkg/aruba. Per ogni wrapper troverai:
- La catena di accessor per raggiungerlo da
arubaClient - Uno snippet
Createpronto all'uso - I metodi accessor di risposta disponibili sul wrapper restituito
Per il walkthrough end-to-end del ciclo di vita (come Create, Get, Update, List, Delete e il polling si integrano) vedi la Guida al Walkthrough API.
Convenzioni
Ogni risorsa segue la stessa struttura:
// 1. Raggiungi il sub-client
client := arubaClient.FromX().Y()
// 2. Costruisci la richiesta inline e crea
result, err := client.Create(ctx,
aruba.NewX().
IntoParent(parentRef). // scope al progetto / VPC / ecc.
Named("my-resource").
Tagged("env-prod").
WithFoo(...))
// 3. Attendi che le risorse asincrone diventino pronte
if err := result.WaitUntilReady(ctx); err != nil { … }
// 4. Leggi gli accessor di risposta
fmt.Println(result.ID(), result.Name(), result.State())
aruba.NewX()— factory constructor per ogni builder di risorsaIntoFoo(ref)— lega lo scope del genitore; accetta qualsiasiaruba.Ref(wrapper idratato oaruba.URI("…"))WithFoo(...)— setter fluenti; gli errori sono differiti fino aCreate/UpdateWaitUntilReady(ctx, opts...)— disponibile sulle risorse marcate async qui sotto; vedi Async / Await per le opzioni completearuba.URI(s)— avvolge un percorso stringa grezzo in unRef(vedi Guida al Walkthrough API)
L'API di Aruba valida i valori dei tag contro ^[A-Za-z0-9-]{4,30}$: solo caratteri alfanumerici e trattini, lunghezza da 4 a 30. Due punti, punti, underscore, spazi e altra punteggiatura vengono rifiutati con 400 — One or more validation error occurred. L'SDK non valida i tag lato client, quindi un tag non valido fallisce solo quando la richiesta raggiunge il server.
Lettura dello stato del wrapper
Ogni wrapper promuove i campi di risposta più usati a accessor piatti. Preferiscili rispetto a wrapper.Raw().Properties.X:
fmt.Println(result.ID()) // UUID
fmt.Println(result.Name()) // nome della risorsa
fmt.Println(result.State()) // stato del ciclo di vita
fmt.Println(result.Region()) // slug della regione
fmt.Println(result.RawJSON()) // payload JSON wire completo (per --output json)
fmt.Println(result.RawYAML()) // payload YAML wire completo (per --output yaml)
Gli scalari specifici della risorsa (es. cs.Subnets(), vpnRoute.CloudSubnetCIDR(), kaas.PodCIDR()) sono documentati nella sezione Accessor di risposta di ogni risorsa qui sotto. Vedi Gestione delle risposte per la tassonomia completa degli accessor.
Ogni sezione di risorsa elenca anche i suoi Setter (metodi builder concatenabili raggruppati per l'ordine canonico della catena da ai/CONVENTIONS.md) e un collegamento all'esempio eseguibile in examples/all-resources/.
Progetto
arubaClient.FromProject()
Operazioni supportate: Create, List, Get, Update, Delete
Il Progetto non è asincrono — è pronto in modo sincrono dopo che
Createritorna. Non è necessaria alcuna chiamataWaitUntilReady.
proj, err := arubaClient.FromProject().Create(
ctx,
aruba.NewProject().
Named("my-project").
Tagged("env-prod").
DescribedAs("Progetto di produzione").
NotDefault())
if err != nil {
log.Fatalf("Create project: %v", err)
}
fmt.Printf("✓ Progetto: %s (ID: %s)\n", proj.Name(), proj.ID())
Accessor di risposta:
ID()— UUID della risorsaURI()— percorso completo della risorsa (es./projects/abc-123)Name()— nome del progettoDescription()— descrizione del progettoIsDefault()— se questo è il progetto predefinitoTags()— lista di tag[]stringCreatedAt(),UpdatedAt()— timestampCreatedBy(),UpdatedBy()— identificatore dell'attore che ha creato/aggiornato la risorsa (es.aru-297647)CreatedUser(),UpdatedUser()— nome visualizzato dell'utente che ha creato/aggiornato la risorsaRaw()— struct wire sottostante*types.ProjectResponseRawJSON()/RawYAML()— payload serializzato per i flag--output json/yamlRawRequest()—types.ProjectRequestper i flussi round-tripGet → Update
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Descriptive scalars:
DescribedAs(string) - Boolean state:
AsDefault(),NotDefault()
Esempio end-to-end completo: examples/all-resources/resource_project.go
Audit
arubaClient.FromAudit().Events()
Operazioni supportate: List
Gli Audit Event sono in sola lettura. Non esiste un costruttore Create — usa List con un Ref di progetto e opzionalmente aruba.WithFilter(…) per interrogare l'audit trail.
list, err := arubaClient.FromAudit().Events().List(ctx, proj,
aruba.WithLimit(50),
aruba.WithFilter("action eq 'Create'"))
if err != nil {
log.Fatalf("List events: %v", err)
}
for _, e := range list.Items() {
fmt.Println(e.ID(), e.Action(), e.Timestamp())
}
Accessor di risposta:
ID()— UUID dell'eventoURI()— percorso della risorsaResourceURI()— URI della risorsa a cui l'evento si riferisceAction()— stringa dell'azione (es."Create","Delete")Timestamp()— ora dell'eventoUser()— identificatore utente che ha scatenato l'eventoRaw()— struct wire sottostante
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
Compute
Cloud Server
arubaClient.FromCompute().CloudServers()
Operazioni supportate: Create, List, Get, Update, Delete, PowerOn, PowerOff, SetPassword
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
Un Cloud Server dipende da risorse di rete (VPC, Subnet, Security Group), un Elastic IP, un Boot Volume (Block Storage) e un Key Pair. Crea prima queste risorse e passa i wrapper idratati come parametri Ref.
cs, err := arubaClient.FromCompute().CloudServers().Create(
ctx,
aruba.NewCloudServer().
OfFlavor(aruba.CloudServerFlavorCSO2A4).
Named("my-server").
Tagged("env-prod").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
InZone(aruba.ZoneITBG1).
BootingFrom(blockStorage).
WithVPC(vpc).
OnSubnets(subnet).
WithSecurityGroups(sg).
WithElasticIP(eip).
UsingKeyPair(keyPair))
if err != nil {
log.Fatalf("Create Cloud Server: %v", err)
}
if err := cs.WaitUntilReady(ctx); err != nil {
log.Fatalf("Cloud Server did not become Ready: %v", err)
}
fmt.Printf("✓ Cloud Server: %s (zona: %s, flavor: %s)\n", cs.Name(), cs.Zone(), cs.Flavor())
Azioni di alimentazione e password (richiedono un wrapper idratato da Create/Get):
if err := cs.PowerOff(ctx); err != nil { log.Fatalf("PowerOff: %v", err) }
if err := cs.PowerOn(ctx); err != nil { log.Fatalf("PowerOn: %v", err) }
if err := cs.SetPassword(ctx, "NewStr0ngP@ss!"); err != nil { log.Fatalf("SetPassword: %v", err) }
Accessor di risposta:
ID(),URI(),Name(),Tags()CloudServerID()— ID server assegnato dal providerZone()— zona di disponibilitàFlavor()— slug del flavor di calcoloFlavorRaw()— struct flavor completaVPC()—aruba.Refdella VPC collegataBootVolume()—aruba.Refdel volume di bootKeyPair()—aruba.Refdella key pairNetworkInterfaces()— slice di descrittori di interfacce di reteTemplate()— immagine/template usata al bootState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()— dastatusMixinWaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfFlavor(CloudServerFlavor) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region),InZone(Zone) - Descriptive scalars:
WithUserData(string) - Origin:
BootingFrom(Ref) - Attached config:
WithVPC(Ref),WithSecurityGroups(...Ref),WithElasticIP(Ref) - Network placement:
OnSubnets(...Ref) - Active relationship:
UsingKeyPair(Ref) - Boolean state:
WithVPCPreset(),WithoutVPCPreset() - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_cloud_server.go
Key Pair
arubaClient.FromCompute().KeyPairs()
Operazioni supportate: Create, List, Get, Delete
Asincrono: no.
kp, err := arubaClient.FromCompute().KeyPairs().Create(
ctx,
aruba.NewKeyPair().
Named("my-keypair").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
WithPublicKey("ssh-rsa AAAAB3NzaC1yc2E..."))
if err != nil {
log.Fatalf("Create KeyPair: %v", err)
}
fmt.Printf("✓ KeyPair: %s (ID: %s)\n", kp.Name(), kp.ID())
Accessor di risposta:
ID(),URI(),Name(),Tags()KeyPairID()— ID chiave assegnato dal providerPublicKey()— stringa della chiave pubblicaRegion()— slug della regioneRaw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithPublicKey(string)
Esempio end-to-end completo: examples/all-resources/resource_key_pair.go
Container
KaaS (Kubernetes as a Service)
arubaClient.FromContainer().KaaS()
Operazioni supportate: Create, List, Get, Update, Delete, DownloadKubeconfig
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
k, err := arubaClient.FromContainer().KaaS().Create(
ctx,
aruba.NewKaaS().
Named("my-cluster").
Tagged("env-prod").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
WithKubernetesVersion(aruba.KubernetesVersion1323).
WithPodCIDR("10.200.0.0/16").
WithNodeCIDR("10.100.0.0/16", "node-cidr").
WithVPC(vpc).
WithSubnet(subnet).
WithSecurityGroup(sg).
WithNodePools(aruba.NewNodePool().
OfInstance(aruba.NodePoolInstanceK4A8).
Named("default-pool").
InZone(aruba.ZoneITBG1).
WithCount(3)).
HighlyAvailable().
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create KaaS: %v", err)
}
if err := k.WaitUntilReady(ctx); err != nil {
log.Fatalf("KaaS did not become Ready: %v", err)
}
fmt.Printf("✓ Cluster KaaS: %s (k8s: %s)\n", k.Name(), k.KubernetesVersion())
Download del kubeconfig (richiede un wrapper idratato):
kubeconfig, err := k.DownloadKubeconfig(ctx)
if err != nil {
log.Fatalf("DownloadKubeconfig: %v", err)
}
// kubeconfig è un []byte YAML kubeconfig
Builder del node pool — aruba.NewNodePool():
Named(name)— nome del poolWithCount(n)— numero di nodiOfInstance(flavor)— flavor dell'istanza nodoInZone(zone)— zona di disponibilitàWithAutoscaling(min, max)— abilita l'autoscaling
Accessor di risposta:
ID(),URI(),Name(),Tags()KaaSID()— ID cluster assegnato dal providerVPC(),Subnet()—aruba.Refalle risorse di rete collegateSecurityGroupName()— nome del security group applicatoKubernetesVersion()— stringa della versione KubernetesBillingPeriod()— cadenza di fatturazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithKubernetesVersion(KubernetesVersion),WithPodCIDR(string),WithMaxStorageQuotaGB(int),WithIdentity(string, string) - Attached config:
WithVPC(Ref),WithSubnet(Ref),WithSecurityGroup(Ref),WithNodeCIDR(string, string),WithNodePools(...*NodePool),WithoutNodePools(),ReplaceNodePools(...*NodePool) - Boolean state:
HighlyAvailable() - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_kaas.go
Container Registry
arubaClient.FromContainer().ContainerRegistry()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create. Questa risorsa può impiegare 20–40 minuti per convergere — utilizza un budget di attesa generoso.
reg, err := arubaClient.FromContainer().ContainerRegistry().Create(
ctx,
aruba.NewContainerRegistry().
OfSize(aruba.ContainerRegistrySizeFlavorSmall).
Named("my-registry").
Tagged("env-prod").
InProject(proj).
WithAdminUsername("admin").
WithVPC(vpc).
WithSubnet(subnet).
WithSecurityGroup(sg).
WithElasticIP(eip).
WithBlockStorage(blockStorage).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create ContainerRegistry: %v", err)
}
if err := reg.WaitUntilReady(ctx); err != nil {
log.Fatalf("ContainerRegistry did not become Ready: %v", err)
}
fmt.Printf("✓ Registry: %s (IP pubblico: %s)\n", reg.Name(), reg.PublicIP())
Accessor di risposta:
ID(),URI(),Name(),Tags()ContainerRegistryID()— ID registry assegnato dal providerElasticIP()— URI dell'endpoint pubblicoVPC(),Subnet(),SecurityGroup(),BlockStorage()—aruba.Refalle risorse collegateAdminUsername()— utente amministratore del registryBillingPeriod()— cadenza di fatturazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfSize(ContainerRegistrySizeFlavor) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithAdminUsername(string) - Attached config:
WithElasticIP(Ref),WithVPC(Ref),WithSubnet(Ref),WithSecurityGroup(Ref),WithBlockStorage(Ref) - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_container_registry.go
Database
DBaaS (Database as a Service)
arubaClient.FromDatabase().DBaaS()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
db, err := arubaClient.FromDatabase().DBaaS().Create(
ctx,
aruba.NewDBaaS().
OfEngine(aruba.DatabaseEngineMySQL80).
OfFlavor(aruba.DBaaSFlavorDBO2A4).
Named("my-database").
Tagged("env-prod").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
InZone(aruba.ZoneITBG1).
SizedGB(20).
WithVPC(vpc).
WithSubnet(subnet).
WithSecurityGroup(sg).
WithElasticIP(eip).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create DBaaS: %v", err)
}
if err := db.WaitUntilReady(ctx); err != nil {
log.Fatalf("DBaaS did not become Ready: %v", err)
}
fmt.Printf("✓ DBaaS: %s (engine: %s)\n", db.Name(), db.Engine())
Accessor di risposta:
ID(),URI(),Name(),Tags()DBaaSID()— ID istanza assegnato dal providerEngine()— identificatore dell'engine (costanteDatabaseEngine)EngineRaw()— struct engine completaFlavor()— identificatore del flavor (costanteDBaaSFlavor)FlavorRaw()— struct flavor completaSizeGB()— dimensione dello storage in GBAutoscalingEnabled()— boolVPC(),Subnet(),SecurityGroup(),ElasticIP()—aruba.Refalle risorse di reteBillingPeriod()— cadenza di fatturazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfEngine(DatabaseEngine),OfFlavor(DBaaSFlavor) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region),InZone(Zone) - Descriptive scalars:
SizedGB(int),WithAutoscaling(min, max int),WithoutAutoscaling() - Attached config:
WithVPC(Ref),WithSubnet(Ref),WithSecurityGroup(Ref),WithElasticIP(Ref) - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_dbaas.go
Database
arubaClient.FromDatabase().Databases()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
database, err := arubaClient.FromDatabase().Databases().Create(
ctx,
aruba.NewDatabase().
Named("my-app-db").
Tagged("app-backend").
InDBaaS(db))
if err != nil {
log.Fatalf("Create Database: %v", err)
}
if err := database.WaitUntilReady(ctx); err != nil {
log.Fatalf("Database did not become Ready: %v", err)
}
fmt.Printf("✓ Database: %s\n", database.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()DatabaseID()— ID database assegnato dal providerDBaaSID()— ID DBaaS padreState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Containment:
InDBaaS(Ref)
Esempio end-to-end completo: examples/all-resources/resource_database.go
User
arubaClient.FromDatabase().Users()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
user, err := arubaClient.FromDatabase().Users().Create(
ctx,
aruba.NewUser().
Tagged("app-backend").
InDBaaS(db).
WithUsername("app_user").
WithPassword("Str0ngP@ssword!"))
if err != nil {
log.Fatalf("Create User: %v", err)
}
if err := user.WaitUntilReady(ctx); err != nil {
log.Fatalf("User did not become Ready: %v", err)
}
fmt.Printf("✓ Utente: %s\n", user.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()UserID()— ID utente assegnato dal providerUsername()— nome utente del databaseDBaaSID()— ID DBaaS padreState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
WithUsername(string) - Containment:
InDBaaS(Ref) - Descriptive scalars:
WithPassword(string)
Esempio end-to-end completo: examples/all-resources/resource_dbaas_user.go
Grant
arubaClient.FromDatabase().Grants()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
grant, err := arubaClient.FromDatabase().Grants().Create(
ctx,
aruba.NewGrant().
OfRole("liteadmin").
InDatabase(database).
ForUser("app_user"))
if err != nil {
log.Fatalf("Create Grant: %v", err)
}
if err := grant.WaitUntilReady(ctx); err != nil {
log.Fatalf("Grant did not become Ready: %v", err)
}
fmt.Printf("✓ Grant: %s (privilegi: %s)\n", grant.Name(), grant.Privileges())
Accessor di risposta:
ID(),URI(),Name(),Tags()GrantID()— ID grant assegnato dal providerDatabaseID()— ID Database padrePrivileges()— stringa dei privilegiState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Containment:
InDatabase(Ref) - Active relationship:
ForUser(string),OfRole(string)
Esempio end-to-end completo: examples/all-resources/resource_grant.go
DBaaS Backup
arubaClient.FromDatabase().DBaaSBackups()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
backup, err := arubaClient.FromDatabase().DBaaSBackups().Create(
ctx,
aruba.NewDBaaSBackup().
Named("my-db-backup").
Tagged("backup").
InProject(proj).
FromDBaaS(db).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create DBaaSBackup: %v", err)
}
if err := backup.WaitUntilReady(ctx); err != nil {
log.Fatalf("DBaaS Backup did not become Ready: %v", err)
}
fmt.Printf("✓ DBaaS Backup: %s\n", backup.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()DBaaSBackupID()— ID backup assegnato dal providerDBaaSURI()— URI del DBaaS sorgenteDatabaseURI()— URI del Database sorgente (se applicabile)SizeGB()— dimensione del backup in GBZone()— zona di disponibilitàBillingPeriod()— cadenza di fatturazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref),FromDBaaS(Ref),FromDatabase(Ref) - Geography:
InRegion(Region),InZone(Zone) - Billing:
BilledBy(BillingPeriod)
Le operazioni di DBaaS Backup sono trattate nell'esempio DBaaS: examples/all-resources/resource_dbaas.go
Metric
Alert
arubaClient.FromMetric().Alerts()
Operazioni supportate: List
Gli Alert sono in sola lettura. Usa List con un Ref di progetto per interrogare gli alert attivi.
list, err := arubaClient.FromMetric().Alerts().List(ctx, proj)
if err != nil {
log.Fatalf("List Alerts: %v", err)
}
for _, a := range list.Items() {
fmt.Println(a.ID(), a.Name(), a.IsActive())
}
Accessor di risposta:
ID(),URI(),Name()Threshold()— valore soglia dell'alertAction()— azione scatenata all'alertIsActive()— boolRaw()— struct wire sottostante
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
Metric
arubaClient.FromMetric().Metrics()
Operazioni supportate: List
Le Metric sono risultati di query di serie temporali in sola lettura.
list, err := arubaClient.FromMetric().Metrics().List(ctx, proj,
aruba.WithFilter("resource eq '"+cs.URI()+"'"))
if err != nil {
log.Fatalf("List Metrics: %v", err)
}
for _, m := range list.Items() {
fmt.Println(m.ID(), m.Name())
}
Accessor di risposta:
ID(),URI(),Name()Raw()— struct wire sottostante
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
Network
VPC
arubaClient.FromNetwork().VPCs()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
vpc, err := arubaClient.FromNetwork().VPCs().Create(
ctx,
aruba.NewVPC().
Named("my-vpc").
Tagged("network").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
NotDefault().
WithoutPreset())
if err != nil {
log.Fatalf("Create VPC: %v", err)
}
if err := vpc.WaitUntilReady(ctx); err != nil {
log.Fatalf("VPC did not become Ready: %v", err)
}
fmt.Printf("✓ VPC: %s\n", vpc.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()VPCID()— ID VPC assegnato dal providerRegion()— slug della regioneIsDefault(),IsPreset()— flagState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Boolean state:
AsDefault(),NotDefault(),WithPreset(),WithoutPreset()
Esempio end-to-end completo: examples/all-resources/resource_vpc.go
Subnet
arubaClient.FromNetwork().Subnets()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
OfType accetta aruba.SubnetTypeBasic o aruba.SubnetTypeAdvanced (costanti tipizzate — nessun cast a stringa necessario).
aruba.NewSubnetDHCP() è un sub-builder per la configurazione DHCP. Collegalo con WithDHCP(...).
subnet, err := arubaClient.FromNetwork().Subnets().Create(
ctx,
aruba.NewSubnet().
OfType(aruba.SubnetTypeAdvanced).
Named("my-subnet").
Tagged("network").
InVPC(vpc).
InRegion(aruba.RegionITBGBergamo).
WithCIDR("192.168.1.0/25").
WithDHCP(aruba.NewSubnetDHCP().
Enabled().
WithRange("192.168.1.10", 50).
WithRoutes(aruba.SubnetDHCPRouteCommon{Address: "0.0.0.0/0", Gateway: "192.168.1.1"}).
WithDNSServers("8.8.8.8", "8.8.4.4")).
NotDefault())
if err != nil {
log.Fatalf("Create Subnet: %v", err)
}
if err := subnet.WaitUntilReady(ctx); err != nil {
log.Fatalf("Subnet did not become Ready: %v", err)
}
fmt.Printf("✓ Subnet: %s (CIDR: %s)\n", subnet.Name(), subnet.CIDR())
Accessor di risposta:
ID(),URI(),Name(),Tags()SubnetID()— ID subnet assegnato dal providerType()— tipo di subnet (costanteSubnetType)CIDR()— blocco CIDRDHCP()— configurazione DHCPIsDefault()— boolRegion()— slug della regioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfType(SubnetType) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InVPC(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithCIDR(string) - Attached config:
WithDHCP(*SubnetDHCPCommon) - Boolean state:
AsDefault(),NotDefault()
Esempio end-to-end completo: examples/all-resources/resource_subnet.go
Elastic IP
arubaClient.FromNetwork().ElasticIPs()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
eip, err := arubaClient.FromNetwork().ElasticIPs().Create(
ctx,
aruba.NewElasticIP().
Named("my-eip").
Tagged("network").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create ElasticIP: %v", err)
}
if err := eip.WaitUntilReady(ctx); err != nil {
log.Fatalf("ElasticIP did not become Ready: %v", err)
}
fmt.Printf("✓ Elastic IP: %s (%s)\n", eip.Name(), eip.Address())
Accessor di risposta:
ID(),URI(),Name(),Tags()ElasticIPID()— ID IP assegnato dal providerAddress()— indirizzo IP pubblico allocatoBillingPeriod()— cadenza di fatturazioneRegion()— slug della regioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilNotUsed(ctx, opts...),WaitUntilUsed(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_elastic_ip.go
Security Group
arubaClient.FromNetwork().SecurityGroups()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
sg, err := arubaClient.FromNetwork().SecurityGroups().Create(
ctx,
aruba.NewSecurityGroup().
Named("my-security-group").
Tagged("security").
InVPC(vpc).
NotDefault())
if err != nil {
log.Fatalf("Create SecurityGroup: %v", err)
}
if err := sg.WaitUntilReady(ctx); err != nil {
log.Fatalf("SecurityGroup did not become Active: %v", err)
}
fmt.Printf("✓ Security Group: %s (ID: %s)\n", sg.Name(), sg.ID())
Accessor di risposta:
ID(),URI(),Name(),Tags()SecurityGroupID()— ID gruppo assegnato dal providerIsDefault()— boolState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InVPC(Ref) - Boolean state:
AsDefault(),NotDefault()
Esempio end-to-end completo: examples/all-resources/resource_security_group.go
Security Rule
arubaClient.FromNetwork().SecurityGroupRules()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — State() e FailureReason() sono disponibili.
WithDirection accetta aruba.RuleDirectionIngress o aruba.RuleDirectionEgress. WithProtocol accetta aruba.RuleProtocolTCP, aruba.RuleProtocolUDP, aruba.RuleProtocolICMP o aruba.RuleProtocolANY.
Avvertenza:
TargetingCIDReTargetingSecurityGroupsono mutuamente esclusivi. Impostare entrambi registra un errore al momento del setter, che emerge al momento diCreate.
rule, err := arubaClient.FromNetwork().SecurityGroupRules().Create(
ctx,
aruba.NewSecurityRule().
Named("allow-ssh").
Tagged("ssh-key").
InSecurityGroup(sg).
InRegion(aruba.RegionITBGBergamo).
WithDirection(aruba.RuleDirectionIngress).
WithProtocol(aruba.RuleProtocolTCP).
WithPort("22").
TargetingCIDR("0.0.0.0/0"))
if err != nil {
log.Fatalf("Create SecurityRule: %v", err)
}
fmt.Printf("✓ Security Rule: %s\n", rule.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()SecurityRuleID()— ID regola assegnato dal providerDirection()—"Ingress"o"Egress"Protocol()— es."TCP","UDP","ICMP"Port()— numero di porta o intervalloTargetKind()—"Ip"o"SecurityGroup"TargetValue()— stringa CIDR o URI del Security GroupRegion()— slug della regioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InSecurityGroup(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithDirection(RuleDirection),WithProtocol(RuleProtocol),WithPort(string) - Active relationship:
TargetingCIDR(string),TargetingSecurityGroup(Ref)
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
Load Balancer
arubaClient.FromNetwork().LoadBalancers()
Operazioni supportate: List, Get
I Load Balancer sono in sola lettura tramite questo SDK — vengono creati e gestiti automaticamente dalla piattaforma Aruba Cloud.
list, err := arubaClient.FromNetwork().LoadBalancers().List(ctx, proj)
if err != nil {
log.Fatalf("List LoadBalancers: %v", err)
}
for _, lb := range list.Items() {
fmt.Println(lb.ID(), lb.Name(), lb.Address())
}
Accessor di risposta:
ID(),URI(),Name(),Tags()LoadBalancerID()— ID LB assegnato dal providerAddress()— indirizzo pubblicoVPC()—aruba.Refalla VPC collegataRegion()— slug della regioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()Raw()— struct wire sottostante
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
VPC Peering
arubaClient.FromNetwork().VPCPeerings()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
peering, err := arubaClient.FromNetwork().VPCPeerings().Create(
ctx,
aruba.NewVPCPeering().
Named("my-peering").
Tagged("network").
InVPC(vpc).
InRegion(aruba.RegionITBGBergamo).
WithPeerVPC(aruba.URI("/projects/"+peerProjectID+"/vpcs/"+peerVPCID)))
if err != nil {
log.Fatalf("Create VPCPeering: %v", err)
}
if err := peering.WaitUntilReady(ctx); err != nil {
log.Fatalf("VPCPeering did not become Active: %v", err)
}
fmt.Printf("✓ VPC Peering: %s\n", peering.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()VPCPeeringID()— ID peering assegnato dal providerVPCID()— ID VPC sorgentePeerVPC()—aruba.Refalla VPC peerState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InVPC(Ref) - Geography:
InRegion(Region) - Active relationship:
PeeredWith(Ref)
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
VPC Peering Route
arubaClient.FromNetwork().VPCPeeringRoutes()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
route, err := arubaClient.FromNetwork().VPCPeeringRoutes().Create(
ctx,
aruba.NewVPCPeeringRoute().
Named("my-peering-route").
Tagged("network").
InVPCPeering(peering).
InRegion(aruba.RegionITBGBergamo).
WithCIDR("10.0.0.0/8").
WithTarget(aruba.URI("/projects/"+projectID+"/vpcs/"+vpcID)))
if err != nil {
log.Fatalf("Create VPCPeeringRoute: %v", err)
}
if err := route.WaitUntilReady(ctx); err != nil {
log.Fatalf("VPCPeeringRoute did not become Active: %v", err)
}
fmt.Printf("✓ Peering Route: %s (CIDR: %s)\n", route.Name(), route.CIDR())
Accessor di risposta:
ID(),URI(),Name(),Tags()CIDR()— blocco CIDR della routeTarget()—aruba.Refal target della routeVPCPeeringID()— ID peering padreState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InVPCPeering(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithLocalCIDR(string),WithRemoteCIDR(string) - Billing:
BilledBy(BillingPeriod)
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
VPN Tunnel
arubaClient.FromNetwork().VPNTunnels()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
Sub-builder del VPN Tunnel:
aruba.NewVPNIKE()— parametri fase 1 IKE (WithEncryption(IKEEncryption),WithHash(IKEHash),WithDHGroup(IKEDHGroup),WithDPDAction(IKEDPDAction))aruba.NewVPNESP()— parametri fase 2 ESP (WithEncryption(ESPEncryption),WithHash(ESPHash),WithPFS(ESPPFSGroup))aruba.NewVPNPSK()— configurazione pre-shared key (WithKey(string),WithCloudSite(string),WithOnPremSite(string))
tunnel, err := arubaClient.FromNetwork().VPNTunnels().Create(
ctx,
aruba.NewVPNTunnel().
Named("my-vpn-tunnel").
Tagged("vpn-net").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
WithPeerClientPublicIP("203.0.113.1").
WithIKESettings(aruba.NewVPNIKE().
WithEncryption(aruba.IKEEncryptionAES256).
WithHash(aruba.IKEHashSHA256).
WithDHGroup(aruba.IKEDHGroup14)).
WithESPSettings(aruba.NewVPNESP().
WithEncryption(aruba.ESPEncryptionAES256).
WithHash(aruba.ESPHashSHA256)).
WithPSKSettings(aruba.NewVPNPSK().
WithKey("my-pre-shared-key")))
if err != nil {
log.Fatalf("Create VPNTunnel: %v", err)
}
if err := tunnel.WaitUntilReady(ctx); err != nil {
log.Fatalf("VPNTunnel did not become Active: %v", err)
}
fmt.Printf("✓ VPN Tunnel: %s (gateway: %s)\n", tunnel.Name(), tunnel.PeerClientPublicIP())
Accessor di risposta:
ID(),URI(),Name(),Tags()VPNTunnelID()— ID tunnel assegnato dal providerPeerClientPublicIP()— IP gateway del peer remotoIKE()— impostazioni IKE*aruba.VPNIKEESP()— impostazioni ESP*aruba.VPNESPPSK()— impostazioni PSK*aruba.VPNPSKState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfType(VPNType) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithVPNClientProtocol(VPNClientProtocol),WithPeerClientPublicIP(string) - Attached config:
WithIPConfig(*VPNIPConfig),WithIKESettings(*VPNIKE),WithESPSettings(*VPNESP),WithPSKSettings(*VPNPSK) - Billing:
BilledBy(BillingPeriod)
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
VPN Route
arubaClient.FromNetwork().VPNRoutes()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
vpnRoute, err := arubaClient.FromNetwork().VPNRoutes().Create(
ctx,
aruba.NewVPNRoute().
Named("my-vpn-route").
Tagged("vpn-net").
InVPNTunnel(tunnel).
InRegion(aruba.RegionITBGBergamo).
WithCIDR("10.0.0.0/8").
WithTarget(aruba.URI("/projects/"+projectID+"/vpcs/"+vpcID)))
if err != nil {
log.Fatalf("Create VPNRoute: %v", err)
}
if err := vpnRoute.WaitUntilReady(ctx); err != nil {
log.Fatalf("VPNRoute did not become Active: %v", err)
}
fmt.Printf("✓ VPN Route: %s (CIDR: %s)\n", vpnRoute.Name(), vpnRoute.CIDR())
Accessor di risposta:
ID(),URI(),Name(),Tags()CIDR()— blocco CIDR della routeTarget()—aruba.Refal target della routeVPNTunnelID()— ID VPN Tunnel padreState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InVPNTunnel(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
WithCloudSubnet(string),WithOnPremSubnet(string)
Eseguito come parte dell'orchestratore: examples/all-resources/orchestrator_create.go
Schedule
Job
arubaClient.FromSchedule().Jobs()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — State() e FailureReason() sono disponibili.
Usa OneShotAt(t time.Time) per pianificare un job one-shot, oppure WithCron(expr string) per un job ricorrente con una pianificazione cron. Usa RecurringUntil(t time.Time) per impostare una data di fine per un job ricorrente.
// Job one-shot — eseguito una sola volta a un orario specifico
job, err := arubaClient.FromSchedule().Jobs().Create(
ctx,
aruba.NewJob().
Named("my-one-shot-job").
Tagged("automation").
InProject(proj).
OneShotAt(time.Now().Add(10*time.Minute)))
if err != nil {
log.Fatalf("Create Job: %v", err)
}
fmt.Printf("✓ Job: %s (tipo: %s)\n", job.Name(), job.JobType())
// Job ricorrente — eseguito secondo una pianificazione cron
cronJob, err := arubaClient.FromSchedule().Jobs().Create(
ctx,
aruba.NewJob().
Named("my-recurring-job").
Tagged("automation").
InProject(proj).
WithCron("0 * * * *"))
if err != nil {
log.Fatalf("Create recurring Job: %v", err)
}
fmt.Printf("✓ Job ricorrente: %s (cron: %s)\n", cronJob.Name(), cronJob.Cron())
Accessor di risposta:
ID(),URI(),Name(),Tags()JobID()— ID job assegnato dal providerJobType()— tipo di job (types.JobTypeOneShototypes.JobTypeRecurring)Cron()— espressione cron (job ricorrenti)IsEnabled()— boolState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()Raw()— struct wire sottostante
Setter:
- Classifier:
OfType(JobType) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
OneShotAt(time.Time),StartingAt(time.Time),WithCron(string),RecurringUntil(time.Time),WithSteps(...*JobStep) - Boolean state:
Enabled(),Disabled()
Esempio end-to-end completo: examples/all-resources/resource_job.go
Security
KMS (Key Management Service)
arubaClient.FromSecurity().KMS()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
kms, err := arubaClient.FromSecurity().KMS().Create(
ctx,
aruba.NewKMS().
Named("my-kms").
Tagged("security").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create KMS: %v", err)
}
if err := kms.WaitUntilReady(ctx); err != nil {
log.Fatalf("KMS did not become Active: %v", err)
}
fmt.Printf("✓ KMS: %s (ID: %s)\n", kms.Name(), kms.ID())
Accessor di risposta:
ID(),URI(),Name(),Tags()KMSID()— ID istanza KMS assegnato dal providerBillingPeriod()— cadenza di fatturazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_kms.go
Key
arubaClient.FromSecurity().Keys()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — State() e FailureReason() sono disponibili.
OfAlgorithm accetta aruba.KeyAlgorithmAes o aruba.KeyAlgorithmRsa (costanti tipizzate — nessun cast a stringa necessario).
key, err := arubaClient.FromSecurity().Keys().Create(
ctx,
aruba.NewKey().
OfAlgorithm(aruba.KeyAlgorithmAes).
Named("my-encryption-key").
Tagged("security").
InKMS(kms))
if err != nil {
log.Fatalf("Create Key: %v", err)
}
fmt.Printf("✓ Chiave: %s (algoritmo: %s)\n", key.Name(), key.Algorithm())
Accessor di risposta:
ID(),URI(),Name(),Tags()KeyID()— ID chiave assegnato dal providerAlgorithm()— stringa dell'algoritmoType()—"Symmetric"o"Asymmetric"Status()— stato del ciclo di vita della chiaveCreationSource()— come è stata creata la chiaveState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfAlgorithm(KeyAlgorithm) - Name:
Named(string) - Containment:
InKMS(Ref)
Le operazioni sulle chiavi sono trattate nell'esempio KMS: examples/all-resources/resource_kms.go
Kmip
arubaClient.FromSecurity().Kmips()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create. WaitUntilReady del KMIP ha successo su "CertificateAvailable" o "Active". WaitUntilCertificateAvailable è un alias per WaitUntilReady.
km, err := arubaClient.FromSecurity().Kmips().Create(
ctx,
aruba.NewKmip().
Named("my-kmip").
Tagged("security").
InKMS(kms))
if err != nil {
log.Fatalf("Create Kmip: %v", err)
}
if err := km.WaitUntilReady(ctx); err != nil {
log.Fatalf("Kmip did not become ready: %v", err)
}
fmt.Printf("✓ Kmip: %s\n", km.Name())
Download del certificato KMIP (richiede un wrapper idratato):
cert, err := km.Download(ctx)
if err != nil {
log.Fatalf("Download Kmip certificate: %v", err)
}
fmt.Println("Cert:", cert.Cert())
fmt.Println("Key:", cert.Key())
Accessor di risposta:
ID(),URI(),Name(),Tags()KmipID()— ID KMIP assegnato dal providerKmipStatus()— stato specifico del KMIPState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilCertificateAvailable(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Containment:
InKMS(Ref)
Le operazioni KMIP sono trattate nell'esempio KMS: examples/all-resources/resource_kms.go
Storage
Block Storage (Volume)
arubaClient.FromStorage().Volumes()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
OfType accetta aruba.BlockStorageTypeStandard o aruba.BlockStorageTypePerformance. Usa AsBootable() per contrassegnare un volume come avviabile; NotBootable() per annullare l'impostazione. Usa FromImage(imageID) per specificare un'immagine di base.
bs, err := arubaClient.FromStorage().Volumes().Create(
ctx,
aruba.NewBlockStorage().
OfType(aruba.BlockStorageTypeStandard).
Named("my-volume").
Tagged("storage").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
InZone(aruba.ZoneITBG1).
SizedGB(20).
FromImage("LU22-001").
AsBootable().
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create BlockStorage: %v", err)
}
if err := bs.WaitUntilReady(ctx); err != nil {
log.Fatalf("BlockStorage did not become Active: %v", err)
}
fmt.Printf("✓ Volume: %s (%d GB)\n", bs.Name(), bs.SizeGB())
Per creare un volume da uno snapshot, usa FromSnapshot(snapshot) invece di FromImage:
bs, err := arubaClient.FromStorage().Volumes().Create(
ctx,
aruba.NewBlockStorage().
OfType(aruba.BlockStorageTypeStandard).
Named("restored-volume").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
InZone(aruba.ZoneITBG1).
SizedGB(20).
FromSnapshot(snapshot).
AsBootable().
BilledBy(aruba.BillingPeriodHour))
Accessor di risposta:
ID(),URI(),Name(),Tags()BlockStorageID()— ID volume assegnato dal providerSizeGB()— dimensione in GBType()— tipo di storageZone()— zona di disponibilitàBillingPeriod()— cadenza di fatturazioneIsBootable()— boolImage()— riferimento all'immagineSnapshotURI()— URI dello snapshot sorgente (se creato da snapshot)State(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilNotUsed(ctx, opts...),WaitUntilUsed(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfType(BlockStorageType) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region),InZone(Zone) - Descriptive scalars:
SizedGB(int) - Origin:
FromImage(string),FromSnapshot(Ref) - Boolean state:
AsBootable(),NotBootable() - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_block_storage.go
Snapshot
arubaClient.FromStorage().Snapshots()
Operazioni supportate: Create, List, Get, Update, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
snap, err := arubaClient.FromStorage().Snapshots().Create(
ctx,
aruba.NewSnapshot().
Named("my-snapshot").
Tagged("backup").
InProject(proj).
InRegion(aruba.RegionITBGBergamo).
FromVolume(bs).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create Snapshot: %v", err)
}
if err := snap.WaitUntilReady(ctx); err != nil {
log.Fatalf("Snapshot did not become Active: %v", err)
}
fmt.Printf("✓ Snapshot: %s\n", snap.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()SnapshotID()— ID snapshot assegnato dal providerSizeGB()— dimensione dello snapshot in GBType()— tipo di storageZone()— zona di disponibilitàBillingPeriod()— cadenza di fatturazioneBootable()— boolVolumeURI()— URI del volume sorgenteState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Origin:
FromVolume(Ref) - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_snapshot.go
Storage Backup
arubaClient.FromStorage().Backups()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
OfType accetta aruba.StorageBackupTypeFull o aruba.StorageBackupTypeIncremental. Usa FromVolume(vol) per specificare il volume sorgente.
backup, err := arubaClient.FromStorage().Backups().Create(
ctx,
aruba.NewStorageBackup().
OfType(aruba.StorageBackupTypeFull).
Named("my-backup").
Tagged("backup").
InProject(proj).
RetainedForDays(30).
FromVolume(bs).
BilledBy(aruba.BillingPeriodHour))
if err != nil {
log.Fatalf("Create StorageBackup: %v", err)
}
if err := backup.WaitUntilReady(ctx); err != nil {
log.Fatalf("StorageBackup did not become Active: %v", err)
}
fmt.Printf("✓ Storage Backup: %s\n", backup.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()BackupID()— ID backup assegnato dal providerType()— tipo di backupRetentionDays()— periodo di conservazione in giorniOriginURI()— URI del volume sorgenteBillingPeriod()— cadenza di fatturazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Classifier:
OfType(StorageBackupType) - Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
InProject(Ref) - Geography:
InRegion(Region) - Descriptive scalars:
RetainedForDays(int) - Origin:
FromVolume(Ref) - Billing:
BilledBy(BillingPeriod)
Esempio end-to-end completo: examples/all-resources/resource_storage_backup.go
Storage Restore
arubaClient.FromStorage().Restores()
Operazioni supportate: Create, List, Get, Delete
Asincrono: sì — chiama WaitUntilReady(ctx) dopo Create.
restore, err := arubaClient.FromStorage().Restores().Create(
ctx,
aruba.NewStorageRestore().
Named("my-restore").
Tagged("restore").
FromBackup(backup).
WithTarget(aruba.URI(backup.OriginURI())))
if err != nil {
log.Fatalf("Create StorageRestore: %v", err)
}
if err := restore.WaitUntilReady(ctx); err != nil {
log.Fatalf("StorageRestore did not become Active: %v", err)
}
fmt.Printf("✓ Storage Restore: %s\n", restore.Name())
Accessor di risposta:
ID(),URI(),Name(),Tags()RestoreID()— ID restore assegnato dal providerTargetURI()— URI del volume di destinazioneState(),FailureReason(),PreviousState(),IsDisabled(),DisableReasons()WaitUntilReady(ctx, opts...),WaitUntilActive(ctx, opts...),WaitUntilStates(ctx, []types.State{...}, opts...),WaitUntilGone(ctx, opts...)Raw()— struct wire sottostante
Setter:
- Name:
Named(string) - Labels:
Tagged(...string),Untagged(...string),RetaggedAs(...string) - Containment:
FromBackup(Ref) - Geography:
InRegion(Region) - Origin:
ToVolume(Ref)
Esempio end-to-end completo: examples/all-resources/resource_storage_restore.go
Opzioni di chiamata
Passa le opzioni di chiamata come argomenti variadic a qualsiasi chiamata List, Get, Create, Update o Delete:
| Opzione | Scopo |
|---|---|
aruba.WithFilter(expr) | Espressione filtro lato server |
aruba.WithSort(expr) | Espressione di ordinamento |
aruba.WithLimit(n) | Dimensione della pagina |
aruba.WithOffset(n) | Offset di paginazione |
aruba.WithProjection(expr) | Proiezione dei campi |
aruba.WithAPIVersion(v) | Sovrascrive la versione API per questa chiamata |
Vedi Filtri per la sintassi dei filtri e degli ordinamenti.
Costanti enum
Tutti i tipi enum sono ri-esportati da pkg/aruba — nessun import aggiuntivo necessario. L'elenco canonico si trova in pkg/aruba/aliases.go.
Regione e Zona
| Costante | Descrizione |
|---|---|
aruba.RegionITBGBergamo | Datacenter di Bergamo (Italia) |
aruba.ZoneITBG1 | Zona di disponibilità Bergamo 1 |
aruba.ZoneITBG2 | Zona di disponibilità Bergamo 2 |
aruba.ZoneITBG3 | Zona di disponibilità Bergamo 3 |
Fatturazione
| Costante | Descrizione |
|---|---|
aruba.BillingPeriodHour | Fatturazione oraria |
aruba.BillingPeriodMonth | Fatturazione mensile |
Network
| Costante | Valore |
|---|---|
aruba.RuleDirectionIngress | "Ingress" |
aruba.RuleDirectionEgress | "Egress" |
aruba.RuleProtocolTCP | "TCP" |
aruba.RuleProtocolUDP | "UDP" |
aruba.RuleProtocolICMP | "ICMP" |
aruba.RuleProtocolANY | (wildcard — qualsiasi protocollo) |
aruba.SubnetTypeBasic | "Basic" |
aruba.SubnetTypeAdvanced | "Advanced" |
Compute
| Costante | Descrizione |
|---|---|
aruba.CloudServerFlavorCSO1A2 | 1 vCPU, 2 GB RAM |
aruba.CloudServerFlavorCSO2A4 | 2 vCPU, 4 GB RAM |
aruba.CloudServerFlavorCSO4A8 | 4 vCPU, 8 GB RAM |
aruba.CloudServerFlavorCSO8A16 | 8 vCPU, 16 GB RAM |
… (vedi aliases.go per l'elenco completo) |
Container
| Costante | Descrizione |
|---|---|
aruba.KubernetesVersion1323 | Kubernetes 1.32.3 |
aruba.KubernetesVersion1332 | Kubernetes 1.33.2 |
aruba.KubernetesVersion1341 | Kubernetes 1.34.1 |
aruba.NodePoolInstanceK2A4 | 2 vCPU, 4 GB RAM |
aruba.NodePoolInstanceK4A8 | 4 vCPU, 8 GB RAM |
aruba.NodePoolInstanceK8A16 | 8 vCPU, 16 GB RAM |
… (vedi aliases.go per l'elenco completo) | |
aruba.ContainerRegistrySizeFlavorSmall | Livello small di utenti concorrenti |
aruba.ContainerRegistrySizeFlavorMedium | Livello medium di utenti concorrenti |
aruba.ContainerRegistrySizeFlavorHighPerf | Livello ad alte prestazioni |
Database
| Costante | Descrizione |
|---|---|
aruba.DatabaseEngineMySQL80 | MySQL 8.0 |
aruba.DatabaseEngineMSSQL2022Web | SQL Server 2022 Web |
aruba.DatabaseEngineMSSQL2022Standard | SQL Server 2022 Standard |
aruba.DatabaseEngineMSSQL2022Enterprise | SQL Server 2022 Enterprise |
aruba.DBaaSFlavorDBO1A2 | 1 vCPU, 2 GB RAM |
aruba.DBaaSFlavorDBO2A4 | 2 vCPU, 4 GB RAM |
aruba.DBaaSFlavorDBO4A8 | 4 vCPU, 8 GB RAM |
… (vedi aliases.go per l'elenco completo) |
Storage
| Costante | Valore |
|---|---|
aruba.BlockStorageTypeStandard | "Standard" |
aruba.BlockStorageTypePerformance | "Performance" |
aruba.StorageBackupTypeFull | "Full" |
aruba.StorageBackupTypeIncremental | "Incremental" |
Security
| Costante | Valore |
|---|---|
aruba.KeyAlgorithmAes | "Aes" |
aruba.KeyAlgorithmRsa | "Rsa" |
aruba.KeyTypeSymmetric | "Symmetric" |
aruba.KeyTypeAsymmetric | "Asymmetric" |
aruba.ServiceStatusCertificateAvailable | "CertificateAvailable" |
Crittografia VPN
| Costante | Descrizione |
|---|---|
aruba.IKEEncryptionAES256 | AES-256 CBC (IKE fase 1) |
aruba.IKEHashSHA256 | HMAC-SHA-256 (IKE fase 1) |
aruba.IKEDHGroup14 | Gruppo Diffie-Hellman MODP-2048 |
aruba.ESPEncryptionAES256 | AES-256 CBC (ESP fase 2) |
aruba.ESPHashSHA256 | HMAC-SHA-256 (ESP fase 2) |
aruba.ESPPFSGroupEnable | PFS abilitato (gruppo DH negoziato) |
aruba.ESPPFSGroupDisable | PFS disabilitato |
… (vedi aliases.go per gli elenchi completi) |
Schedule
| Costante | Valore |
|---|---|
aruba.JobTypeOneShot | "OneShot" |
aruba.JobTypeRecurring | "Recurring" |
Appendice: Tipi wire grezzi (pkg/types)
I seguenti tipi sono le struct wire di basso livello sottostanti. Normalmente vi si accede solo tramite .Raw() o .RawRequest() su un wrapper, oppure quando si costruiscono integrazioni avanzate con pkg/async. Sono anche ri-esportati come alias di tipo aruba.XxxRequest / aruba.XxxResponse in modo da poterli referenziare senza un import aggiuntivo.
| Tipo | File | Note |
|---|---|---|
Response[T] | resource.go | Envelope HTTP generico restituito dagli adapter di basso livello |
ErrorResponse | error.go | Errore strutturato RFC 7807 |
ListResponse | resource.go | Link di paginazione e conteggio totale |
ResourceMetadataRequest | resource.go | Nome + tag per Create |
RegionalResourceMetadataRequest | resource.go | Estende i metadati con Location |
ResourceMetadataResponse | resource.go | ID, URI, Name, timestamp |
ResourceStatusResponse | resource.go | Campo State |
ReferenceResourceCommon | resource.go | {uri: "…"} link a un'altra risorsa |
RequestParameters | parameters.go | Struct filtro/ordinamento/limit/offset di basso livello (preferire gli helper CallOption) |
ProjectRequest / ProjectResponse / ProjectListResponse | project.project.go | |
VPCRequest / VPCResponse / VPCListResponse | network.vpc.go | |
SubnetRequest / SubnetResponse / SubnetListResponse | network.subnet.go | |
SecurityGroupRequest / SecurityGroupResponse | network.security-group.go | |
SecurityRuleRequest / SecurityRuleResponse | network.security-rule.go | |
ElasticIPRequest / ElasticIPResponse | network.elastic-ip.go | |
CloudServerRequest / CloudServerResponse | compute.cloudserver.go | |
KeyPairRequest / KeyPairResponse | compute.keypair.go | |
KaaSRequest / KaaSResponse / KaaSUpdateRequest | container.kaas.go | |
ContainerRegistryRequest / ContainerRegistryResponse | container.containerregistry.go | |
DBaaSRequest / DBaaSResponse | database.dbaas.go | |
KmsRequest / KmsResponse | security.kms.go | |
KeyRequest / KeyResponse | security.kms.go | |
KmipRequest / KmipResponse / KmipCertificateResponse | security.kms.go | |
BlockStorageRequest / BlockStorageResponse | storage.block-storage.go | |
SnapshotRequest / SnapshotResponse | storage.snapshot.go | |
StorageBackupRequest / StorageBackupResponse | storage.backup.go | |
JobRequest / JobResponse / JobListResponse | schedule.job.go | |
AlertResponse / AlertsListResponse | metrics.alert.go | |
MetricResponse / MetricListResponse | metrics.metric.go | |
AuditEvent / AuditEventListResponse | audit.event.go | |
VPCPeeringRequest / VPCPeeringResponse | network.vpc-peering.go | |
VPNTunnelRequest / VPNTunnelResponse | network.vpn-tunnel.go | |
VPNRouteRequest / VPNRouteResponse | network.vpn-route.go | |
LoadBalancerResponse | network.load-balancer.go |