@@ -122,8 +122,8 @@ type SupportedMicroversions struct {
122122 MinMinor int
123123}
124124
125- // GetSupportedMicroversions returns the minimum and maximum microversion that is supported by the ServiceClient Endpoint.
126- func GetSupportedMicroversions (ctx context.Context , client * gophercloud.ServiceClient ) (SupportedMicroversions , error ) {
125+ // GetServiceVersions returns the minimum and maximum microversion that is supported by the ServiceClient Endpoint.
126+ func GetServiceVersions (ctx context.Context , client * gophercloud.ProviderClient , endpointURL string ) (SupportedMicroversions , error ) {
127127 type valueResp struct {
128128 ID string `json:"id"`
129129 Status string `json:"status"`
@@ -138,8 +138,9 @@ func GetSupportedMicroversions(ctx context.Context, client *gophercloud.ServiceC
138138 var minVersion , maxVersion string
139139 var supportedMicroversions SupportedMicroversions
140140 var resp response
141- _ , err := client .Get (ctx , client .Endpoint , & resp , & gophercloud.RequestOpts {
142- OkCodes : []int {200 , 300 },
141+ _ , err := client .Request (ctx , "GET" , endpointURL , & gophercloud.RequestOpts {
142+ JSONResponse : & resp ,
143+ OkCodes : []int {200 , 300 },
143144 })
144145
145146 if err != nil {
@@ -161,7 +162,7 @@ func GetSupportedMicroversions(ctx context.Context, client *gophercloud.ServiceC
161162
162163 // Return early if the endpoint does not support microversions
163164 if minVersion == "" && maxVersion == "" {
164- return supportedMicroversions , fmt .Errorf ("microversions not supported by ServiceClient Endpoint " )
165+ return supportedMicroversions , fmt .Errorf ("microversions not supported by endpoint " )
165166 }
166167
167168 supportedMicroversions .MinMajor , supportedMicroversions .MinMinor , err = ParseMicroversion (minVersion )
@@ -177,6 +178,11 @@ func GetSupportedMicroversions(ctx context.Context, client *gophercloud.ServiceC
177178 return supportedMicroversions , nil
178179}
179180
181+ // GetSupportedMicroversions returns the minimum and maximum microversion that is supported by the ServiceClient Endpoint.
182+ func GetSupportedMicroversions (ctx context.Context , client * gophercloud.ServiceClient ) (SupportedMicroversions , error ) {
183+ return GetServiceVersions (ctx , client .ProviderClient , client .Endpoint )
184+ }
185+
180186// RequireMicroversion checks that the required microversion is supported and
181187// returns a ServiceClient with the microversion set.
182188func RequireMicroversion (ctx context.Context , client gophercloud.ServiceClient , required string ) (gophercloud.ServiceClient , error ) {
0 commit comments