File tree Expand file tree Collapse file tree
doc/source/command-objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,8 @@ List flavors
9191 os flavor list
9292 [--public | --private | --all]
9393 [--long]
94+ [--marker < marker> ]
95+ [--limit < limit> ]
9496
9597 .. option :: --public
9698
@@ -108,6 +110,14 @@ List flavors
108110
109111 List additional fields in output
110112
113+ .. option :: --marker <marker >
114+
115+ The last flavor ID of the previous page
116+
117+ .. option :: --limit <limit >
118+
119+ Maximum number of flavors to display
120+
111121flavor show
112122-----------
113123
Original file line number Diff line number Diff line change @@ -181,6 +181,15 @@ def get_parser(self, prog_name):
181181 action = 'store_true' ,
182182 default = False ,
183183 help = 'List additional fields in output' )
184+ parser .add_argument (
185+ '--marker' ,
186+ metavar = "<marker>" ,
187+ help = 'The last flavor ID of the previous page' )
188+ parser .add_argument (
189+ '--limit' ,
190+ type = int ,
191+ metavar = "<limit>" ,
192+ help = 'Maximum number of flavors to display' )
184193 return parser
185194
186195 def take_action (self , parsed_args ):
@@ -202,7 +211,9 @@ def take_action(self, parsed_args):
202211 # and flavors from their own projects only.
203212 is_public = None if parsed_args .all else parsed_args .public
204213
205- data = compute_client .flavors .list (is_public = is_public )
214+ data = compute_client .flavors .list (is_public = is_public ,
215+ marker = parsed_args .marker ,
216+ limit = parsed_args .limit )
206217
207218 if parsed_args .long :
208219 columns = columns + (
Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ def test_flavor_list_no_options(self):
7676
7777 # Set expected values
7878 kwargs = {
79- 'is_public' : True
79+ 'is_public' : True ,
80+ 'limit' : None ,
81+ 'marker' : None
8082 }
8183
8284 self .flavors_mock .list .assert_called_with (
@@ -119,7 +121,9 @@ def test_flavor_list_all_flavors(self):
119121
120122 # Set expected values
121123 kwargs = {
122- 'is_public' : None
124+ 'is_public' : None ,
125+ 'limit' : None ,
126+ 'marker' : None
123127 }
124128
125129 self .flavors_mock .list .assert_called_with (
@@ -162,7 +166,9 @@ def test_flavor_list_private_flavors(self):
162166
163167 # Set expected values
164168 kwargs = {
165- 'is_public' : False
169+ 'is_public' : False ,
170+ 'limit' : None ,
171+ 'marker' : None
166172 }
167173
168174 self .flavors_mock .list .assert_called_with (
@@ -205,7 +211,9 @@ def test_flavor_list_public_flavors(self):
205211
206212 # Set expected values
207213 kwargs = {
208- 'is_public' : True
214+ 'is_public' : True ,
215+ 'limit' : None ,
216+ 'marker' : None
209217 }
210218
211219 self .flavors_mock .list .assert_called_with (
@@ -248,7 +256,9 @@ def test_flavor_list_long(self):
248256
249257 # Set expected values
250258 kwargs = {
251- 'is_public' : True
259+ 'is_public' : True ,
260+ 'limit' : None ,
261+ 'marker' : None
252262 }
253263
254264 self .flavors_mock .list .assert_called_with (
You can’t perform that action at this time.
0 commit comments