
Remove vim setting, Remove line containing: comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 at the top of source code files, except for files in openstack/common. Change-Id: I5e2aad6dca8407890fc3c2afbda541bd4f124ea8 Closes-Bug: #1229324
72 lines
2.4 KiB
Python
72 lines
2.4 KiB
Python
# Copyright 2013 Hewlett-Packard Development Company, L.P.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
|
|
from trove.openstack.common import log as logging
|
|
|
|
from trove.common import extensions
|
|
from trove.common import wsgi
|
|
from trove.common import cfg
|
|
from trove.extensions.security_group import service
|
|
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
CONF = cfg.CONF
|
|
|
|
|
|
# The Extensions module from openstack common expects the classname of the
|
|
# extension to be loaded to be the exact same as the filename, except with
|
|
# a capital first letter. That's the reason this class has such a funky name.
|
|
class Security_group(extensions.ExtensionsDescriptor):
|
|
|
|
def get_name(self):
|
|
return "SecurityGroup"
|
|
|
|
def get_description(self):
|
|
return "Security Group related operations such as list \
|
|
security groups and manage security group rules."
|
|
|
|
def get_alias(self):
|
|
return "SecurityGroup"
|
|
|
|
def get_namespace(self):
|
|
return "http://TBD"
|
|
|
|
def get_updated(self):
|
|
return "2012-02-26T17:25:27-08:00"
|
|
|
|
def get_resources(self):
|
|
resources = []
|
|
serializer = wsgi.TroveResponseSerializer(
|
|
body_serializers={'application/xml':
|
|
wsgi.TroveXMLDictSerializer()})
|
|
|
|
if CONF.trove_security_groups_support:
|
|
security_groups = extensions.ResourceExtension(
|
|
'{tenant_id}/security-groups',
|
|
service.SecurityGroupController(),
|
|
deserializer=wsgi.TroveRequestDeserializer(),
|
|
serializer=serializer)
|
|
resources.append(security_groups)
|
|
|
|
security_group_rules = extensions.ResourceExtension(
|
|
'{tenant_id}/security-group-rules',
|
|
service.SecurityGroupRuleController(),
|
|
deserializer=wsgi.TroveRequestDeserializer(),
|
|
serializer=serializer)
|
|
resources.append(security_group_rules)
|
|
|
|
return resources
|