github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/db/v1/datastores/requests.go (about)

     1  package datastores
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  	"github.com/huaweicloud/golangsdk/pagination"
     6  )
     7  
     8  // List will list all available datastore types that instances can use.
     9  func List(client *golangsdk.ServiceClient) pagination.Pager {
    10  	return pagination.NewPager(client, baseURL(client), func(r pagination.PageResult) pagination.Page {
    11  		return DatastorePage{pagination.SinglePageBase(r)}
    12  	})
    13  }
    14  
    15  // Get will retrieve the details of a specified datastore type.
    16  func Get(client *golangsdk.ServiceClient, datastoreID string) (r GetResult) {
    17  	_, r.Err = client.Get(resourceURL(client, datastoreID), &r.Body, nil)
    18  	return
    19  }
    20  
    21  // ListVersions will list all of the available versions for a specified
    22  // datastore type.
    23  func ListVersions(client *golangsdk.ServiceClient, datastoreID string) pagination.Pager {
    24  	return pagination.NewPager(client, versionsURL(client, datastoreID), func(r pagination.PageResult) pagination.Page {
    25  		return VersionPage{pagination.SinglePageBase(r)}
    26  	})
    27  }
    28  
    29  // GetVersion will retrieve the details of a specified datastore version.
    30  func GetVersion(client *golangsdk.ServiceClient, datastoreID, versionID string) (r GetVersionResult) {
    31  	_, r.Err = client.Get(versionURL(client, datastoreID, versionID), &r.Body, nil)
    32  	return
    33  }