WANdisco
 Navigation:  v1.4.2-LA Build 9b16f99c | Release Notes | Install | Upgrade | Administration | Reference | Gerrit | API | Glossary | Archive

API

SVN MultiSite Plus version 1.4 is Limited Availability - contact WANdisco support.

1. RESTful API


Access Control offers increased control and flexibility through the support of a RESTful (Representational State Transfer) API for accessing a set of resources through a fixed set of operations.

Prerequisites

Provided examples use Curl on the command line, but many other delivery mechanisms can achieve the same thing against a Restful API will.

Authentication

Provided examples show the use of admin:password credentials for clarity. Clearly you shouldn't use this approach for production. It can be beneficial to create a suitably permissioned user exclusively for API duties.

­

Online documentation

You can review a copy of the bundled API documenation. This documentation is taken straight from a live installation. Given that the documentation is automatically generated, it frequently links to local files and resources that will not be available here.

General Examples

Create a replication group

Replication Groups


This page details how to manage your replication groups using the available REST API. Read more about the replication-groups end point.

Authentication

Requires basic authentication to an administrator account.

Access point

protocol://node:port/api/replication-groups

  • protocol is either http (without SSL) or https (with SSL)
  • node is the IP address or hostname of the SVN MultiSite Plus node that will serve the request.
  • port is the port used for the REST API, which defaults to 8082.

GET

Retrieves a list of replication groups.

Parameters

  • withPendingTransactions
    • Default value: false
    • Set to true to include pending transactions in the response
    • Set to false to omit pending transactions in the response

Output

The HTML response code is included in the section headings describing the various types of output.

    200 - Success

    Success returns an XML-formatted document that describes each replication group. The XML document is a tree rooted at replicationgrouplist. Each replicationgroup has the following elements:

    • dsmId - The replication group's state machine ID
    • groupStarted - A boolean indicating whether the replication group's state machine is active
    • replicationGroupIdentity - The replication group's unique ID
    • pendingTransactions - If the withPendingTransactions parameter is true, this element will be included and will give a count of pending transactions for the replication group.
    • replicationGroupName - The replication group's common (display) name, as seen in the user interface
    • rotationSuspended - A boolean indicating whether schedule rotation is suspended in the replication group
    • scheduleManagingNodeId - The unique ID of the node that manages the replication group's schedule

    Each replication group has one or more repositoryIds elements, the body of which lists the unique ID of a repository in the replication group.

    Each replication group has a list of replicationGroupNodes, each of which has the following elements.

    • managingNode - A boolean that indicates if this node is the replication group's managing node
    • role - The node's role in the replication group.

    Under the node tree, each node also has the following information.

    • nodeIdentity - The node's unique ID
    • locationIdentity - The node's unique location ID
    • isLocal - A boolean indicating whether the node is local to the node that is serving the request
    • isUp - A boolean indicating whether the replicator on the node is running
    • isStopped - A boolean indicating whether the replicator on the node is not handling requests
    • lastStatusChange - A UNIX epoch timestamp indicating when the node's status last changed

    Each node also has a list of attributes. Each attribute has a key and a value. Common and useful attributes include:

    • eco.system.membership - The unique ID of the node's ecosystem membership
    • eco.system.dsm.identity - The unique ID of the node's ecosystem state machine
    • node.name - The common (display) name for the node, as seen in the user interface

    The replication group element also includes a schedule block that describes the replication group's schedule. For each unique phase of the schedule, this block will contain:

    • dayOfWeek The day that this schedule phase becomes active.
    • hourOfDay The hour of the day (0-23) that this schedule phase becomes active.
    • membershipId The unique ID of the scheduled phase's membership
    • quorum A boolean indicating whether the schedule will adjust quorum
    • scheduled A boolean indicating whether the phase is actively scheduled
    • A list of scheduledNodes, each of which contains:
      • managingNode A boolean indicating whether the node is the managing node during this phase of the schedule
      • A node element, containing information similar to that returned in nodes

    400 - Processing error

    The request was invalid or the node could not process it successfully. The output will contain an error message with more details.

    401 - Invalid authentication

    Invalid authentication returns a brief XML document that embeds an HTML-formatted error message.

Usage examples

In the following examples we use:

  • admin as an administrator account name
  • pass as the credential for the admin account
  • http://192.168.56.190 as the IP address of the SVN MultiSite Plus node
  • 8082 as the REST port

