def instance_add_security_group(context, instance_uuid, security_group_id):
 sec_group_ref = models.SecurityGroupInstanceAssociation()
 sec_group_ref.update({'instance_uuid': instance_uuid, 'security_group_id': security_group_id})
 sec_group_ref.save()

def instance_add_security_group ( context , instance_uuid , security_group_id ) : sec_group_ref = models . SecurityGroupInstanceAssociation ( ) sec_group_ref . update ( { 'instance_uuid' : instance_uuid , 'security_group_id' : security_group_id } ) sec_group_ref . save ( )
associate the given security group with the given instance .