Esempio n. 1
0
def __setup_bambou():
    """ Avoid having bad behavior when using importlib.import_module method
    """
    import pkg_resources
    from bambou import BambouConfig, NURESTModelController

    default_attrs = pkg_resources.resource_filename(__name__, '/resources/attrs_defaults.ini')
    BambouConfig.set_default_values_config_file(default_attrs)

    NURESTModelController.register_model(GAList)
    NURESTModelController.register_model(GARoot)
    NURESTModelController.register_model(GATask)
Esempio n. 2
0
    "NUMultiNICVPort", "NUFlowSecurityPolicy", "NUFlow", "NUSubnetTemplate",
    "NUUser", "NUEgressACLEntryTemplate", "NUNetworkLayout", "NUVSDComponent",
    "NUSubnet", "NUIngressAdvFwdTemplate", "NUFloatingIp",
    "NUNetworkMacroGroup", "NUIPReservation",
    "NUIngressExternalServiceTemplateEntry", "NUGateway", "NUNSGateway",
    "NUStatisticsPolicy", "NUJob", "NUDHCPOption", "NUBootstrapActivation",
    "NUNSRedundantGWGrp", "NUL2DomainTemplate", "NUDomain", 'set_log_level',
    'NUVSDSession'
]

import pkg_resources
from bambou import BambouConfig, NURESTModelController

default_attrs = pkg_resources.resource_filename(
    __name__, '/resources/attrs_defaults.ini')
BambouConfig.set_default_values_config_file(default_attrs)

