1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """
17 Resource class and its manager for endpoints in Identity V2 API
18 """
19
20 from yakumo import base
21 from yakumo.constant import UNDEF
22 from yakumo import mapper
23 from yakumo import exception
24
25
26 ATTRIBUTE_MAPPING = [
27 ('id', 'id', mapper.Noop),
28 ('public_url', 'publicurl', mapper.Noop),
29 ('internal_url', 'internalurl', mapper.Noop),
30 ('admin_url', 'adminurl', mapper.Noop),
31 ('region', 'region', mapper.Noop),
32 ('is_enabled', 'enabled', mapper.Noop),
33 ('service', 'service_id', mapper.Resource('keystone.service')),
34 ]
35
36
38 """resource class for endpoints on Identity V2 API"""
39
40
42 """manager class for endpoints on Identity V2 API"""
43
44 resource_class = Resource
45 service_type = 'identity'
46 _attr_mapping = ATTRIBUTE_MAPPING
47 _hidden_methods = ["update"]
48 _json_resource_key = 'endpoint'
49 _json_resources_key = 'endpoints'
50 _url_resource_path = '/endpoints'
51
54 """
55 Register endpoints for a service
56
57 @keyword public_url: URL of the public endpoint
58 @type public_url: str
59 @keyword internal_url: URL of the internal endpoint
60 @type internal_url: str
61 @keyword admin_url: URL of the admin endpoint
62 @type admin_url: str
63 @keyword region: Region name
64 @type region: str
65 @keyword is_enabled: Whether the endpoints are enabled or not
66 @type is_enabled: bool
67 @keyword service: Service
68 @type service: yakumo.keystone.v2.service.Resource
69 @return: Created endpoint
70 @rtype: yakumo.keystone.v2.endpoint.Resource
71 """
72 return super(Manager, self).create(
73 public_url=public_url,
74 internal_url=internal_url,
75 admin_url=admin_url,
76 region=region,
77 is_enabled=is_enabled,
78 service=service)
79
88