get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/87931/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 87931,
    "url": "http://patches.dpdk.org/api/patches/87931/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210216113921.28725-1-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210216113921.28725-1-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210216113921.28725-1-bruce.richardson@intel.com",
    "date": "2021-02-16T11:39:21",
    "name": "[v2] usertools/dpdk-telemetry: print name of app when connected",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "bbf51ec1ba7f9c3ebbfa71f7ad15c399d3933408",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210216113921.28725-1-bruce.richardson@intel.com/mbox/",
    "series": [
        {
            "id": 15268,
            "url": "http://patches.dpdk.org/api/series/15268/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15268",
            "date": "2021-02-16T11:39:21",
            "name": "[v2] usertools/dpdk-telemetry: print name of app when connected",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/15268/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/87931/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/87931/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2579BA0558;\n\tTue, 16 Feb 2021 12:39:32 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 98EB516072E;\n\tTue, 16 Feb 2021 12:39:31 +0100 (CET)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id 8C21A40690\n for <dev@dpdk.org>; Tue, 16 Feb 2021 12:39:29 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Feb 2021 03:39:28 -0800",
            "from silpixa00399126.ir.intel.com ([10.237.223.216])\n by orsmga001.jf.intel.com with ESMTP; 16 Feb 2021 03:39:27 -0800"
        ],
        "IronPort-SDR": [
            "\n /IqIRnrqdH0bY16IRMBboyhzAq8MXee+jec9SApHP5jhIIw37ZFhQLa21IncjnMBNn75Ut1/oo\n 6GINg/7TXr3g==",
            "\n c2v/uUwbo9hMspkXzpYg/Ks1a73PX3y0gWp2sfjy5lJburqc8yhhg44uBdKg8GdCu3ZioKsyi7\n 5CSFFDBTBzxw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9896\"; a=\"244339601\"",
            "E=Sophos;i=\"5.81,183,1610438400\"; d=\"scan'208\";a=\"244339601\"",
            "E=Sophos;i=\"5.81,183,1610438400\"; d=\"scan'208\";a=\"438887814\""
        ],
        "X-ExtLoop1": "1",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "anatoly.burakov@intel.com, Bruce Richardson <bruce.richardson@intel.com>,\n Kevin Laatz <kevin.laatz@intel.com>",
        "Date": "Tue, 16 Feb 2021 11:39:21 +0000",
        "Message-Id": "<20210216113921.28725-1-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210216094415.28000-1-bruce.richardson@intel.com>",
        "References": "<20210216094415.28000-1-bruce.richardson@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2] usertools/dpdk-telemetry: print name of app\n when connected",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "When the dpdk-telemetry client connects to a DPDK instance, we can use the\nPID provided in the initial connection message to query from /proc the name\nof the process we are connected to, and display that to the user. We use\nthe \"cmdline\" procfs entry for the query since that is available on both\nLinux and FreeBSD (assuming procfs is mounted on the BSD instance).\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n\n---\nV2:\n  Updated with stylistic feedback from Anatoly, and split name query into a\n  separate function.\n---\n usertools/dpdk-telemetry.py | 18 ++++++++++++++++++\n 1 file changed, 18 insertions(+)\n\n--\n2.27.0",
    "diff": "diff --git a/usertools/dpdk-telemetry.py b/usertools/dpdk-telemetry.py\nindex 181859658..b2acd92ba 100755\n--- a/usertools/dpdk-telemetry.py\n+++ b/usertools/dpdk-telemetry.py\n@@ -11,6 +11,7 @@\n import os\n import glob\n import json\n+import errno\n import readline\n\n # global vars\n@@ -32,6 +33,20 @@ def read_socket(sock, buf_len, echo=True):\n     return ret\n\n\n+def get_app_name(pid):\n+    \"\"\" return the app name for a given pid, for printing \"\"\"\n+    proc_cmdline = os.path.join('/proc', str(pid), 'cmdline')\n+    try:\n+        with open(proc_cmdline) as f:\n+            argv0 = f.read(1024).split('\\0')[0]\n+            return os.path.basename(argv0)\n+    except IOError as e:\n+        # ignore file not found errors\n+        if e.errno != errno.ENOENT:\n+            raise\n+    return None\n+\n+\n def handle_socket(path):\n     \"\"\" Connect to socket and handle user input \"\"\"\n     sock = socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET)\n@@ -45,6 +60,9 @@ def handle_socket(path):\n         return\n     json_reply = read_socket(sock, 1024)\n     output_buf_len = json_reply[\"max_output_len\"]\n+    app_name = get_app_name(json_reply[\"pid\"])\n+    if app_name:\n+        print('Connected to application: \"%s\"' % app_name)\n\n     # get list of commands for readline completion\n     sock.send(\"/\".encode())\n",
    "prefixes": [
        "v2"
    ]
}