NURESTModelController.register_model(NUVSP)
NURESTModelController.register_model(NUL2Domain)
NURESTModelController.register_model(NUAutoDiscoveredGateway)
NURESTModelController.register_model(NUPort)
NURESTModelController.register_model(NUDSCPForwardingClassMapping)
NURESTModelController.register_model(NULicense)
NURESTModelController.register_model(NUQOS)
NURESTModelController.register_model(NUIngressACLTemplate)
NURESTModelController.register_model(NUExternalAppService)
NURESTModelController.register_model(NUBGPPeer)
NURESTModelController.register_model(NUGroup)
NURESTModelController.register_model(NUApplicationService)
NURESTModelController.register_model(NUHostInterface)
NURESTModelController.register_model(NULocation)
Esempio n. 3
0
def __setup_bambou():
    """ Avoid having bad behavior when using importlib.import_module method
    """
    import pkg_resources
    from bambou import BambouConfig, NURESTModelController

    default_attrs = pkg_resources.resource_filename(
        __name__, '/resources/attrs_defaults.ini')
    BambouConfig.set_default_values_config_file(default_attrs)

    NURESTModelController.register_model(NUAddressMap)
    NURESTModelController.register_model(NUAddressRange)
    NURESTModelController.register_model(NUAggregateMetadata)
    NURESTModelController.register_model(NUAlarm)
    NURESTModelController.register_model(NUAllAlarm)
    NURESTModelController.register_model(NUApplication)
    NURESTModelController.register_model(NUApplicationBinding)
    NURESTModelController.register_model(NUApplicationperformancemanagement)
    NURESTModelController.register_model(
        NUApplicationperformancemanagementbinding)
    NURESTModelController.register_model(NUAutoDiscoverCluster)
    NURESTModelController.register_model(NUAutodiscovereddatacenter)
    NURESTModelController.register_model(NUAutoDiscoveredGateway)
    NURESTModelController.register_model(NUAutoDiscoverHypervisorFromCluster)
    NURESTModelController.register_model(NUAvatar)
    NURESTModelController.register_model(NUBFDSession)
    NURESTModelController.register_model(NUBGPNeighbor)
    NURESTModelController.register_model(NUBGPPeer)
    NURESTModelController.register_model(NUBGPProfile)
    NURESTModelController.register_model(NUBootstrap)
    NURESTModelController.register_model(NUBootstrapActivation)
    NURESTModelController.register_model(NUBRConnection)
    NURESTModelController.register_model(NUBridgeInterface)
    NURESTModelController.register_model(NUBulkStatistics)
    NURESTModelController.register_model(NUCaptivePortalProfile)
    NURESTModelController.register_model(NUCertificate)
    NURESTModelController.register_model(NUCloudMgmtSystem)
    NURESTModelController.register_model(NUCommand)
    NURESTModelController.register_model(NUConnectionendpoint)
    NURESTModelController.register_model(NUContainer)
    NURESTModelController.register_model(NUContainerInterface)
    NURESTModelController.register_model(NUContainerResync)
    NURESTModelController.register_model(NUCOSRemarkingPolicy)
    NURESTModelController.register_model(NUCOSRemarkingPolicyTable)
    NURESTModelController.register_model(NUCSNATPool)
    NURESTModelController.register_model(NUCTranslationMap)
    NURESTModelController.register_model(NUCustomProperty)
    NURESTModelController.register_model(NUDefaultGateway)
    NURESTModelController.register_model(NUDemarcationService)
    NURESTModelController.register_model(NUDestinationurl)
    NURESTModelController.register_model(NUDHCPOption)
    NURESTModelController.register_model(NUDiskStat)
    NURESTModelController.register_model(NUDomain)
    NURESTModelController.register_model(NUDomainFIPAclTemplate)
    NURESTModelController.register_model(NUDomainFIPAclTemplateEntry)
    NURESTModelController.register_model(NUDomainTemplate)
    NURESTModelController.register_model(NUDSCPForwardingClassMapping)
    NURESTModelController.register_model(NUDSCPForwardingClassTable)
    NURESTModelController.register_model(NUDSCPRemarkingPolicy)
    NURESTModelController.register_model(NUDSCPRemarkingPolicyTable)
    NURESTModelController.register_model(NUDUCGroup)
    NURESTModelController.register_model(NUDUCGroupBinding)
    NURESTModelController.register_model(NUEgressACLEntryTemplate)
    NURESTModelController.register_model(NUEgressACLTemplate)
    NURESTModelController.register_model(NUEgressAdvFwdEntryTemplate)
    NURESTModelController.register_model(NUEgressAdvFwdTemplate)
    NURESTModelController.register_model(NUEgressQOSPolicy)
    NURESTModelController.register_model(NUEnterprise)
    NURESTModelController.register_model(NUEnterpriseNetwork)
    NURESTModelController.register_model(NUEnterprisePermission)
    NURESTModelController.register_model(NUEnterpriseProfile)
    NURESTModelController.register_model(NUEnterpriseSecuredData)
    NURESTModelController.register_model(NUEnterpriseSecurity)
    NURESTModelController.register_model(NUEventLog)
    NURESTModelController.register_model(NUFirewallAcl)
    NURESTModelController.register_model(NUFirewallRule)
    NURESTModelController.register_model(NUFloatingIp)
    NURESTModelController.register_model(NUFloatingIPACLTemplate)
    NURESTModelController.register_model(NUFloatingIPACLTemplateEntry)
    NURESTModelController.register_model(NUGateway)
    NURESTModelController.register_model(NUGatewaySecuredData)
    NURESTModelController.register_model(NUGatewaySecurity)
    NURESTModelController.register_model(NUGatewayTemplate)
    NURESTModelController.register_model(NUGlobalMetadata)
    NURESTModelController.register_model(NUGroup)
    NURESTModelController.register_model(NUGroupKeyEncryptionProfile)
    NURESTModelController.register_model(NUHostInterface)
    NURESTModelController.register_model(NUHSC)
    NURESTModelController.register_model(NUIKECertificate)
    NURESTModelController.register_model(NUIKEEncryptionprofile)
    NURESTModelController.register_model(NUIKEGateway)
    NURESTModelController.register_model(NUIKEGatewayConfig)
    NURESTModelController.register_model(NUIKEGatewayConnection)
    NURESTModelController.register_model(NUIKEGatewayProfile)
    NURESTModelController.register_model(NUIKEPSK)
    NURESTModelController.register_model(NUIKESubnet)
    NURESTModelController.register_model(NUInfrastructureAccessProfile)
    NURESTModelController.register_model(NUInfrastructureConfig)
    NURESTModelController.register_model(NUInfrastructureGatewayProfile)
    NURESTModelController.register_model(NUInfrastructureVscProfile)
    NURESTModelController.register_model(NUIngressACLEntryTemplate)
    NURESTModelController.register_model(NUIngressACLTemplate)
    NURESTModelController.register_model(NUIngressAdvFwdEntryTemplate)
    NURESTModelController.register_model(NUIngressAdvFwdTemplate)
    NURESTModelController.register_model(NUIngressExternalServiceTemplate)
    NURESTModelController.register_model(NUIngressExternalServiceTemplateEntry)
    NURESTModelController.register_model(NUIngressQOSPolicy)
    NURESTModelController.register_model(NUIPReservation)
    NURESTModelController.register_model(NUJob)
    NURESTModelController.register_model(NUKeyServerMember)
    NURESTModelController.register_model(NUKeyServerMonitor)
    NURESTModelController.register_model(NUKeyServerMonitorEncryptedSeed)
    NURESTModelController.register_model(NUKeyServerMonitorSeed)
    NURESTModelController.register_model(NUKeyServerMonitorSEK)
    NURESTModelController.register_model(NUL2Domain)
    NURESTModelController.register_model(NUL2DomainTemplate)
    NURESTModelController.register_model(NUL4Service)
    NURESTModelController.register_model(NUL4ServiceGroup)
    NURESTModelController.register_model(NUL7applicationsignature)
    NURESTModelController.register_model(NULDAPConfiguration)
    NURESTModelController.register_model(NULicense)
    NURESTModelController.register_model(NULicenseStatus)
    NURESTModelController.register_model(NULink)
    NURESTModelController.register_model(NULocation)
    NURESTModelController.register_model(NULTEInformation)
    NURESTModelController.register_model(NULtestatistics)
    NURESTModelController.register_model(NUMe)
    NURESTModelController.register_model(NUMetadata)
    NURESTModelController.register_model(NUMirrorDestination)
    NURESTModelController.register_model(NUMonitoringPort)
    NURESTModelController.register_model(NUMonitorscope)
    NURESTModelController.register_model(NUMultiCastChannelMap)
    NURESTModelController.register_model(NUMultiCastList)
    NURESTModelController.register_model(NUMultiCastRange)
    NURESTModelController.register_model(NUMultiNICVPort)
    NURESTModelController.register_model(NUNATMapEntry)
    NURESTModelController.register_model(NUNetworkLayout)
    NURESTModelController.register_model(NUNetworkMacroGroup)
    NURESTModelController.register_model(NUNetworkPerformanceBinding)
    NURESTModelController.register_model(NUNetworkPerformanceMeasurement)
    NURESTModelController.register_model(NUNextHop)
    NURESTModelController.register_model(NUNSGateway)
    NURESTModelController.register_model(NUNSGatewayTemplate)
    NURESTModelController.register_model(NUNSGGroup)
    NURESTModelController.register_model(NUNSGInfo)
    NURESTModelController.register_model(NUNSGPatchProfile)
    NURESTModelController.register_model(NUNSGRoutingPolicyBinding)
    NURESTModelController.register_model(NUNSGUpgradeProfile)
    NURESTModelController.register_model(NUNSPort)
    NURESTModelController.register_model(NUNSPortTemplate)
    NURESTModelController.register_model(NUNSRedundantGatewayGroup)
    NURESTModelController.register_model(NUOSPFArea)
    NURESTModelController.register_model(NUOSPFInstance)
    NURESTModelController.register_model(NUOSPFInterface)
    NURESTModelController.register_model(NUOverlayAddressPool)
    NURESTModelController.register_model(NUOverlayMirrorDestination)
    NURESTModelController.register_model(NUOverlayMirrorDestinationTemplate)
    NURESTModelController.register_model(NUOverlayPATNATEntry)
    NURESTModelController.register_model(NUPATIPEntry)
    NURESTModelController.register_model(NUPATMapper)
    NURESTModelController.register_model(NUPATNATPool)
    NURESTModelController.register_model(NUPerformanceMonitor)
    NURESTModelController.register_model(NUPermission)
    NURESTModelController.register_model(NUPGExpression)
    NURESTModelController.register_model(NUPGExpressionTemplate)
    NURESTModelController.register_model(NUPolicyDecision)
    NURESTModelController.register_model(NUPolicyEntry)
    NURESTModelController.register_model(NUPolicyGroup)
    NURESTModelController.register_model(NUPolicyGroupTemplate)
    NURESTModelController.register_model(NUPolicyObjectGroup)
    NURESTModelController.register_model(NUPolicyStatement)
    NURESTModelController.register_model(NUPort)
    NURESTModelController.register_model(NUPortMapping)
    NURESTModelController.register_model(NUPortTemplate)
    NURESTModelController.register_model(NUProxyARPFilter)
    NURESTModelController.register_model(NUPSNATPool)
    NURESTModelController.register_model(NUPSPATMap)
    NURESTModelController.register_model(NUPTranslationMap)
    NURESTModelController.register_model(NUPublicNetworkMacro)
    NURESTModelController.register_model(NUQOS)
    NURESTModelController.register_model(NUQosPolicer)
    NURESTModelController.register_model(NURateLimiter)
    NURESTModelController.register_model(NURedirectionTarget)
    NURESTModelController.register_model(NURedirectionTargetTemplate)
    NURESTModelController.register_model(NURedundancyGroup)
    NURESTModelController.register_model(NURedundantPort)
    NURESTModelController.register_model(NURoutingPolicy)
    NURESTModelController.register_model(NUSharedNetworkResource)
    NURESTModelController.register_model(NUSiteInfo)
    NURESTModelController.register_model(NUSPATSourcesPool)
    NURESTModelController.register_model(NUSSHKey)
    NURESTModelController.register_model(NUSSIDConnection)
    NURESTModelController.register_model(NUStaticRoute)
    NURESTModelController.register_model(NUStatistics)
    NURESTModelController.register_model(NUStatisticsPolicy)
    NURESTModelController.register_model(NUStatsCollectorInfo)
    NURESTModelController.register_model(NUSubnet)
    NURESTModelController.register_model(NUSubnetTemplate)
    NURESTModelController.register_model(NUSystemConfig)
    NURESTModelController.register_model(NUTCA)
    NURESTModelController.register_model(NUTier)
    NURESTModelController.register_model(NUTrunk)
    NURESTModelController.register_model(NUUnderlay)
    NURESTModelController.register_model(NUUplinkConnection)
    NURESTModelController.register_model(NUUplinkRD)
    NURESTModelController.register_model(NUUser)
    NURESTModelController.register_model(NUUserContext)
    NURESTModelController.register_model(NUVCenter)
    NURESTModelController.register_model(NUVCenterCluster)
    NURESTModelController.register_model(NUVCenterDataCenter)
    NURESTModelController.register_model(NUVCenterEAMConfig)
    NURESTModelController.register_model(NUVCenterHypervisor)
    NURESTModelController.register_model(NUVCenterVRSConfig)
    NURESTModelController.register_model(NUVirtualFirewallPolicy)
    NURESTModelController.register_model(NUVirtualFirewallRule)
    NURESTModelController.register_model(NUVirtualIP)
    NURESTModelController.register_model(NUVLAN)
    NURESTModelController.register_model(NUVLANTemplate)
    NURESTModelController.register_model(NUVM)
    NURESTModelController.register_model(NUVMInterface)
    NURESTModelController.register_model(NUVMResync)
    NURESTModelController.register_model(NUVNF)
    NURESTModelController.register_model(NUVNFCatalog)
    NURESTModelController.register_model(NUVNFDescriptor)
    NURESTModelController.register_model(NUVNFDomainMapping)
    NURESTModelController.register_model(NUVNFInterface)
    NURESTModelController.register_model(NUVNFInterfaceDescriptor)
    NURESTModelController.register_model(NUVNFMetadata)
    NURESTModelController.register_model(NUVNFThresholdPolicy)
    NURESTModelController.register_model(NUVPNConnection)
    NURESTModelController.register_model(NUVPort)
    NURESTModelController.register_model(NUVPortMirror)
    NURESTModelController.register_model(NUVRS)
    NURESTModelController.register_model(NUVRSAddressRange)
    NURESTModelController.register_model(NUVRSMetrics)
    NURESTModelController.register_model(NUVRSRedeploymentpolicy)
    NURESTModelController.register_model(NUVSC)
    NURESTModelController.register_model(NUVSD)
    NURESTModelController.register_model(NUVSDComponent)
    NURESTModelController.register_model(NUVsgRedundantPort)
    NURESTModelController.register_model(NUVSP)
    NURESTModelController.register_model(NUWANService)
    NURESTModelController.register_model(NUWirelessPort)
    NURESTModelController.register_model(NUZFBAutoAssignment)
    NURESTModelController.register_model(NUZFBRequest)
    NURESTModelController.register_model(NUZone)
    NURESTModelController.register_model(NUZoneTemplate)
