<?xml version="1.0" encoding="UTF-8"?> <chapter xml:id="api.protections" xmlns="http://docbook.org/ns/docbook" version="5.0" > <title> Protections: List and update the protections table </title> <para> These methods, that should operate with superuser credentials, allow you to update the protections 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.protections.v1_protections_GET"> <literal>GET /v1/protections</literal> </link> </para> </entry> <entry> <para>List protections </para> </entry> </row> <row> <entry> <para> <link linkend="api.protections.v1_protections_PUT"> <literal>PUT /v1/protections</literal> </link> </para> </entry> <entry> <para>Update protections</para> </entry> </row> </tbody> </tgroup> </informaltable> <section xml:id="api.protections.v1_protections_GET"> <title><literal>GET /v1/protections</literal></title> <para> List protections 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.protections.v1_protections_GET.response_data"> <title>Response Data</title> <para> Returns fields available from the <literal>p4 -ztag protects</literal> command. For more information, see the <ulink url="http://www.perforce.com/perforce/doc.current/manuals/cmdref/p4_protects.html"> <literal>p4 protects</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>Protections</entry> <entry>The protections entries of the system.</entry> <entry>array</entry> <entry>Yes</entry> </row> </tbody> </tgroup> </informaltable> </simplesect> <simplesect xml:id="api.protections.v1_protections_GET.example"> <title>Example</title> <para> List the protections available in a relatively simple server: </para> <programlisting> GET /v1/protections HTTP/1.1 Authorization: Basic c3VwZXI6NzcxMmJkMTAtOGQxMi00ZmUwLTgxM2MtZmM2OTExODQ3Yjdj</programlisting> <para> Here's a response with three entries: </para> <programlisting language="json"> HTTP/1.1 200 OK { "Protections": [ "read user * * //...", "write user * * //depot/projects/...", "super user super * //..." ] }</programlisting> </simplesect> </section> <section xml:id="api.protections.v1_protections_PUT"> <title><literal>PUT /v1/protections</literal></title> <para> Update protections 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.protections.v1_protections_PUT.parameters"> <title>Parameters</title> <para> The input parameters is basically the same resource as the repsonse data from the <link linkend="api.protections.v1_protections_GET.response_data"><literal>GET /v1/protections</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>Protections</entry> <entry>The protections entries of the system.</entry> <entry>array</entry> <entry>body</entry> <entry>Yes</entry> </row> </tbody> </tgroup> </informaltable> </simplesect> <simplesect xml:id="api.protections.v1_protections_PUT.example"> <title>Example</title> <para> Update the protections table with four entries: </para> <programlisting language="json"> PUT /v1/protections HTTP/1.1 Authorization: Basic c3VwZXI6NzcxMmJkMTAtOGQxMi00ZmUwLTgxM2MtZmM2OTExODQ3Yjdj Content-Type: application/json { "Protections": [ "read user * * //...", "write user * * //depot/projects/...", "write user * * //depot/services/...", "super user super * //..." ] }</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/protections.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. |