diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-05-29 00:11:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-05-29 00:11:02 +0000 |
| commit | 6d99004ab93df2e5afce82f313a2e9c9a3768ff1 (patch) | |
| tree | e709a5d028af1eb1f2a3a31ea2d385f0e26cbc39 /nova/api | |
| parent | ea4c411bca55dc885c466b0068fde02fb289323d (diff) | |
| parent | 1ddb1bc515749c5033687b926049f67d66a4ffb1 (diff) | |
| download | nova-6d99004ab93df2e5afce82f313a2e9c9a3768ff1.tar.gz nova-6d99004ab93df2e5afce82f313a2e9c9a3768ff1.tar.xz nova-6d99004ab93df2e5afce82f313a2e9c9a3768ff1.zip | |
Merge "Add update method of security group name and description"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/security_groups.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/security_groups.py b/nova/api/openstack/compute/contrib/security_groups.py index 87ef6d882..041eb0dc5 100644 --- a/nova/api/openstack/compute/contrib/security_groups.py +++ b/nova/api/openstack/compute/contrib/security_groups.py @@ -295,6 +295,30 @@ class SecurityGroupController(SecurityGroupControllerBase): return {'security_group': self._format_security_group(context, group_ref)} + @wsgi.serializers(xml=SecurityGroupTemplate) + def update(self, req, id, body): + """Update a security group.""" + context = _authorize_context(req) + + id = self.security_group_api.validate_id(id) + + security_group = self.security_group_api.get(context, None, id, + map_exception=True) + security_group_data = self._from_body(body, 'security_group') + + group_name = security_group_data.get('name', None) + group_description = security_group_data.get('description', None) + + self.security_group_api.validate_property(group_name, 'name', None) + self.security_group_api.validate_property(group_description, + 'description', None) + + group_ref = self.security_group_api.update_security_group( + context, security_group, group_name, group_description) + + return {'security_group': self._format_security_group(context, + group_ref)} + class SecurityGroupRulesController(SecurityGroupControllerBase): @@ -577,7 +601,7 @@ class Security_groups(extensions.ExtensionDescriptor): name = "SecurityGroups" alias = "os-security-groups" namespace = "http://docs.openstack.org/compute/ext/securitygroups/api/v1.1" - updated = "2011-07-21T00:00:00+00:00" + updated = "2013-05-28T00:00:00+00:00" def get_controller_extensions(self): controller = SecurityGroupActionController() |