Esempio n. 4
0
from .nujob import NUJob
from .nudhcpoption import NUDHCPOption
from .nubootstrapactivation import NUBootstrapActivation
from .nunsredundantgwgrp import NUNSRedundantGWGrp
from .nuldapconfiguration import NULDAPConfiguration
from .nudomain import NUDomain
from .utils import set_log_level
from .nuvsdsession import NUVSDSession

__all__ = ["NUVSP", "NUL2Domain", "NUAutoDiscoveredGateway", "NUPort", "NUUplinkRD", "NUDSCPForwardingClassMapping", "NUVCenterCluster", "NULicense", "NUQOS", "NUIngressACLTemplate", "NUExternalAppService", "NUBGPPeer", "NUGroup", "NUApplicationService", "NUHostInterface", "NULocation", "NUVCenterDataCenter", "NUEndPoint", "NUVCenterVRSConfig", "NUEgressQOSPolicy", "NUNSPortTemplate", "NUSystemConfig", "NURESTUser", "NUStatsCollectorInfo", "NUInfrastructureConfig", "NUBridgeInterface", "NURateLimiter", "NUEventLog", "NUKeyServerMonitorSeed", "NUAddressRange", "NUMonitoringPort", "NUEnterprisePermission", "NUVLAN", "NUEnterprise", "NURedirectionTargetTemplate", "NUPATNATPool", "NUVSD", "NUVPNConnection", "NUApp", "NUFlowForwardingPolicy", "NUInfrastructureVscProfile", "NUVCenter", "NUTCA", "NUVCenterHypervisor", "NUKeyServerMonitorEncryptedSEK", "NUPortTemplate", "NUVRS", "NUMultiCastRange", "NUStatistics", "NUNSPort", "NUNSPortStaticConfiguration", "NUCloudMgmtSystem", "NUDomainTemplate", "NUVirtualIP", "NUVMInterface", "NUInfrastructurePortProfile", "NUKeyServerMonitor", "NUPermittedAction", "NUMetadataTag", "NUIngressAdvFwdEntryTemplate", "NUZone", "NUEgressACLTemplate", "NUL2DomainTemplate", "NUTier", "NUIngressACLEntryTemplate", "NUGatewayTemplate", "NUBootstrap", "NUSiteInfo", "NURedirectionTarget", "NUEnterpriseProfile", "NUCertificate", "NUPolicyGroup", "NUKeyServerMonitorSEK", "NUHSC", "NUVM", "NUMultiCastChannelMap", "NUVCenterEAMConfig", "NUVPort", "NUMultiCastList", "NUNSGatewayTemplate", "NUAggregateMetadata", "NUMirrorDestination", "NUWANService", "NUPolicyDecision", "NUExternalService", "NUZoneTemplate", "NUNATMapEntry", "NUStaticRoute", "NUVLANTemplate", "NURedundancyGroup", "NUGlobalMetadata", "NUVMResync", "NUDSCPForwardingClassTable", "NUIngressExternalServiceTemplate", "NUEnterpriseNetwork", "NUVPortMirror", "NUAlarm", "NUKeyServerMonitorEncryptedSeed", "NUInfrastructureGatewayProfile", "NUSharedNetworkResource", "NUGroupKeyEncryptionProfile", "NUPublicNetworkMacro", "NUPolicyGroupTemplate", "NUMultiNICVPort", "NUFlowSecurityPolicy", "NUVCenterVRSAddressRange", "NUFlow", "NUSubnetTemplate", "NURedundantPort", "NUMetadata", "NUUser", "NUVSC", "NUEgressACLEntryTemplate", "NUNetworkLayout", "NUVSDComponent", "NUSubnet", "NUIngressAdvFwdTemplate", "NUFloatingIp", "NUNetworkMacroGroup", "NUIPReservation", "NUIngressExternalServiceTemplateEntry", "NUGateway", "NUNSGateway", "NUStatisticsPolicy", "NUJob", "NUDHCPOption", "NUBootstrapActivation", "NUNSRedundantGWGrp", "NULDAPConfiguration", "NUDomain", 'set_log_level', 'NUVSDSession']

import pkg_resources
from bambou import BambouConfig, NURESTModelController

