<?xml version="1.0" encoding="UTF-8"?> <chapter xml:id="api.triggers" xmlns="http://docbook.org/ns/docbook" version="5.0" > <title> Triggers: List and update the triggers table </title> <para> These methods, allow you to update the triggers table of the system. </para> <informaltable> <tgroup cols="2"> <colspec colname="topic" colwidth="*"/> <colspec colname="description" colwidth="*"/> <thead> <row> <entry> <para>Path</para> </entry> <entry> <para>Description</para> </entry> </row> </thead> <tbody> <row> <entry> <para> <link linkend="api.triggers.v1_triggers_GET"> <literal>GET /v1/triggers</literal> </link> </para> </entry> <entry> <para>List triggers </para> </entry> </row> <row> <entry> <para> <link linkend="api.triggers.v1_triggers_PUT"> <literal>PUT /v1/triggers</literal> </link> </para> </entry> <entry> <para>Update triggers</para> </entry> </row> </tbody> </tgroup> </informaltable> <section xml:id="api.triggers.v1_triggers_GET"> <title><literal>GET /v1/triggers</literal></title> <para> List triggers settings in the system. </para> <para> This method requires authentication. See <link linkend="clientprog.authentication">Perforce Web API Authentication</link> </para> <simplesect xml:id="api.triggers.v1_triggers_GET.response_data"> <title>Response Data</title> <para> The response returns an object with one key, <literal>Triggers</literal>, key maps to an array of triggers table entries. </para> <para> Returns fields available from the <literal>p4 -ztag triggers</literal> command. For more information, see the <ulink url="http://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_triggers.html"> <literal>p4 triggers</literal> command reference. </ulink>. </para> <informaltable> <tgroup cols="4"> <colspec colname="parameter" colwidth="*"/> <colspec colname="description" colwidth="4*"/> <colspec colname="type" colwidth="*"/> <colspec colname="required" colwidth="*"/> <thead> <row> <entry> <para>Parameter</para> </entry> <entry> <para>Description</para> </entry> <entry> <para>Type</para> </entry> <entry> <para>Required</para> </entry> </row> </thead> <tbody> <row> <entry>Triggers</entry> <entry>The triggers entries of the system.</entry> <entry>array</entry> <entry>Yes</entry> </row> </tbody> </tgroup> </informaltable> </simplesect> <simplesect xml:id="api.triggers.v1_triggers_GET.example"> <title>Example</title> <para> List the triggers available in a relatively simple server: </para> <programlisting> GET /v1/triggers HTTP/1.1 Authorization: Basic c3VwZXI6NzcxMmJkMTAtOGQxMi00ZmUwLTgxM2MtZmM2OTExODQ3Yjdj</programlisting> <para> Here's a response with one entry: </para> <programlisting language="json"> HTTP/1.1 200 OK { "Triggers": [ "cscheck change-submit //depot/... \"cmd %changelist%\"" ] }</programlisting> </simplesect> </section> <section xml:id="api.triggers.v1_triggers_PUT"> <title><literal>PUT /v1/triggers</literal></title> <para> Update triggers settings in the system. </para> <para> This method requires authentication. See <link linkend="clientprog.authentication">Perforce Web API Authentication</link> </para> <simplesect xml:id="api.triggers.v1_triggers_PUT.parameters"> <title>Parameters</title> <para> The input parameters is basically the same resource as the response data from the <link linkend="api.triggers.v1_triggers_GET.response_data"><literal>GET /v1/triggers</literal></link> command. </para> <informaltable> <tgroup cols="4"> <colspec colname="parameter" colwidth="*"/> <colspec colname="description" colwidth="4*"/> <colspec colname="type" colwidth="*"/> <colspec colname="paramtype" colwidth="*"/> <colspec colname="required" colwidth="*"/> <thead> <row> <entry> <para>Parameter</para> </entry> <entry> <para>Description</para> </entry> <entry> <para>Type</para> </entry> <entry> <para>Required</para> </entry> </row> </thead> <tbody> <row> <entry>Triggers</entry> <entry>The triggers entries of the system.</entry> <entry>array</entry> <entry>body</entry> <entry>Yes</entry> </row> </tbody> </tgroup> </informaltable> </simplesect> <simplesect xml:id="api.triggers.v1_triggers_PUT.example"> <title>Example</title> <para> Update the triggers table with two entries: </para> <programlisting language="json"> PUT /v1/triggers HTTP/1.1 Authorization: Basic c3VwZXI6NzcxMmJkMTAtOGQxMi00ZmUwLTgxM2MtZmM2OTExODQ3Yjdj Content-Type: application/json { "Triggers": [ "cscheck change-submit //depot/... \"cmd %changelist%\"", "no-oblits command pre-user-obliterate fail" ] }</programlisting> <para> The response should just indicate success or failure. </para> <programlisting> HTTP/1.1 200 OK</programlisting> </simplesect> </section> </chapter>
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 13972 | tjuricek |
Removing old microservice implementations. The system is now mostly a monolith. Eventually there will be a websocket service. |
||
#1 | 13458 | tjuricek |
Revising P4 Web API docbook documentation to become the Perforce Web Services guide. Right now this is just focused on the Qt SDK. The remaining protocol documentation, etc, will happen eventually. |
||
//guest/perforce_software/helix-web-services/main/p4_web_api/p4_web_api/docbook/xml/methods/triggers.xml | |||||
#1 | 13412 | tjuricek |
Initial version of the web-services mainline. This is a collection of several projects, that will likely often get released together, though many of them may not always be relevant. See the README for more information. |