(TSDB tsdb, HttpQuery query)
| 48 | final class UniqueIdRpc implements HttpRpc { |
| 49 | |
| 50 | @Override |
| 51 | public void execute(TSDB tsdb, HttpQuery query) throws IOException { |
| 52 | |
| 53 | // the uri will be /api/vX/uid/? or /api/uid/? |
| 54 | final String[] uri = query.explodeAPIPath(); |
| 55 | final String endpoint = uri.length > 1 ? uri[1] : ""; |
| 56 | |
| 57 | if (endpoint.toLowerCase().equals("assign")) { |
| 58 | this.handleAssign(tsdb, query); |
| 59 | return; |
| 60 | } else if (endpoint.toLowerCase().equals("uidmeta")) { |
| 61 | this.handleUIDMeta(tsdb, query); |
| 62 | return; |
| 63 | } else if (endpoint.toLowerCase().equals("tsmeta")) { |
| 64 | this.handleTSMeta(tsdb, query); |
| 65 | return; |
| 66 | } else if (endpoint.toLowerCase().equals("rename")) { |
| 67 | this.handleRename(tsdb, query); |
| 68 | return; |
| 69 | } else { |
| 70 | throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMENTED, |
| 71 | "Other UID endpoints have not been implemented yet"); |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Assigns UIDs to the given metric, tagk or tagv names if applicable |
nothing calls this directly
no test coverage detected