@@ -319,16 +319,16 @@ func (cnsClient *CNSClient) ReleaseIPAddress(orchestratorContext []byte) error {
319319
320320// GetIPAddressesWithStates takes a variadic number of string parameters, to get all IP Addresses matching a number of states
321321// usage GetIPAddressesWithStates(cns.Available, cns.Allocated)
322- func (cnsClient * CNSClient ) GetIPAddressesMatchingStates (StateFilter ... string ) ([]cns.IPAddressState , error ) {
322+ func (cnsClient * CNSClient ) GetIPAddressesMatchingStates (StateFilter ... string ) ([]cns.IPConfigurationStatus , error ) {
323323 var (
324- resp cns.GetIPAddressStateResponse
324+ resp cns.GetIPAddressStatusResponse
325325 err error
326326 res * http.Response
327327 body bytes.Buffer
328328 )
329329
330330 if len (StateFilter ) == 0 {
331- return []cns. IPAddressState {} , nil
331+ return resp . IPConfigurationStatus , nil
332332 }
333333
334334 url := cnsClient .connectionURL + cns .GetIPAddresses
@@ -341,33 +341,33 @@ func (cnsClient *CNSClient) GetIPAddressesMatchingStates(StateFilter ...string)
341341 err = json .NewEncoder (& body ).Encode (payload )
342342 if err != nil {
343343 log .Errorf ("encoding json failed with %v" , err )
344- return resp .IPAddresses , err
344+ return resp .IPConfigurationStatus , err
345345 }
346346
347347 res , err = http .Post (url , contentTypeJSON , & body )
348348 if err != nil {
349349 log .Errorf ("[Azure CNSClient] HTTP Post returned error %v" , err .Error ())
350- return resp .IPAddresses , err
350+ return resp .IPConfigurationStatus , err
351351 }
352352
353353 defer res .Body .Close ()
354354
355355 if res .StatusCode != http .StatusOK {
356356 errMsg := fmt .Sprintf ("[Azure CNSClient] GetIPAddressesMatchingStates invalid http status code: %v" , res .StatusCode )
357357 log .Errorf (errMsg )
358- return resp .IPAddresses , fmt .Errorf (errMsg )
358+ return resp .IPConfigurationStatus , fmt .Errorf (errMsg )
359359 }
360360
361361 err = json .NewDecoder (res .Body ).Decode (& resp )
362362 if err != nil {
363363 log .Errorf ("[Azure CNSClient] Error received while parsing GetIPAddressesMatchingStates response resp:%v err:%v" , res .Body , err .Error ())
364- return resp .IPAddresses , err
364+ return resp .IPConfigurationStatus , err
365365 }
366366
367367 if resp .Response .ReturnCode != 0 {
368368 log .Errorf ("[Azure CNSClient] GetIPAddressesMatchingStates received error response :%v" , resp .Response .Message )
369- return resp .IPAddresses , fmt .Errorf (resp .Response .Message )
369+ return resp .IPConfigurationStatus , fmt .Errorf (resp .Response .Message )
370370 }
371371
372- return resp .IPAddresses , err
372+ return resp .IPConfigurationStatus , err
373373}
0 commit comments