code: func (a *Agent) AddProxy(proxy *structs.ConnectManagedProxy, persist, FromFile bool,
  	restoredProxyToken string, source configSource) error {
  	a.stateLock.Lock()
  	defer a.stateLock.Unlock()
  	return a.addProxyLocked(proxy, persist, FromFile, restoredProxyToken, source)
  }
docs: // AddProxy adds a new local Connect Proxy instance to be managed by the agent.
  //
  // It REQUIRES that the service that is being proxied is already present in the
  // local state. Note that this is only used for agent-managed proxies so we can
  // ensure that we always make this true. For externally managed and registered
  // proxies we explicitly allow the proxy to be registered first to make
  // bootstrap ordering of a new service simpler but the same is not true here
  // since this is only ever called when setting up a _managed_ proxy which was
  // registered as part of a service registration either from config or HTTP API
  // call.
  //
  // The restoredProxyToken argument should only be used when restoring proxy
  // definitions from disk; new proxies must leave it blank to get a new token
  // assigned. We need to restore from disk to enable to continue authenticating
  // running proxies that already had that credential injected.