get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44015,
    "url": "http://patches.dpdk.org/api/patches/44015/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180830105422.1198-7-david.hunt@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": "<20180830105422.1198-7-david.hunt@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180830105422.1198-7-david.hunt@intel.com",
    "date": "2018-08-30T10:54:21",
    "name": "[v1,6/7] doc/vm_power_manager: add JSON interface API info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bbbe954a61924c6d26c06a7f94768d394b3716a2",
    "submitter": {
        "id": 342,
        "url": "http://patches.dpdk.org/api/people/342/?format=api",
        "name": "Hunt, David",
        "email": "david.hunt@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/20180830105422.1198-7-david.hunt@intel.com/mbox/",
    "series": [
        {
            "id": 1109,
            "url": "http://patches.dpdk.org/api/series/1109/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1109",
            "date": "2018-08-30T10:54:15",
            "name": "add json power policy interface for containers",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/1109/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44015/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44015/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7AC695592;\n\tThu, 30 Aug 2018 12:55:10 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby dpdk.org (Postfix) with ESMTP id 529034CAF\n\tfor <dev@dpdk.org>; Thu, 30 Aug 2018 12:55:03 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t30 Aug 2018 03:55:02 -0700",
            "from silpixa00399952.ir.intel.com (HELO\n\tsilpixa00399952.ger.corp.intel.com) ([10.237.223.64])\n\tby fmsmga004.fm.intel.com with ESMTP; 30 Aug 2018 03:55:02 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.53,306,1531810800\"; d=\"scan'208\";a=\"84641520\"",
        "From": "David Hunt <david.hunt@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "john.mcnamara@intel.com,\n\tdavid.hunt@intel.com",
        "Date": "Thu, 30 Aug 2018 11:54:21 +0100",
        "Message-Id": "<20180830105422.1198-7-david.hunt@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20180830105422.1198-1-david.hunt@intel.com>",
        "References": "<20180830105422.1198-1-david.hunt@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v1 6/7] doc/vm_power_manager: add JSON interface\n\tAPI info",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: David Hunt <david.hunt@intel.com>\n---\n .../sample_app_ug/vm_power_management.rst     | 195 ++++++++++++++++++\n 1 file changed, 195 insertions(+)",
    "diff": "diff --git a/doc/guides/sample_app_ug/vm_power_management.rst b/doc/guides/sample_app_ug/vm_power_management.rst\nindex 855570d6b..13a325eae 100644\n--- a/doc/guides/sample_app_ug/vm_power_management.rst\n+++ b/doc/guides/sample_app_ug/vm_power_management.rst\n@@ -337,6 +337,201 @@ monitoring of branch ratio on cores doing busy polling via PMDs.\n   and will need to be adjusted for different workloads.\n \n \n+\n+JSON API\n+~~~~~~~~\n+\n+In addition to the command line interface for host command and a virtio-serial\n+interface for VM power policies, there is also a JSON interface through which\n+power commands and policies can be sent. Sending a command or policy to the\n+power manager application is achieved by simply opening a fifo file, writing\n+a JSON string to that fifo, and closing the file.\n+\n+The fifo is at /tmp/powermonitor/fifo.0\n+\n+The jason string can be a policy or instruction, and takes the following\n+format:\n+\n+  .. code-block:: console\n+\n+    {\"packet_type\": {\n+      \"pair_1\": value,\n+      \"pair_2\": value\n+    }}\n+\n+The 'packet_type' header can contain one of two values, depending on\n+whether a policy or power command is being sent. The two possible values are\n+\"policy\" and \"instruction\", and the expected name-value pairs is different\n+depending on which type is being sent.\n+\n+The pairs are the format of standard JSON name-value pairs. The value type\n+varies between the different name/value pairs, and may be intgers, strings,\n+arrays, etc. Examples of policies follow later in this document. The allowed\n+names and value types are as follows:\n+\n+\n+:Pair Name: \"name\"\n+:Description: Name of the VM or Host. Allows the parser to associate the\n+  policy with the relevant VM or Host OS.\n+:Type: string\n+:Values: any valid string\n+:Required: yes\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"\"name\", \"ubuntu2\"\n+\n+\n+:Pair Name: \"command\"\n+:Description: The type of packet we're sending to the power manager. We can be\n+  creating or destroying a policy, or sending a direct command to adjust\n+  the frequency of a core, similar to the command line interface.\n+:Type: string\n+:Values:\n+\n+  :\"CREATE\": used when creating a new policy,\n+  :\"DESTROY\": used when removing a policy,\n+  :\"POWER\": used when sending an immediate command, max, min, etc.\n+:Required: yes\n+:Example:\n+\n+    .. code-block:: console\n+\n+      \"command\", \"CREATE\"\n+\n+\n+:Pair Name: \"policy_type\"\n+:Description: Type of policy to apply. Please see vm_power_manager documentation\n+  for more information on the types of policies that may be used.\n+:Type: string\n+:Values:\n+\n+  :\"TIME\": Time-of-day policy. Frequencies of the relevant cores are\n+    scaled up/down depending on busy and quiet hours.\n+  :\"TRAFFIC\": This policy takes statistics from the NIC and scales up\n+    and down accordingly.\n+  :\"WORKLOAD\": This policy looks at how heavily loaded the cores are,\n+    and scales up and down accordingly.\n+  :\"BRANCH_RATIO\": This out-of-band policy can look at the ratio between\n+    branch hits and misses on a core, and is useful for detecting\n+    how much packet processing a core is doing.\n+:Required: only for CREATE/DESTROY command\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"policy_type\", \"TIME\"\n+\n+:Pair Name: \"busy_hours\"\n+:Description: The hours of the day in which we scale up the cores for busy\n+  times.\n+:Type: array of integers\n+:Values: array with list of hour numbers, (0-23)\n+:Required: only for TIME policy\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"busy_hours\":[ 17, 18, 19, 20, 21, 22, 23 ]\n+\n+:Pair Name: \"quiet_hours\"\n+:Description: The hours of the day in which we scale down the cores for quiet\n+  times.\n+:Type: array of integers\n+:Values: array with list of hour numbers, (0-23)\n+:Required: only for TIME policy\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"quiet_hours\":[ 2, 3, 4, 5, 6 ]\n+\n+:Pair Name: \"core_list\"\n+:Description: The cores to which to apply the policy.\n+:Type: array of integers\n+:Values: array with list of virtual CPUs.\n+:Required: only policy CREATE/DESTROY\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"core_list\":[ 10, 11 ]\n+\n+:Pair Name: \"unit\"\n+:Description: the type of power operation to apply in the command\n+:Type: string\n+:Values:\n+\n+  :\"SCALE_MAX\": Scale frequency of this core to maximum\n+  :\"SCALE_MIN\": Scale frequency of this core to minimum\n+  :\"SCALE_UP\": Scale up frequency of this core\n+  :\"SCALE_DOWN\": Scale down frequency of this core\n+  :\"ENABLE_TURBO\": Enable Turbo Boost for this core\n+  :\"DISABLE_TURBO\": Disable Turbo Boost for this core\n+:Required: only for POWER instruction\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"unit\", \"SCALE_MAX\"\n+\n+:Pair Name: \"resource_id\"\n+:Description: The core to which to apply the power command.\n+:Type: integer\n+:Values: valid core id for VM or host OS.\n+:Required: only POWER instruction\n+:Example:\n+\n+  .. code-block:: console\n+\n+    \"resource_id\": 10\n+\n+JSON API Examples\n+~~~~~~~~~~~~~~~~~\n+\n+Profile create example:\n+\n+  .. code-block:: console\n+\n+    {\"policy\": {\n+      \"name\": \"ubuntu\",\n+      \"command\": \"create\",\n+      \"policy_type\": \"TIME\",\n+      \"busy_hours\":[ 17, 18, 19, 20, 21, 22, 23 ],\n+      \"quiet_hours\":[ 2, 3, 4, 5, 6 ],\n+      \"core_list\":[ 11 ]\n+    }}\n+\n+Profile destroy example:\n+\n+  .. code-block:: console\n+\n+    {\"profile\": {\n+      \"name\": \"ubuntu\",\n+      \"command\": \"destroy\",\n+    }}\n+\n+Power command example:\n+\n+  .. code-block:: console\n+\n+    {\"command\": {\n+      \"name\": \"ubuntu\",\n+      \"unit\": \"SCALE_MAX\",\n+      \"resource_id\": 10\n+    }}\n+\n+To send a JSON string to the Power Manager application, simply paste the\n+example JSON string into a text file and cat it into the fifo:\n+\n+  .. code-block:: console\n+\n+    cat file.json >/tmp/powermonitor/fifo.0\n+\n+The console of the Power Manager application should indicate the command that\n+was just received via the fifo.\n+\n Compiling and Running the Guest Applications\n --------------------------------------------\n \n",
    "prefixes": [
        "v1",
        "6/7"
    ]
}