Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / api / util.py @ 8b7c2fc3

History | View | Annotate | Download (15.8 kB)

# Date Author Comment
8b7c2fc3 12/09/2013 05:00 pm Christos Stavrakakis

cyclades: Fix typo error

bd16bf3e 12/02/2013 04:03 pm Stratos Psomadakis

Encrypt instance ids in the stats URLs

406968dc 11/25/2013 01:13 pm Dionysis Grigoropoulos

cyclades: Catch an unhandled exception

7bbe4333 11/20/2013 12:05 pm Ilias Tsitsimpis

cyclades: Catch exception in verify_personality

The verify_personality function assumes that the contents of a
personality is encoded in base64 and tries to decode them. But if the
client didn't encode them a TypeError `Incorrect padding' will be
raised. Catch this exception and raise a BadRequest.

24ea227b 11/06/2013 06:58 pm Dionysis Grigoropoulos

cyclades: Return 'links' in subnet and port calls

  • Return 'links' attribute in subnet api response
  • Return 'links' attribute in port api response
cdd6fc06 11/06/2013 04:06 pm Christos Stavrakakis

cyclades: Create 'cyclades_network' service

Create 'cyclades_network' service which is part of Cyclades, of 'network'
type and with 'network' prefix to hold all API endpoints that are
relative with networks. So, for example, the endpoint for networks will...

8d5795b4 11/06/2013 02:00 pm Christos Stavrakakis

Cyclades: Rename 'Can not' to 'Cannot' to all msgs

0292883e 11/04/2013 03:52 pm Christos Stavrakakis

cyclades: Refactor code

Move code relative with allocating ips and floating IPs to 'logic.ips'
module.

3f18f035 11/04/2013 12:18 pm Christos Stavrakakis

cyclades: Forbid new ports no deleting network

Do not allow creation of new ports and reservation of floating IPs on
network that are being deleted. Currently the state of the network
changes only when the network gets deleted from all backends. So we
check if a network is being deleted by checking if the action of the...

09b76b7e 11/02/2013 02:39 pm Christos Stavrakakis

cyclades: Fix permissions when looking up ports

Look up of ports should check the port userid and not the network
userid.

fae6e5f0 11/01/2013 04:17 pm Christos Stavrakakis

cyclades: Create ports without 'device_id'

Allow creation of ports that are not connected to any instance. Such
ports will be in 'DOWN' state. To allow this, 'machine' attribute of
NetworkInterface model has been made to allow null values. Finally, the
'logic.ports' module has been remove, and the corresponding code has...

691c98cf 11/01/2013 12:45 am Christos Stavrakakis

cyclades: Fix bugs relative to pool allocation

Fix bug when trying to allocate a specified IPv4 address. Only one of
the IP pools will contain this address, so you must bypass InvalidValue
exceptions until searching all pools.

Also PoolManager raised 'EmptyPool' exception when trying to allocate from an...

4edfc376 10/31/2013 11:52 am Christos Stavrakakis

cyclades: Get floating IP without specifying pools

Extend GET /floatingips API method, to allow requests that do not
specify the 'floating_network_id' attribute. In this case it will try
to allocate a floating IP address from one of the available floating IP...

0711e5aa 10/30/2013 12:56 am Christos Stavrakakis

cyclades: Fix default values for IP pool

Temporary commit to change default offset and size of IPPoolTable
factory.

495e2be8 10/29/2013 02:17 pm Christos Stavrakakis

Revert "cyclades: Add /routers api"

This reverts commit 69dadbe4e3223dc4d8cbaa5b09dde755c15679ed. Temporary
remove the /routers API.

d9c36253 10/25/2013 12:35 am Marios Kogias

cyclades: snf-manage floating-ip-attach

snf-manage floating-ip-attach <address> --machine <server_id/router_id>

69dadbe4 10/25/2013 12:35 am Marios Kogias

