cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Announcing: ThingWorx Solution Central 3.1.0 and its New API

ttielebein
12-Amethyst

Announcing: ThingWorx Solution Central 3.1.0 and its New API

edc_technical_brief_banner.png

Announcing: ThingWorx Solution Central 3.1.0 and its New API

Written by: Tori Firewind of the IoT EDC

 

Solution Central 3.1.0

ttielebein_0-1647885239673.png

ThingWorx Solution Central (SC) is the solution management tool for ThingWorx and Digital Performance Management (DPM), the latest version of which (DPM 1.1) can now be deployed directly from the PTC Solutions menu of SC. Streamlining packaging strategies and ensuring efficient solution deployment can now be done for all kinds of ThingWorx solutions, even those with heavy customization. The new API allows for updated building blocks from within the PTC Solutions menu to be easily discovered and deployed right alongside custom solutions. Even the most advanced developers can now house their deployment management process within SC.

 

As discussed in a previous article, Solution Central forms a necessary part of a mature DevOps pipeline, usually as a set of services within Foundation which finalize and publish the solution to the Solution Central servers. The recommendation to utilize Solution Central from within Foundation remains a best practice for ThingWorx DevOps because the vast majority of solutions benefit from using the ThingWorx APIs, which scan and check for dependencies and proper XML formatting on each included entity.

 

Picture2.png

Packaging and publishing the solution from within ThingWorx is the easiest and most straightforward way recommended by PTC, but it is now possible to publish to Solution Central using a standard API for those who need to publish from Jenkins or other build jobs. If there are legacy extensions, 3rd party tool dependencies, or other customizations within the ThingWorx application, then it may be beneficial to use this new API instead.

 

The new API also allows for editable extensions and entities within a published solution, though PTC still recommends avoiding this as a general practice. It is usually better for purposes of maintainability and ease of upgrades to just publish the solution again (with an incremented) version each time any changes are made.

 

How to Use the API

ttielebein_2-1647885239682.png

Within Solution Central, a new menu option has been added to review the API, with information about the different types of requests and their parameters and responses. To access this within the Solution Central UI, open the help menu and navigate to “Public APIs” (see the image on the right). To see a sample response, select a request type and scroll down to the “Responses” section (shown below). Examples of error responses are also provided, and it’s important to ensure that whatever makes these requests can properly report or log any errors for troubleshooting and maintenance of the DevOps process.

ttielebein_3-1647885239699.png

 

ttielebein_4-1647885239705.pngThe general steps for making use of this API are as follows:

  1. Create the solution resource with a POST
  2. Add some files to that solution with PUTs
    1. First, create the solution archive with the right Solution Identifiers; this should contain at least one project XML and all of the entities belonging to that ThingWorx project
    2. Next, compute MD5 using a tool like DigestUtils on the contents of the archive; this checksum is required for Solution Central
    3. Compute the SHA hash on the archive and save it; this will need to be provided along with the archive in the PUT requests
    4. Compute MD5 on the hash file also
    5. Finally, make the two PUT requests, one for the archive and one for its hash; for example cURL requests, see the Help Center
  3. Publish the solution using a PUT

So, with a little more work it is now possible to make use of SC in a more custom DevOps process. It is now possible to build JSON or XML solutions using development tools outside of ThingWorx and still publish these customizations to Solution Central. The process of DevOps Management just became more versatile, and with the ease of deployment of DPM and other PTC building blocks as well, ThingWorx is now more accessible and easy to use than ever before.

0 REPLIES 0
Announcements