code: func (aSpace *addrSpace) UnmarshalJSON(data []byte) error {
  	aSpace.Lock()
  	defer aSpace.Unlock()
  
  	m := map[string]interface{}{}
  	err := json.Unmarshal(data, &m)
  	if err != nil {
  		return err
  	}
  
  	aSpace.scope = datastore.LocalScope
  	s := m["Scope"].(string)
  	if s == string(datastore.GlobalScope) {
  		aSpace.scope = datastore.GlobalScope
  	}
  
  	if v, ok := m["Subnets"]; ok {
  		sb, _ := json.Marshal(v)
  		var s map[string]*PoolData
  		err := json.Unmarshal(sb, &s)
  		if err != nil {
  			return err
  		}
  		for ks, v := range s {
  			k := SubnetKey{}
  			k.FromString(ks)
  			aSpace.subnets[k] = v
  		}
  	}
  
  	return nil
  }
docs: // UnmarshalJSON decodes data into the addrSpace object