Commit Graph

216 Commits

Author SHA1 Message Date
gongysh
7c8d2ad3a9 Move network schedule to first port creation.
blueprint quantum-scheduler

we remove scheduling network
to dhcp agent when creating network so that we can give admin
the chance to allocate the given network to a given dhcp agent after
network creation.

Change-Id: I228870669825405277de0505a3f2ece074918524
2013-03-02 11:12:46 +08:00
Jenkins
76501496f5 Merge "Remove compat cfg wrapper" 2013-02-28 18:45:05 +00:00
gongysh
00897bd3b7 Add scheduling feature basing on agent management extension
3rd part of blueprint quantum-scheduler

1. Allow networks to be hosted by certain dhcp agents.
Network to dhcp agent is a
many to many relationship. Provide a simple
scheduler to schedule a network randomly
to an active dhcp agent when a network or port is created.
2. Allow admin user to (de)schedule network to a
certain dhcp agent manually.
3. Allow routers to be hosted by a certain l3 agent.
Router to l3 agent is a many to one relationship.
Provide a simple scheduler to
schedule a router to l3 agent if the router is not
scheduled when the router is  updated.
4. Auto schedule networks and routers to agents when agents
start.
5. Only support ovs plugin at this point

Change-Id: Iddec3ea9d4c0fe2d51a59f7db47145722fc5a1cd
2013-02-27 21:20:51 +08:00
Mark McLoughlin
ee5516bba9 Remove compat cfg wrapper
This wrapper was there to allow oslo-config changes through the gate
while keystoneclient hadn't been updated.

Also update to 2013.1b4.

Change-Id: I3d48673af58ae379e8e4d2c7fb4b4d81f3ed67dd
2013-02-27 22:15:54 +09:00
Jenkins
aa2280c282 Merge "Raising error if invalid attribute passed in." 2013-02-20 07:55:06 +00:00
Jason Zhang
de70f513f4 Raising error if invalid attribute passed in.
400 will be returned when invalid attributes
are passed into Quantum API.

Fixed the some test cases failed since the
enforcement of invalid attribute checking

Fixes: bug #1076179

Change-Id: I4e9e2891c444f9dcd051f7b325d3c9403b28db86
2013-02-19 11:38:53 -08:00
He Jie Xu
4e7521bb9c Supporting pagination in api v2.0
Implements bp support-pagination-in-api-v2.0

Add sort and pagination feature for api v2.0.
*Add sort_key, sort_dir for sorting feature.
*Add limit, marker, page_reverse for pagination feature.
*Add emulated sorting and pagination

Native pagination and native sorting implemented for:
*plugins: ovs, linuxbridge
*extensions: l3 securitygroup

Emulated pagination and sorting enabled for:
extensions: lbaas

Change-Id: I28ec6ab7bcae9839cb42c6d60bbfff7250de13ed
2013-02-19 23:04:13 +08:00
gongysh
4126d593e7 Modify dhcp agent for agent management extension
2nd part of blueprint quantum-scheduler

Remove openstack openstack listener on DHCP agent side.
Add DHCPagent notifier on quantum server side.

Change-Id: I196691650a99ba865bf06081a1fc4546f9fac7bd
2013-02-19 20:28:02 +08:00
Mark McLoughlin
b5990a7bd7 Use oslo-config-2013.1b3
The cfg API is now available via the oslo-config library, so switch to
it and remove the copied-and-pasted version.

Add the 2013.1b3 tarball to tools/pip-requires - this will be changed
to 'oslo-config>=2013.1' when oslo-config is published to pypi. This
will happen in time for grizzly final.

Remove the 'deps = pep8' from tox.ini as it means all the other deps
get installed with easy_install which can't install oslo-config from
the URL.

Retain dummy cfg.py file until keystoneclient middleware has been
updated (I18c450174277c8e2d15ed93879da6cd92074c27a).

Change-Id: I4815aeb8a9341a31a250e920157f15ee15cfc5bc
2013-02-17 17:33:05 +00:00
Kaiwei Fan
6d9e4413b1 Add support for extended attributes for extension resources
Removed unsed import from quantum/tests/unit/test_extension_extended_attribute.py
Address comments.
Change update_attributes_map definition/behavior