default_attrs = pkg_resources.resource_filename(__name__, '/resources/attrs_defaults.ini')
BambouConfig.set_default_values_config_file(default_attrs)

NURESTModelController.register_model(NUVSP)
NURESTModelController.register_model(NUL2Domain)
NURESTModelController.register_model(NUAutoDiscoveredGateway)
NURESTModelController.register_model(NUPort)
NURESTModelController.register_model(NUUplinkRD)
NURESTModelController.register_model(NUDSCPForwardingClassMapping)
NURESTModelController.register_model(NUVCenterCluster)
NURESTModelController.register_model(NULicense)
NURESTModelController.register_model(NUQOS)
NURESTModelController.register_model(NUIngressACLTemplate)
NURESTModelController.register_model(NUExternalAppService)
NURESTModelController.register_model(NUBGPPeer)
NURESTModelController.register_model(NUGroup)
NURESTModelController.register_model(NUApplicationService)
Esempio n. 5
0
def __setup_bambou():
    """ Avoid having bad behavior when using importlib.import_module method
    """
    import pkg_resources
    from bambou import BambouConfig, NURESTModelController

    default_attrs = pkg_resources.resource_filename(__name__, '/resources/attrs_defaults.ini')
    BambouConfig.set_default_values_config_file(default_attrs)

    NURESTModelController.register_model(NUAddressMap)
    NURESTModelController.register_model(NUAddressRange)
    NURESTModelController.register_model(NUAggregateMetadata)
    NURESTModelController.register_model(NUAlarm)
    NURESTModelController.register_model(NUAllAlarm)
    NURESTModelController.register_model(NUApplication)
    NURESTModelController.register_model(NUApplicationBinding)
    NURESTModelController.register_model(NUApplicationperformancemanagement)
    NURESTModelController.register_model(NUApplicationperformancemanagementbinding)
    NURESTModelController.register_model(NUApplicationService)
    NURESTModelController.register_model(NUAutoDiscoverCluster)
    NURESTModelController.register_model(NUAutodiscovereddatacenter)
    NURESTModelController.register_model(NUAutoDiscoveredGateway)
    NURESTModelController.register_model(NUAutoDiscoverHypervisorFromCluster)
    NURESTModelController.register_model(NUAvatar)
    NURESTModelController.register_model(NUBFDSession)
    NURESTModelController.register_model(NUBGPNeighbor)
    NURESTModelController.register_model(NUBGPPeer)
    NURESTModelController.register_model(NUBGPProfile)
    NURESTModelController.register_model(NUBootstrap)
    NURESTModelController.register_model(NUBootstrapActivation)
    NURESTModelController.register_model(NUBRConnection)
    NURESTModelController.register_model(NUBridgeInterface)
    NURESTModelController.register_model(NUBulkStatistics)
    NURESTModelController.register_model(NUCertificate)
    NURESTModelController.register_model(NUCloudMgmtSystem)
    NURESTModelController.register_model(NUConnectionendpoint)
    NURESTModelController.register_model(NUContainer)
    NURESTModelController.register_model(NUContainerInterface)
    NURESTModelController.register_model(NUContainerResync)
    NURESTModelController.register_model(NUCustomProperty)
    NURESTModelController.register_model(NUDemarcationService)
    NURESTModelController.register_model(NUDHCPOption)
    NURESTModelController.register_model(NUDiskStat)
    NURESTModelController.register_model(NUDomain)
    NURESTModelController.register_model(NUDomainFIPAclTemplate)
    NURESTModelController.register_model(NUDomainFIPAclTemplateEntry)
    NURESTModelController.register_model(NUDomainTemplate)
    NURESTModelController.register_model(NUDSCPForwardingClassMapping)
    NURESTModelController.register_model(NUDSCPForwardingClassTable)
    NURESTModelController.register_model(NUDUCGroup)
    NURESTModelController.register_model(NUDUCGroupBinding)
    NURESTModelController.register_model(NUEgressACLEntryTemplate)
    NURESTModelController.register_model(NUEgressACLTemplate)
    NURESTModelController.register_model(NUEgressQOSPolicy)
    NURESTModelController.register_model(NUEndPoint)
    NURESTModelController.register_model(NUEnterprise)
    NURESTModelController.register_model(NUEnterpriseNetwork)
    NURESTModelController.register_model(NUEnterprisePermission)
    NURESTModelController.register_model(NUEnterpriseProfile)
    NURESTModelController.register_model(NUEnterpriseSecuredData)
    NURESTModelController.register_model(NUEnterpriseSecurity)
    NURESTModelController.register_model(NUEventLog)
    NURESTModelController.register_model(NUExternalAppService)
    NURESTModelController.register_model(NUExternalService)
    NURESTModelController.register_model(NUFirewallAcl)
    NURESTModelController.register_model(NUFirewallRule)
    NURESTModelController.register_model(NUFloatingIp)
    NURESTModelController.register_model(NUFloatingIPACLTemplate)
    NURESTModelController.register_model(NUFloatingIPACLTemplateEntry)
    NURESTModelController.register_model(NUFlow)
    NURESTModelController.register_model(NUFlowForwardingPolicy)
    NURESTModelController.register_model(NUFlowSecurityPolicy)
    NURESTModelController.register_model(NUGateway)
    NURESTModelController.register_model(NUGatewaySecuredData)
    NURESTModelController.register_model(NUGatewaySecurity)
    NURESTModelController.register_model(NUGatewayTemplate)
    NURESTModelController.register_model(NUGlobalMetadata)
    NURESTModelController.register_model(NUGroup)
    NURESTModelController.register_model(NUGroupKeyEncryptionProfile)
    NURESTModelController.register_model(NUHostInterface)
    NURESTModelController.register_model(NUHSC)
    NURESTModelController.register_model(NUIKECertificate)
    NURESTModelController.register_model(NUIKEEncryptionprofile)
    NURESTModelController.register_model(NUIKEGateway)
    NURESTModelController.register_model(NUIKEGatewayConfig)
    NURESTModelController.register_model(NUIKEGatewayConnection)
    NURESTModelController.register_model(NUIKEGatewayProfile)
    NURESTModelController.register_model(NUIKEPSK)
    NURESTModelController.register_model(NUIKESubnet)
    NURESTModelController.register_model(NUInfrastructureAccessProfile)
    NURESTModelController.register_model(NUInfrastructureConfig)
    NURESTModelController.register_model(NUInfrastructureGatewayProfile)
    NURESTModelController.register_model(NUInfrastructureVscProfile)
    NURESTModelController.register_model(NUIngressACLEntryTemplate)
    NURESTModelController.register_model(NUIngressACLTemplate)
    NURESTModelController.register_model(NUIngressAdvFwdEntryTemplate)
    NURESTModelController.register_model(NUIngressAdvFwdTemplate)
    NURESTModelController.register_model(NUIngressExternalServiceTemplate)
    NURESTModelController.register_model(NUIngressExternalServiceTemplateEntry)
    NURESTModelController.register_model(NUIngressQOSPolicy)
    NURESTModelController.register_model(NUIPReservation)
    NURESTModelController.register_model(NUJob)
    NURESTModelController.register_model(NUKeyServerMember)
    NURESTModelController.register_model(NUKeyServerMonitor)
    NURESTModelController.register_model(NUKeyServerMonitorEncryptedSeed)
    NURESTModelController.register_model(NUKeyServerMonitorSeed)
    NURESTModelController.register_model(NUKeyServerMonitorSEK)
    NURESTModelController.register_model(NUKeyServerNotification)
    NURESTModelController.register_model(NUL2Domain)
    NURESTModelController.register_model(NUL2DomainTemplate)
    NURESTModelController.register_model(NUL7applicationsignature)
    NURESTModelController.register_model(NULDAPConfiguration)
    NURESTModelController.register_model(NULicense)
    NURESTModelController.register_model(NULicenseStatus)
    NURESTModelController.register_model(NULink)
    NURESTModelController.register_model(NULocation)
    NURESTModelController.register_model(NULtestatistics)
    NURESTModelController.register_model(NUMe)
    NURESTModelController.register_model(NUMetadata)
    NURESTModelController.register_model(NUMetadataTag)
    NURESTModelController.register_model(NUMirrorDestination)
    NURESTModelController.register_model(NUMonitoringPort)
    NURESTModelController.register_model(NUMonitorscope)
    NURESTModelController.register_model(NUMultiCastChannelMap)
    NURESTModelController.register_model(NUMultiCastList)
    NURESTModelController.register_model(NUMultiCastRange)
    NURESTModelController.register_model(NUMultiNICVPort)
    NURESTModelController.register_model(NUNATMapEntry)
    NURESTModelController.register_model(NUNetworkLayout)
    NURESTModelController.register_model(NUNetworkMacroGroup)
    NURESTModelController.register_model(NUNetworkPerformanceBinding)
    NURESTModelController.register_model(NUNetworkPerformanceMeasurement)
    NURESTModelController.register_model(NUNextHop)
    NURESTModelController.register_model(NUNextHopAddress)
    NURESTModelController.register_model(NUNSGateway)
    NURESTModelController.register_model(NUNSGatewayTemplate)
    NURESTModelController.register_model(NUNSGGroup)
    NURESTModelController.register_model(NUNSGInfo)
    NURESTModelController.register_model(NUNSPort)
    NURESTModelController.register_model(NUNSPortTemplate)
    NURESTModelController.register_model(NUNSRedundantGatewayGroup)
    NURESTModelController.register_model(NUOverlayAddressPool)
    NURESTModelController.register_model(NUOverlayPATNATEntry)
    NURESTModelController.register_model(NUPATIPEntry)
    NURESTModelController.register_model(NUPATMapper)
    NURESTModelController.register_model(NUPATNATPool)
    NURESTModelController.register_model(NUPerformanceMonitor)
    NURESTModelController.register_model(NUPermission)
    NURESTModelController.register_model(NUPolicyDecision)
    NURESTModelController.register_model(NUPolicyGroup)
    NURESTModelController.register_model(NUPolicyGroupTemplate)
    NURESTModelController.register_model(NUPort)
    NURESTModelController.register_model(NUPortMapping)
    NURESTModelController.register_model(NUPortTemplate)
    NURESTModelController.register_model(NUPublicNetworkMacro)
    NURESTModelController.register_model(NUQOS)
    NURESTModelController.register_model(NURateLimiter)
    NURESTModelController.register_model(NURedirectionTarget)
    NURESTModelController.register_model(NURedirectionTargetTemplate)
    NURESTModelController.register_model(NURedundancyGroup)
    NURESTModelController.register_model(NURedundantPort)
    NURESTModelController.register_model(NURoutingPolicy)
    NURESTModelController.register_model(NUSharedNetworkResource)
    NURESTModelController.register_model(NUSiteInfo)
    NURESTModelController.register_model(NUSSHKey)
    NURESTModelController.register_model(NUStaticRoute)
    NURESTModelController.register_model(NUStatistics)
    NURESTModelController.register_model(NUStatisticsPolicy)
    NURESTModelController.register_model(NUStatsCollectorInfo)
    NURESTModelController.register_model(NUSubnet)
    NURESTModelController.register_model(NUSubnetTemplate)
    NURESTModelController.register_model(NUSystemConfig)
    NURESTModelController.register_model(NUTCA)
    NURESTModelController.register_model(NUTier)
    NURESTModelController.register_model(NUUnderlay)
    NURESTModelController.register_model(NUUplinkConnection)
    NURESTModelController.register_model(NUUplinkRD)
    NURESTModelController.register_model(NUUser)
    NURESTModelController.register_model(NUVCenter)
    NURESTModelController.register_model(NUVCenterCluster)
    NURESTModelController.register_model(NUVCenterDataCenter)
    NURESTModelController.register_model(NUVCenterEAMConfig)
    NURESTModelController.register_model(NUVCenterHypervisor)
    NURESTModelController.register_model(NUVCenterVRSConfig)
    NURESTModelController.register_model(NUVia)
    NURESTModelController.register_model(NUVirtualIP)
    NURESTModelController.register_model(NUVLAN)
    NURESTModelController.register_model(NUVLANTemplate)
    NURESTModelController.register_model(NUVM)
    NURESTModelController.register_model(NUVMInterface)
    NURESTModelController.register_model(NUVMResync)
    NURESTModelController.register_model(NUVPNConnection)
    NURESTModelController.register_model(NUVPort)
    NURESTModelController.register_model(NUVPortMirror)
    NURESTModelController.register_model(NUVRS)
    NURESTModelController.register_model(NUVRSAddressRange)
    NURESTModelController.register_model(NUVRSMetrics)
    NURESTModelController.register_model(NUVRSRedeploymentpolicy)
    NURESTModelController.register_model(NUVSC)
    NURESTModelController.register_model(NUVSD)
    NURESTModelController.register_model(NUVSDComponent)
    NURESTModelController.register_model(NUVsgRedundantPort)
    NURESTModelController.register_model(NUVSP)
    NURESTModelController.register_model(NUWANService)
    NURESTModelController.register_model(NUZFBAutoAssignment)
    NURESTModelController.register_model(NUZFBRequest)
    NURESTModelController.register_model(NUZone)
    NURESTModelController.register_model(NUZoneTemplate)
