Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / app_settings / default / api.py @ d7841399

History | View | Annotate | Download (5.4 kB)

1
# -*- coding: utf-8 -*-
2
#
3
# API configuration
4
#####################
5

    
6

    
7
DEBUG = False
8

    
9
# Top-level URL for deployment. Numerous other URLs depend on this.
10
APP_INSTALL_URL = "https://host:port"
11

    
12
# The API implementation needs to accept and return absolute references
13
# to its resources. Thus, it needs to know its public URL.
14
API_ROOT_URL = APP_INSTALL_URL + '/api'
15

    
16
# The API will return HTTP Bad Request if the ?changes-since
17
# parameter refers to a point in time more than POLL_LIMIT seconds ago.
18
POLL_LIMIT = 3600
19

    
20
#
21
# Network Configuration
22
#
23

    
24
# Maximum allowed network size for private networks.
25
MAX_CIDR_BLOCK = 22
26

    
27
# The first mac prefix to use
28
MAC_POOL_BASE = 'aa:00:0'
29
MAC_POOL_LIMIT = 65536
30

    
31
ENABLED_NETWORKS = ['PUBLIC_ROUTED',
32
                    'PRIVATE_MAC_FILTERED',
33
                    'PRIVATE_PHYSICAL_VLAN']
34
                    # CUSTOM_ROUTED,
35
                    # CUSTOM_BRIDGED,
36

    
37
# Settings for PUBLIC_ROUTED network:
38
# -----------------------------------
39
# In this case VMCs act as routers that forward the traffic to/from VMs, based
40
# on the defined routing table($PUBLIC_ROUTED_ROUTING_TABLE) and ip rules, that
41
# exist in every node, implenting an IP-less routed and proxy-arp setup.
42
# (This value is also hardcoded in fixture db/fixtures/initial_data.json)
43
PUBLIC_ROUTED_ROUTING_TABLE = 'snf_public'
44
PUBLIC_ROUTED_TAGS = ['ip-less-routed']
45

    
46
# Boolean value indicating whether synnefo would hold a Pool and allocate IP
47
# addresses. If this setting is set to False, IP pool management will be
48
# delegated to Ganeti. If machines have been created with this option as False,
49
# you must run network reconciliation after turning it to True.
50
PUBLIC_USE_POOL = True
51

    
52
# Settings for PRIVATE_MAC_FILTERED network:
53
# ------------------------------------------
54
# All networks of this type are bridged to the same bridge. Isolation between
55
# networks is achieved by assigning a unique MAC-prefix to each network and
56
# filtering packets via ebtables.
57
PRIVATE_MAC_FILTERED_BRIDGE = 'br0'
58
PRIVATE_MAC_FILTERED_TAGS = ['private-filtered']
59

    
60
# Settings for PRIVATE_PHSICAL_VLAN network:
61
# ------------------------------------------
62
# Each network of this type is mapped to an isolated physical VLAN, which must
63
# be preconfigured in the backend. Each vlan corresponds to a bridge named
64
# $PRIVATE_PHYSICAL_VLAN_PREFIX{1..$PRIVATE_PHYSICAL_VLAN_MAX_NUMBER} (e.g. prv5)
65
# VirtualMachine's taps are eventually bridged to the corresponding bridge.
66
PRIVATE_PHYSICAL_VLAN_BRIDGE_PREFIX = 'prv'
67
# The max limit of physical vlan pool
68
PRIVATE_PHYSICAL_VLAN_MAX_NUMBER = 100
69
PRIVATE_PHYSICAL_VLAN_TAGS = ['physical-vlan']
70

    
71

    
72
# Settings for CUSTOM_ROUTED:
73
# ---------------------------
74
# Same as PUBLIC_ROUTED but with custom values
75
CUSTOM_ROUTED_ROUTING_TABLE = 'custom_routing_table'
76
CUSTOM_ROUTED_TAGS = []
77

    
78
# Settings for CUSTOM_BRIDGED:
79
# ---------------------------
80
# Same as PRIVATE_BRIDGED but with custom values
81
CUSTOM_BRIDGED_BRIDGE = 'custom_bridge'
82
CUSTOM_BRIDGED_TAGS = []
83

    
84
# Firewalling
85
GANETI_FIREWALL_ENABLED_TAG = 'synnefo:network:0:protected'
86
GANETI_FIREWALL_DISABLED_TAG = 'synnefo:network:0:unprotected'
87
GANETI_FIREWALL_PROTECTED_TAG = 'synnefo:network:0:limited'
88

    
89
# The default firewall profile that will be in effect if no tags are defined
90
DEFAULT_FIREWALL_PROFILE = 'DISABLED'
91

    
92
# our REST API would prefer to be explicit about trailing slashes
93
APPEND_SLASH = False
94

    
95
# Fixed mapping of user VMs to a specific backend.
96
# e.g. BACKEND_PER_USER = {'example@okeanos.grnet.gr': 2}
97
BACKEND_PER_USER = {}
98

    
99
# Quota
100
#
101
# Maximum number of VMs a user is allowed to have.
102
MAX_VMS_PER_USER = 3
103

    
104
# Override maximum number of VMs for specific users.
105
# e.g. VMS_USER_QUOTA = {'user1@grnet.gr': 5, 'user2@grnet.gr': 10}
106
VMS_USER_QUOTA = {}
107

    
108
# Maximum number of networks a user is allowed to have.
109
MAX_NETWORKS_PER_USER = 5
110

    
111
# Override maximum number of private networks for specific users.
112
# e.g. NETWORKS_USER_QUOTA = {'user1@grnet.gr': 5, 'user2@grnet.gr': 10}
113
NETWORKS_USER_QUOTA = {}
114

    
115
# URL templates for the stat graphs.
116
# The API implementation replaces '%s' with the encrypted backend id.
117
# FIXME: For now we do not encrypt the backend id.
118
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png'
119
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png'
120
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png'
121
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png'
122

    
123
# Recommended refresh period for server stats
124
STATS_REFRESH_PERIOD = 60
125

    
126
# The maximum number of file path/content pairs that can be supplied on server
127
# build
128
MAX_PERSONALITY = 5
129

    
130
# The maximum size, in bytes, for each personality file
131
MAX_PERSONALITY_SIZE = 10240
132

    
133
# Available storage types to be used as disk templates
134
# Use ext_<provider_name> to map specific provider for `ext` disk template.
135
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain',
136
                         'rbd',  'sharedfile')
137
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd'
138

    
139
# The URL of an astakos instance that will be used for user authentication
140
ASTAKOS_URL = 'https://astakos.okeanos.grnet.gr/im/authenticate'
141

    
142
# Key for password encryption-decryption. After changing this setting, synnefo
143
# will be unable to decrypt all existing Backend passwords. You will need to
144
# store again the new password by using 'snf-manage backend-modify'.
145
# SECRET_ENCRYPTION_KEY may up to 32 bytes. Keys bigger than 32 bytes are not
146
# supported.
147
SECRET_ENCRYPTION_KEY= "Password Encryption Key"