2525--------
2626
2727The :class:`~openstack.auth.service_filter.ServiceFilter` class can be built
28- with a service type, visibility , region, name, and version.
28+ with a service type, interface , region, name, and version.
2929
3030Create a service filter
3131~~~~~~~~~~~~~~~~~~~~~~~
4141 matches = (result.match_service_type('compute') and
4242 result.match_service_name('Hal9000') and
4343 result.match_region('DiscoveryOne') and
44- result.match_visibility ('public'))
44+ result.match_interface ('public'))
4545 print(str(result))
4646 print("matches=" + str(matches))
4747
4848The resulting output from the code::
4949
50- service_type=compute,visibility =public,version=v2
50+ service_type=compute,interface =public,version=v2
5151 matches=True
5252"""
5353
@@ -72,30 +72,30 @@ class ServiceFilter(object):
7272 PUBLIC = 'public'
7373 INTERNAL = 'internal'
7474 ADMIN = 'admin'
75- VISIBILITY = [PUBLIC , INTERNAL , ADMIN ]
75+ INTERFACE = [PUBLIC , INTERNAL , ADMIN ]
7676 valid_versions = []
7777
78- def __init__ (self , service_type = ANY , visibility = PUBLIC , region = None ,
78+ def __init__ (self , service_type = ANY , interface = PUBLIC , region = None ,
7979 service_name = None , version = None ):
8080 """Create a service identifier.
8181
8282 :param string service_type: The desired type of service.
83- :param string visibility : The exposure of the endpoint. Should be
83+ :param string interface : The exposure of the endpoint. Should be
8484 `public` (default), `internal` or `admin`.
8585 :param string region: The desired region (optional).
8686 :param string service_name: Name of the service
8787 :param string version: Version of service to use.
8888 """
8989 self .service_type = service_type .lower ()
90- self .set_visibility ( visibility )
90+ self .set_interface ( interface )
9191 self .region = region
9292 self .service_name = service_name
9393 self .version = version
9494
9595 def __repr__ (self ):
9696 ret = "service_type=%s" % self .service_type
97- if self .visibility is not None :
98- ret += ",visibility =%s" % self .visibility
97+ if self .interface is not None :
98+ ret += ",interface =%s" % self .interface
9999 if self .region is not None :
100100 ret += ",region=%s" % self .region
101101 if self .service_name :
@@ -121,9 +121,9 @@ def join(self, default):
121121 response .service_type = default .service_type
122122 response .service_name = self .service_name
123123 response .valid_versions = default .valid_versions
124- response .visibility = default .visibility
125- if self .visibility :
126- response .visibility = self .visibility
124+ response .interface = default .interface
125+ if self .interface :
126+ response .interface = self .interface
127127 if self .region :
128128 response .region = self .region
129129 response .version = version
@@ -151,23 +151,23 @@ def match_region(self, region):
151151 return True
152152 return False
153153
154- def match_visibility (self , visibility ):
155- """Service visibilities are equavilent."""
156- if not self .visibility :
154+ def match_interface (self , interface ):
155+ """Service interfaces are equavilent."""
156+ if not self .interface :
157157 return True
158- return self .visibility == visibility
158+ return self .interface == interface
159159
160- def set_visibility (self , visibility ):
161- """Set the visibility of the service filter."""
162- if not visibility :
163- self .visibility = None
160+ def set_interface (self , interface ):
161+ """Set the interface of the service filter."""
162+ if not interface :
163+ self .interface = None
164164 return
165- visibility = visibility .replace ('URL' , '' )
166- visibility = visibility .lower ()
167- if visibility not in self .VISIBILITY :
168- msg = "Visibility <%s> not in %s" % (visibility , self .VISIBILITY )
165+ interface = interface .replace ('URL' , '' )
166+ interface = interface .lower ()
167+ if interface not in self .INTERFACE :
168+ msg = "Interface <%s> not in %s" % (interface , self .INTERFACE )
169169 raise exceptions .SDKException (msg )
170- self .visibility = visibility
170+ self .interface = interface
171171
172172 def _get_valid_version (self ):
173173 if self .valid_versions :
0 commit comments