docs: private void handleAssign(final TSDB tsdb, final HttpQuery query) {
      // only accept GET And POST
      if (query.method() != HttpMethod.GET && query.method() != HttpMethod.POST) {
        throw new BadRequestException(HttpResponseStatus.METHOD_NOT_ALLOWED, 
            "Method not allowed", "The HTTP method [" + query.method().getName() +
            "] is not permitted for this endpoint");
      }
      
      final HashMap<String, List<String>> source;
      if (query.method() == HttpMethod.POST) {
        source = query.serializer().parseUidAssignV1();
      } else {
        source = new HashMap<String, List<String>>(3);
        // cut down on some repetitive code, split the query string values by
        // comma and add them to the source hash
        String[] types = {"metric", "tagk", "tagv"};
        for (int i = 0; i < types.length; i++) {
          final String values = query.getQueryStringParam(types[i]);
          if (values != null && !values.isEmpty()) {
            final String[] metrics = values.split(",");
            if (metrics != null && metrics.length > 0) {
              source.put(types[i], Arrays.asList(metrics));
            }
          }
        }
      }
      
      if (source.size() < 1) {
        throw new BadRequestException("Missing values to assign UIDs");
      }
      
      final Map<String, TreeMap<String, String>> response = 
        new HashMap<String, TreeMap<String, String>>();
      
      int error_count = 0;
      for (Map.Entry<String, List<String>> entry : source.entrySet()) {
        final TreeMap<String, String> results = 
          new TreeMap<String, String>();
        final TreeMap<String, String> errors = 
          new TreeMap<String, String>();
        
        for (String name : entry.getValue()) {
          try {
            final byte[] uid = tsdb.assignUid(entry.getKey(), name);
            results.put(name, 
                UniqueId.uidToString(uid));
          } catch (IllegalArgumentException e) {
            errors.put(name, e.getMessage());
            error_count++;
          }
        }
        
        response.put(entry.getKey(), results);
        if (errors.size() > 0) {
          response.put(entry.getKey() + "_errors", errors);
        }
      }
      
      if (error_count < 1) {
        query.sendReply(query.serializer().formatUidAssignV1(response));
      } else {
        query.sendReply(HttpResponseStatus.BAD_REQUEST,
            query.serializer().formatUidAssignV1(response));
      }
    }