Fixes: bug #1116664
Change-Id: Idc360f5b3b35fb1d40237e1bbce39684508175cf
2013-02-14 08:10:57 -08:00
Roman Prykhodchenko
ea7a1740cb Support advanced validation of dictionaries in the API.
This change allows to specify constraints for individual keys in
dictionaries in the specification of the API resources.

Introduces type:dict_or_none validator that allows to skip
validation of a dictionary if a None value was supplied.

Adds constraints for session persistance parameters to the API.

Disables specifying cookie_name for session persistence, if
the type is set to HTTP_COOKIE or SOURCE_IP.

Fixes: bug #1104110

Change-Id: I62068deed449967949eaba9259028c88dd6974f8
2013-02-13 18:47:23 +02:00
Zhongyue Luo
e58ce67179 Adds API parameters to quantum.api.extension.ResourceExtension
Part of blueprint quantum-api-wadl

Fixes bug #1104882

Change-Id: I0d30864d3176ab001b10948f1deb37b3c062987c
2013-02-11 13:26:53 +09:00
Henry Gessau
7ba71c4887 Improvements to API validation logic.
Do not automatically map generic exceptions like AttributeError to
http errors (instead they should be handled closer to where they occur
so that they can be "intelligently" converted to the appropriate
error).

Fix up some expected error codes in the unit tests.
Improve some of the validation messages.
Remove all use of locals() in attributes.py

Fixes: bug #1076813
Change-Id: Iabf8808a840e927307bbcae4cd41790af3d79a9e
2013-02-09 01:31:47 -05:00
gongysh
5b108a6278 Adds xml support for quantum v2 API.
Fixes bug 1007998.
blueprint quantum-v2-api-xml

Author: gongysh <gongysh@linux.vnet.ibm.com>

Change-Id: I5f5407e767f8203f980b77075109845bc1553ed9
2013-02-06 00:50:24 +00:00
Zhongyue Luo
9466b83ff8 Fixes rest of "not in" usage
find quantum -type f -name "*py" -exec grep -HE " not [^ ]+ in " {} \;

Change-Id: Ief9560e515c05f05c0b5346609b87a8fdde569d7
2013-02-04 12:35:13 +08:00
Roman Prykhodchenko
b7197ccd7b Resetting session persisnence for a VIP.
This change allows to reset session persistence, if it
was configured for a VIP. It's possible by passing None
value for session persistence through the REST API.

Change-Id: I8690850d0589065502a8eb774d51fe40851624f8
Fixes: bug #1109101
2013-02-01 17:40:35 +02:00
Zhongyue Luo
8f4cbb9578 Fixes 'not in' operator usage
Fixes bug #1110058

Change-Id: I45c10097abfb929918925e7befb8ed6c36b1de1c
2013-02-01 10:14:54 +08:00
He Jie Xu
54233724f1 Fixes per tenant quota doesn't work
Fixes bug 1101331

Change-Id: I9c4e88b437506ed5818ee56ff6fd70588cb0f965
2013-01-24 17:16:52 +08:00
Jenkins
ff57b6a446 Merge "Fix i18n messages" 2013-01-23 03:52:23 +00:00
He Jie Xu
ac9aefab75 Fix i18n messages
Fix the last scraps of messages

Change-Id: I0494ab43fa95b7040de2b5a596fa08b9c73aab8d
2013-01-22 11:42:15 +08:00
Zhongyue Luo
34c83c0215 Removes redundant code in quantum.api.api_common
Fixes bug #1102313

Change-Id: Ie321c48ae6d38f013e1ef8471df4d86b63b28931
2013-01-21 17:09:27 +08:00
Zhongyue Luo
0a1681cea8 Fix i18n messages in quantum.api.api_common
Change-Id: I30dc9ad76dbfb6cc038c283d81e449cf64d7ffec
2013-01-21 17:08:21 +08:00
Zhongyue Luo
6618270b68 Fixes inefficiency in quantum.api.v2.base._filters
Use iteritems() instead of getall() on request.GET

Fixes bug #1092995

