[
https://issues.apache.org/jira/browse/TS-4395?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15357300#comment-15357300
]
ASF GitHub Bot commented on TS-4395:
------------------------------------
Github user jpeach commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/747#discussion_r69157179
--- Diff: plugins/experimental/remap_purge/remap_purge.c ---
@@ -0,0 +1,335 @@
+/** @file
+
+ Per-remap purge RESTful API for stateful generation ID management.
+
+ @section license License
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <getopt.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ts/ink_defs.h"
+
+static const char *PLUGIN_NAME = "remap_purge";
+static const char *DEFAULT_DIR = "var/trafficserver"; /* Not perfect, but
no better API) */
--- End diff --
Can you pleas file a JIRA to make a API to get the runtime directory?
> conf_purge: Simple plugin to purge an entire remap rule
> -------------------------------------------------------
>
> Key: TS-4395
> URL: https://issues.apache.org/jira/browse/TS-4395
> Project: Traffic Server
> Issue Type: New Feature
> Components: Plugins
> Reporter: Leif Hedstrom
> Assignee: Leif Hedstrom
> Fix For: 7.0.0
>
>
> This is similar to the existing plugin to purge based on a genID stored in a
> persistent storage. The difference is that the purging is done exclusively
> via a restful API, and has little (no) overhead on performance (since the
> generation ID is always in memory).
> Example:
> {code}
> map http://example.com/p1 http://p1.example.com
> @plugin=remap_purge.so @pparam=--path=__secret_purge__
> @pparam=--state=example_p1
> {code}
> And to purge:
> {code}
> $ curl -s -D - -X PURGE http://example.com/p1/__secret_purge__
> HTTP/1.1 200 OK
> Date: Sat, 30 Apr 2016 00:09:34 GMT
> Connection: close
> Server: ATS/7.0.0
> Content-Length: 39
> Content-Type: text/html
> PURGED http://example.com/p1
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)