The nova.network.security_group.neutron_driver Module

class SecurityGroupAPI(skip_policy_check=False)

Bases: nova.network.security_group.security_group_base.SecurityGroupBase

add_default_rules(context, vals)
add_rules(context, id, name, vals)

Add security group rule(s) to security group.

Note: the Nova security group API doesn’t support adding multiple security group rules at once but the EC2 one does. Therefore, this function is written to support both. Multiple rules are installed to a security group in neutron using bulk support.

add_to_instance(context, target, *args, **kwargs)

Add security group to the instance.

create_security_group(context, name, description)
default_rule_exists(context, values)
destroy(context, security_group)

This function deletes a security group.

get(context, name=None, id=None, map_exception=False)
get_all_default_rules(context)
get_default_rule(context, id)
get_instance_security_groups(context, instance_uuid, detailed=False)

Returns the security groups that are associated with an instance. If detailed is True then it also returns the full details of the security groups associated with an instance.

get_instances_security_groups_bindings(context, servers, detailed=False)

Returns a dict(instance_id, [security_groups]) to allow obtaining all of the instances and their security groups in one shot.

get_rule(context, id)
id_is_uuid = True
list(context, names=None, ids=None, project=None, search_opts=None)

Returns list of security group rules owned by tenant.

populate_security_groups(instance, security_groups)
remove_default_rules(context, rule_ids)
remove_from_instance(context, target, *args, **kwargs)

Remove the security group associated with the instance.

remove_rules(context, security_group, rule_ids)
update_security_group(context, security_group, name, description)
validate_id(id)
validate_property(value, property, allowed)

Validate given security group property.

Parameters:
  • value – the value to validate, as a string or unicode
  • property – the property, either ‘name’ or ‘description’
  • allowed – the range of characters allowed, but not used because Neutron is allowing any characters.

Previous topic

The nova.network.rpcapi Module

Next topic

The nova.network.security_group.openstack_driver Module

Project Source

This Page