cyclades: Add /routers api

  • Add support for /routers api calls
  • Add tests for the api
9d1e6480 10/25/2013 12:35 am Marios Kogias

cyclades: snf-manage floating-ip-release <address>

0069a20c 10/16/2013 11:19 am Marios Kogias

cyclades: Add snf-manage port-remove command

a1713485 10/15/2013 01:20 am Marios Kogias

cyclades: snf-manage port-create

  • Create new command snf-manage port-create
  • Create new function util.get_security_group
ae994d2e 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Fix getting value from pool

If an address is specified, check that the value belong to the pool,
else raise InvalidValue.

710b1c43 10/14/2013 03:51 pm Christos Stavrakakis

cyclades: Refactor code for allocating IPs

Refactor code that was used for allocating IP addresses and creating
NetworkInterfaces. The new code is more suitable to the new DB schema
where each network may have many IPv4 subnets and each subnet may
have many IP pools. Also, the new functions are using prefetch related...

b3a43976 10/11/2013 02:40 pm Christos Stavrakakis

cyclades: Optimize DB queries of /servers API

Use 'prefetch_related' attribute of Django queryset to prefetch the
NetworkInterface and IPaddress objects that are related with a
VirtualMachine object. Also, modify functions that operate on server
NICs and IPs, to to use only the prefetched objects, which means that...

a96e84cf 10/10/2013 08:08 pm Christos Stavrakakis

cyclades: Fix code for networks logic and API

95a213d4 10/10/2013 04:46 pm Christos Stavrakakis

cyclades: Fix indentation, PEP8 and wrong imports

0baa1e3d 10/10/2013 12:40 pm Build Bot

Integrate /networks API call

593851e0 10/10/2013 12:40 pm Build Bot

cyclades: Add /ports api call

92d2d1ce 10/10/2013 01:56 am Christos Stavrakakis

cyclades: Make API server tests pass

Refactor Cyclades code so that it follows the new models for Networks,
Subnets and IPAddresses. This refactor is not complete. Instead is the
necessary refactor for making tests for server API calls succeed.

326c3ec8 10/09/2013 07:36 pm Christos Stavrakakis

cyclades: Replace FloatingIP with IPAddress

This commit just replaces all references to FloatingIP objects with
references to IPAddress object, in order to be able to just load the
code. But the code is left unchanged, so all tests will fail.

d0545590 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Use NIC UUID in firewall tags

Use NICs UUID instead of index to generate firewall tags. Make the
'set_firewall_profile' action to take the NICs ID as argument. Also,
update the firewall settings.

c988fcca 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Change format of 'attachment' attribute

Change the format of the 'attachment' attribute. Until now, each
attachment had an identifier of the form 'nic-$vm_id-$nic_id'. This
commit changes the identifier to just '$nic_id', since from now on
is unique for the lifetime of a NIC.

7c714455 10/09/2013 11:40 am Christos Stavrakakis

cyclades: Use Ganeti NIC UUIDs

Since Ganeti 2.8, it is supported to refer to devices (NICs and Disks)
not only by their index but also by their name or UUID. This commit
updates Synnefo to refer to devices by their name. Synnefo will set the
name of the devices which will be a UUID. We do not use Ganeti's UUIDs...

c172f4ab 08/23/2013 12:16 pm Christos Stavrakakis

Pass hashmap instead of location to snf-image

Update Cyclades, to pass as 'img_id' the hashmap('checksum') of the
image, instead of the location URL. In that way, snf-image does not any
access to the Pithos database.

a4658bbe 08/06/2013 08:40 am Christos Stavrakakis

cyclades: Move code for validating network values

Move code for network parameters validation from 'api' module to 'logic'.

12e539f0 07/24/2013 09:15 pm Christos Stavrakakis

cyclades: Exclude FIP pools from IP allocation

Do not include the floating IP pools, to the available public networks
when allocating an IPv4 address, when 'SNF:ANY_PUBLIC' option is used.

