Merge "Disabling policy retrieval for pci opt"
[optf/osdf.git] / osdf / __init__.py
1 # -------------------------------------------------------------------------
2 #   Copyright (c) 2015-2018 AT&T Intellectual Property
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 #
16 # -------------------------------------------------------------------------
17 #
18
19 """Core functions for OSDF Application, including flask app"""
20
21 from jinja2 import Template
22
23
24 end_point_auth_mapping = {  # map a URL endpoint to auth group
25     "cmscheduler": "CMScheduler",
26     "placement": "Placement",
27     "pci": "PCIOpt"
28 }
29
30 userid_suffix, passwd_suffix = "Username", "Password"
31 auth_groups = set(end_point_auth_mapping.values())
32
33 ERROR_TEMPLATE = Template("""
34 {
35      "serviceException": {
36         "text": "{{ description }}"
37      }
38 }
39 """)
40
41 ACCEPTED_MESSAGE_TEMPLATE = Template("""
42 {
43    "requestId": "{{ request_id }}",
44    "transactionId": "{{ transaction_id }}",
45    "requestStatus": "{{ request_status }}",
46    "statusMessage": "{{ status_message }}"
47 }
48 """)