Exemplo n.º 1
0
import json

from bottle import delete, put, get, post
from bottle import abort, request, response

from simplenet.common.auth import handle_auth
from simplenet.common.config import config, get_logger
from simplenet.exceptions import (
    FeatureNotAvailable, EntityNotFound,
    OperationNotPermited, FeatureNotAvailable
)
from simplenet.common.http_utils import (
    reply_json, create_manager
)

logger = get_logger()

@get('/<network_appliance>/policy/<owner_type>/<policy_id>/info')
@handle_auth
@reply_json
def policy_info(network_appliance, owner_type, policy_id):
    """
    ::

      GET /<network_appliance>/policy/<owner_type>/<policy_id>/info

    Get policy informations
    """
    manager = create_manager(network_appliance)
    return manager.policy_info(owner_type, policy_id)
Exemplo n.º 2
0
 def __init__(self):
     self.logger = get_logger()
     self.session = db_utils.get_database_session()