Completed
Push — develop ( 0f3610...5e335d )
by
unknown
01:36
created

ComputeAPI   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 9
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 4 2
1
# -*- coding: utf-8 -*-
2
#
3
# Copyright (c) 2013-2015 Online SAS and Contributors. All Rights Reserved.
4
#                         Julien Castets <[email protected]>
5
#                         Kevin Deldycke <[email protected]>
6
#
7
# Licensed under the BSD 2-Clause License (the "License"); you may not use this
8
# file except in compliance with the License. You may obtain a copy of the
9
# License at http://opensource.org/licenses/BSD-2-Clause
10
11
from . import API
12
13
14
REGIONS = {
15
    'par1': {
16
        'url': 'https://cp-par1.scaleway.com/',
17
    },
18
    'ams1': {
19
        'url': 'https://cp-ams1.scaleway.com/',
20
    }
21
}
22
23
24
class ComputeAPI(API):
25
    """ The default region is par1 as it was the first availability zone
26
    provided by Scaleway, but it could change in the future.
27
    """
28
29
    def __init__(self, region='par1', **kwargs):
30
        assert region in REGIONS
31
        base_url = REGIONS[region]['url']
32
        super(ComputeAPI, self).__init__(base_url=base_url, **kwargs)
33