github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/evs/v1/apiversions/list.go (about)

     1  package apiversions
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func List(client *golangsdk.ServiceClient) ([]APIVersion, error) {
     9  	raw, err := client.Get(client.ServiceURL(""), nil, nil)
    10  	if err != nil {
    11  		return nil, err
    12  	}
    13  
    14  	var res []APIVersion
    15  	err = extract.IntoSlicePtr(raw.Body, &res, "versions")
    16  	return res, err
    17  }
    18  
    19  type APIVersion struct {
    20  	// unique identifier
    21  	ID string `json:"id"`
    22  	// current status e.g. SUPPORTED
    23  	Status string `json:"status"`
    24  	// date last updated e.g. 2014-06-28T12:20:21Z
    25  	Updated string `json:"updated"`
    26  }