Esempio n. 6
0
    def __init__(self, sdks_info, redis_info, channels=[], plugins=[], additional_controller_classes=[], additional_master_controller_classes=[],
                 log_level=logging.INFO, log_handler=None, runloop=True, banner=True, debug=False):
        """ Initializes Garuda.

        """
        setproctitle('garuda-server')
        BambouConfig.set_should_raise_bambou_http_error(False)

        self._uuid = str(uuid4())
        self._redis_info = redis_info if redis_info else {'host': '127.0.0.1', 'port': '6379', 'db': 0}
        self._runloop = runloop
        self._sdks_info = sdks_info
        self._sdk_library = GASDKLibrary()
        self._channels = channels
        self._debug = debug
        self._additional_controller_classes = additional_controller_classes
        self._additional_master_controller_classes = additional_master_controller_classes

        self._authentication_plugins = []
        self._storage_plugins = []
        self._logic_plugins = []
        self._permission_plugins = []

        for sdk_info in self._sdks_info:
            self._sdk_library.register_sdk(identifier=sdk_info['identifier'], sdk=importlib.import_module(sdk_info['module']))

        for plugin in plugins:

            if isinstance(plugin, GAChannel):
                self._channels.append(plugin)
            elif isinstance(plugin, GAAuthenticationPlugin):
                self._authentication_plugins.append(plugin)
            elif isinstance(plugin, GAStoragePlugin):
                self._storage_plugins.append(plugin)
            elif isinstance(plugin, GAPermissionsPlugin):
                self._permission_plugins.append(plugin)
            elif isinstance(plugin, GALogicPlugin):
                self._logic_plugins.append(plugin)

        if banner:
            self.print_banner()

        if not log_handler:
            log_handler = logging.StreamHandler()
            log_handler.setFormatter(logging.Formatter('[%(levelname)s] %(name)s: %(message)s'))
            logger.addHandler(log_handler)

        logger.setLevel(log_level)

        self._channels_controller = GAChannelsController(garuda_uuid=self._uuid,
                                                         channels=self._channels,
                                                         redis_info=self._redis_info,
                                                         additional_controller_classes=self._additional_controller_classes,
                                                         logic_plugins=self._logic_plugins,
                                                         authentication_plugins=self._authentication_plugins,
                                                         storage_plugins=self._storage_plugins,
                                                         permission_plugins=self._permission_plugins)

        self._master_core = GACoreController(garuda_uuid=self._uuid,
                                             redis_info=self._redis_info,
                                             logic_plugins=[],
                                             additional_controller_classes=self._additional_master_controller_classes,
                                             authentication_plugins=self._authentication_plugins,
                                             storage_plugins=self._storage_plugins,
                                             permission_plugins=self._permission_plugins)
