|
10 | 10 | # License for the specific language governing permissions and limitations |
11 | 11 | # under the License. |
12 | 12 |
|
| 13 | +from openstack.network.v2 import address_scope as _address_scope |
13 | 14 | from openstack.network.v2 import availability_zone |
14 | 15 | from openstack.network.v2 import extension |
15 | 16 | from openstack.network.v2 import floating_ip as _floating_ip |
|
35 | 36 |
|
36 | 37 | class Proxy(proxy.BaseProxy): |
37 | 38 |
|
| 39 | + def create_address_scope(self, **attrs): |
| 40 | + """Create a new address scope from attributes |
| 41 | +
|
| 42 | + :param dict attrs: Keyword arguments which will be used to create |
| 43 | + a :class:`~openstack.network.v2.address_scope.AddressScope`, |
| 44 | + comprised of the properties on the AddressScope class. |
| 45 | +
|
| 46 | + :returns: The results of address scope creation |
| 47 | + :rtype: :class:`~openstack.network.v2.address_scope.AddressScope` |
| 48 | + """ |
| 49 | + return self._create(_address_scope.AddressScope, **attrs) |
| 50 | + |
| 51 | + def delete_address_scope(self, address_scope, ignore_missing=True): |
| 52 | + """Delete an address scope |
| 53 | +
|
| 54 | + :param address_scope: The value can be either the ID of an |
| 55 | + address scope or |
| 56 | + a :class:`~openstack.network.v2.address_scope.AddressScope` |
| 57 | + instance. |
| 58 | + :param bool ignore_missing: When set to ``False`` |
| 59 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 60 | + raised when the address scope does not exist. |
| 61 | + When set to ``True``, no exception will be set when |
| 62 | + attempting to delete a nonexistent address scope. |
| 63 | +
|
| 64 | + :returns: ``None`` |
| 65 | + """ |
| 66 | + self._delete(_address_scope.AddressScope, address_scope, |
| 67 | + ignore_missing=ignore_missing) |
| 68 | + |
| 69 | + def find_address_scope(self, name_or_id, ignore_missing=True): |
| 70 | + """Find a single address scope |
| 71 | +
|
| 72 | + :param name_or_id: The name or ID of an address scope. |
| 73 | + :param bool ignore_missing: When set to ``False`` |
| 74 | + :class:`~openstack.exceptions.ResourceNotFound` will be |
| 75 | + raised when the resource does not exist. |
| 76 | + When set to ``True``, None will be returned when |
| 77 | + attempting to find a nonexistent resource. |
| 78 | + :returns: One :class:`~openstack.network.v2.address_scope.AddressScope` |
| 79 | + or None |
| 80 | + """ |
| 81 | + return self._find(_address_scope.AddressScope, name_or_id, |
| 82 | + ignore_missing=ignore_missing) |
| 83 | + |
| 84 | + def get_address_scope(self, address_scope): |
| 85 | + """Get a single address scope |
| 86 | +
|
| 87 | + :param address_scope: The value can be the ID of an address scope or a |
| 88 | + :class:`~openstack.network.v2.address_scope.AddressScope` instance. |
| 89 | +
|
| 90 | + :returns: One :class:`~openstack.network.v2.address_scope.AddressScope` |
| 91 | + :raises: :class:`~openstack.exceptions.ResourceNotFound` |
| 92 | + when no resource can be found. |
| 93 | + """ |
| 94 | + return self._get(_address_scope.AddressScope, address_scope) |
| 95 | + |
| 96 | + def address_scopes(self, **query): |
| 97 | + """Return a generator of address scopes |
| 98 | +
|
| 99 | + :param kwargs \*\*query: Optional query parameters to be sent to limit |
| 100 | + the resources being returned. |
| 101 | +
|
| 102 | + :returns: A generator of address scope objects |
| 103 | + :rtype: :class:`~openstack.network.v2.address_scope.AddressScope` |
| 104 | + """ |
| 105 | + return self._list(_address_scope.AddressScope, |
| 106 | + paginated=False, |
| 107 | + **query) |
| 108 | + |
| 109 | + def update_address_scope(self, address_scope, **attrs): |
| 110 | + """Update an address scope |
| 111 | +
|
| 112 | + :param address_scope: Either the ID of an address scope or a |
| 113 | + :class:`~openstack.network.v2.address_scope.AddressScope` instance. |
| 114 | + :attrs kwargs: The attributes to update on the address scope |
| 115 | + represented by ``value``. |
| 116 | +
|
| 117 | + :returns: The updated address scope |
| 118 | + :rtype: :class:`~openstack.network.v2.address_scope.AddressScope` |
| 119 | + """ |
| 120 | + return self._update(_address_scope.AddressScope, |
| 121 | + address_scope, |
| 122 | + **attrs) |
| 123 | + |
38 | 124 | def availability_zones(self): |
39 | 125 | """Return a generator of availability zones |
40 | 126 |
|
|
0 commit comments