1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5#      http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12
13from openstack import resource
14
15
16class AddressScope(resource.Resource):
17    """Address scope extension."""
18    resource_key = 'address_scope'
19    resources_key = 'address_scopes'
20    base_path = '/address-scopes'
21
22    _allow_unknown_attrs_in_body = True
23
24    # capabilities
25    allow_create = True
26    allow_fetch = True
27    allow_commit = True
28    allow_delete = True
29    allow_list = True
30
31    _query_mapping = resource.QueryParameters(
32        'name', 'ip_version',
33        project_id='tenant_id',
34        is_shared='shared',
35    )
36
37    # Properties
38    #: The address scope name.
39    name = resource.Body('name')
40    #: The ID of the project that owns the address scope.
41    project_id = resource.Body('tenant_id')
42    #: The IP address family of the address scope.
43    #: *Type: int*
44    ip_version = resource.Body('ip_version', type=int)
45    #: Indicates whether this address scope is shared across all projects.
46    #: *Type: bool*
47    is_shared = resource.Body('shared', type=bool)
48