// GetDocknetState gets the docknet entry from state store
8131
func GetDocknetState(tenantName, networkName, serviceName string) (*DnetOperState, error) {
	log.Infof("GetDocknetState for %s.%s.%s", tenantName, networkName, serviceName)

	// Get the state driver
	stateDriver, err := utils.GetStateDriver()
	if err != nil {
		log.Warnf("Couldn't get state driver for docknet %v", err)
		return nil, err
	}

	// save docknet oper state
	dnetOper := DnetOperState{}
	dnetOper.ID = fmt.Sprintf("%s.%s.%s", tenantName, networkName, serviceName)
	dnetOper.StateDriver = stateDriver

	// Read the dnet oper state
	err = dnetOper.Read(dnetOper.ID)
	if err == nil {
		return &dnetOper, nil
	}
	return nil, err
}
961108
func (vm *VM) GetState() (string, error) {

	if vm.ID == "" {
		return "", fmt.Errorf("Need an ID to get virtual machine state")
	}

	if err := vm.updateInfo(); err != nil {
		return "", err
	}

	return vm.state, nil
}
971584
func (d *DismissedReview) GetState() string {
	if d == nil || d.State == nil {
		return ""
	}
	return *d.State
}
685283
func (fbo *folderBlockOps) GetState(
	lState *kbfssync.LockState) overallBlockState {
	fbo.blockLock.RLock(lState)
	defer fbo.blockLock.RUnlock(lState)
	if len(fbo.dirtyFiles) == 0 && len(fbo.dirtyDirs) == 0 &&
		fbo.dirtyRootDirEntry == nil {
		return cleanState
	}
	return dirtyState
}
933499
func (k *KeyReadWriter) GetCurrentState() (PEMKeyHeaders, KEKData) {
	k.mu.Lock()
	defer k.mu.Unlock()
	return k.headersObj, k.kekData
}
98791
func (ctlr *Controller) GetState(modelTag names.ModelTag) (*PooledState, error) {
	return ctlr.pool.Get(modelTag.Id())
}
233562
func (qe *UpdateBatchBackedQueryExecuter) GetState(ns, key string) (*statedb.VersionedValue, error) {
	return qe.UpdateBatch.Get(ns, key), nil
}
1243169
func (p *Project) GetState() string {
	if p == nil || p.State == nil {
		return ""
	}
	return *p.State
}
153951
func InitDockPlugin(np *plugin.NetPlugin, mode string) error {
	// Save state
	netPlugin = np
	pluginMode = mode

	// Get local hostname
	hostname, err := os.Hostname()
	if err != nil {
		log.Fatalf("Could not retrieve hostname: %v", err)
	}

	log.Debugf("Configuring router")

	router := mux.NewRouter()
	s := router.Methods("POST").Subrouter()

	dispatchMap := map[string]func(http.ResponseWriter, *http.Request){
		"/Plugin.Activate":                           activate(hostname),
		"/Plugin.Deactivate":                         deactivate(hostname),
		"/NetworkDriver.GetCapabilities":             getCapability,
		"/NetworkDriver.CreateNetwork":               createNetwork,
		"/NetworkDriver.DeleteNetwork":               deleteNetwork,
		"/NetworkDriver.CreateEndpoint":              createEndpoint(hostname),
		"/NetworkDriver.DeleteEndpoint":              deleteEndpoint(hostname),
		"/NetworkDriver.EndpointOperInfo":            endpointInfo,
		"/NetworkDriver.Join":                        join,
		"/NetworkDriver.Leave":                       leave,
		"/NetworkDriver.AllocateNetwork":             allocateNetwork,
		"/NetworkDriver.FreeNetwork":                 freeNetwork,
		"/NetworkDriver.ProgramExternalConnectivity": programExternalConnectivity,
		"/NetworkDriver.RevokeExternalConnectivity":  revokeExternalConnectivity,
		"/NetworkDriver.DiscoverNew":                 discoverNew,
		"/NetworkDriver.DiscoverDelete":              discoverDelete,
		"/IpamDriver.GetDefaultAddressSpaces":        getDefaultAddressSpaces,
		"/IpamDriver.RequestPool":                    requestPool,
		"/IpamDriver.ReleasePool":                    releasePool,
		"/IpamDriver.RequestAddress":                 requestAddress,
		"/IpamDriver.ReleaseAddress":                 releaseAddress,
		"/IpamDriver.GetCapabilities":                getIpamCapability,
	}

	for dispatchPath, dispatchFunc := range dispatchMap {
		s.HandleFunc(dispatchPath, logHandler(dispatchPath, dispatchFunc))
	}

	s.HandleFunc("/NetworkDriver.{*}", unknownAction)
	s.HandleFunc("/IpamDriver.{*}", unknownAction)

	driverPath := path.Join(pluginPath, driverName) + ".sock"
	os.Remove(driverPath)
	os.MkdirAll(pluginPath, 0700)

	go func() {
		l, err := net.ListenUnix("unix", &net.UnixAddr{Name: driverPath, Net: "unix"})
		if err != nil {
			panic(err)
		}

		log.Infof("docker plugin listening on %s", driverPath)
		server := &http.Server{Handler: router}
		server.SetKeepAlivesEnabled(false)
		server.Serve(l)
		l.Close()
		log.Infof("docker plugin closing %s", driverPath)
	}()

	return nil
}
585686
func (p *Plugin) getAgentState() status.OperationalState {
	p.access.Lock()
	defer p.access.Unlock()
	return p.agentStat.State
}
998265
func (c *Client) GetStateFromCluster() (*State, error) {
	resp, err := c.GetHTTPResponseFromCluster(c.GetURLForStateFile)
	return c.parseStateResponse(resp, err)
}
609422
func (d *DeploymentStatus) GetState() string {
	if d == nil || d.State == nil {
		return ""
	}
	return *d.State
}
710430
func (p *ProjectOptions) GetState() string {
	if p == nil || p.State == nil {
		return ""
	}
	return *p.State
}
249631
func (d *DeploymentStatusRequest) GetState() string {
	if d == nil || d.State == nil {
		return ""
	}
	return *d.State
}
1089455
func (s *StatusEvent) GetState() string {
	if s == nil || s.State == nil {
		return ""
	}
	return *s.State
}
252470
func (c *ClusterManager) GetGossipState() *cluster.ClusterState {
	gossipStoreKey := types.StoreKey(heartbeatKey + c.config.ClusterId)
	nodeValue := c.gossip.GetStoreKeyValue(gossipStoreKey)
	nodes := make([]types.NodeValue, len(nodeValue), len(nodeValue))
	i := 0
	for _, value := range nodeValue {
		nodes[i] = value
		i++
	}

	return &cluster.ClusterState{NodeStatus: nodes}
}
998825
func (c *Client) GetState() uint8 {
	c.stateLock.Lock()
	defer c.stateLock.Unlock()

	return c.state.State()
}