1.5 Generating a REST Client for the APIs

PlateSpin Transformation Manager is compliant with the OpenAPI Specification, formerly known as the Swagger RESTful API Documentation Specification. You can use the open source Swagger Editor to generate a REST client in your language of choice.

1.5.1 PTM Client Used by PlateSpin Migrate Connector

The PTM Client used by PlateSpin Migrate Connector is available in the ptmclient.zip file on the PlateSpin Transformation Manager Appliance in the <connector-path>\resources\ folder.

1.5.2 Generating a Custom PTM Client from the PTM REST API

The PTM REST API leverages the Swagger framework to present descriptions for its REST APIs. Swagger is built around the OpenAPI Specification (OAS). You can use Swagger tools to generate a client to “talk” to PTM. That is, your client sends a request to PTM and PTM responds with the requested information. Swagger supports a variety of programming languages.

The PTM RESTAPI interface is available on your PTM server at the following URL:

http://<your-ptmserver-ip-address-or-fqdn>:8082/restapi

For example: http://10.10.10.10:8082/restapi

The basic workflow for generating a PTM client:

  1. In a web browser, go to

    http://<your-ptmserver-ip-address-or-fqdn>:8082/restapi/swagger.json

  2. Click Raw Data to expand the code.

  3. Click Copy to save the information to your computer clipboard.

  4. In a web browser, go to the Swagger Editor website at http://editor.swagger.io.

  5. In the Swagger Editor toolbar, select File > Clear editor.

  6. Right-click in the editing panel on the left, then click Paste to insert the information you copied.

  7. Click OK to agree to convert the code from JSON to YAML.

    The PlateSpin Transformation Manager REST API with REST commands and syntax display in the right panel.

    This is the same type of information displayed when you visit the REST API location on your PlateSpin Transformation Manager server at http://<your-ptmserver-ip-address-or-fqdn>:8082/restapi.

  8. In the Swagger Editor toolbar, select Generate Client > Python to download a client written in Python.

    Our example code is written in Python. Swagger Editor supports over 50 other languages that you can use for the client interface you develop.

  9. In the pop-up dialog, select Save File then click OK to save the a ZIP file that contains the generated Python client (python-client-generated.zip).