// InstallDefaultHandlers registers the default set of supported HTTP request
// patterns with the restful Container.
541153
func (s *Server) InstallDefaultHandlers() {
	healthz.InstallHandler(s.restfulCont,
		healthz.PingHealthz,
		healthz.LogHealthz,
		healthz.NamedCheck("syncloop", s.syncLoopHealthCheck),
	)
	ws := new(restful.WebService)
	ws.
		Path("/pods").
		Produces(restful.MIME_JSON)
	ws.Route(ws.GET("").
		To(s.getPods).
		Operation("getPods"))
	s.restfulCont.Add(ws)

	s.restfulCont.Add(stats.CreateHandlers(statsPath, s.host, s.resourceAnalyzer))
	s.restfulCont.Handle(metricsPath, prometheus.Handler())

	// cAdvisor metrics are exposed under the secured handler as well
	r := prometheus.NewRegistry()

	includedMetrics := cadvisormetrics.MetricSet{
		cadvisormetrics.CpuUsageMetrics:         struct{}{},
		cadvisormetrics.MemoryUsageMetrics:      struct{}{},
		cadvisormetrics.CpuLoadMetrics:          struct{}{},
		cadvisormetrics.DiskIOMetrics:           struct{}{},
		cadvisormetrics.DiskUsageMetrics:        struct{}{},
		cadvisormetrics.NetworkUsageMetrics:     struct{}{},
		cadvisormetrics.AcceleratorUsageMetrics: struct{}{},
		cadvisormetrics.AppMetrics:              struct{}{},
	}
	r.MustRegister(metrics.NewPrometheusCollector(prometheusHostAdapter{s.host}, containerPrometheusLabelsFunc(s.host), includedMetrics))
	s.restfulCont.Handle(cadvisorMetricsPath,
		promhttp.HandlerFor(r, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}),
	)

	v1alpha1ResourceRegistry := prometheus.NewRegistry()
	v1alpha1ResourceRegistry.MustRegister(stats.NewPrometheusResourceMetricCollector(s.resourceAnalyzer, v1alpha1.Config()))
	s.restfulCont.Handle(path.Join(resourceMetricsPathPrefix, v1alpha1.Version),
		promhttp.HandlerFor(v1alpha1ResourceRegistry, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}),
	)

	// prober metrics are exposed under a different endpoint
	p := prometheus.NewRegistry()
	p.MustRegister(prober.ProberResults)
	s.restfulCont.Handle(proberMetricsPath,
		promhttp.HandlerFor(p, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}),
	)

	ws = new(restful.WebService)
	ws.
		Path(specPath).
		Produces(restful.MIME_JSON)
	ws.Route(ws.GET("").
		To(s.getSpec).
		Operation("getSpec").
		Writes(cadvisorapi.MachineInfo{}))
	s.restfulCont.Add(ws)
}
964432
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1alpha1.AuditSink{}, func(obj interface{}) { SetObjectDefaults_AuditSink(obj.(*v1alpha1.AuditSink)) })
	scheme.AddTypeDefaultingFunc(&v1alpha1.AuditSinkList{}, func(obj interface{}) { SetObjectDefaults_AuditSinkList(obj.(*v1alpha1.AuditSinkList)) })
	return nil
}
223724
func DefaultHTTPErrorHandler(err error, c echo.Context) {
	Default.DefaultHTTPErrorHandler(err, c)
}
338487
func AddDefaultStoragePools(p storage.Provider, pm PoolManager) error {
	for _, pool := range p.DefaultPools() {
		if err := addDefaultPool(pm, pool); err != nil {
			return err
		}
	}
	return nil
}
1365972
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1.OAuthAuthorizeToken{}, func(obj interface{}) { SetObjectDefaults_OAuthAuthorizeToken(obj.(*v1.OAuthAuthorizeToken)) })
	scheme.AddTypeDefaultingFunc(&v1.OAuthAuthorizeTokenList{}, func(obj interface{}) { SetObjectDefaults_OAuthAuthorizeTokenList(obj.(*v1.OAuthAuthorizeTokenList)) })
	return nil
}
835889
func InstallHandlers(r *router.Router, base router.MiddlewareChain, srv crimson.CrimsonServer, tmplPath string) {
	m := base.Extend(func(c *router.Context, next router.Handler) {
		c.Context = context.WithValue(c.Context, &serverKey, srv)
		next(c)
	})
	m = m.Extend(
		templates.WithTemplates(prepareTemplates(tmplPath)),
		auth.Authenticate(gaeserver.UsersAPIAuthMethod{}),
	)
	r.GET("/", m, indexPage)
	r.GET("/datacenters", m, datacentersPage)
	r.GET("/dracs", m, dracsPage)
	r.GET("/hosts", m, hostsPage)
	r.GET("/kvms", m, kvmsPage)
	r.GET("/machines", m, machinesPage)
	r.GET("/nics", m, nicsPage)
	r.GET("/oses", m, osesPage)
	r.GET("/platforms", m, platformsPage)
	r.GET("/racks", m, racksPage)
	r.GET("/switches", m, switchesPage)
	r.GET("/vlans", m, vlansPage)
	r.GET("/vms", m, vmsPage)
}
571286
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	// Pprof native routing structure is not supported by julienschmidt/httprouter
	// since it mixes prefix matches and direct matches. So we'll have to do some
	// manual routing for paths under /debug/pprof :(
	r.GET("/debug/pprof/*path", base, func(c *router.Context) {
		// Validate the token generated through the portal page.
		tok := c.Request.FormValue("tok")
		if tok == "" {
			sendError(c.Writer, "Missing 'tok' query parameter with a pprof token", http.StatusBadRequest)
			return
		}
		switch err := checkToken(c.Context, tok); {
		case transient.Tag.In(err):
			sendError(c.Writer, fmt.Sprintf("Transient error, please retry: %s", err), http.StatusInternalServerError)
			return
		case err != nil:
			sendError(c.Writer, fmt.Sprintf("Bad pprof token: %s", err), http.StatusBadRequest)
			return
		}

		// Manually route. See init() in go/src/net/http/pprof/pprof.go.
		h := pprofRoutes[c.Params.ByName("path")]
		if h == nil {
			h = internal.Index
		}
		h(c.Writer, c.Request)
	})
}
1190600
func (h *localLoginHandlers) AddHandlers(mux *apiserverhttp.Mux) {
	var errorMapper httprequest.ErrorMapper = httpbakery.ErrorToResponse
	var handleJSON = errorMapper.HandleJSON
	makeHandler := func(h httprouter.Handle) http.Handler {
		return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
			h(w, req, nil)
		})
	}
	dischargeMux := http.NewServeMux()
	httpbakery.AddDischargeHandler(
		dischargeMux,
		localUserIdentityLocationPath,
		h.authCtxt.localUserThirdPartyBakeryService,
		h.checkThirdPartyCaveat,
	)
	dischargeMux.Handle(
		localUserIdentityLocationPath+"/login",
		makeHandler(handleJSON(h.serveLogin)),
	)
	dischargeMux.Handle(
		localUserIdentityLocationPath+"/wait",
		makeHandler(handleJSON(h.serveWait)),
	)
	mux.AddHandler("POST", localUserIdentityLocationPath+"/discharge", dischargeMux)
	mux.AddHandler("GET", localUserIdentityLocationPath+"/publickey", dischargeMux)
	mux.AddHandler("GET", localUserIdentityLocationPath+"/wait", dischargeMux)
	mux.AddHandler("GET", localUserIdentityLocationPath+"/login", dischargeMux)
	mux.AddHandler("POST", localUserIdentityLocationPath+"/login", dischargeMux)
}
1015207
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1beta1.CertificateSigningRequest{}, func(obj interface{}) {
		SetObjectDefaults_CertificateSigningRequest(obj.(*v1beta1.CertificateSigningRequest))
	})
	scheme.AddTypeDefaultingFunc(&v1beta1.CertificateSigningRequestList{}, func(obj interface{}) {
		SetObjectDefaults_CertificateSigningRequestList(obj.(*v1beta1.CertificateSigningRequestList))
	})
	return nil
}
1187839
func NewDefaultCleaner(fs fs.FileSystem, docker docker.Docker) Cleaner {
	return &DefaultCleaner{
		fs:     fs,
		docker: docker,
	}
}
955331
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1beta1.KubeletConfiguration{}, func(obj interface{}) { SetObjectDefaults_KubeletConfiguration(obj.(*v1beta1.KubeletConfiguration)) })
	return nil
}
563913
func InstallWithoutDefaults(options InstallOptions, fs afero.Fs) error {
	debug("Downloading ignition")
	response, err := http.Get(options.IgnitionURL)
	if err != nil {
		return err
	}
	if response.StatusCode != 200 {
		return fmt.Errorf("Ignition download expected 200, Received: %v", response.StatusCode)
	}

	debug("Reading response.Body")
	data, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return err
	}

	debug("Making the directory")
	err = fs.MkdirAll(filepath.Dir(options.IgnitionPath), 0755)
	if err != nil {
		return err
	}

	return afero.WriteFile(fs, options.IgnitionPath, data, 0755)
}
885931
func (o *ClientOptions) SetDefaultPublishHandler(defaultHandler MessageHandler) *ClientOptions {
	o.DefaultPublishHandler = defaultHandler
	return o
}
814636
func (c *Connection) setDefaults() {
	if c.UserAgent == "" {
		c.UserAgent = DefaultUserAgent
	}
	if c.Retries == 0 {
		c.Retries = DefaultRetries
	}
	if c.ConnectTimeout == 0 {
		c.ConnectTimeout = 10 * time.Second
	}
	if c.Timeout == 0 {
		c.Timeout = 60 * time.Second
	}
	if c.Transport == nil {
		t := &http.Transport{
			//		TLSClientConfig:    &tls.Config{RootCAs: pool},
			//		DisableCompression: true,
			Proxy: http.ProxyFromEnvironment,
			// Half of linux's default open files limit (1024).
			MaxIdleConnsPerHost: 512,
		}
		SetExpectContinueTimeout(t, 5*time.Second)
		c.Transport = t
	}
	if c.client == nil {
		c.client = &http.Client{
			//		CheckRedirect: redirectPolicyFunc,
			Transport: c.Transport,
		}
	}
}
101683
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1beta1.DaemonSet{}, func(obj interface{}) { SetObjectDefaults_DaemonSet(obj.(*v1beta1.DaemonSet)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.DaemonSetList{}, func(obj interface{}) { SetObjectDefaults_DaemonSetList(obj.(*v1beta1.DaemonSetList)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.Deployment{}, func(obj interface{}) { SetObjectDefaults_Deployment(obj.(*v1beta1.Deployment)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.DeploymentList{}, func(obj interface{}) { SetObjectDefaults_DeploymentList(obj.(*v1beta1.DeploymentList)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.NetworkPolicy{}, func(obj interface{}) { SetObjectDefaults_NetworkPolicy(obj.(*v1beta1.NetworkPolicy)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.NetworkPolicyList{}, func(obj interface{}) { SetObjectDefaults_NetworkPolicyList(obj.(*v1beta1.NetworkPolicyList)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.PodSecurityPolicy{}, func(obj interface{}) { SetObjectDefaults_PodSecurityPolicy(obj.(*v1beta1.PodSecurityPolicy)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.PodSecurityPolicyList{}, func(obj interface{}) { SetObjectDefaults_PodSecurityPolicyList(obj.(*v1beta1.PodSecurityPolicyList)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.ReplicaSet{}, func(obj interface{}) { SetObjectDefaults_ReplicaSet(obj.(*v1beta1.ReplicaSet)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.ReplicaSetList{}, func(obj interface{}) { SetObjectDefaults_ReplicaSetList(obj.(*v1beta1.ReplicaSetList)) })
	return nil
}
316341
func InstallHandlers(r *router.Router, base router.MiddlewareChain) {
	r.POST(handlerPattern, base.Extend(gaemiddleware.RequireTaskQueue("")), TaskQueueHandler)
	r.POST("/_ah/push-handlers/"+notifyTopicSuffix, base, PubsubReceiver)
}
724015
func (t *Repository) LoadDefaults() {

	for name, asset := range assets {
		if err := t.addFile(name, string(asset), true); err != nil {
			log.Fatal(err)
		}
	}
}