Common Parameters of Python SDK

The Python SDK supports some common parameters. They are used as follows:

ignore_missing

This parameter is usually displayed in the delete interface of a service. The default value is True. For example:

delete_flavor(self, flavor, ignore_missing=True)

delete_image(self, image, ignore_missing=True)

If this parameter is set to True and the deleted resource does not exist, no exception information is displayed and thrown.

If this parameter is set to False and the deleted resource does not exist, the openstack.exceptions.ResourceNotFound exception will be thrown. If the exception is not handled, the program stops abnormally.

details

This parameter is usually displayed in the interface for obtaining the detailed resource list. For example:

flavors(self, details=True, **query)

images(self, details=True, **query)

Only the resources that support /detail interface can be imported.

If this parameter is set to True and the URI of the requested resource is {RES} /details, return the detailed information of the resource.

If this parameter is set to False and the URI of the requested resource is {RES}, return the most basic information of the resource.

limit

This parameter is usually displayed in the interface for obtaining the detailed resource list. For example:

flavors(self, details=True, limit = 5)

images(self, details=True, limit = 10)

When the limit parameter is imported, the returned results are displayed in pages. The number of returned results equates the limit value.

If the limit parameter is not imported, the query results are returned once.