@@ -86,6 +86,7 @@ def __init__(
8686 self ._pw_callback = pw_func
8787 self ._url = self ._cli_options .auth .get ('url' , None )
8888 self ._region_name = self ._cli_options .region_name
89+ self ._endpoint_type = self ._cli_options .endpoint_type
8990
9091 self .timing = self ._cli_options .timing
9192
@@ -183,18 +184,23 @@ def auth_ref(self):
183184 self ._auth_ref = self .auth .get_auth_ref (self .session )
184185 return self ._auth_ref
185186
186- def get_endpoint_for_service_type (self , service_type , region_name = None ):
187+ def get_endpoint_for_service_type (self , service_type , region_name = None ,
188+ endpoint_type = 'public' ):
187189 """Return the endpoint URL for the service type."""
190+ if not endpoint_type :
191+ endpoint_type = 'public'
188192 # See if we are using password flow auth, i.e. we have a
189193 # service catalog to select endpoints from
190194 if self .auth_ref :
191195 endpoint = self .auth_ref .service_catalog .url_for (
192196 service_type = service_type ,
193197 region_name = region_name ,
198+ endpoint_type = endpoint_type ,
194199 )
195200 else :
196201 # Get the passed endpoint directly from the auth plugin
197- endpoint = self .auth .get_endpoint (self .session )
202+ endpoint = self .auth .get_endpoint (self .session ,
203+ interface = endpoint_type )
198204 return endpoint
199205
200206
0 commit comments