Default

curl -u admin:pass http://192.168.56.190:8082/api/replication-groups

Returns a list of replication groups.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<replicationgrouplist>
  <replicationgroup>
    <dsmId>3f049150-0658-11e4-9d99-080027b651cd</dsmId>
    <groupStarted>true</groupStarted>
    <nodes>
      <replicationGroupNodes>
        <managingNode>false</managingNode>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
          <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397169893</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56191</value>
            </attribute>
          </attributes>
        </node>
        <role>AV</role>
      </replicationGroupNodes>
      <replicationGroupNodes>
        <managingNode>false</managingNode>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
          <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397207914</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56192</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
        <role>AV</role>
      </replicationGroupNodes>
      <replicationGroupNodes>
        <managingNode>true</managingNode>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
          <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
          <isLocal>true</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1404787853739</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56190</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
        <role>AV</role>
      </replicationGroupNodes>
    </nodes>
    <replicationGroupIdentity>3f04df72-0658-11e4-9d99-080027b651cd</replicationGroupIdentity>
    <replicationGroupName>3 Nodes Group</replicationGroupName>
    <repositoryIds>5dc5a543-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5d75b075-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5d0c674f-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5ddcd6cb-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5e006466-0658-11e4-9d99-080027b651cd</repositoryIds>
    <rotationSuspended>false</rotationSuspended>
    <schedule>
      <scheduledNodeLists>
        <dayOfWeek>7</dayOfWeek>
        <hourOfDay>0</hourOfDay>
        <membershipId>3f04b861-0658-11e4-9d99-080027b651cd</membershipId>
        <quorum>true</quorum>
        <scheduled>true</scheduled>
        <scheduledNodes>
          <managingNode>false</managingNode>
          <node>
            <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
            <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
            <isLocal>false</isLocal>
            <isUp>true</isUp>
            <isStopped>false</isStopped>
            <lastStatusChange>1411397169893</lastStatusChange>
            <attributes>
              <attribute>
                <key>eco.system.membership</key>
                <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
              </attribute>
              <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
              </attribute>
              <attribute>
                <key>node.name</key>
                <value>node56191</value>
              </attribute>
            </attributes>
          </node>
          <role>AV</role>
        </scheduledNodes>
        <scheduledNodes>
          <managingNode>false</managingNode>
          <node>
            <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
            <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
            <isLocal>false</isLocal>
            <isUp>true</isUp>
            <isStopped>false</isStopped>
            <lastStatusChange>1411397207914</lastStatusChange>
            <attributes>
              <attribute>
                <key>eco.system.membership</key>
                <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
              </attribute>
              <attribute>
                <key>node.name</key>
                <value>node56192</value>
              </attribute>
              <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
              </attribute>
            </attributes>
          </node>
          <role>AV</role>
        </scheduledNodes>
        <scheduledNodes>
          <managingNode>true</managingNode>
          <node>
            <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
            <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
            <isLocal>true</isLocal>
            <isUp>true</isUp>
            <isStopped>false</isStopped>
            <lastStatusChange>1404787853739</lastStatusChange>
            <attributes>
              <attribute>
                <key>eco.system.membership</key>
                <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
              </attribute>
              <attribute>
                <key>node.name</key>
                <value>node56190</value>
              </attribute>
              <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
              </attribute>
            </attributes>
          </node>
          <role>AVT</role>
        </scheduledNodes>
      </scheduledNodeLists>
    </schedule>
    <scheduleManagingNodeId>abb21772-5544-43e2-9cb9-ff1node56190</scheduleManagingNodeId>
  </replicationgroup>
</replicationgrouplist>

Include pending transactions in output

curl -u admin:pass http://192.168.56.190:8082/api/replication-groups?withPendingTransactions=true

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<replicationgrouplist>
  <replicationgroup>
    <dsmId>3f049150-0658-11e4-9d99-080027b651cd</dsmId>
    <groupStarted>true</groupStarted>
    <nodes>
      <replicationGroupNodes>
        <managingNode>false</managingNode>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
          <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397169893</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56191</value>
            </attribute>
          </attributes>
        </node>
        <role>AV</role>
      </replicationGroupNodes>
      <replicationGroupNodes>
        <managingNode>false</managingNode>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
          <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397207914</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56192</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
        <role>AV</role>
      </replicationGroupNodes>
      <replicationGroupNodes>
        <managingNode>true</managingNode>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
          <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
          <isLocal>true</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1404787853739</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56190</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
        <role>AV</role>
      </replicationGroupNodes>
    </nodes>
    <pendingTransactions>0</pendingTransactions>
    <replicationGroupIdentity>3f04df72-0658-11e4-9d99-080027b651cd</replicationGroupIdentity>
    <replicationGroupName>3 Nodes Group</replicationGroupName>
    <repositoryIds>5dc5a543-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5d75b075-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5d0c674f-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5ddcd6cb-0658-11e4-9d99-080027b651cd</repositoryIds>
    <repositoryIds>5e006466-0658-11e4-9d99-080027b651cd</repositoryIds>
    <rotationSuspended>false</rotationSuspended>
    <schedule>
      <scheduledNodeLists>
        <dayOfWeek>7</dayOfWeek>
        <hourOfDay>0</hourOfDay>
        <membershipId>3f04b861-0658-11e4-9d99-080027b651cd</membershipId>
        <quorum>true</quorum>
        <scheduled>true</scheduled>
        <scheduledNodes>
          <managingNode>false</managingNode>
          <node>
            <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
            <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
            <isLocal>false</isLocal>
            <isUp>true</isUp>
            <isStopped>false</isStopped>
            <lastStatusChange>1411397169893</lastStatusChange>
            <attributes>
              <attribute>
                <key>eco.system.membership</key>
                <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
              </attribute>
              <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
              </attribute>
              <attribute>
                <key>node.name</key>
                <value>node56191</value>
              </attribute>
            </attributes>
          </node>
          <role>AV</role>
        </scheduledNodes>
        <scheduledNodes>
          <managingNode>false</managingNode>
          <node>
            <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
            <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
            <isLocal>false</isLocal>
            <isUp>true</isUp>
            <isStopped>false</isStopped>
            <lastStatusChange>1411397207914</lastStatusChange>
            <attributes>
              <attribute>
                <key>eco.system.membership</key>
                <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
              </attribute>
              <attribute>
                <key>node.name</key>
                <value>node56192</value>
              </attribute>
              <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
              </attribute>
            </attributes>
          </node>
          <role>AV</role>
        </scheduledNodes>
        <scheduledNodes>
          <managingNode>true</managingNode>
          <node>
            <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
            <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
            <isLocal>true</isLocal>
            <isUp>true</isUp>
            <isStopped>false</isStopped>
            <lastStatusChange>1404787853739</lastStatusChange>
            <attributes>
              <attribute>
                <key>eco.system.membership</key>
                <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
              </attribute>
              <attribute>
                <key>node.name</key>
                <value>node56190</value>
              </attribute>
              <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
              </attribute>
            </attributes>
          </node>
          <role>AVT</role>
        </scheduledNodes>
      </scheduledNodeLists>
    </schedule>
    <scheduleManagingNodeId>abb21772-5544-43e2-9cb9-ff1node56190</scheduleManagingNodeId>
  </replicationgroup>
</replicationgrouplist>

Invalid authentication

curl -u admin:wrongpass http://192.168.56.190:8082/api/replication-groups

<?xml version="1.0"?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 No client with requested id: admin</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /api/replication-groups. Reason:
<pre>    No client with requested id: admin</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>

POST

Create a new replication group.

Request body

An XML document that describes the new replication group. The root element is replicationGroup and it contains the following elements.

  • replicationGroupName The common (display) name for the new replication group
  • replicationGroupIdentity An empty element
  • schedule A block listing the desired schedule, including the nodes that will constitute the replication group. See the GET description for how to construct this block. Note:
    • The new replication group must satisfy the normal rules of quorum during all phases of the schedule.
    • One node must function as the managing node.

Output

The HTML response code is included in the section headings describing the various types of output.

202 - Success

Success returns the 202 response code with no further information.

400 - Processing error

The request was invalid or the node could not process it successfully. The output will contain an error message with more details.

401 - Invalid authentication

Invalid authentication returns a brief XML document that embeds an HTML-formatted error message.

Usage examples

