|
1 |
| -# Copyright © 2019 Province of British Columbia |
2 |
| -# |
3 |
| -# Licensed under the Apache License, Version 2.0 (the "License"); |
4 |
| -# you may not use this file except in compliance with the License. |
5 |
| -# You may obtain a copy of the License at |
6 |
| -# |
7 |
| -# http://www.apache.org/licenses/LICENSE-2.0 |
8 |
| -# |
9 |
| -# Unless required by applicable law or agreed to in writing, software |
10 |
| -# distributed under the License is distributed on an "AS IS" BASIS, |
11 |
| -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 |
| -# See the License for the specific language governing permissions and |
13 |
| -# limitations under the License. |
14 |
| -"""Exposes all of the resource endpoints mounted in Flask-Blueprint style. |
15 |
| -
|
16 |
| -Uses restplus namespaces to mount individual api endpoints into the service. |
17 |
| -
|
18 |
| -All services have 2 defaults sets of endpoints: |
19 |
| - - ops |
20 |
| - - meta |
21 |
| -That are used to expose operational health information about the service, and meta information. |
22 |
| -""" |
23 |
| - |
24 |
| -from flask import Blueprint |
25 |
| - |
26 |
| -from .act_section import API as ACT_SECTION_API |
27 |
| -from .apihelper import Api |
28 |
| -from .code import API as CODES_API |
29 |
| -from .event import API as EVENT_API |
30 |
| -from .event_configuration import API as EVENT_CONFIGURATION_API |
31 |
| -from .event_template import API as EVENT_TEMPLATE_API |
32 |
| -from .indigenous_nation import API as INDIGENOUS_NATION_API |
33 |
| -from .inspection import API as INSPECTION_API |
34 |
| -from .lookup_data_generator import API as LOOKUP_API |
35 |
| -from .meta import API as META_API |
36 |
| -from .ops import API as OPS_API |
37 |
| -from .outcome import API as OUTCOME_API |
38 |
| -from .outcome_configuration import API as OUTCOME_CONFIGURATION_API |
39 |
| -from .phase import API as PHASE_API |
40 |
| -from .position import API as POSITION_API |
41 |
| -from .project import API as PROJECTS_API |
42 |
| -from .proponent import API as PROPONENT_API |
43 |
| -from .reminder_configuration import API as REMINDER_CONFIGURATION_API |
44 |
| -from .reports import API as REPORTS_API |
45 |
| -from .responsibility import API as RESPONSIBILITY_API |
46 |
| -from .special_field import API as SPECIAL_FIELD_API |
47 |
| -from .staff import API as STAFF_API |
48 |
| -from .sub_types import API as SUB_TYPES_API |
49 |
| -from .sync_form_data import API as SYNC_FORM_DATA_API |
50 |
| -from .task import API as TASK_API |
51 |
| -from .task_template import API as TASK_TEMPLATE_API |
52 |
| -from .user import API as USER_API |
53 |
| -from .work import API as WORK_API |
54 |
| -from .work_issues import API as WORK_ISSUES_API |
55 |
| -from .work_status import API as WORK_STATUS_API |
56 |
| -from .region import API as REGION_API |
57 |
| -from .eao_team import API as EAO_TEAM_API |
58 |
| - |
59 |
| - |
60 |
| -__all__ = ("API_BLUEPRINT", "OPS_BLUEPRINT") |
61 |
| - |
62 |
| -# This will add the Authorize button to the swagger docs |
63 |
| -AUTHORIZATIONS = {"apikey": {"type": "apiKey", "in": "header", "name": "Authorization"}} |
64 |
| - |
65 |
| -OPS_BLUEPRINT = Blueprint("API_OPS", __name__, url_prefix="/ops") |
66 |
| - |
67 |
| -API_OPS = Api( |
68 |
| - OPS_BLUEPRINT, |
69 |
| - title="Service OPS API", |
70 |
| - version="1.0", |
71 |
| - description="The Core API for the Reports System", |
72 |
| - security=["apikey"], |
73 |
| - authorizations=AUTHORIZATIONS, |
74 |
| -) |
75 |
| - |
76 |
| -API_OPS.add_namespace(OPS_API, path="/") |
77 |
| - |
78 |
| -API_BLUEPRINT = Blueprint("API", __name__, url_prefix="/api/v1") |
79 |
| - |
80 |
| -API = Api( |
81 |
| - API_BLUEPRINT, |
82 |
| - title="EAO Reports API", |
83 |
| - version="1.0", |
84 |
| - description="The Core API for the Reports System", |
85 |
| - security=["apikey"], |
86 |
| - authorizations=AUTHORIZATIONS, |
87 |
| -) |
88 |
| - |
89 |
| -API.add_namespace(META_API, path="/meta") |
90 |
| -API.add_namespace(CODES_API, path="/codes") |
91 |
| -API.add_namespace(PROJECTS_API, path="/projects") |
92 |
| -API.add_namespace(SYNC_FORM_DATA_API, path="/sync-form-data") |
93 |
| -API.add_namespace(PHASE_API, path="/phases") |
94 |
| -API.add_namespace(STAFF_API, path="/staffs") |
95 |
| -API.add_namespace(OUTCOME_API, path="/outcomes") |
96 |
| -API.add_namespace(SUB_TYPES_API, path="/sub-types") |
97 |
| -API.add_namespace(INSPECTION_API, path="/inspections") |
98 |
| -API.add_namespace(WORK_API, path="/works") |
99 |
| -API.add_namespace(LOOKUP_API, path="/lookups") |
100 |
| -API.add_namespace(REPORTS_API, path="/reports") |
101 |
| -API.add_namespace(INDIGENOUS_NATION_API, path="/indigenous-nations") |
102 |
| -API.add_namespace(PROPONENT_API, path="/proponents") |
103 |
| -API.add_namespace(REMINDER_CONFIGURATION_API, path="/reminder-configurations") |
104 |
| -API.add_namespace(USER_API, path='/users') |
105 |
| -API.add_namespace(TASK_TEMPLATE_API, path="/task-templates") |
106 |
| -API.add_namespace(EVENT_TEMPLATE_API, path="/event-templates") |
107 |
| -API.add_namespace(TASK_API, path="/tasks") |
108 |
| -API.add_namespace(EVENT_API, path="/milestones") |
109 |
| -API.add_namespace(EVENT_CONFIGURATION_API, path="/event-configurations") |
110 |
| -API.add_namespace(RESPONSIBILITY_API, path="/responsibilities") |
111 |
| -API.add_namespace(OUTCOME_CONFIGURATION_API, path="/outcome-configurations") |
112 |
| -API.add_namespace(ACT_SECTION_API, path="/act-sections") |
113 |
| -API.add_namespace(WORK_STATUS_API, path='/work/<int:work_id>/statuses') |
114 |
| -API.add_namespace(WORK_ISSUES_API, path='/work/<int:work_id>/issues') |
115 |
| -API.add_namespace(SPECIAL_FIELD_API, path='/special-fields') |
116 |
| -API.add_namespace(POSITION_API, path='/positions') |
117 |
| -API.add_namespace(REGION_API, path='/regions') |
118 |
| -API.add_namespace(EAO_TEAM_API, path='/eao-teams') |
| 1 | +# Copyright © 2019 Province of British Columbia |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +"""Exposes all of the resource endpoints mounted in Flask-Blueprint style. |
| 15 | +
|
| 16 | +Uses restplus namespaces to mount individual api endpoints into the service. |
| 17 | +
|
| 18 | +All services have 2 defaults sets of endpoints: |
| 19 | + - ops |
| 20 | + - meta |
| 21 | +That are used to expose operational health information about the service, and meta information. |
| 22 | +""" |
| 23 | + |
| 24 | +from flask import Blueprint |
| 25 | + |
| 26 | +from .act_section import API as ACT_SECTION_API |
| 27 | +from .apihelper import Api |
| 28 | +from .code import API as CODES_API |
| 29 | +from .event import API as EVENT_API |
| 30 | +from .event_configuration import API as EVENT_CONFIGURATION_API |
| 31 | +from .event_template import API as EVENT_TEMPLATE_API |
| 32 | +from .indigenous_nation import API as INDIGENOUS_NATION_API |
| 33 | +from .inspection import API as INSPECTION_API |
| 34 | +from .lookup_data_generator import API as LOOKUP_API |
| 35 | +from .meta import API as META_API |
| 36 | +from .ops import API as OPS_API |
| 37 | +from .outcome import API as OUTCOME_API |
| 38 | +from .outcome_configuration import API as OUTCOME_CONFIGURATION_API |
| 39 | +from .phase import API as PHASE_API |
| 40 | +from .position import API as POSITION_API |
| 41 | +from .project import API as PROJECTS_API |
| 42 | +from .project_type import API as PROJECT_TYPES_API |
| 43 | +from .proponent import API as PROPONENT_API |
| 44 | +from .reminder_configuration import API as REMINDER_CONFIGURATION_API |
| 45 | +from .reports import API as REPORTS_API |
| 46 | +from .responsibility import API as RESPONSIBILITY_API |
| 47 | +from .special_field import API as SPECIAL_FIELD_API |
| 48 | +from .staff import API as STAFF_API |
| 49 | +from .sub_types import API as SUB_TYPES_API |
| 50 | +from .sync_form_data import API as SYNC_FORM_DATA_API |
| 51 | +from .task import API as TASK_API |
| 52 | +from .task_template import API as TASK_TEMPLATE_API |
| 53 | +from .user import API as USER_API |
| 54 | +from .work import API as WORK_API |
| 55 | +from .work_issues import API as WORK_ISSUES_API |
| 56 | +from .work_status import API as WORK_STATUS_API |
| 57 | +from .work_type import API as WORK_TYPES_API |
| 58 | +from .region import API as REGION_API |
| 59 | +from .eao_team import API as EAO_TEAM_API |
| 60 | + |
| 61 | + |
| 62 | +__all__ = ("API_BLUEPRINT", "OPS_BLUEPRINT") |
| 63 | + |
| 64 | +# This will add the Authorize button to the swagger docs |
| 65 | +AUTHORIZATIONS = {"apikey": {"type": "apiKey", "in": "header", "name": "Authorization"}} |
| 66 | + |
| 67 | +OPS_BLUEPRINT = Blueprint("API_OPS", __name__, url_prefix="/ops") |
| 68 | + |
| 69 | +API_OPS = Api( |
| 70 | + OPS_BLUEPRINT, |
| 71 | + title="Service OPS API", |
| 72 | + version="1.0", |
| 73 | + description="The Core API for the Reports System", |
| 74 | + security=["apikey"], |
| 75 | + authorizations=AUTHORIZATIONS, |
| 76 | +) |
| 77 | + |
| 78 | +API_OPS.add_namespace(OPS_API, path="/") |
| 79 | + |
| 80 | +API_BLUEPRINT = Blueprint("API", __name__, url_prefix="/api/v1") |
| 81 | + |
| 82 | +API = Api( |
| 83 | + API_BLUEPRINT, |
| 84 | + title="EAO Reports API", |
| 85 | + version="1.0", |
| 86 | + description="The Core API for the Reports System", |
| 87 | + security=["apikey"], |
| 88 | + authorizations=AUTHORIZATIONS, |
| 89 | +) |
| 90 | + |
| 91 | +API.add_namespace(META_API, path="/meta") |
| 92 | +API.add_namespace(CODES_API, path="/codes") |
| 93 | +API.add_namespace(PROJECTS_API, path="/projects") |
| 94 | +API.add_namespace(PROJECT_TYPES_API, path="/project-types") |
| 95 | +API.add_namespace(SYNC_FORM_DATA_API, path="/sync-form-data") |
| 96 | +API.add_namespace(PHASE_API, path="/phases") |
| 97 | +API.add_namespace(STAFF_API, path="/staffs") |
| 98 | +API.add_namespace(OUTCOME_API, path="/outcomes") |
| 99 | +API.add_namespace(SUB_TYPES_API, path="/sub-types") |
| 100 | +API.add_namespace(INSPECTION_API, path="/inspections") |
| 101 | +API.add_namespace(WORK_API, path="/works") |
| 102 | +API.add_namespace(LOOKUP_API, path="/lookups") |
| 103 | +API.add_namespace(REPORTS_API, path="/reports") |
| 104 | +API.add_namespace(INDIGENOUS_NATION_API, path="/indigenous-nations") |
| 105 | +API.add_namespace(PROPONENT_API, path="/proponents") |
| 106 | +API.add_namespace(REMINDER_CONFIGURATION_API, path="/reminder-configurations") |
| 107 | +API.add_namespace(USER_API, path='/users') |
| 108 | +API.add_namespace(TASK_TEMPLATE_API, path="/task-templates") |
| 109 | +API.add_namespace(EVENT_TEMPLATE_API, path="/event-templates") |
| 110 | +API.add_namespace(TASK_API, path="/tasks") |
| 111 | +API.add_namespace(EVENT_API, path="/milestones") |
| 112 | +API.add_namespace(EVENT_CONFIGURATION_API, path="/event-configurations") |
| 113 | +API.add_namespace(RESPONSIBILITY_API, path="/responsibilities") |
| 114 | +API.add_namespace(OUTCOME_CONFIGURATION_API, path="/outcome-configurations") |
| 115 | +API.add_namespace(ACT_SECTION_API, path="/act-sections") |
| 116 | +API.add_namespace(WORK_STATUS_API, path='/work/<int:work_id>/statuses') |
| 117 | +API.add_namespace(WORK_TYPES_API, path='/work-types') |
| 118 | +API.add_namespace(WORK_ISSUES_API, path='/work/<int:work_id>/issues') |
| 119 | +API.add_namespace(SPECIAL_FIELD_API, path='/special-fields') |
| 120 | +API.add_namespace(POSITION_API, path='/positions') |
| 121 | +API.add_namespace(REGION_API, path='/regions') |
| 122 | +API.add_namespace(EAO_TEAM_API, path='/eao-teams') |
0 commit comments