5aeb4e93 07/17/2013 02:57 pm Christos Stavrakakis

cyclades: Support IPv6 only networks

Make Cyclades support IPv6 only networks. Such networks will have
the 'subnet' attribute set to None, in the same way that IPv4 only
networks have the 'subnet6' attribute set to None.

Because currently Ganeti does not support IPv6 only networks, we create the...

32e4e343 07/07/2013 03:04 pm Christos Stavrakakis

PEP8 fixes

660b9f3b 07/02/2013 12:32 pm Christos Stavrakakis

cyclades: Remove PUBLIC_USE_POOL setting

Remove PUBLIC_USE_POOL setting, since in order to use floating IPs, the
cyclades must be responsible for managing all IP pools.

f8675683 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Various fixes regarding floating IPs

Fix some issues regarding floating ips introduced by rebasing branch.

9e8be4fb 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Auto allocate a floating IP

Make 'pool' attribute of POST /os-floating-ips request optional. If
attribute is missing, the server will allocate a floating IP from one of
the available public networks.

41a7fae7 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Major refactor to api and logic apps

Major refactor to cyclades api and logic apps that removes most code
from the api views and moves it to logic app, so that the same logic
code can be used by different apps (e.g. EC2 API). Code is moved into...

34c03a51 07/02/2013 12:31 pm Christos Stavrakakis

cyclades: Handle 'EmptyPool' in util method

Refactor cyclades code to handle 'EmptyPool' exception in
'get_network_free_address' function.

73fbaad3 06/14/2013 06:11 pm Christos Stavrakakis

cyclades: Fix typo in links

1b696c26 06/14/2013 03:52 pm Christos Stavrakakis

cyclades: Add 'links' to compute endpoints

Add 'links' attribute to API responses for servers, networks, flavors
and images endpoints.

b47b110d 06/03/2013 11:50 am Kostas Papadimitriou

cyclades: Remove userdata api from ui prefix

- Individualize userdata api by placing module under synnefo namespace and
urs under it's own USERDATA_PREFIX

6dafedf6 05/31/2013 05:12 pm Christos Stavrakakis

cyclades: Add 'drained' flag to Network

Extend Network model with the 'drained' attribute, to indicate whether a
network should be used in public IP allocation when creating servers.
This option is only useful for public networks.

bcd80cd9 05/16/2013 06:30 pm Christos Stavrakakis

cyclades: Move common code to seperate function

Move common between API method and management command for creating a
server to a separate function.

5b0832fc 05/14/2013 01:24 pm Christos Stavrakakis

cyclades: Fix stale 'DeletedError' exception

85919a0f 04/25/2013 04:14 pm Christos Stavrakakis

Fix deadlock when creating server

Fix deadlock when creating a server that was introduced by commit
501053a. Allocating the public IP in the same transaction with creating
the server resulted in a deadlock with backend allocator, because
inserting the new VM in the database waits on an exclusive lock of the...

cda71050 04/22/2013 10:10 am Christos Stavrakakis

plankton: Cleanup and improve code

Major refactor in plankton APP and ImageBackend code:
  • Remove unused code
  • Remove 'plankton_method' decorator that added an ImageBackend to
    requests an replace it with 'image_backend' context manager. This
    context manager is responsible for opening and closing connections...
04a1b675 04/08/2013 06:17 pm Christos Stavrakakis

Move astakos lib from snf-common to snf-django-lib

05d401cf 04/08/2013 11:06 am Christos Stavrakakis

Remove VM/Network DeletedError and BuildingError

Handle these errors explicitly in the code instead of the "api_method"
decorator.

f6ff4b40 04/08/2013 11:06 am Christos Stavrakakis

Remove ImageBackend NotAllowedError

Refs #3359

b3fd98ae 04/08/2013 11:06 am Christos Stavrakakis

Use common 'api_method' decorator to cyclades api

