#NEWLINE# def _get_endpoint_url( self ) : #NEWLINE# #INDENT# if ( self . auth_url is None ) : #NEWLINE# #INDENT# raise exceptions . NoAuthURLProvided ( ) #NEWLINE# #UNINDENT# url = ( self . auth_url + ( '/tokens/%s/endpoints' % self . auth_token ) ) #NEWLINE# try : #NEWLINE# #INDENT# ( resp , body ) = self . _cs_request ( url , 'GET' ) #NEWLINE# #UNINDENT# except exceptions . Unauthorized : #NEWLINE# #INDENT# self . authenticate ( ) #NEWLINE# return self . endpoint_url #NEWLINE# #UNINDENT# body = json . loads ( body ) #NEWLINE# for endpoint in body . get ( 'endpoints' , [ ] ) : #NEWLINE# #INDENT# if ( ( endpoint [ 'type' ] == 'network' ) and ( endpoint . get ( 'region' ) == self . region_name ) ) : #NEWLINE# #INDENT# if ( self . endpoint_type not in endpoint ) : #NEWLINE# #INDENT# raise exceptions . EndpointTypeNotFound ( type_ = self . endpoint_type ) #NEWLINE# #UNINDENT# return endpoint [ endpoint . endpoint_type ] #NEWLINE# #UNINDENT# #UNINDENT# raise exceptions . EndpointNotFound ( )