Esempio n. 7
0
def __setup_bambou():
    """ Avoid having bad behavior when using importlib.import_module method
    """
    import pkg_resources
    from bambou import BambouConfig, NURESTModelController

    default_attrs = pkg_resources.resource_filename(__name__, '/resources/attrs_defaults.ini')
    BambouConfig.set_default_values_config_file(default_attrs)

    NURESTModelController.register_model(NUAddressMap)
    NURESTModelController.register_model(NUAddressRange)
    NURESTModelController.register_model(NUAggregateMetadata)
    NURESTModelController.register_model(NUAlarm)
    NURESTModelController.register_model(NUAllAlarm)
    NURESTModelController.register_model(NUAllGateway)
    NURESTModelController.register_model(NUAllRedundancyGroup)
    NURESTModelController.register_model(NUApplication)
    NURESTModelController.register_model(NUApplicationBinding)
    NURESTModelController.register_model(NUApplicationperformancemanagement)
    NURESTModelController.register_model(NUApplicationperformancemanagementbinding)
    NURESTModelController.register_model(NUAutoDiscoverCluster)
    NURESTModelController.register_model(NUAutodiscovereddatacenter)
    NURESTModelController.register_model(NUAutoDiscoveredGateway)
    NURESTModelController.register_model(NUAutoDiscoverHypervisorFromCluster)
    NURESTModelController.register_model(NUAvatar)
    NURESTModelController.register_model(NUBFDSession)
    NURESTModelController.register_model(NUBGPNeighbor)
    NURESTModelController.register_model(NUBGPPeer)
    NURESTModelController.register_model(NUBGPProfile)
    NURESTModelController.register_model(NUBootstrap)
    NURESTModelController.register_model(NUBootstrapActivation)
    NURESTModelController.register_model(NUBRConnection)
    NURESTModelController.register_model(NUBridgeInterface)
    NURESTModelController.register_model(NUBulkStatistics)
    NURESTModelController.register_model(NUCaptivePortalProfile)
    NURESTModelController.register_model(NUCertificate)
    NURESTModelController.register_model(NUCloudMgmtSystem)
    NURESTModelController.register_model(NUCommand)
    NURESTModelController.register_model(NUConnectionendpoint)
    NURESTModelController.register_model(NUContainer)
    NURESTModelController.register_model(NUContainerInterface)
    NURESTModelController.register_model(NUContainerResync)
    NURESTModelController.register_model(NUCOSRemarkingPolicy)
    NURESTModelController.register_model(NUCOSRemarkingPolicyTable)
    NURESTModelController.register_model(NUCSNATPool)
    NURESTModelController.register_model(NUCTranslationMap)
    NURESTModelController.register_model(NUCustomProperty)
    NURESTModelController.register_model(NUDefaultGateway)
    NURESTModelController.register_model(NUDemarcationService)
    NURESTModelController.register_model(NUDeploymentFailure)
    NURESTModelController.register_model(NUDestinationurl)
    NURESTModelController.register_model(NUDHCPOption)
    NURESTModelController.register_model(NUDiskStat)
    NURESTModelController.register_model(NUDomain)
    NURESTModelController.register_model(NUDomainFIPAclTemplate)
    NURESTModelController.register_model(NUDomainFIPAclTemplateEntry)
    NURESTModelController.register_model(NUDomainTemplate)
    NURESTModelController.register_model(NUDownloadProgress)
    NURESTModelController.register_model(NUDSCPForwardingClassMapping)
    NURESTModelController.register_model(NUDSCPForwardingClassTable)
    NURESTModelController.register_model(NUDSCPRemarkingPolicy)
    NURESTModelController.register_model(NUDSCPRemarkingPolicyTable)
    NURESTModelController.register_model(NUDUCGroup)
    NURESTModelController.register_model(NUDUCGroupBinding)
    NURESTModelController.register_model(NUEgressACLEntryTemplate)
    NURESTModelController.register_model(NUEgressACLTemplate)
    NURESTModelController.register_model(NUEgressAdvFwdEntryTemplate)
    NURESTModelController.register_model(NUEgressAdvFwdTemplate)
    NURESTModelController.register_model(NUEgressProfile)
    NURESTModelController.register_model(NUEgressQOSPolicy)
    NURESTModelController.register_model(NUEnterprise)
    NURESTModelController.register_model(NUEnterpriseNetwork)
    NURESTModelController.register_model(NUEnterprisePermission)
    NURESTModelController.register_model(NUEnterpriseProfile)
    NURESTModelController.register_model(NUEnterpriseSecuredData)
    NURESTModelController.register_model(NUEnterpriseSecurity)
    NURESTModelController.register_model(NUEventLog)
    NURESTModelController.register_model(NUFirewallAcl)
    NURESTModelController.register_model(NUFirewallRule)
    NURESTModelController.register_model(NUFloatingIp)
    NURESTModelController.register_model(NUForwardingPathList)
    NURESTModelController.register_model(NUForwardingPathListEntry)
    NURESTModelController.register_model(NUGateway)
    NURESTModelController.register_model(NUGatewayRedundantPort)
    NURESTModelController.register_model(NUGatewaySecuredData)
    NURESTModelController.register_model(NUGatewaySecurity)
    NURESTModelController.register_model(NUGatewaysLocation)
    NURESTModelController.register_model(NUGatewayTemplate)
    NURESTModelController.register_model(NUGlobalMetadata)
    NURESTModelController.register_model(NUGroup)
    NURESTModelController.register_model(NUGroupKeyEncryptionProfile)
    NURESTModelController.register_model(NUHostInterface)
    NURESTModelController.register_model(NUHSC)
    NURESTModelController.register_model(NUIKECertificate)
    NURESTModelController.register_model(NUIKEEncryptionprofile)
    NURESTModelController.register_model(NUIKEGateway)
    NURESTModelController.register_model(NUIKEGatewayConfig)
    NURESTModelController.register_model(NUIKEGatewayConnection)
    NURESTModelController.register_model(NUIKEGatewayProfile)
    NURESTModelController.register_model(NUIKEPSK)
    NURESTModelController.register_model(NUIKESubnet)
    NURESTModelController.register_model(NUInfrastructureAccessProfile)
    NURESTModelController.register_model(NUInfrastructureConfig)
    NURESTModelController.register_model(NUInfrastructureEVDFProfile)
    NURESTModelController.register_model(NUInfrastructureGatewayProfile)
    NURESTModelController.register_model(NUInfrastructureVscProfile)
    NURESTModelController.register_model(NUIngressACLEntryTemplate)
    NURESTModelController.register_model(NUIngressACLTemplate)
    NURESTModelController.register_model(NUIngressAdvFwdEntryTemplate)
    NURESTModelController.register_model(NUIngressAdvFwdTemplate)
    NURESTModelController.register_model(NUIngressProfile)
    NURESTModelController.register_model(NUIngressQOSPolicy)
    NURESTModelController.register_model(NUIPFilterProfile)
    NURESTModelController.register_model(NUIPReservation)
    NURESTModelController.register_model(NUIPv6FilterProfile)
    NURESTModelController.register_model(NUJob)
    NURESTModelController.register_model(NUKeyServerMember)
    NURESTModelController.register_model(NUKeyServerMonitor)
    NURESTModelController.register_model(NUKeyServerMonitorEncryptedSeed)
    NURESTModelController.register_model(NUKeyServerMonitorSeed)
    NURESTModelController.register_model(NUKeyServerMonitorSEK)
    NURESTModelController.register_model(NUL2Domain)
    NURESTModelController.register_model(NUL2DomainTemplate)
    NURESTModelController.register_model(NUL4Service)
    NURESTModelController.register_model(NUL4ServiceGroup)
    NURESTModelController.register_model(NUL7applicationsignature)
    NURESTModelController.register_model(NULDAPConfiguration)
    NURESTModelController.register_model(NULicense)
    NURESTModelController.register_model(NULicenseStatus)
    NURESTModelController.register_model(NULink)
    NURESTModelController.register_model(NULocation)
    NURESTModelController.register_model(NULTEInformation)
    NURESTModelController.register_model(NULtestatistics)
    NURESTModelController.register_model(NUMACFilterProfile)
    NURESTModelController.register_model(NUMe)
    NURESTModelController.register_model(NUMetadata)
    NURESTModelController.register_model(NUMirrorDestination)
    NURESTModelController.register_model(NUMonitoringPort)
    NURESTModelController.register_model(NUMonitorscope)
    NURESTModelController.register_model(NUMultiCastChannelMap)
    NURESTModelController.register_model(NUMultiCastList)
    NURESTModelController.register_model(NUMultiCastRange)
    NURESTModelController.register_model(NUMultiNICVPort)
    NURESTModelController.register_model(NUNATMapEntry)
    NURESTModelController.register_model(NUNetconfManager)
    NURESTModelController.register_model(NUNetconfProfile)
    NURESTModelController.register_model(NUNetconfSession)
    NURESTModelController.register_model(NUNetworkLayout)
    NURESTModelController.register_model(NUNetworkMacroGroup)
    NURESTModelController.register_model(NUNetworkPerformanceBinding)
    NURESTModelController.register_model(NUNetworkPerformanceMeasurement)
    NURESTModelController.register_model(NUNextHop)
    NURESTModelController.register_model(NUNSGateway)
    NURESTModelController.register_model(NUNSGatewayMonitor)
    NURESTModelController.register_model(NUNSGatewaysCount)
    NURESTModelController.register_model(NUNSGatewaySummary)
    NURESTModelController.register_model(NUNSGatewayTemplate)
    NURESTModelController.register_model(NUNSGGroup)
    NURESTModelController.register_model(NUNSGInfo)
    NURESTModelController.register_model(NUNSGPatchProfile)
    NURESTModelController.register_model(NUNSGRoutingPolicyBinding)
    NURESTModelController.register_model(NUNSGUpgradeProfile)
    NURESTModelController.register_model(NUNSPort)
    NURESTModelController.register_model(NUNSPortInfo)
    NURESTModelController.register_model(NUNSPortTemplate)
    NURESTModelController.register_model(NUNSRedundantGatewayGroup)
    NURESTModelController.register_model(NUOSPFArea)
    NURESTModelController.register_model(NUOSPFInstance)
    NURESTModelController.register_model(NUOSPFInterface)
    NURESTModelController.register_model(NUOverlayAddressPool)
    NURESTModelController.register_model(NUOverlayManagementProfile)
    NURESTModelController.register_model(NUOverlayManagementSubnetProfile)
    NURESTModelController.register_model(NUOverlayMirrorDestination)
    NURESTModelController.register_model(NUOverlayMirrorDestinationTemplate)
    NURESTModelController.register_model(NUOverlayPATNATEntry)
    NURESTModelController.register_model(NUPatch)
    NURESTModelController.register_model(NUPATIPEntry)
    NURESTModelController.register_model(NUPATMapper)
    NURESTModelController.register_model(NUPATNATPool)
    NURESTModelController.register_model(NUPerformanceMonitor)
    NURESTModelController.register_model(NUPermission)
    NURESTModelController.register_model(NUPGExpression)
    NURESTModelController.register_model(NUPGExpressionTemplate)
    NURESTModelController.register_model(NUPolicyDecision)
    NURESTModelController.register_model(NUPolicyEntry)
    NURESTModelController.register_model(NUPolicyGroup)
    NURESTModelController.register_model(NUPolicyGroupCategory)
    NURESTModelController.register_model(NUPolicyGroupTemplate)
    NURESTModelController.register_model(NUPolicyObjectGroup)
    NURESTModelController.register_model(NUPolicyStatement)
    NURESTModelController.register_model(NUPort)
    NURESTModelController.register_model(NUPortMapping)
    NURESTModelController.register_model(NUPortTemplate)
    NURESTModelController.register_model(NUProxyARPFilter)
    NURESTModelController.register_model(NUPSNATPool)
    NURESTModelController.register_model(NUPSPATMap)
    NURESTModelController.register_model(NUPTranslationMap)
    NURESTModelController.register_model(NUPublicNetworkMacro)
    NURESTModelController.register_model(NUQOS)
    NURESTModelController.register_model(NUQosPolicer)
    NURESTModelController.register_model(NURateLimiter)
    NURESTModelController.register_model(NURedirectionTarget)
    NURESTModelController.register_model(NURedirectionTargetTemplate)
    NURESTModelController.register_model(NURedundancyGroup)
    NURESTModelController.register_model(NURedundantPort)
    NURESTModelController.register_model(NURoutingPolicy)
    NURESTModelController.register_model(NUSaaSApplicationGroup)
    NURESTModelController.register_model(NUSaaSApplicationType)
    NURESTModelController.register_model(NUSAPEgressQoSProfile)
    NURESTModelController.register_model(NUSAPIngressQoSProfile)
    NURESTModelController.register_model(NUSharedNetworkResource)
    NURESTModelController.register_model(NUShuntLink)
    NURESTModelController.register_model(NUSiteInfo)
    NURESTModelController.register_model(NUSPATSourcesPool)
    NURESTModelController.register_model(NUSSHKey)
    NURESTModelController.register_model(NUSSIDConnection)
    NURESTModelController.register_model(NUStaticRoute)
    NURESTModelController.register_model(NUStatistics)
    NURESTModelController.register_model(NUStatisticsPolicy)
    NURESTModelController.register_model(NUStatsCollectorInfo)
    NURESTModelController.register_model(NUSubnet)
    NURESTModelController.register_model(NUSubnetTemplate)
    NURESTModelController.register_model(NUSyslogDestination)
    NURESTModelController.register_model(NUSystemConfig)
    NURESTModelController.register_model(NUTCA)
    NURESTModelController.register_model(NUTier)
    NURESTModelController.register_model(NUTrunk)
    NURESTModelController.register_model(NUUnderlay)
    NURESTModelController.register_model(NUUplinkConnection)
    NURESTModelController.register_model(NUUplinkRD)
    NURESTModelController.register_model(NUUser)
    NURESTModelController.register_model(NUUserContext)
    NURESTModelController.register_model(NUVCenter)
    NURESTModelController.register_model(NUVCenterCluster)
    NURESTModelController.register_model(NUVCenterDataCenter)
    NURESTModelController.register_model(NUVCenterEAMConfig)
    NURESTModelController.register_model(NUVCenterHypervisor)
    NURESTModelController.register_model(NUVCenterVRSConfig)
    NURESTModelController.register_model(NUVirtualFirewallPolicy)
    NURESTModelController.register_model(NUVirtualFirewallRule)
    NURESTModelController.register_model(NUVirtualIP)
    NURESTModelController.register_model(NUVLAN)
    NURESTModelController.register_model(NUVLANTemplate)
    NURESTModelController.register_model(NUVM)
    NURESTModelController.register_model(NUVMInterface)
    NURESTModelController.register_model(NUVMResync)
    NURESTModelController.register_model(NUVNF)
    NURESTModelController.register_model(NUVNFCatalog)
    NURESTModelController.register_model(NUVNFDescriptor)
    NURESTModelController.register_model(NUVNFDomainMapping)
    NURESTModelController.register_model(NUVNFInterface)
    NURESTModelController.register_model(NUVNFInterfaceDescriptor)
    NURESTModelController.register_model(NUVNFMetadata)
    NURESTModelController.register_model(NUVNFThresholdPolicy)
    NURESTModelController.register_model(NUVPNConnection)
    NURESTModelController.register_model(NUVPort)
    NURESTModelController.register_model(NUVPortMirror)
    NURESTModelController.register_model(NUVRS)
    NURESTModelController.register_model(NUVRSAddressRange)
    NURESTModelController.register_model(NUVRSMetrics)
    NURESTModelController.register_model(NUVRSRedeploymentpolicy)
    NURESTModelController.register_model(NUVSC)
    NURESTModelController.register_model(NUVSD)
    NURESTModelController.register_model(NUVSDComponent)
    NURESTModelController.register_model(NUVsgRedundantPort)
    NURESTModelController.register_model(NUVSP)
    NURESTModelController.register_model(NUWANService)
    NURESTModelController.register_model(NUWebCategory)
    NURESTModelController.register_model(NUWebDomainName)
    NURESTModelController.register_model(NUWirelessPort)
    NURESTModelController.register_model(NUZFBAutoAssignment)
    NURESTModelController.register_model(NUZFBRequest)
    NURESTModelController.register_model(NUZone)
    NURESTModelController.register_model(NUZoneTemplate)
