Skip to content

Commit 36391a8

Browse files
committed
Rename endpoint type to interface
Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c Closes-Bug: #1454392
1 parent ee64c2f commit 36391a8

13 files changed

Lines changed: 46 additions & 50 deletions

File tree

doc/source/configuration.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The keys match the :program:`openstack` global options but without the
7878
username: openstack
7979
password: xyzpdq!lazydog
8080
region_name: DFW,ORD,IAD
81-
endpoint_type: internal
81+
interface: internal
8282

8383
In the above example, the ``auth_url`` for the ``rackspace`` cloud is taken
8484
from :file:`clouds-public.yaml` (see below).
@@ -97,7 +97,7 @@ to the following options if the ``rackspace`` entry in :file:`clouds-public.yaml
9797
--os-username openstack
9898
--os-password xyzpdq!lazydog
9999
--os-region-name DFW
100-
--os-endpoint-type internal
100+
--os-interface internal
101101

102102
and can be selected on the command line::
103103

@@ -107,9 +107,9 @@ Note that multiple regions are listed in the ``rackspace`` entry. An otherwise
107107
identical configuration is created for each region. If ``-os-region-name`` is not
108108
specified on the command line, the first region in the list is used by default.
109109

110-
The selection of ``endpoint_type`` (as seen above in the ``rackspace`` entry)
110+
The selection of ``interface`` (as seen above in the ``rackspace`` entry)
111111
is optional. For this configuration to work, every service for this cloud
112-
instance must already be configured to support this type of endpoint.
112+
instance must already be configured to support this type of interface.
113113

114114
clouds-public.yaml
115115
~~~~~~~~~~~~~~~~~~

doc/source/man/openstack.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ OPTIONS
6767
The authentication plugin type to use when connecting to the Identity service.
6868
If this option is not set, :program:`openstack` will attempt to guess the
6969
authentication method to use based on the other options.
70-
If this option is set, its version must match :option:`--os-identity-api-version`
70+
If this option is set, its version must match :option:`--os-identity-api-version`
7171

7272
:option:`--os-auth-url` <auth-url>
7373
Authentication URL
@@ -120,8 +120,8 @@ OPTIONS
120120
:option:`--os-XXXX-api-version` <XXXX-api-version>
121121
Additional API version options will be available depending on the installed API libraries.
122122

123-
:option:`--os-endpoint-type` <endpoint-type>
124-
Endpoint type. Valid options are `public`, `admin` and `internal`.
123+
:option:`--os-interface` <interface>
124+
Interface type. Valid options are `public`, `admin` and `internal`.
125125

126126
COMMANDS
127127
========
@@ -299,7 +299,7 @@ The following environment variables can be set to alter the behaviour of :progra
299299
The name of a cloud configuration in ``clouds.yaml``.
300300

301301
:envvar:`OS_AUTH_PLUGIN`
302-
The authentication plugin to use when connecting to the Identity service, its version must match the Identity API version
302+
The authentication plugin to use when connecting to the Identity service, its version must match the Identity API version
303303

304304
:envvar:`OS_AUTH_URL`
305305
Authentication URL
@@ -346,8 +346,8 @@ The following environment variables can be set to alter the behaviour of :progra
346346
:envvar:`OS_XXXX_API_VERSION`
347347
Additional API version options will be available depending on the installed API libraries.
348348

349-
:envvar:`OS_ENDPOINT_TYPE`
350-
Endpoint type. Valid options are `public`, `admin` and `internal`.
349+
:envvar:`OS_INTERFACE`
350+
Interface type. Valid options are `public`, `admin` and `internal`.
351351

352352

353353
BUGS

openstackclient/common/clientmanager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +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
89+
self._interface = self._cli_options.interface
9090

9191
self.timing = self._cli_options.timing
9292

@@ -185,22 +185,22 @@ def auth_ref(self):
185185
return self._auth_ref
186186

187187
def get_endpoint_for_service_type(self, service_type, region_name=None,
188-
endpoint_type='public'):
188+
interface='public'):
189189
"""Return the endpoint URL for the service type."""
190-
if not endpoint_type:
191-
endpoint_type = 'public'
190+
if not interface:
191+
interface = 'public'
192192
# See if we are using password flow auth, i.e. we have a
193193
# service catalog to select endpoints from
194194
if self.auth_ref:
195195
endpoint = self.auth_ref.service_catalog.url_for(
196196
service_type=service_type,
197197
region_name=region_name,
198-
endpoint_type=endpoint_type,
198+
endpoint_type=interface,
199199
)
200200
else:
201201
# Get the passed endpoint directly from the auth plugin
202202
endpoint = self.auth.get_endpoint(self.session,
203-
interface=endpoint_type)
203+
interface=interface)
204204
return endpoint
205205

206206

openstackclient/compute/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ def make_client(instance):
4848

4949
extensions = [extension.Extension('list_extensions', list_extensions)]
5050

51-
# Remember endpoint_type only if it is set
52-
kwargs = utils.build_kwargs_dict('endpoint_type',
53-
instance._endpoint_type)
51+
# Remember interface only if it is set
52+
kwargs = utils.build_kwargs_dict('endpoint_type', instance._interface)
5453

5554
client = compute_client(
5655
session=instance.session,

openstackclient/identity/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ def make_client(instance):
4646
API_VERSIONS)
4747
LOG.debug('Instantiating identity client: %s', identity_client)
4848

49-
# Remember interface only if endpoint_type is set
50-
kwargs = utils.build_kwargs_dict('interface',
51-
instance._endpoint_type)
49+
# Remember interface only if interface is set
50+
kwargs = utils.build_kwargs_dict('interface', instance._interface)
5251

5352
client = identity_client(
5453
session=instance.session,

openstackclient/image/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def make_client(instance):
4646
endpoint = instance.get_endpoint_for_service_type(
4747
API_NAME,
4848
region_name=instance._region_name,
49-
endpoint_type=instance._endpoint_type,
49+
interface=instance._interface,
5050
)
5151

5252
client = image_client(
@@ -69,7 +69,7 @@ def make_client(instance):
6969
endpoint=instance.get_endpoint_for_service_type(
7070
IMAGE_API_TYPE,
7171
region_name=instance._region_name,
72-
endpoint_type=instance._endpoint_type,
72+
interface=instance._interface,
7373
)
7474
)
7575

openstackclient/network/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ def make_client(instance):
4747
endpoint = instance.get_endpoint_for_service_type(
4848
API_NAME,
4949
region_name=instance._region_name,
50-
endpoint_type=instance._endpoint_type,
50+
interface=instance._interface,
5151
)
5252

5353
# Remember endpoint_type only if it is set
54-
kwargs = utils.build_kwargs_dict('endpoint_type',
55-
instance._endpoint_type)
54+
kwargs = utils.build_kwargs_dict('endpoint_type', instance._interface)
5655

5756
client = network_client(
5857
session=instance.session,

openstackclient/object/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def make_client(instance):
3636
endpoint = instance.get_endpoint_for_service_type(
3737
'object-store',
3838
region_name=instance._region_name,
39-
endpoint_type=instance._endpoint_type,
39+
interface=instance._interface,
4040
)
4141

4242
client = object_store_v1.APIv1(

openstackclient/shell.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,14 @@ def build_option_parser(self, description, version):
209209
DEFAULT_DOMAIN +
210210
' (Env: OS_DEFAULT_DOMAIN)')
211211
parser.add_argument(
212-
'--os-endpoint-type',
213-
metavar='<endpoint-type>',
214-
dest='endpoint_type',
212+
'--os-interface',
213+
metavar='<interface>',
214+
dest='interface',
215215
choices=['admin', 'public', 'internal'],
216-
default=utils.env('OS_ENDPOINT_TYPE'),
217-
help='Select an endpoint type.'
218-
' Valid endpoint types: [admin, public, internal].'
219-
' (Env: OS_ENDPOINT_TYPE)')
216+
default=utils.env('OS_INTERFACE'),
217+
help='Select an interface type.'
218+
' Valid interface types: [admin, public, internal].'
219+
' (Env: OS_INTERFACE)')
220220
parser.add_argument(
221221
'--timing',
222222
default=False,
@@ -263,10 +263,10 @@ def initialize_app(self, argv):
263263
self.options.project_name = tenant_name
264264

265265
# Do configuration file handling
266-
# Ignore the default value of endpoint_type. Only if it is set later
266+
# Ignore the default value of interface. Only if it is set later
267267
# will it be used.
268268
cc = cloud_config.OpenStackConfig(
269-
override_defaults={'endpoint_type': None, })
269+
override_defaults={'interface': None, })
270270
self.log.debug("defaults: %s", cc.defaults)
271271

272272
self.cloud = cc.get_one_cloud(

openstackclient/tests/common/test_clientmanager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, **kwargs):
5454
self.identity_api_version = '2.0'
5555
self.timing = None
5656
self.region_name = None
57-
self.endpoint_type = None
57+
self.interface = None
5858
self.url = None
5959
self.auth = {}
6060
self.default_domain = 'default'
@@ -124,7 +124,7 @@ def test_client_manager_token(self):
124124
auth_url=fakes.AUTH_URL,
125125
),
126126
auth_type='v2token',
127-
endpoint_type=fakes.ENDPOINT_TYPE,
127+
interface=fakes.INTERFACE,
128128
region_name=fakes.REGION_NAME,
129129
),
130130
api_version=API_VERSION,
@@ -141,8 +141,8 @@ def test_client_manager_token(self):
141141
auth_v2.Token,
142142
)
143143
self.assertEqual(
144-
fakes.ENDPOINT_TYPE,
145-
client_manager._endpoint_type,
144+
fakes.INTERFACE,
145+
client_manager._interface,
146146
)
147147
self.assertEqual(
148148
fakes.REGION_NAME,

0 commit comments

Comments
 (0)