CXTM API
Bonus: CXTM API
  • Introduction
  • CXTM Basics
  • CXTM Projects
  • CXTM Test Cases
  • CXTM Test Automation
  • Revisit Imported Test Cases
  • CXTM Batches
  • CXTM Notifications
  • NetDevOps
  • CXTM Reporting
  • CXTM References
  • Bonus: Project Users
  • Bonus: CXTM REST API
  • Bonus: Secret Env Variables

CXTM API

In this section, you'll use CXTM's embedded interactive API documentation to make the same API call to execute a batch that was used in your pipeline.

Step 1 - Locate CXTM's REST API documentation

In the left sidebar navigation menu:

  1. Scroll down until you locate the heading Documentation


Step 2 - Open the swagger API Documentation


In the left sidebar navigation menu:

  1. Click on REST API

  2. The REST API documentation page will open in a new browser tab.


Step 3 - Authorize with your CXTM API Key


From the swagger page:

  1. Click on the Authorize button



  2. Enter your CXTM API Key

  3. Note: if you didn't save your API Key generated during the Create CXTM Pipeline Script section, return to that section to recall how to return to Manage Profile to delete your API Key and generate a new one.

  4. Click the Authorize button
  5. Click the Close button


Step 4 - Locate the API endpoint to run a batch

The API endpoint used to run the batches used in the pre-tests and post-test stages of your pipeline is /batches/{_batch_id}/run

From the swagger page:

  1. use Ctrl+F to search for /batches/{_batch_id}/run on the page



  2. Click on the /batches/{_batch_id}/run entry to expand it



  3. Notice that this API endpoint Runs all the testcases in a batch, identified by a provided batch ID. You'll need to get the batch ID from the desired batch in your CXTM project. Keep the swagger browser window open and follow the next steps to identify the batch ID from your project.


Step 5 - Navigate to your CXTM Project's Batches page


Return to your CXTM browser window

  1. Open the sidebar if not already open
  2. Scroll down until you locate the heading Test Cases
  3. Under Test Cases, click Test Case Batches


Step 6 - Identify the batch ID


From your project's Batches page:

  1. Click on the Edit button for the LTROPS-2711 Topology Routing Batch



  2. Collect the batch ID for the LTROPS-2711 Topology Routing Batch directly from the URL ("235" in this example)



  3. Copy this batch ID and return to the swagger page


Step 7 - Execute the API call from swagger


From your the swagger page:

  1. Click on the Try it out button for the the expanded /batches/{_batch_id}/run API endpoint



  2. Enter the Batch ID into the Batch ID of the batch to run field
  3. Copy the following JSON into the Jobfile info to be run field under the Request Body section in swagger:
  4.         
    {
      "is_default_topology": true
    }
        

    The "is_default_topology": true tells the pipeline to use the default topology (LTROPS-2711 Topology) that you set for these test cases earlier in the lab.

  5. Click the Execute button



  6. Confirm that you received a 201 status Code.

  7. Notice the Request URL provided. This is the same Request URL and request body used in your pipeline.

  8. Return to your CXTM browser.


Step 8 - Return to your project Batches page


From the LTROPS-2711 Topology Routing Batch batch page:

  1. Click on the Batches tab in the navigation breadcrumbs to return to the project Batches page



  2. Click on the Results link for the LTROPS-2711 Topology Routing Batch batch



  3. Confirm that the test case belonging to the LTROPS-2711 Topology Routing Batch batch are running

Continue to the next section to explore CXTM's secret environment variables feature.