# watcherclient.common.api_versioning module

class watcherclient.common.api_versioning.APIVersion(version_str=None)

  Bases: `object`

  This class represents an API Version Request.

  This class provides convenience methods for manipulation and comparison of version numbers that we need to do to implement microversions.

  get_string()

    Version string representation.

    Converts object to string representation which if used to create an APIVersion object results in the same version.

  is_latest()
  is_null()
  matches(min_version, max_version)

    Matches the version object.

    Returns whether the version object represents a version greater than or equal to the minimum version and less than or equal to the maximum version.

    Parameters

      - min_version – Minimum acceptable version.

      - max_version – Maximum acceptable version.

    Returns

      boolean

    If min_version is null then there is no minimum limit. If max_version is null then there is no maximum limit. If self is null then raise ValueError

watcherclient.common.api_versioning.allow_start_end_audit_time(requested_version)

  Check if we should support optional start/end attributes for Audit.

  Version 1.1 of the API added support for start and end time of continuous audits.

watcherclient.common.api_versioning.check_major_version(api_version)

  Checks major part of `APIVersion` obj is supported.

  Raises

    watcherclient.exceptions.UnsupportedVersion – if major part is not supported

watcherclient.common.api_versioning.get_api_version(version_string)

  Returns checked APIVersion object

watcherclient.common.api_versioning.get_available_major_versions()

watcherclient.common.api_versioning.launch_audit_forced(requested_version)

  Check if we should support force option for Audit.

  Version 1.2 of the API added support for force option.

this page last updated: 2021-12-01 21:05:37

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug