Lattix Web REST API#

The Lattix Web REST API#

You can use the REST API to manage the Lattix Web users

REST API for user management#

You can use the curl command to send REST requests to Lattix Web. The main URL for user management is: http://localhost:8080/LattixWeb/rest/users

Add User#

This example will add a user. In this example the user data is stored in the file “users.json” shown below
curl -X POST -H "Content-Type: application/json" -d "@add_users.json" "http://localhost:8080/LattixWeb/rest/users?username=admin&password=admin"
file: add_users.json
{"users":[   {"username":"testname","fullname":"testname3","email":"testname@lattix.com","group":"Users","admin":false, "password":"password", "groups":["Coders"]} ]}

Update User#

curl -X PUT -H "Content-Type: application/json" -d "@update_users.json" "http://localhost:8080/LattixWeb/rest/users?username=admin&password=admin"

file: add_users.json
{"users":[   {"username":"testname","fullname":"new name", "password":"newpassword"} ]}

Delete User#

curl -X DELETE -H "Content-Type: application/json" -d "@update_users.json" "http://localhost:8080/LattixWeb/rest/users/testname?username=admin&password=admin"

REST commands for projects#

Here are a list of rest command that can be used to access Lattix Web. The responses are all in XML.

URL

Description

client/xml

List projects/snapshots

client/cmd/delete-track

Delete project

client/cmd/delete-snapshot

Delete snapshot

To specify a project you can use either “track” or “track_id”. See below for details.

Get list of all projects and snapshots#

curl -d "username=username&password=password" -X POST "http://localhost:8080/LattixWeb/client/xml

Sample output

<?xml version="1.0"?>
<repository version="5.5" ldm_version="12.2wip" license_valid="true">
  <project-track id="20151230125150" name="Ant Demo" modified="1451504852000">
    <property name="description"/>
    <property name="userid" value="00000000000000"/>
    <property name="creationdate" value="1451497910000"/>
    <property name="compound"/>
    <snap-shot id="20151230125326" project="20151230125150" name="20151230125326" description="Ant Demo" display_name="v1.9.6 - 12/30/15" date="1451498006000" filename=".lattixsnapshot" version="v1.9.6" modified="1453300908000">
      <property name="description" value="Ant Demo"/>
      <property name="version" value="v1.9.6"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="1449247102000"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1451498006457"/>
      <property name="snapshotdate"/>
      <property name="index" value="27"/>
    </snap-shot>
    <snap-shot id="20151230125322" project="20151230125150" name="20151230125322" description="Ant Demo" display_name="v1.9.5 - 12/30/15" date="1451498002000" filename=".lattixsnapshot" version="v1.9.5" modified="1453300908000">
      <property name="description" value="Ant Demo"/>
      <property name="version" value="v1.9.5"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="1449247024000"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1451498002623"/>
      <property name="snapshotdate"/>
      <property name="index" value="26"/>
    </snap-shot>
    <snap-shot id="20151230125318" project="20151230125150" name="20151230125318" description="Ant Demo" display_name="v1.9.4 - 12/30/15" date="1451497998000" filename=".lattixsnapshot" version="v1.9.4" modified="1453300908000">
      <property name="description" value="Ant Demo"/>
      <property name="version" value="v1.9.4"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="1449246969000"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1451497998907"/>
      <property name="snapshotdate"/>
      <property name="index" value="25"/>
    </snap-shot>
  </project-track>
  <project-track id="20160111110853" name="IsoAgLib Demo" modified="1453661068000">
    <property name="description"/>
    <property name="userid" value="00000000000000"/>
    <property name="creationdate" value="1452528533000"/>
    <property name="compound"/>
    <snap-shot id="20160111110945" project="20160111110853" name="20160111110945" description="IsoAgLib_Demo" display_name="v2.7.0 - 1/11/16" date="1452528585000" filename=".lattixsnapshot" version="v2.7.0" modified="1453300908000">
      <property name="description" value="IsoAgLib_Demo"/>
      <property name="version" value="v2.7.0"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="0"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1452528585261"/>
      <property name="snapshotdate"/>
      <property name="index" value="12"/>
    </snap-shot>
    <snap-shot id="20160111110941" project="20160111110853" name="20160111110941" description="IsoAgLib_Demo" display_name="v2.6.2-rc4 - 1/11/16" date="1452528581000" filename=".lattixsnapshot" version="v2.6.2-rc4" modified="1453300908000">
      <property name="description" value="IsoAgLib_Demo"/>
      <property name="version" value="v2.6.2-rc4"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="0"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1452528581079"/>
      <property name="snapshotdate"/>
      <property name="index" value="11"/>
    </snap-shot>
  </project-track>
</repository>

Get list of snapshots for specified project#

Parameter

Description

track

Name of track (cannot be used with track_id)

track_id

ID of track (cannot be used with track)

curl -d "track_id=20151230125150&username=username&password=password" -X POST "http://localhost:8080/LattixWeb/client/xml"

Sample output

<?xml version="1.0"?>
<repository version="5.5" ldm_version="12.2wip" license_valid="true">
  <project-track id="20151230125150" name="Ant Demo" modified="1451504852000">
    <property name="description"/>
    <property name="userid" value="00000000000000"/>
    <property name="creationdate" value="1451497910000"/>
    <property name="compound"/>
    <snap-shot id="20151230125326" project="20151230125150" name="20151230125326" description="Ant Demo" display_name="v1.9.6 - 12/30/15" date="1451498006000" filename=".lattixsnapshot" version="v1.9.6" modified="1453300908000">
      <property name="description" value="Ant Demo"/>
      <property name="version" value="v1.9.6"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="1449247102000"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1451498006457"/>
      <property name="snapshotdate"/>
      <property name="index" value="27"/>
    </snap-shot>
    <snap-shot id="20151230125322" project="20151230125150" name="20151230125322" description="Ant Demo" display_name="v1.9.5 - 12/30/15" date="1451498002000" filename=".lattixsnapshot" version="v1.9.5" modified="1453300908000">
      <property name="description" value="Ant Demo"/>
      <property name="version" value="v1.9.5"/>
      <property name="ldmversion" value="10.0"/>
      <property name="updatedate" value="1449247024000"/>
      <property name="userid" value="00000000000000"/>
      <property name="creationdate" value="1451498002623"/>
      <property name="snapshotdate"/>
      <property name="index" value="26"/>
    </snap-shot>
  </project-track>
</reposistory>

Delete project#

Parameter

Description

track

Name of track (cannot be used with track_id)

track_id

ID of track (cannot be used with track)

curl -d "track_id=20151230125150&username=username&password=password" -X POST "http://localhost:8080/LattixWeb/client/cmd/delete-track"

Delete snapshot#

Parameter

Description

track

Name of track (cannot be used with track_id)

track_id

ID of track (cannot be used with track)

snapshot

ID of snapshot

curl -d "track_id=20151230125150&snapshot=20151230125150&username=username&password=password" -X POST "http://localhost:8080/LattixWeb/client/cmd/delete-snapshot"