Esempio n. 8
0
    def __init__(self,
                 sdks_info,
                 redis_info,
                 channels=[],
                 plugins=[],
                 additional_controller_classes=[],
                 additional_master_controller_classes=[],
                 log_level=logging.INFO,
                 log_handler=None,
                 runloop=True,
                 banner=True,
                 debug=False):
        """ Initializes Garuda.

        """
        setproctitle('garuda-server')
        BambouConfig.set_should_raise_bambou_http_error(False)

        self._uuid = str(uuid4())
        self._redis_info = redis_info if redis_info else {
            'host': '127.0.0.1',
            'port': '6379',
            'db': 0
        }
        self._runloop = runloop
        self._sdks_info = sdks_info
        self._sdk_library = GASDKLibrary()
        self._channels = channels
        self._debug = debug
        self._additional_controller_classes = additional_controller_classes
        self._additional_master_controller_classes = additional_master_controller_classes

        self._authentication_plugins = []
        self._storage_plugins = []
        self._logic_plugins = []
        self._permission_plugins = []

        for sdk_info in self._sdks_info:
            self._sdk_library.register_sdk(identifier=sdk_info['identifier'],
                                           sdk=importlib.import_module(
                                               sdk_info['module']))

        for plugin in plugins:

            if isinstance(plugin, GAChannel):
                self._channels.append(plugin)
            elif isinstance(plugin, GAAuthenticationPlugin):
                self._authentication_plugins.append(plugin)
            elif isinstance(plugin, GAStoragePlugin):
                self._storage_plugins.append(plugin)
            elif isinstance(plugin, GAPermissionsPlugin):
                self._permission_plugins.append(plugin)
            elif isinstance(plugin, GALogicPlugin):
                self._logic_plugins.append(plugin)

        if banner:
            self.print_banner()

        if not log_handler:
            log_handler = logging.StreamHandler()
            log_handler.setFormatter(
                logging.Formatter('[%(levelname)s] %(name)s: %(message)s'))
            logger.addHandler(log_handler)

        logger.setLevel(log_level)

        self._channels_controller = GAChannelsController(
            garuda_uuid=self._uuid,
            channels=self._channels,
            redis_info=self._redis_info,
            additional_controller_classes=self._additional_controller_classes,
            logic_plugins=self._logic_plugins,
            authentication_plugins=self._authentication_plugins,
            storage_plugins=self._storage_plugins,
            permission_plugins=self._permission_plugins)

        self._master_core = GACoreController(
            garuda_uuid=self._uuid,
            redis_info=self._redis_info,
            logic_plugins=[],
            additional_controller_classes=self.
            _additional_master_controller_classes,
            authentication_plugins=self._authentication_plugins,
            storage_plugins=self._storage_plugins,
            permission_plugins=self._permission_plugins)