def list(self, **kwargs):
"""Get a list of software configs.
:rtype: list of :class:`SoftwareConfig`
"""
qparams = {}
for opt, val in six.iteritems(kwargs):
if val:
qparams[opt] = val
# Transform the dict to a sequence of two-element tuples in fixed
# order, then the encoded string will be consistent in Python 2&3.
if qparams:
new_qparams = sorted(qparams.items(), key=lambda x: x[0])
query_string = "?%s" % parse.urlencode(new_qparams)
else:
query_string = ""
url = '/software_configs%s' % query_string
return self._list(url, "software_configs")
评论列表
文章目录