In the following examples we use:

  • admin as an administrator account name
  • pass as the credential for the admin account
  • http://192.168.56.190 as the IP address of the SVN MultiSite Plus node
  • 8082 as the REST port
  • A set of example node identities and location identities. These can be gleaned from the nodes end point.

Creating a new group

Using this data as the response body:

<?xml version="1.0"?>
<replicationGroup>
  <replicationGroupName>All Nodes Group</replicationGroupName>
  <schedule>
    <scheduledNodeLists>
      <dayOfWeek>7</dayOfWeek>
      <scheduledNodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
          <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
        </node>
        <role>AVT</role>
        <managingNode>true</managingNode>
      </scheduledNodes>
      <scheduledNodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
          <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
        </node>
        <role>AV</role>
        <managingNode>false</managingNode>
      </scheduledNodes>
      <scheduledNodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
          <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
        </node>
        <role>AV</role>
        <managingNode>false</managingNode>
      </scheduledNodes>
    </scheduledNodeLists>
  </schedule>
  <replicationGroupIdentity/>
</replicationGroup>

curl -u admin:pass -X POST -d "<replicationGroup><replicationGroupName>All Nodes Group</replicationGroupName><schedule><scheduledNodeLists><dayOfWeek>7</dayOfWeek><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity><locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity></node><role>AVT</role><managingNode>true</managingNode></scheduledNodes><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity><locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity></node><role>AV</role><managingNode>false</managingNode></scheduledNodes><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity><locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity></node><role>AV</role><managingNode>false</managingNode></scheduledNodes></scheduledNodeLists></schedule><replicationGroupIdentity></replicationGroupIdentity></replicationGroup>" --header 'Content-Type: application/xml' http://192.168.56.191:8082/api/replication-groups

Aside from the 202 response code there is no further output.

Invalid request

Using this response body:

<?xml version="1.0"?>
<replicationGroup>
  <replicationGroupName>All Nodes Group</replicationGroupName>
  <schedule>
    <scheduledNodeLists>
      <dayOfWeek>7</dayOfWeek>
      <scheduledNodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
          <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
        </node>
        <role>AV</role>
        <managingNode>false</managingNode>
      </scheduledNodes>
      <scheduledNodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
          <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
        </node>
        <role>AV</role>
        <managingNode>false</managingNode>
      </scheduledNodes>
    </scheduledNodeLists>
  </schedule>
  <replicationGroupIdentity/>
</replicationGroup>

curl -u admin:pass -X POST -d "<replicationGroup><replicationGroupName>All Nodes Group</replicationGroupName><schedule><scheduledNodeLists><dayOfWeek>7</dayOfWeek><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity><locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity></node><role>AV</role><managingNode>false</managingNode></scheduledNodes><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity><locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity></node><role>AV</role><managingNode>false</managingNode></scheduledNodes></scheduledNodeLists></schedule><replicationGroupIdentity></replicationGroupIdentity></replicationGroup>" --header 'Content-Type: application/xml' http://192.168.56.191:8082/api/replication-groups

This request is invalid as it includes two nodes with no tie-breaker, violating quorum requirements. The output is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<exception>
  <class>com.wandisco.nodes.groups.exceptions.UnsupportedMembershipException</class>
  <message>Memberships with an even number of acceptors should have a DN defined</message>
  <stack-trace>com.wandisco.nodes.groups.exceptions.UnsupportedMembershipException: Memberships with an even number of acceptors should have a DN defined
        at com.wandisco.application.tasks.membership.MembershipUtils.checkRoles(MembershipUtils.java:386)
        at com.wandisco.application.tasks.membership.MembershipUtils.checkRoles(MembershipUtils.java:343)
        at com.wandisco.application.dao.ReplicationGroupDAO.checkMemberships(ReplicationGroupDAO.java:426)
        at com.wandisco.application.dao.ReplicationGroupDAO.createReplicationGroup(ReplicationGroupDAO.java:302)
        at com.wandisco.application.rest.resources.ReplicationGroupResource.createReplicationGroup(ReplicationGroupResource.java:121)
        at com.wandiscoapi.fsfs.api.resources.ReplicationGroupsResource.createReplicationGroup(ReplicationGroupsResource.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:643)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:131)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1302)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:448)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1067)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:377)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1001)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
        at org.eclipse.jetty.server.Server.handle(Server.java:360)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:622)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538)
        at java.lang.Thread.run(Thread.java:722)