Update Cyclades API methods to use the new common 'api_method'
decorator. Also, update all the relevant tests.

9dcb5b8a 04/08/2013 11:06 am Christos Stavrakakis

Remove dead code

bd40abfa 04/08/2013 11:06 am Christos Stavrakakis

Move cloud faults to 'snf_django.lib.api.faults'

Gather all faults from all synnefo projects into common
'snf_django.lib.api.faults'.

9ae613af 02/22/2013 04:38 pm Christos Stavrakakis

Validate all network-create parameters

d368ec0c 02/20/2013 06:54 pm Christos Stavrakakis

Fix bug: Detect malformed network subnet

Fix bug in Cyclades network API. API should raise BadRequest if
specified network subnet is invalid. Also, do not allow subnets with
host bits set (like 10.0.0.1/28).

e440e835 02/15/2013 02:52 pm Christos Stavrakakis

pep8 fixes

2cb812be 01/31/2013 01:43 pm Christos Stavrakakis

Fix image 'backend_id' for archipelago

Archipelago needs as disk origin, the hashmap of the image
instead of its url in the backend.

55f562a4 01/11/2013 04:35 pm Kostas Papadimitriou

Helper api method to retrieve existing userids

b7d38981 12/04/2012 04:51 pm Dimitris Aragiorgis

Introduce network flavors to replace network types

Add tags and mode to network db model. Replace existing type with
flavor. Introduce 4 different flavors. Each flavor has mode, link,
mac_prefix, tags. Supported flavors are CUSTOM, IP_LESS_ROUTED,
MAC_FILTERED, PHYSICAL_VLAN and are hardcoded in db models....

006c6249 11/30/2012 12:49 pm Christos Stavrakakis

Fix typos

2a599282 11/30/2012 12:20 pm Christos Stavrakakis

Merge handling of ext_<provider> disk templates

6ec4694f 11/30/2012 11:44 am Christos Stavrakakis

Use helper function for verifying personalities

33050118 11/29/2012 03:55 pm Georgios D. Tsoukalas

Merge branch 'origin/devel-0.13' into quota

Conflicts:
snf-cyclades-app/synnefo/api/servers.py

74459c12 11/27/2012 04:13 pm Christos Stavrakakis

Fix wrong setting

PUBLIC_ROUTED_USE_POOL has been renamed to PUBLIC_USE_POOL

dca7553e 11/26/2012 12:36 pm Christos Stavrakakis

Refactor some code to API create_server method

2db7d9df 11/26/2012 12:22 pm Christos Stavrakakis

Handle Pithos NotAllowedError

7f2dbcad 11/07/2012 12:52 pm Christos Stavrakakis

Use select_for_update for VirtualMachines

Use select_for_update method when accessing VM objects to prevent
race conditions. Also move start_action from logic to api.

17c2ed57 11/06/2012 12:50 pm Christos Stavrakakis

Fix HTTP response code when refusing action

Return Forbidden(403) instead of Unauthorized(401) when refusing a
requested action, because the VM is suspended or the resource is public.
Unauthorized should be used only when authentication is required and has...

3a522cff 11/05/2012 01:55 pm Christos Stavrakakis

Return the VM!

e221ade2 11/01/2012 01:24 pm Christos Stavrakakis

Do not allow any API action on suspended VMs

Do not allow any modification of any administratively suspended VM through the
API.

aa8230bd 10/30/2012 12:49 pm Christos Stavrakakis

Include deleted networks in get_flavor_info

22a9959d 10/30/2012 12:49 pm Christos Stavrakakis

Do not allow actions to deleted networks

69033a7a 10/15/2012 11:32 am Christos Stavrakakis

Block create instance api call with deleted flavor

Do not allow creation of instances with deleted flavors
Refs #2481

d3406fbc 10/15/2012 10:29 am Christos Stavrakakis

Fix GET networks API response for public networks

260147b1 10/11/2012 05:43 pm Christos Stavrakakis

