1010# License for the specific language governing permissions and limitations
1111# under the License.
1212
13- from openstack .database .v1 import database
14- from openstack .database .v1 import flavor
15- from openstack .database .v1 import instance
16- from openstack .database .v1 import user
13+ from openstack .database .v1 import database as _database
14+ from openstack .database .v1 import flavor as _flavor
15+ from openstack .database .v1 import instance as _instance
16+ from openstack .database .v1 import user as _user
1717from openstack import proxy
1818
1919
@@ -29,12 +29,12 @@ def create_database(self, **attrs):
2929 :returns: The results of server creation
3030 :rtype: :class:`~openstack.database.v1.database.Database`
3131 """
32- return self ._create (database .Database , ** attrs )
32+ return self ._create (_database .Database , ** attrs )
3333
34- def delete_database (self , value , ignore_missing = True ):
34+ def delete_database (self , database , ignore_missing = True ):
3535 """Delete a database
3636
37- :param value : The value can be either the ID of a database or a
37+ :param database : The value can be either the ID of a database or a
3838 :class:`~openstack.database.v1.database.Database` instance.
3939 :param bool ignore_missing: When set to ``False``
4040 :class:`~openstack.exceptions.ResourceNotFound` will be
@@ -44,7 +44,8 @@ def delete_database(self, value, ignore_missing=True):
4444
4545 :returns: ``None``
4646 """
47- self ._delete (database .Database , value , ignore_missing = ignore_missing )
47+ self ._delete (_database .Database , database ,
48+ ignore_missing = ignore_missing )
4849
4950 def find_database (self , name_or_id , ignore_missing = True ):
5051 """Find a single database
@@ -57,7 +58,7 @@ def find_database(self, name_or_id, ignore_missing=True):
5758 attempting to find a nonexistent resource.
5859 :returns: One :class:`~openstack.database.v1.database.Database` or None
5960 """
60- return self ._find (database .Database , name_or_id ,
61+ return self ._find (_database .Database , name_or_id ,
6162 ignore_missing = ignore_missing )
6263
6364 def databases (self , ** query ):
@@ -69,20 +70,20 @@ def databases(self, **query):
6970 :returns: A generator of database objects
7071 :rtype: :class:`~openstack.database.v1.database.Database`
7172 """
72- return self ._list (database .Database , paginated = False , ** query )
73+ return self ._list (_database .Database , paginated = False , ** query )
7374
74- def get_database (self , value ):
75+ def get_database (self , database ):
7576 """Get a single database
7677
77- :param value : The value can be the ID of a database or a
78- :class:`~openstack.database.v1.database.Database`
79- instance.
78+ :param database : The value can be the ID of a database or a
79+ :class:`~openstack.database.v1.database.Database`
80+ instance.
8081
8182 :returns: One :class:`~openstack.database.v1.database.Database`
8283 :raises: :class:`~openstack.exceptions.ResourceNotFound`
8384 when no resource can be found.
8485 """
85- return self ._get (database .Database , value )
86+ return self ._get (_database .Database , database )
8687
8788 def find_flavor (self , name_or_id , ignore_missing = True ):
8889 """Find a single flavor
@@ -95,20 +96,20 @@ def find_flavor(self, name_or_id, ignore_missing=True):
9596 attempting to find a nonexistent resource.
9697 :returns: One :class:`~openstack.database.v1.flavor.Flavor` or None
9798 """
98- return self ._find (flavor .Flavor , name_or_id ,
99+ return self ._find (_flavor .Flavor , name_or_id ,
99100 ignore_missing = ignore_missing )
100101
101- def get_flavor (self , value ):
102+ def get_flavor (self , flavor ):
102103 """Get a single flavor
103104
104- :param value : The value can be the ID of a flavor or a
105- :class:`~openstack.database.v1.flavor.Flavor` instance.
105+ :param flavor : The value can be the ID of a flavor or a
106+ :class:`~openstack.database.v1.flavor.Flavor` instance.
106107
107108 :returns: One :class:`~openstack.database.v1.flavor.Flavor`
108109 :raises: :class:`~openstack.exceptions.ResourceNotFound`
109110 when no resource can be found.
110111 """
111- return self ._get (flavor .Flavor , value )
112+ return self ._get (_flavor .Flavor , flavor )
112113
113114 def flavors (self , ** query ):
114115 """Return a generator of flavors
@@ -119,7 +120,7 @@ def flavors(self, **query):
119120 :returns: A generator of flavor objects
120121 :rtype: :class:`~openstack.database.v1.flavor.Flavor`
121122 """
122- return self ._list (flavor .Flavor , paginated = False , ** query )
123+ return self ._list (_flavor .Flavor , paginated = False , ** query )
123124
124125 def create_instance (self , ** attrs ):
125126 """Create a new instance from attributes
@@ -131,12 +132,12 @@ def create_instance(self, **attrs):
131132 :returns: The results of server creation
132133 :rtype: :class:`~openstack.database.v1.instance.Instance`
133134 """
134- return self ._create (instance .Instance , ** attrs )
135+ return self ._create (_instance .Instance , ** attrs )
135136
136- def delete_instance (self , value , ignore_missing = True ):
137+ def delete_instance (self , instance , ignore_missing = True ):
137138 """Delete an instance
138139
139- :param value : The value can be either the ID of an instance or a
140+ :param instance : The value can be either the ID of an instance or a
140141 :class:`~openstack.database.v1.instance.Instance` instance.
141142 :param bool ignore_missing: When set to ``False``
142143 :class:`~openstack.exceptions.ResourceNotFound` will be
@@ -146,7 +147,8 @@ def delete_instance(self, value, ignore_missing=True):
146147
147148 :returns: ``None``
148149 """
149- self ._delete (instance .Instance , value , ignore_missing = ignore_missing )
150+ self ._delete (_instance .Instance , instance ,
151+ ignore_missing = ignore_missing )
150152
151153 def find_instance (self , name_or_id , ignore_missing = True ):
152154 """Find a single instance
@@ -159,21 +161,21 @@ def find_instance(self, name_or_id, ignore_missing=True):
159161 attempting to find a nonexistent resource.
160162 :returns: One :class:`~openstack.database.v1.instance.Instance` or None
161163 """
162- return self ._find (instance .Instance , name_or_id ,
164+ return self ._find (_instance .Instance , name_or_id ,
163165 ignore_missing = ignore_missing )
164166
165- def get_instance (self , value ):
167+ def get_instance (self , instance ):
166168 """Get a single instance
167169
168- :param value : The value can be the ID of an instance or a
169- :class:`~openstack.database.v1.instance.Instance`
170- instance.
170+ :param instance : The value can be the ID of an instance or a
171+ :class:`~openstack.database.v1.instance.Instance`
172+ instance.
171173
172174 :returns: One :class:`~openstack.database.v1.instance.Instance`
173175 :raises: :class:`~openstack.exceptions.ResourceNotFound`
174176 when no resource can be found.
175177 """
176- return self ._get (instance .Instance , value )
178+ return self ._get (_instance .Instance , instance )
177179
178180 def instances (self , ** query ):
179181 """Return a generator of instances
@@ -184,21 +186,21 @@ def instances(self, **query):
184186 :returns: A generator of instance objects
185187 :rtype: :class:`~openstack.database.v1.instance.Instance`
186188 """
187- return self ._list (instance .Instance , paginated = False , ** query )
189+ return self ._list (_instance .Instance , paginated = False , ** query )
188190
189- def update_instance (self , value , ** attrs ):
191+ def update_instance (self , instance , ** attrs ):
190192 """Update a instance
191193
192- :param value : Either the id of a instance or a
193- :class:`~openstack.database.v1.instance.Instance`
194- instance.
194+ :param instance : Either the id of a instance or a
195+ :class:`~openstack.database.v1.instance.Instance`
196+ instance.
195197 :attrs kwargs: The attributes to update on the instance represented
196198 by ``value``.
197199
198200 :returns: The updated instance
199201 :rtype: :class:`~openstack.database.v1.instance.Instance`
200202 """
201- return self ._update (instance .Instance , value , ** attrs )
203+ return self ._update (_instance .Instance , instance , ** attrs )
202204
203205 def create_user (self , ** attrs ):
204206 """Create a new user from attributes
@@ -210,13 +212,13 @@ def create_user(self, **attrs):
210212 :returns: The results of server creation
211213 :rtype: :class:`~openstack.database.v1.user.User`
212214 """
213- return self ._create (user .User , ** attrs )
215+ return self ._create (_user .User , ** attrs )
214216
215- def delete_user (self , value , ignore_missing = True ):
217+ def delete_user (self , user , ignore_missing = True ):
216218 """Delete a user
217219
218- :param value : The value can be either the ID of a user or a
219- :class:`~openstack.database.v1.user.User` instance.
220+ :param user : The value can be either the ID of a user or a
221+ :class:`~openstack.database.v1.user.User` instance.
220222 :param bool ignore_missing: When set to ``False``
221223 :class:`~openstack.exceptions.ResourceNotFound` will be
222224 raised when the user does not exist.
@@ -225,7 +227,7 @@ def delete_user(self, value, ignore_missing=True):
225227
226228 :returns: ``None``
227229 """
228- self ._delete (user .User , value , ignore_missing = ignore_missing )
230+ self ._delete (_user .User , user , ignore_missing = ignore_missing )
229231
230232 def find_user (self , name_or_id , ignore_missing = True ):
231233 """Find a single user
@@ -238,7 +240,8 @@ def find_user(self, name_or_id, ignore_missing=True):
238240 attempting to find a nonexistent resource.
239241 :returns: One :class:`~openstack.database.v1.user.User` or None
240242 """
241- return self ._find (user .User , name_or_id , ignore_missing = ignore_missing )
243+ return self ._find (_user .User , name_or_id ,
244+ ignore_missing = ignore_missing )
242245
243246 def users (self , ** query ):
244247 """Return a generator of users
@@ -249,16 +252,16 @@ def users(self, **query):
249252 :returns: A generator of user objects
250253 :rtype: :class:`~openstack.database.v1.user.User`
251254 """
252- return self ._list (user .User , paginated = False , ** query )
255+ return self ._list (_user .User , paginated = False , ** query )
253256
254- def get_user (self , value ):
257+ def get_user (self , user ):
255258 """Get a single user
256259
257- :param value : The value can be the ID of a user or a
258- :class:`~openstack.database.v1.user.User` instance.
260+ :param user : The value can be the ID of a user or a
261+ :class:`~openstack.database.v1.user.User` instance.
259262
260263 :returns: One :class:`~openstack.database.v1.user.User`
261264 :raises: :class:`~openstack.exceptions.ResourceNotFound`
262265 when no resource can be found.
263266 """
264- return self ._get (user .User , value )
267+ return self ._get (_user .User , user )
0 commit comments