|
25 | 25 | from openstack.network.v2 import pool as _pool |
26 | 26 | from openstack.network.v2 import pool_member as _pool_member |
27 | 27 | from openstack.network.v2 import port as _port |
| 28 | +from openstack.network.v2 import qos_policy as _qos_policy |
28 | 29 | from openstack.network.v2 import quota as _quota |
29 | 30 | from openstack.network.v2 import rbac_policy as _rbac_policy |
30 | 31 | from openstack.network.v2 import router as _router |
@@ -1890,3 +1891,86 @@ def update_vpn_service(self, vpn_service, **attrs): |
1890 | 1891 | :rtype: :class:`~openstack.network.v2.vpn_service.VPNService` |
1891 | 1892 | """ |
1892 | 1893 | return self._update(_vpn_service.VPNService, vpn_service, **attrs) |
| 1894 | + |
| 1895 | + def create_qos_policy(self, **attrs): |
| 1896 | + """Create a new QoS policy from attributes |
| 1897 | +
|
| 1898 | + :param dict attrs: Keyword arguments which will be used to create |
| 1899 | + a :class:`~openstack.network.v2.qos_policy. |
| 1900 | + QoSPolicy`, comprised of the properties on the |
| 1901 | + QoSPolicy class. |
| 1902 | +
|
| 1903 | + :returns: The results of QoS policy creation |
| 1904 | + :rtype: :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1905 | + """ |
| 1906 | + return self._create(_qos_policy.QoSPolicy, **attrs) |
| 1907 | + |
| 1908 | + def delete_qos_policy(self, qos_policy, ignore_missing=True): |
| 1909 | + """Delete a QoS policy |
| 1910 | +
|
| 1911 | + :param qos_policy: The value can be either the ID of a QoS policy or a |
| 1912 | + :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1913 | + instance. |
| 1914 | + :param bool ignore_missing: When set to ``False`` |
| 1915 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 1916 | + raised when the QoS policy does not exist. |
| 1917 | + When set to ``True``, no exception will be set when |
| 1918 | + attempting to delete a nonexistent QoS policy. |
| 1919 | +
|
| 1920 | + :returns: ``None`` |
| 1921 | + """ |
| 1922 | + self._delete(_qos_policy.QoSPolicy, qos_policy, |
| 1923 | + ignore_missing=ignore_missing) |
| 1924 | + |
| 1925 | + def find_qos_policy(self, name_or_id, ignore_missing=True): |
| 1926 | + """Find a single QoS policy |
| 1927 | +
|
| 1928 | + :param name_or_id: The name or ID of a QoS policy. |
| 1929 | + :param bool ignore_missing: When set to ``False`` |
| 1930 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 1931 | + raised when the resource does not exist. |
| 1932 | + When set to ``True``, None will be returned when |
| 1933 | + attempting to find a nonexistent resource. |
| 1934 | + :returns: One :class:`~openstack.network.v2.qos_policy.QoSPolicy` or |
| 1935 | + None |
| 1936 | + """ |
| 1937 | + return self._find(_qos_policy.QoSPolicy, name_or_id, |
| 1938 | + ignore_missing=ignore_missing) |
| 1939 | + |
| 1940 | + def get_qos_policy(self, qos_policy): |
| 1941 | + """Get a single QoS policy |
| 1942 | +
|
| 1943 | + :param qos_policy: The value can be the ID of a QoS policy or a |
| 1944 | + :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1945 | + instance. |
| 1946 | +
|
| 1947 | + :returns: One :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1948 | + :raises: :class:`~openstack.exceptions.ResourceNotFound` |
| 1949 | + when no resource can be found. |
| 1950 | + """ |
| 1951 | + return self._get(_qos_policy.QoSPolicy, qos_policy) |
| 1952 | + |
| 1953 | + def qos_policies(self, **query): |
| 1954 | + """Return a generator of QoS policies |
| 1955 | +
|
| 1956 | + :param kwargs \*\*query: Optional query parameters to be sent to limit |
| 1957 | + the resources being returned. |
| 1958 | +
|
| 1959 | + :returns: A generator of QoS policy objects |
| 1960 | + :rtype: :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1961 | + """ |
| 1962 | + return self._list(_qos_policy.QoSPolicy, paginated=False, **query) |
| 1963 | + |
| 1964 | + def update_qos_policy(self, qos_policy, **attrs): |
| 1965 | + """Update a QoS policy |
| 1966 | +
|
| 1967 | + :param qos_policy: Either the id of a QoS policy or a |
| 1968 | + :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1969 | + instance. |
| 1970 | + :attrs kwargs: The attributes to update on the QoS policy represented |
| 1971 | + by ``value``. |
| 1972 | +
|
| 1973 | + :returns: The updated QoS policy |
| 1974 | + :rtype: :class:`~openstack.network.v2.qos_policy.QoSPolicy` |
| 1975 | + """ |
| 1976 | + return self._update(_qos_policy.QoSPolicy, qos_policy, **attrs) |
0 commit comments