Questo contenuto non è disponibile nella lingua selezionata.

3.8. Getting Sub-Resources


The following example outlines how to reference the sub-resources of a resource. In this example, a disk with the name 'my disk' that belongs to a virtual machine with the name 'test' is referenced.

Procedure 3.5. Getting the Sub-Resources of a Resource

  1. Declare an instance of the resource whose sub-resources are to be referenced:
    VM vm = api.getVMs().get("test");
  2. Declare an instance of the sub-resource to be referenced:
    VMDisk disk = vm.getDisks().get("my disk");
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni sulla documentazione di Red Hat

Legal Notice

Theme

© 2026 Red Hat
Torna in cima