Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (5.7 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
# Ignore disk size specified by flavor, always build the
96
# machine with a 4GB (in the case of Windows: 14GB) disk.
97
# This setting is helpful in development setups.
98
#
99
IGNORE_FLAVOR_DISK_SIZES = False
100

    
101
# Fixed mapping of user VMs to a specific backend.
102
# e.g. BACKEND_PER_USER = {'example@okeanos.grnet.gr': 2}
103
BACKEND_PER_USER = {}
104

    
105
# Quota
106
#
107
# Set to True to use the Quotaholder service. Otherwise, static
108
# limits are used
109
USE_QUOTAHOLDER = False
110
# Maximum number of VMs a user is allowed to have.
111
MAX_VMS_PER_USER = 3
112

    
113
# Override maximum number of VMs for specific users.
114
# e.g. VMS_USER_QUOTA = {'user1@grnet.gr': 5, 'user2@grnet.gr': 10}
115
VMS_USER_QUOTA = {}
116

    
117
# Maximum number of networks a user is allowed to have.
118
MAX_NETWORKS_PER_USER = 5
119

    
120
# Override maximum number of private networks for specific users.
121
# e.g. NETWORKS_USER_QUOTA = {'user1@grnet.gr': 5, 'user2@grnet.gr': 10}
122
NETWORKS_USER_QUOTA = {}
123

    
124
# URL templates for the stat graphs.
125
# The API implementation replaces '%s' with the encrypted backend id.
126
# FIXME: For now we do not encrypt the backend id.
127
CPU_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-bar.png'
128
CPU_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/cpu-ts.png'
129
NET_BAR_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-bar.png'
130
NET_TIMESERIES_GRAPH_URL = 'http://stats.okeanos.grnet.gr/%s/net-ts.png'
131

    
132
# Recommended refresh period for server stats
133
STATS_REFRESH_PERIOD = 60
134

    
135
# The maximum number of file path/content pairs that can be supplied on server
136
# build
137
MAX_PERSONALITY = 5
138

    
139
# The maximum size, in bytes, for each personality file
140
MAX_PERSONALITY_SIZE = 10240
141

    
142
# Available storage types to be used as disk templates
143
# Use ext_<provider_name> to map specific provider for `ext` disk template.
144
GANETI_DISK_TEMPLATES = ('blockdev', 'diskless', 'drbd', 'file', 'plain',
145
                         'rbd',  'sharedfile')
146
DEFAULT_GANETI_DISK_TEMPLATE = 'drbd'
147

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

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