// NewEnterprise returns a new *Enterprise
342728
func NewEnterprise() *Enterprise {

	return &Enterprise{
		VNFManagementEnabled:                   false,
		WebFilterEnabled:                       false,
		DictionaryVersion:                      2,
		VirtualFirewallRulesEnabled:            false,
		FlowCollectionEnabled:                  "DISABLED",
		EnableApplicationPerformanceManagement: false,
		UseGlobalMAC:                           false,
	}
}
1156488
func New(config Config) (environs.InstanceBroker, error) {
	if err := config.Validate(); err != nil {
		return nil, errors.Trace(err)
	}

	manager, err := factory.NewContainerManager(config.ContainerType, config.ManagerConfig)
	if err != nil {
		return nil, errors.Trace(err)
	}

	var newBroker ContainerBrokerFunc
	switch config.ContainerType {
	case instance.KVM:
		newBroker = NewKVMBroker
	case instance.LXD:
		newBroker = NewLXDBroker
	default:
		return nil, errors.NotValidf("ContainerType %s", config.ContainerType)
	}

	broker, err := newBroker(prepareHost(config), config.APICaller, manager, config.AgentConfig)
	if err != nil {
		logger.Errorf("failed to create new %s broker", config.ContainerType)
		return nil, errors.Trace(err)
	}

	return broker, nil
}
13036
func NewInstance(fw *choria.Framework) (i *Instance, err error) {
	i = &Instance{
		fw:               fw,
		cfg:              fw.Config,
		requests:         make(chan *choria.ConnectorMessage),
		mu:               &sync.Mutex{},
		startTime:        time.Now(),
		lastMsgProcessed: time.Unix(0, 0),
		agentDenyList:    []string{},
	}

	i.log = log.WithFields(log.Fields{"identity": fw.Config.Identity, "component": "server"})
	i.discovery = discovery.New(fw, i.log)

	return i, nil
}
1361142
func (c *Client) EndpointCreate(ep *models.EndpointChangeRequest) error {
	id := pkgEndpointID.NewCiliumID(ep.ID)
	params := endpoint.NewPutEndpointIDParams().WithID(id).WithEndpoint(ep).WithTimeout(api.ClientTimeout)
	_, err := c.Endpoint.PutEndpointID(params)
	return Hint(err)
}
228616
func NewEventSub(evtype, evtarget string) *EventSub {
	return &EventSub{
		EventMeta: &EventMetable{
			EventType:   evtype,
			EventTarget: evtarget,
		},
		Chains: ChainIdentity(),
	}
}
1003838
func NewFromEnv(ctx context.Context) *Server {
	ds, err := datastore.New(viper.GetString(EnvDBURL))
	if err != nil {
		logrus.WithError(err).Fatalln("Error initializing datastore.")
	}

	mq, err := mqs.New(viper.GetString(EnvMQURL))
	if err != nil {
		logrus.WithError(err).Fatal("Error initializing message queue.")
	}

	apiURL := viper.GetString(EnvAPIURL)

	return New(ctx, ds, mq, apiURL)
}
400004
func New() (*DisallowFlunder, error) {
	return &DisallowFlunder{
		Handler: admission.NewHandler(admission.Create),
	}, nil
}
1147442
func newInstance(raw ociCore.Instance, env *Environ) (*ociInstance, error) {
	if raw.Id == nil {
		return nil, errors.New(
			"Instance response does not contain an ID",
		)
	}
	instance := &ociInstance{
		raw:  raw,
		env:  env,
		arch: "amd64",
	}

	return instance, nil
}
285101
func newFlunders(c *WardleV1beta1Client, namespace string) *flunders {
	return &flunders{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
621384
func New(producer OutboundProducer, namespace string) *Auditor {
	log.Debug("auditing enabled for service", log.Data{"service": namespace})
	return &Auditor{
		producer:      producer,
		service:       namespace,
		marshalToAvro: EventSchema.Marshal,
	}
}
971252
func newEntry() *Entry {
	e := logrus.NewEntry(logger)
	addContext(e.Data, defaultDepth)
	return &Entry{*e}
}
1042247
func newLeases(c *CoordinationV1beta1Client, namespace string) *leases {
	return &leases{
		client: c.RESTClient(),
		ns:     namespace,
	}
}
710784
func NewPresenceService(b backend.Backend) *PresenceService {
	return &PresenceService{
		log:     logrus.WithFields(logrus.Fields{trace.Component: "Presence"}),
		Backend: b,
	}
}
712562
func New(endpoint protocol.EngineEndpoint) (e *Engine, err error) {

	e = &Engine{
		endpoint: endpoint,
	}

	e.stop = make(chan bool)

	e.opsExecutors = map[int]executor{
		parser.CreateToken:   createExecutor,
		parser.TableToken:    createTableExecutor,
		parser.SelectToken:   selectExecutor,
		parser.InsertToken:   insertIntoTableExecutor,
		parser.DeleteToken:   deleteExecutor,
		parser.UpdateToken:   updateExecutor,
		parser.IfToken:       ifExecutor,
		parser.NotToken:      notExecutor,
		parser.ExistsToken:   existsExecutor,
		parser.TruncateToken: truncateExecutor,
		parser.DropToken:     dropExecutor,
		parser.GrantToken:    grantExecutor,
	}

	e.relations = make(map[string]*Relation)

	err = e.start()
	if err != nil {
		return nil, err
	}

	return
}
856831
func (f *Facade) AddService(ctx datastore.Context, svc service.Service) (err error) {
	var tenantID string
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.AddService"))
	alog := f.auditLogger.Action(audit.Add).Message(ctx, "Adding new Service ").WithField("servicename", svc.Name).Entity(&svc)

	if svc.ParentServiceID == "" {
		tenantID = svc.ID
	} else if tenantID, err = f.GetTenantID(ctx, svc.ParentServiceID); err != nil {
		return alog.Error(err)
	}
	mutex := getTenantLock(tenantID)
	mutex.RLock()
	defer mutex.RUnlock()
	return alog.Error(f.addService(ctx, tenantID, svc, false))
}
724081
func NewOrganizationService(context servicecontext.ServiceContext) service.OrganizationService {
	return &organizationServiceImpl{base.NewBaseService(context)}
}
1122062
func newEndpoints(c *CoreClient, namespace string) *endpoints {
	return &endpoints{
		client: c,
		ns:     namespace,
	}
}