Log 5xx API faults

adc46059 09/28/2012 12:19 pm Christos Stavrakakis

Perform allocations in separate transactions

Add ForUpdateManager to the Backend model, in order to guarantee
exclusive order when allocating a VM.

Use manual transactions when allocating Backend and public IP for a new
VM, since these allocations need exclusive access (SELECT..FOR UPDATE)...

d2e73c0c 09/27/2012 03:59 pm Christos Stavrakakis

Fix race conditions when updating network objects

Use for_update() object manager in order to exclude race conditions
when updating network objects.

fdc94944 09/20/2012 12:14 pm Christos Stavrakakis

Refactor IP pools

Treat IP pool the same way as bridge and mac-prefix pools. The pool is
removed from the Network table and moved to an IPPoolTable containing the
IP pools for all networks. Also added support for external reservations.

Migration files for transfering the pool to the new tables are included....

af6a3bc5 09/19/2012 01:16 pm Christos Stavrakakis

Unique mac-prefix only for mac-filtered networks

03992c72 09/19/2012 01:16 pm Christos Stavrakakis

Refactor bridge and mac-prefix pool tables

Redesign the implementation of pools and map mac-prefix and bridge pools
to that design.

Each pool type is mapped to a table in the database, and each row of
that table is a pool of that type. All pool tables must contain the...

7fede91e 09/07/2012 05:36 pm Christos Stavrakakis

Implement multiple public networks

Implement multiple public networks in order to support:
- different public networks per backend
- non-consecutive IP ranges in each backend

To support this, public networks are treated different from private
ones. Namely, they are correlated with one backend (and so have...

b14725eb 09/07/2012 05:36 pm Christos Stavrakakis

Do not allow creation of two big/small networks

- Networks smaller than /29 are not supported in Ganeti.
- Big networks will result in degraded performance in Ganeti
and DB due to the big reservation map.

3165f027 07/27/2012 02:57 pm Christos Stavrakakis

Implement MAC Prefix Management

In order to guarantee uniqueness of MAC address accross all backends,
synnefo assignes a unique mac prefix to each network in each backend.

A mac-prefix of 20 bits, which is picked from the MacPrefixPool, is
assigned to each Network. The mac-prefix of the network in each...

6dd70a5c 07/23/2012 11:49 am Christos Stavrakakis

New management command for creating a network

Create a management command for creating networks. Also remove
the initial_data.json, since it is currently not necessary.

08b079e2 07/23/2012 11:42 am Stavros Sachtouris

Update servers/networks responses for new API

- Reponses for servers and netowrks details (list or solo) are now
consistent to recent backend changes.
- Methods get_nic_from_index and construct_nic_id have been created
- Syntax for nic removal from network/vm has been adjusted

ce55f211 07/02/2012 08:25 pm Kostas Papadimitriou

Simple per user quota mechanism for networks/vms

- New dict setting VMS_USER_QUOTA to allow setting per user quota
(overrides MAX_VMS_PER_USER setting)
- Private networks quota mechanism (based on MAX_NETWORKS_PER_USER and
NETWORKS_USER_QUOTA settings)...

4b3b8688 02/24/2012 05:51 pm Giorgos Verigakis

Use lib.astakos instead of our own middleware

2035039b 02/24/2012 05:49 pm Giorgos Verigakis

Switch to the logging middleware

cc875294 02/02/2012 05:10 pm Giorgos Verigakis

Merge remote-tracking branch 'origin/master' into astakos-integration

Conflicts:
runtests.sh
snf-cyclades-app/synnefo/aai/__init__.py
snf-cyclades-app/synnefo/aai/fixtures/auth_test_data.json
snf-cyclades-app/synnefo/aai/middleware.py
snf-cyclades-app/synnefo/aai/models.py...

9c0ac5af 01/30/2012 06:55 pm Kostas Papadimitriou

Renamed snf-app to snf-cyclades-app