github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/blockstorage/extensions/volumetenants/doc.go (about)

     1  /*
     2  Package volumetenants provides the ability to extend a volume result with
     3  tenant/project information. Example:
     4  
     5  	type VolumeWithTenant struct {
     6  		volumes.Volume
     7  		volumetenants.VolumeTenantExt
     8  	}
     9  
    10  	var allVolumes []VolumeWithTenant
    11  
    12  	allPages, err := volumes.List(client, nil).AllPages()
    13  	if err != nil {
    14  		panic("Unable to retrieve volumes: %s", err)
    15  	}
    16  
    17  	err = volumes.ExtractVolumesInto(allPages, &allVolumes)
    18  	if err != nil {
    19  		panic("Unable to extract volumes: %s", err)
    20  	}
    21  
    22  	for _, volume := range allVolumes {
    23  		fmt.Println(volume.TenantID)
    24  	}
    25  */
    26  package volumetenants