github.com/gophercloud/gophercloud@v1.11.0/openstack/compute/apiversions/doc.go (about)

     1  /*
     2  Package apiversions provides information and interaction with the different
     3  API versions for the Compute service, code-named Nova.
     4  
     5  Example to List API Versions
     6  
     7  	allPages, err := apiversions.List(computeClient).AllPages()
     8  	if err != nil {
     9  		panic(err)
    10  	}
    11  
    12  	allVersions, err := apiversions.ExtractAPIVersions(allPages)
    13  	if err != nil {
    14  		panic(err)
    15  	}
    16  
    17  	for _, version := range allVersions {
    18  		fmt.Printf("%+v\n", version)
    19  	}
    20  
    21  Example to Get an API Version
    22  
    23  	version, err := apiVersions.Get(computeClient, "v2.1").Extract()
    24  	if err != nil {
    25  		panic(err)
    26  	}
    27  
    28  	fmt.Printf("%+v\n", version)
    29  */
    30  package apiversions