</stack-trace>
</exception>

Invalid authentication

`curl -u admin:wrongpass -X POST -d "<replicationGroup><replicationGroupName>All Nodes Group</replicationGroupName><schedule><scheduledNodeLists><dayOfWeek>7</dayOfWeek><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity><locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity></node><role>AV</role><managingNode>false</managingNode></scheduledNodes><scheduledNodes><node><nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity><locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity></node><role>AV</role><managingNode>false</managingNode></scheduledNodes></scheduledNodeLists></schedule><replicationGroupIdentity></replicationGroupIdentity></replicationGroup>" --header 'Content-Type: application/xml' http://192.168.56.191:8082/api/replication-groups`

<?xml version="1.0"?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 No client with requested id: admin</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /api/replication-groups. Reason:
<pre>    No client with requested id: admin</pre></p>
<hr/><i><small>Powered by Jetty://</small></i>
</body>
</html>

Nodes Endpoint

This page details how to manage your Nodes using the available REST API. Read more about the Nodes end point.

  • Authentication
  • Access point
  • Authentication

    Requires basic authentication to an administrator account.

    Access point

    protocol://node:port/api/nodes

    • protocol is either http (without SSL) or https (with SSL)
    • node is the IP address or hostname of the SVN MultiSite Plus node that will serve the request.
    • port is the port used for the REST API, which defaults to 8082.

    GET

    Parameters

    • withRemoved
      • Default value: false
      • Set to true to include removed nodes in the response
      • Set to false to omit removed nodes in the response

      Output

      The HTML response code is included in the section headings describing the various types of output.

      200 - Success

      Success returns an XML-formatted document that describes each node. The XML document is a tree of nodes. Each node has the following elements:

      • nodeIdentity - The node's unique ID
      • locationIdentity - The node's unique location ID
      • isLocal - A boolean indicating whether the node is local to the node that is serving the request
      • isUp - A boolean indicating whether the replicator on the node is running
      • isStopped - A boolean indicating whether the replicator on the node is not handling requests
      • lastStatusChange - A UNIX epoch timestamp indicating when the node's status last changed

      Each node also has a list of attributes. Each attribute has a key and a value. Common and useful attributes include:

      • eco.system.membership - The unique ID of the node's ecosystem membership
      • eco.system.dsm.identity - The unique ID of the node's ecosystem state machine
      • node.name - The common (display) name for the node, as seen in the user interface

      401 - Invalid authentication

      Invalid authentication returns a brief XML document that embeds an HTML-formatted error message.

      Usage examples

      In the following examples we use:

      • admin as an administrator account name
      • pass as the credential for the admin account
      • http://192.168.56.190 as the IP address of the SVN MultiSite Plus node
      • 8082 as the REST port

      Default

      curl -u admin:pass http://192.168.56.190:8082/api/nodes

      Returns a list of non-removed nodes.

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <nodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
          <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397169893</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56191</value>
            </attribute>
          </attributes>
        </node>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
          <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397207914</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56192</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
          <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
          <isLocal>true</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1404787853739</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56190</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
      </nodes>
      

      Include removed nodes in output

      curl -u admin:pass http://192.168.56.190:8082/api/nodes?withRemoved=true

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <nodes>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56191</nodeIdentity>
          <locationIdentity>3027fc8f-064e-11e4-b8d2-080027ec317a</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>false</isUp>
          <isStopped>true</isStopped>
          <lastStatusChange>1411397169893</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56191</value>
            </attribute>
          </attributes>
        </node>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56192</nodeIdentity>
          <locationIdentity>9ae09faf-0650-11e4-a747-0800279336f8</locationIdentity>
          <isLocal>false</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1411397207914</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56192</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
        <node>
          <nodeIdentity>abb21772-5544-43e2-9cb9-ff1node56190</nodeIdentity>
          <locationIdentity>d29772a0-0648-11e4-aaa1-080027b651cd</locationIdentity>
          <isLocal>true</isLocal>
          <isUp>true</isUp>
          <isStopped>false</isStopped>
          <lastStatusChange>1404787853739</lastStatusChange>
          <attributes>
            <attribute>
              <key>eco.system.membership</key>
              <value>ECO-MEMBERSHIP-190823c6-0658-11e4-a747-0800279336f8</value>
            </attribute>
            <attribute>
              <key>node.name</key>
              <value>node56190</value>
            </attribute>
            <attribute>
              <key>eco.system.dsm.identity</key>
              <value>ECO-DSM-d33204f1-0648-11e4-aaa1-080027b651cd</value>
            </attribute>
          </attributes>
        </node>
      </nodes>
      

      Invalid authentication

      curl -u admin:wrongpass http://192.168.56.190:8082/api/nodes

      <?xml version="1.0"?>
      <html>
        <head>
          <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
          <title>Error 401 No client with requested id: admin</title>
        </head>
        <body>
          <h2>HTTP ERROR: 401</h2>
          <p>Problem accessing /api/nodes. Reason:
      <pre>    No client with requested id: admin</pre></p>
          <hr/>
          <i>
            <small>Powered by Jetty://</small>
          </i>
        </body>
      </html>
      

      Node Induction


      Perform a node induction

      To induct two or more nodes via API the following information need to be included in the XML payload that will be passed to the cURL command:

      INDUCTION_XML

      <inductionTicket>
        <inductorLocationId>${LOCATION_ID}</inductorLocationId>
        <inductorNodeId>${NODE_ID}</inductorNodeId>
        <inductorHostName>${INDUCTOR_HOST}</inductorHostName>
        <inductorPort>${INDUCTOR_DCONE}</inductorPort>
      </inductionTicket>    
      
        ${LOCATION_ID}
        The Location ID of the first node from which we are inducting. You can capture the Location ID from the REST API's Nodes page. e.g.
        http://10.0.2.0:8082/api/nodes
        This returns the following information:
        <nodes>
            <node>
                <nodeIdentity>156d2cd8-0929-4333-a84e-350e6be44e4b</nodeIdentity>
                <locationIdentity>7b212e2f-486b-11e4-90b8-22564bb81bc7</locationIdentity>
                <isLocal>true</isLocal>
                <isUp>true</isUp>
                <isStopped>false</isStopped>
                <lastStatusChange>1412058720321</lastStatusChange>
                <attributes>
                <attribute>
                <key>eco.system.membership</key>
                <value>
                ECO-MEMBERSHIP-df34fdfc-486b-11e4-adb1-aa7004f22f33
                </value>
                </attribute>
                <attribute>
                <key>node.name</key>
                <value>node1</value>
                </attribute>
                <attribute>
                <key>eco.system.dsm.identity</key>
                <value>ECO-DSM-7b86a6c0-486b-11e4-90b8-22564bb81bc7</value>
                </attribute>
                </attributes>
            </node>
        ...
        </nodes>
        
        You can also find the LocationID on the Settings screen of the admin UI.
        ${NODE_ID}
        The Node ID of the first node from we are inducting. This can also be found on the API's /api/nodes screen (see above). It's also available on the Settings screen of the admin UI.
        ${INDUCTOR_HOST}
        The IP/hostname of the first node from which we are inducting.
        ${INDUCTOR_DCONE}
        The DConE port: this is chosen during installation and needs to be the same across all nodes. Default value is 6444.

      Each node (apart from the first node from which we are inducting) will need the above XML.

      Induction

      The cURL command will look as follow (change to https for SSL API):

      curl -u <username>:<password> -X PUT -d "${ABOVE_XML}" --header 'Content-Type: application/xml' http://<nodeIP>:<apiPort>/api/node/${NODE_ID_TO_BE_INDUCTED}
      ${NODE_ID_TO_BE_INDUCTED}
      The Node ID of the node to which we are inducting.

      An example of inducting Node2 (999aacc5-af77-43e7-a8de-9a921aimz3k4) from Node1 (999aacc5-af77-43e7-a8de-9a921apg0sby) would be:

       curl -u admin:pass -X PUT -d '<inductionTicket><inductorLocationId>57b331ba-38f2-11e4-8958-3a2a7398d235</inductorLocationId><inductorNodeId>999aacc5-af77-43e7-a8de-9a921apg0sby</inductorNodeId><inductorHostName>172.16.2.50</inductorHostName><inductorPort>6444</inductorPort></inductionTicket>' --header 'Content-Type: application/xml' http://10.0.2.0:8082/api/node/999aacc5-af77-43e7-a8de-9a921aimz3k4   
      

      Note that the NODE_ID in the XML (the first Node we're inducting from) is different from the NODE_ID of the URL (the Node we're inducting to).

      This cURL command is repeated with the same XML and different NODE_ID in the URL for each node that needs to be inducted. Please note to leave enough time to complete an induction before attempting another induction, otherwise the second induction will be aborted.

      Timing
      Leave enough time to complete induction before attempting another induction. This approach is vulnerable to any possible delays that may occur during an induction. You can take a cautious approach leaving minutes between inductions just to make sure there was no issue.

      Remove a node

      This page describes how to remove a node from your SVN MultiSite replication group. Remove a node gives more details.

      Use the following XML for the cURL command:

      <nodes>
        <node>
          <nodeIdentity>${NODE_ID}</nodeIdentity>
          <locationIdentity>${LOCATION_ID}</locationIdentity>
        </node>
      </nodes>
      
      ${NODE_ID}
      The node ID of the first node that you want to remove from the ecosystem. This is on the Settings screen and looks like "999aacc5-af77-43e7-a8de-9a921a45thuc". It is also in the /api/nodes page.
      ${LOCATION_ID}
      The location ID of the first node that you want to remove from the ecosystem. This is on the Settings screen and looks like "0488a9be-38ec-11e4-aa49-3a2a7398d235". It is also in the /api/nodes page.

      The cURL command looks like this:

      curl -u  <username>: <password> -X PUT -d "${ABOVE_XML}" --header 'Content-Type: application/xml' http://<nodeIP>:<apiPort>/api/node/${LOCAL_NODE_ID}/removenodes    
      

      For SSL API change http to https.

      {LOCAL_NODE_ID}
      The node ID of the node that will remain part of the ecosystem. This is on the Settings screen. It is also in the /api/nodes page.

      A working example would be:

      curl -u admin:pass -X PUT -d "<nodes><node><nodeIdentity>999aacc5-af77-43e7-a8de-9a921aimz3k4</nodeIdentity><locationIdentity>483fcf8d-38f2-11e4-be09-4a9206cdc4f9</locationIdentity></node></nodes>" --header 'Content-Type: application/xml' http://172.16.2.50:8082/api/node/999aacc5-af77-43e7-a8de-9a921apg0sby/removenodes   
      

      If the call is successful the removed node is displayed in the Nodes page as REMOVED when you click Display Removed Nodes.

      Add an existing repository

      Here is an example procedure for adding a repository that is already present on your node under the control of SVN MultiSite Plus:

        curl -u admin:pass -X POST -d "<svn-repository><name>
      $REPO-NAME</name><fileSystemPath>$REPO-LOCATION</fileSystemPath><globalReadOnly>false</globalReadOnly><localReadOnly>false</localReadOnly></svn-repository>" -H "Content-Type:application/xml" http://nodeIP:8082/api/repository?replicationGroupId=<rgId>

      In the XML part obviously replace $REPO-NAME with the repository's name and $REPO-LOCATION with the repository's location (i.e. Repo1, /opt/Subversion/Repo1). Ensure that you use the appropriate credentials and replication group Id.

      XML passed by -d can always be written into a file such as repoXML.xml and then the call becomes:

      curl -u admin:pass -X POST -d "@repoXML.xml" -H "Content-Type:application/xml" http://nodeIP:8082/api/repository?replicationGroupId=<rgId>
      
      as preferred.

      Invoke a consistency check

      Example of a rest call to trigger a consistency check.

      To perform a consistency check on a repository the repository ID need to be used in a cURL or equivalent command. The repository ID can be found by getting a list of the present repositories known to the target node/api/repositories page and will look something like "a6e0c5a3-47a2-11e4-8fe4-22564bb81bc".

      root@redhat6 svn-multisite-plus]# curl -u admin:pass http://172.16.0.254:8082/api/repositories

      Output

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <svn-repositories>
      <repository>
      <dsmId>a6e643e4-47a2-11e4-8fe4-22564bb81bc7</dsmId>
      <fileSystemPath>/opt/Subversion/Repo0
      </fileSystemPath>
      <globalReadOnly>false
      </globalReadOnly>
      <latestRevision>
      <revisionNum>0
      </revisionNum>
      <size>26318
      </size>
      <timestamp>1375431011000
      </timestamp>
      </latestRevision>
      <localReadOnly>false
      </localReadOnly><name>Repo0</name>
      <readOnlyReason></readOnlyReason>
      <replicationGroupId>9a663117-47a2-11e4-8fe4-22564bb81bc7</replicationGroupId>
      <repositoryIdentity>a6e0c5a3-47a2-11e4-8fe4-22564bb81bc7</repositoryIdentity>
      <state xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="deployedStateDTO"/>
      </repository>
      
      <repository>
      <dsmId>ad6a5b3b-47a2-11e4-8fe4-22564bb81bc7</dsmId>
      <fileSystemPath>/opt/Subversion/Repo1</fileSystemPath>...
      

      The cURL command will look like (change to https for SSL API):

      curl -u <username>:<password> -X POST http://<nodeIP>:<apiPort>/api/repository/${REPOSITORY_ID}/consistencyCheck

      It is possible to specify the number of revisions to be checked (a value of -1 will check all revisions). This parameter will need to be appended at the end of the URL as follow:

      curl -u <username>:<password> -X POST http://<nodeIP>:<apiPort>/api/repository/${REPOSITORY_ID}/consistencyCheck?numberOfRevisions=10

      A working example would be:

      curl -u admin:pass -X POST http://10.0.0.50:8082/api/repository/a6e0c5a3-47a2-11e4-8fe4-22564bb81bc7/consistencyCheck?numberOfRevisions=3

      License Endpoint


      Perform a license status check

      To get the license status via API the following URL command needs to be used:

        curl -u <username>:<password> http://<nodeIP>:<apiPort>/api/license
        

        Example

        curl -u api:password http://172.16.2.24:8082/api/license

        Output

        An example of the XML returned by the curl:

        <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
          <license>
            <allowedIps></allowedIps>
            <companyName>The API Example Company</companyName>
            <rawproperties><licenseproperty>
            <key>lm-version</key>
            <value>bc15-direct</value>
          </licenseproperty>
          <licenseproperty>
            <key>fd-licver</key>
            <value>3614</value>
          </licenseproperty>
          <licenseproperty>
            <key>expiration</key>
            <value>10/19/2015</value>
          </licenseproperty>
          <licenseproperty>
            <key>eval-license</key>
            <value>true</value>
          </licenseproperty>
          <licenseproperty>
            <key>enterprise-cvs</key>
            <value>true</value>
          </licenseproperty>
          <licenseproperty>
            <key>nusers</key>
            <value>99</value>
          </licenseproperty>
          <licenseproperty>
            <key>ip</key>
            <value>xx.xx.xx.xx</value>
          </licenseproperty>
          <licenseproperty>
            <key>product</key>
            <value>svnplus</value>
          </licenseproperty>
          <licenseproperty>
            <key>maint_start</key>
            <value>1411038806</value>
          </licenseproperty>
          <licenseproperty>
            <key>company</key>
            <value>Name entered into the license</value>
          </licenseproperty>
          <licenseproperty>
            <key>maint_end</key>
            <value>1445253206</value>
          </licenseproperty>
          <licenseproperty>
            <key>scm</key>
            <value>svn</value>
          </licenseproperty>
          </rawproperties>
          <currentUsers>0</currentUsers>
          <expiry>1445209200000</expiry>
          <licenseType>Evaluation License</licenseType>
          <maxUsers>99</maxUsers>
          <numberOfNodes>0</numberOfNodes>
          </license>
         

      Read more about REST API calls for LicenseResources

      Pending Transactions


      List all pending transactions

      To get pending transactions at a node via API the Node ID is required for the cURL command. The node ID can be found on the Settings screen and will look something like "999aacc5-af77-43e7-a8de-9a921a45thuc". Can also be found in the /api/nodes page.

      The cURL command will look like (change to https for SSL API):

        curl -u <username>:<password> http://<nodeIP>:<apiPort>/api/node/${NODE_ID}/pendingTransactions

        This will return the number of pending transactions for the specified node.

        A working example would be:

        Example

        curl -u admin:pass http://10.0.2.50:8082/api/node/999aacc5-af77-43e7-a8de-9a921afg6lei/pendingTransactions

        Output

         3[root@redhat6 svn-multisite-plus]#
        

        The number of pending transactions are returned.