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

     1  /*
     2  Package extensions provides information and interaction with the different
     3  extensions available for an OpenStack service.
     4  
     5  The purpose of OpenStack API extensions is to:
     6  
     7  - Introduce new features in the API without requiring a version change.
     8  - Introduce vendor-specific niche functionality.
     9  - Act as a proving ground for experimental functionalities that might be
    10  included in a future version of the API.
    11  
    12  Extensions usually have tags that prevent conflicts with other extensions that
    13  define attributes or resources with the same names, and with core resources and
    14  attributes. Because an extension might not be supported by all plug-ins, its
    15  availability varies with deployments and the specific plug-in.
    16  
    17  The results of this package vary depending on the type of Service Client used.
    18  In the following examples, note how the only difference is the creation of the
    19  Service Client.
    20  
    21  Example of Retrieving Compute Extensions
    22  
    23  	ao, err := openstack.AuthOptionsFromEnv()
    24  	provider, err := openstack.AuthenticatedClient(ao)
    25  	computeClient, err := openstack.NewComputeV2(provider, golangsdk.EndpointOpts{
    26  		Region: os.Getenv("OS_REGION_NAME"),
    27  	})
    28  
    29  	allPages, err := extensions.List(computeClient).Allpages()
    30  	allExtensions, err := extensions.ExtractExtensions(allPages)
    31  
    32  	for _, extension := range allExtensions{
    33  		fmt.Println("%+v\n", extension)
    34  	}
    35  
    36  
    37  Example of Retrieving Network Extensions
    38  
    39  	ao, err := openstack.AuthOptionsFromEnv()
    40  	provider, err := openstack.AuthenticatedClient(ao)
    41  	networkClient, err := openstack.NewNetworkV2(provider, golangsdk.EndpointOpts{
    42  		Region: os.Getenv("OS_REGION_NAME"),
    43  	})
    44  
    45  	allPages, err := extensions.List(networkClient).Allpages()
    46  	allExtensions, err := extensions.ExtractExtensions(allPages)
    47  
    48  	for _, extension := range allExtensions{
    49  		fmt.Println("%+v\n", extension)
    50  	}
    51  */
    52  package extensions