An extremely powerful capability of Application Transformer for VMware Tanzu is not just getting application data and custom information into App Transformer, but that you can also easily extract that information and use that for a number of other scenarios including but not limited to internal true up of your deployed applications versus what is currently in your Change Management Database (CMDB), inventory analysis across your application vendor and/or versions for auditing, licensing and compliance to identifying vulnerable software versions. The use cases for App Transformer certainly span beyond just App Modernization and can truly be endless!
The App Transformer UI is just one way in which users can interact with the solution but for more advanced workflows or automation purposes, users can also leverage the App Transformer REST API. In this blog post, we take a look at how to get started with the App Transformer REST API.
The primary API endpoint for the App Transformer REST API is https://[APP_TRANSFORMER_FQDN_OR_IP/discovery/ which then it breaks down over a couple dozen+ sub-resource/endpoints that covers functionality roughly across these areas:
- Appliance Management - Manage backup/restore of App Transformer
- Applications - Operations for Applications discovered and created by App Transformer
- Components - Operations for Components discovered by App Transformer
- External Artifacts - Management of specific versions of Weblogic, JDK, Tomcat or JRE for containerization purposes
- Image Registry - Management of OCI-compliance registry for both source and destination containerization purposes
- Image Templates - Operations and Management for Dockerfile templates
- Oracle Accounts - Management of Oracle user accounts
- Policies - Management of VM Naming and Credential Association Rules
- Process - Operations for Processes within a Virtual Machine
- Reports - Export Inventory
- Service Accounts - Management of Credentials
- Session - Login Session
- Support Bundles - Creation and download of Support Bundles
- Tasks - Management of long running tasks (async)
- Telemetry - Management of Telemetry Proxy configurations
- Users - Management of App Transformer local users
- vCenter - Management of registering vCenter Servers
- Virtual Machines - Management of discovered Virtual Machines from a vCenter Server
- vRealize Network Insight - Management of registered vRealize Network Insight or vRealize Network Insight Cloud
App Transformer Swagger
You can actually view the complete App Transformer REST API directly within App Transformer itself. To access the Swagger definition, simply login to your App Transformer instance and in the upper right hand corner, navigate to the "question mark" icon and then click on API Documentation.
App Transformer API Example
Let's now take a look at how to actually use the App Transformer RES API and perform a basic operation such as logging in and then listing all registered vCenter Servers.
Step 1 - You will need the App Transformer Username/Password that you had configured during the OVA deployment and fill in the AT_USERNAME and AT_PASSWORD environment variables. To create a session, we need to perform a POST to /session that includes both the username and password in the body requests.
export AT_USERNAME=""
export AT_PASSWORD=""
curl -k -X POST https://at.vmware.corp/discovery/session \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d "{\"username\":\"${AT_USERNAME}\",\"password\":\"${AT_PASSWORD}\"}"
If the session was created successfully, the API will return a token value, which we will need to include as an authorization header for any subsequent App Transformer API requests.
Step 2 - Copy the value of the token into AT_TOKEN environment variable and if you have already registred a vCenter Server in App Transformer, you can then perform the following operation (or others) which should list the registered vCenter Server.
export AT_TOKEN=""
curl -k -X GET https://at.vmware.corp/discovery/vcenters \
-H "Authorization: Bearer ${AT_TOKEN}" \
-H "Accept: application/json"
App Transformer Postman Collection
While exploring the App Transformer API, I created a basic Postman collection as a way for me to learn about some of the APIs. You can download and import my App Transformer Postman collection to help you get started and it currently covers the following 9 operations.
- Create Login Session
- List all vCenter Servers
- List all Credentials
- Create a new Credential
- List all Virtual Machines
- Associate credential with a Virtual Machine
- List all Applications
- List all Components
- List all Component Signatures
Thanks for the comment!