Change-Id: Ic0b5e3d7c7b1ddd072d9fe918ea22a8e9aef9ee4
2013-01-17 13:42:44 +08:00
Jenkins
890558e763 Merge "Optimize if/else logic in quantum.api.v2.base.prepare_request_body()" 2013-01-15 02:36:52 +00:00
Jenkins
4a355cc6b9 Merge "Fixes quantum.api.v2.base._filters to be more intuitive" 2013-01-13 10:55:54 +00:00
Akihiro MOTOKI
76a03ea6ff Use default_notification_level when notification
Fix bug 1089773

Notifications in quantum api do not honor default_notification_level
in quantum.conf and always use INFO level. On the other hand
dhcp-agent refers to default_notification_level.
If default_notification_level is set to a value other than INFO,
dhcp-agent cannot receive notification from quantum server.

Change-Id: Ie3ae576d62e91651aa59b2324ec114716181107f
2013-01-13 01:53:11 +09:00
Zhongyue Luo
e8b34413a2 Optimize if/else logic in quantum.api.v2.base.prepare_request_body()
Removed redundant checkups of variables

Fixes bug #1096932

Change-Id: Icdee0e946a77865928b942d3248e39e771af0656
2013-01-11 09:10:01 +08:00
Zhongyue Luo
ddca30dc4c Fixes quantum.api.v2.base._filters to be more intuitive
Converts values in one place and sets dictonary according to the return value

Fixes bug #1092977

Change-Id: I05dd9b24a8ab20f8c302c22f5bdda2a80ec90e19
2013-01-11 08:55:02 +08:00
Jenkins
b1cbcb4abf Merge "API extension and DB support for service types" 2013-01-08 07:49:20 +00:00
Jenkins
299b8731de Merge "refactor QuotaV2 import to match to other exts" 2013-01-08 03:47:00 +00:00
Salvatore Orlando
98fcdc0d6f API extension and DB support for service types
Blueprint quantum-service-type

This patch allows for managing service types through the API.
The default service type is specified in the configuration file.
The patch also provides a 'dummy' API extension, which uses the
'dummy' service plugin, as a PoC for usage of service type.
The dummy API extension is used in unit tests only.

Change-Id: I97d400b941fa7925b0efa0fd0d35c07419ff6bfa
2013-01-07 17:21:42 -08:00
Jenkins
f64fa42533 Merge "Cleans up bulk_body generation in quantum.api.v2.base.prepare_request_body()" 2013-01-07 13:11:50 +00:00
Mark McClain
e4711aa453 refactor QuotaV2 import to match to other exts
fixes bug 1096486

The previous code used a special extension loading mechanism to
selectively load the Quota model is the plugin matched and object path.
This was intended to load models required by plugins, but this loading
actually occurred after the db schema was created, so the model was not
always loaded.  This fix refactors the code to make the QuotaV2 ext
behave similarly to the other extensions ensuring the models are loaded
prior to database schema creation.

Change-Id: Id7d1f7ddee69bfc4419df375366319dedc3dc439
2013-01-06 23:33:29 -05:00
e0ne
8d526d55c3 Remove unused imports in api package
Change-Id: I7bb20d2b04a733f9ed5fa3792e6be7dbab325a59
2013-01-02 22:21:06 +02:00
Jenkins
1cba6348c3 Merge "Exceptions cleanup" 2013-01-02 13:25:46 +00:00
Zhongyue Luo
1124569099 Cleans up bulk_body generation in quantum.api.v2.base.prepare_request_body()
Defined a lambda function for code readability

Change-Id: Ic538b16d4643e064b222b76af80478161fd3e318
2013-01-02 21:04:56 +08:00
Gary Kotton
b6b05a30e7 Exceptions cleanup
Ensure that the quantum exceptions in FAULT_MAP are grouped
together (this will save endless bug fixes when the server
will return 500 instead of 4xx)

Change-Id: I89581e1b6b4af3eb1803d6226686adf0b576d1e7
2012-12-31 08:01:52 +00:00
Zhongyue Luo
998c4bdde4 Readjust try/catch block in quantum.api.v2.base.create()
Removed the outer try/catch block to handle all exceptions in one block.
Moved irrelevant statements out of the block

