APIs

VSM provides powerful and dev-friendly APIs to integrate VSM seamlessly into your DevOps toolchain.

LeanIX VSM plans to provide two types of APIs - a REST-based API to import data, and a GraphQL API to access and manage the data in the catalogs.

Authorization - Getting a Bearer Token

LeanIX VSM uses OAuth2 to authenticate users to access any of the available APIs. The following flow describes, how an API Token is used to retrieve a Bearer Token. Administrators can generate one or more API Tokens in the Administration of LeanIX VSM, which have expiry data until they can be used. To get an API Token go to Administration> Technical Users > New Technical User.

An example of how to use the technical user token for acquiring an access token can be seen in the following snippet:

curl --request POST \
  --url https://<host>.leanix.net/services/mtm/v1/oauth2/token \
  -u apitoken:<API Token from the technical user panel> \
  --data grant_type=client_credentials

REST API

The REST API can be used to import data into the catalog, enabling our users to integrate with systems for which no out-of-the-box integration is available.

Importing Services

:bulb: Early Access

This endpoint is in early access. To find more information about the release stages of our APIs & integrations, see Release Stages.

:warning: Early Notice: the endpoint url will be changed shortly to https://{host}-vsm.leanix.net/services/vsm/discovery/v1/item. Currently below route applies.

The endpoint to bring in custom services from your source systems can be reached under https://{host}.leanix.net/services/vsm-collector/v1/item. More information on how to use the endpoint can be found directly via the API documentation or by hands-on tutorials below.

📘

API Documentation

Please find the extensive API documentation here.

📘

Tutorial to import Services via Custom Integration

Navigate to the Tutorial to import Services via Custom Integrations to find out more on how to use the API to bring in your services from third-party systems.

Importing Events

This endpoint is in early access. To find more information about the release stages of our APIs & integrations, see Release Stages.

📘

API Documentation

Please find the extensive API documentation here.

Change event

The change event is about a committed change in a branch that is going to be released later. For some teams this is the main branch, for others this can be the release branch. The most important properties of the change event are the source, the time and the author.

:warning: We do not want to receive a change event for everything committed across all branches of a code repository. Ideally we should receive change events for commits included in a release event later on. Changes that are not associated with a release are going to be ignored for both the lead-time-for-changes and deployment-frequency metrics.

:warning: Early Notice: the endpoint url will be changed shortly to
https://{host}-vsm.leanix.net/services/vsm/events/v1/dora/change

The current endpoint to bring in custom events from your source systems can be reached under
https://{host}.leanix.net/services/vsm-dora-events/v1/dora/change

Properties

Property

Sample value

Description

Datacontenttype

application/json

Content type of the data value. For now only application/json types are accepted

Data

{ "name":"developer name", "email": "[email protected]", "username": "developer username", "changeTime": "2021-12-15T15:13:39.4589254Z" }

A json object with an author property containing the name, username & email of the release committer, and the timestamp of the time when the code was committed to the repository

Sample Request

curl -v http://localhost:8080/dora/change \
  -H "Content-Type: application/json" \
  -d '{
  "id": "6fc68dd0053c5e04bd29c322973a060a9d09d90a",
  "source": "order-history",
  "data": {
    "name":"developer name",
    "email": "[email protected]",
    "username": "developer username",
    "changeTime": "2021-12-15T15:13:39.4589254Z"
  }
}'

Release event

A release event is sent whenever a release for a software artifact successfully gets deployed into production. The release contains a list of the all the committed changes.

:warning: Early Notice: the endpoint url will be changed shortly to
https://{host}-vsm.leanix.net/services/vsm/events/v1/dora/release

The current endpoint to bring in custom events from your source systems can be reached under
https://{host}-vsm.leanix.net/services/vsm-dora-events/v1/dora/release

Properties

Property

Sample value

Description

Id

6fc68dd0053c5e04bd29c322973a060a9d09d90a

The id of the release event.
The combination of id, source, and type shall be unique for each event

Data

{ "changeIds":[ "6fc68dd0053c5e04bd29c322973a060a9d09d90a", "23468dd0053c5e04bd29c322973a060a9d09d90a", "12368dd0053c5e04bd29c322973a060a9d09d90a" ], "releaseTime": "2021-11-18T15:13:39.4589254Z" }

An array of commit ids that were received earlier as change events and Timestamp of when the release was deployed

Sample request

curl -v http://localhost:8080/dora/release \
  -H "Content-Type: application/json" \
  -d '{
  "id": "26f148fb55df0fd244623d98fdd07cc425b1b8d6,
  "source": "order-history",
  "data": {
    "changeIds":[
                "6fc68dd0053c5e04bd29c322973a060a9d09d90a",
        "23468dd0053c5e04bd29c322973a060a9d09d90a",
        "12368dd0053c5e04bd29c322973a060a9d09d90a"
    ],
    "releaseTime": "2021-11-18T15:13:39.4589254Z"
  }
}'

Incident event

The incident events contains the software artifact affected and a creation and resolution date.
An incident event is sent after an incident is resolved.

:warning: Early Notice: the endpoint url will be changed shortly to
https://{host}-vsm.leanix.net/services/vsm/events/v1/dora/incident

The current endpoint to bring in custom events from your source systems can be reached under
https://{host}.leanix.net/services/vsm-dora-events/v1/dora/incident

Properties

Property

Sample value

Description

Id

6fc68dd0053c5e04bd29c322973a060a9d09d90a

The incident id. The combination of id, source, and type shall be unique for each event

Data

{ "incidentTime": "2021-11-18T17:13:39.4589254Z" "resolvedTime": "2021-11-19T22:12:38.4589254Z" }

Timestamp of when the incident was created and Timestamp of when the incident was resolved

Sample incident event

curl -v http://localhost:8080/dora/incident \
  -H "Content-Type: application/json" \
  -d '{
      "id": "6fc68dd0053c5e04bd29c322973a060a9d09d90a",
      "source": "order-history",
      "data": {
        "incidentTime": "2021-11-18T17:13:39.4589254Z"
        "resolvedTime": "2021-11-19T22:12:38.4589254Z"
      }
}'

GraphQL API

Not Available :no-entry:

This API is not yet available. To find more information about the release stages of our APIs & integrations, see Release Stages.

We plan to provide a GraphQL API, which will give our users access to the same functionality used by our VSM UI. This will allow for example to access and manage the data in the Service & API Catalog. Once available, more information on how to use the endpoint will be made available directly via the API documentation and by hands-on tutorials.


Did this page help you?