Change-Id: I5c248403b8419f664ef6f17e70a016e7c0cd4ae6
2012-12-31 10:27:03 +08:00
Jenkins
a822159f34 Merge "Raise InvalidInput directly instead of catch it" 2012-12-30 13:26:08 +00:00
He Jie Xu
d17127afe3 Raise InvalidInput directly instead of catch it
Fixes bug 1094023

Change-Id: I960b01996e33da0da5e9cd181479ebcf70d38997
2012-12-27 21:35:06 +08:00
Gary Kotton
164db207fd Ensure bulk creations have quota validations
Fixes bug 1093749

The patch set also returns a proper error instead of a internal server
error when the quotas are reached.

Change-Id: Ifc74ffa8b54faa70f5558bf5263830f5e71f58ae
2012-12-27 09:22:33 +00:00
Jenkins
fa20b0587e Merge "Removes redundant code in quantum.api.v2.base.create()" 2012-12-25 11:38:07 +00:00
Zhongyue Luo
2535727a7c Removes redundant code in quantum.api.v2.base.create()
Handles collections and one item in one routine by creating a items list

Fixes bug #1093390

Change-Id: I24b892ebff52889f17ed9ea8d17e8964e3de25f6
2012-12-24 13:58:30 +08:00
Gary Kotton
fe82df26f0 Add eventlet db_pool use for mysql
This adds the use of eventlet's db_pool module so that we can make mysql
calls without blocking the whole process.
New config options are introduced:

sql_dbpool_enable -- Enables the use of eventlet's db_pool
sql_min_pool_size -- Set the minimum number of SQL connections
sql_max_pool_size -- Set the maximum number of SQL connections
sql_idle_timeout  -- Timeout before idle sql connections are reaped

The default for sql_dbpool_enable is False for now, so there is
no forced behavior changes for those using mysql. sql_min_pool_size
is defaulted to 1 to match behavior if not using db_pool.

Fixes bug 1086173

Change-Id: Ied0aae33211585743fe955028a75c4e192a15d2f
2012-12-23 10:35:44 +00:00
Oleg Bondarev
1703047903 The patch introduces an API extension for LBaaS service
- API extension
- abstract base class for plugin
- some new validators were added to quantum/api/v2/attributes.py

Implements: blueprint lbaas-restapi-tenant
Change-Id: Ic2fd4debc4969389b395ce7352ab208c6854018b
2012-12-19 13:11:47 +04:00
Oleg Bondarev
9240097e11 add parent/sub-resource support into Quantum API framework
- quantum.api.v2.base.Controller class now able to handle sub-resources
- quantum.api.v2.router.APIRouter now able to specify sub-resources

Fixes bug 1085968

Change-Id: I07f2c1f3d974f7f17d4947804bde064dd8004a84
2012-12-13 16:07:53 +04:00
gongysh
98a9872c73 Support to reset dnsname_servers and host_routes to empty
Bug #1086232

Change-Id: Ia27170b206f755577c8607c5b27dc5cf57d19633
2012-12-09 15:41:27 +08:00
Akihiro MOTOKI
e0ca7396ca Drop duplicated port_id check in remove_router_interface()
Fixes bug 1075157

In addition exceptions used in remove_router_intreface are defined
and gettextized.

Change-Id: I30b1561f3d4be12e485c506e5c3828b41ab226ef
2012-12-06 12:40:16 +09:00
Gary Kotton
c2627f7b37 Returns more appropriate error when address pool is exhausted
Fixes bug 1086226

Change-Id: I97a73151a1ed42877116238a6a741c68c75e199a
2012-12-05 16:22:03 +00:00
gongysh
a7e73f15c1 l3 agent rpc
On one hand, we sync router data (including routers,
their gw ports, interfaces and floatingips) from l3_agent
to quantum server periodically if needed.

On the other hand, we notify l3 agent from quantum server when
we delete or update a router's stuff, such as floating IP,
interface and gwport and router itself.

blueprint rpc-for-l3-agent
bug #1080286

Change-Id: I60f3081975fc7164b22f9e9fa941e702a3f4c663
2012-12-04 16:46:44 +08:00