### Client Configuration Examples Source: https://help.sap.com/docs/leanix/ea/connecting-to-mcp-server Example configurations for connecting to the MCP server using different clients. ```APIDOC ## Client Configuration Examples ### Description These examples show how to configure various clients to connect to the SAP LeanIX MCP Server. ### Claude Desktop #### Configuration ```json { "mcpServers": { "LeanIX MCP Server Remote": { "command": "npx", "args": [ "-y", "mcp-remote", "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "--header", "Authorization: Token {YOUR-API-TOKEN}" ] } } } ``` ### Cline #### Configuration ```json { "mcpServers": { "leanix-remote-http": { "type": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ### Cursor #### Configuration ```json { "mcpServers": { "lx-remote-basic": { "transport": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ``` -------------------------------- ### Start SAP LeanIX Development Server (npm) Source: https://help.sap.com/docs/leanix/ea/setting-up-your-custom-reports-project_locale=en-US&version=CLOUD This command starts the SAP LeanIX development server, installs dependencies, and launches the workspace. It outputs local and LeanIX URLs for testing your custom reports. If a custom SSL certificate is configured, it will be used; otherwise, a self-signed certificate is generated. ```bash $ npm start Your workspace is CustomReportDemo Starting development server and launching with url: https://app.leanix.net/CustomReportDemo/reports/dev?url=https%3A%2F%2Flocalhost%3A8080 --https --port 8080 ℹ 「wds」: Generating SSL Certificate ℹ 「wds」: Project is running at https://localhost:8080/ ℹ 「wds」: webpack output is served from / [...] ℹ 「wdm」: Compiled successfully. Open the following url to test your report: https://app.leanix.net/CustomReportDemo/reports/dev?url=https%3A%2F%2Flocalhost%3A8080#access_token={{ACCESS_TOKEN}} ``` -------------------------------- ### Client Configuration Examples Source: https://help.sap.com/docs/leanix/ea/connecting-to-mcp-server_locale=en-US&state=PRODUCTION&version=CLOUD Provides sample configurations for connecting to the MCP server using different clients like Claude Desktop, Cline, and Cursor. ```APIDOC ## Client Configuration Examples ### Description Sample configurations for connecting to the SAP LeanIX MCP Server using various clients. ### Claude Desktop Configuration #### Sample Code ```json { "mcpServers": { "LeanIX MCP Server Remote": { "command": "npx", "args": [ "-y", "mcp-remote", "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "--header", "Authorization: Token {YOUR-API-TOKEN}" ] } } } ``` ### Cline Configuration #### Sample Code ```json { "mcpServers": { "leanix-remote-http": { "type": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ### Cursor Configuration #### Sample Code ```json { "mcpServers": { "lx-remote-basic": { "transport": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ### Parameters * `{SUBDOMAIN}`: Your SAP LeanIX workspace subdomain. * `{YOUR-API-TOKEN}`: Your generated SAP LeanIX API token. ``` -------------------------------- ### Complete Integration Configuration Example (JSON) Source: https://help.sap.com/docs/leanix/ea/sap-signavio-advanced-configuration_locale=en-US Provides a comprehensive example of the JSON configuration structure for SAP LeanIX integrations. It includes global options and specific settings for LeanIX, Signavio, glossary, and process synchronization. Note: This is an obfuscated reference example. ```json { "active": true, "timerBasedSync": false, "strict": false, "processFactSheetType": "Process", "leanixConfig": { "workspaceId": "XXXXXX-5391-40c7-a47e-YYYYYY", "targetSystem": "https://url.for.server", "userId": "xxxxxxx-336a-4092-ae60-yyyy" }, "signavioConfig": { "url": "https://editor.signavio.com", "username": "user@company.net", "password": "xxxxxxxxxx-xxxxxxxxxx", "tenantId": "f6a3ca755bec1e13xxfeb", "loginParams": "" }, "glossaryCategorySyncDescriptors": [ { "active": true, "factSheetType": "Application", "masterSite": "LEANIX", "strict": false, "relationName": "relProcessToApplication", "inboundMappings": [], "filter": null, "glossaryCategoryId": "d693d09****f87e290" } ], "processSyncDescriptors": [ { "inboundMappings": [], "active": false, "directoryIds": [ "1111111111111111" ], "linkProcessingMode": "NO_PROCESSING", "publishedOnly": false, "startNodeId": null, "leanixParentFactSheetId": null, "blacklist": [], "shortDescription": "" } ] } ``` -------------------------------- ### Install Project Dependencies (npm) Source: https://help.sap.com/docs/leanix/ea/setting-up-your-custom-reports-project Installs all project dependencies listed in the package.json file. This command is fundamental for setting up a Node.js environment and ensuring all required libraries are available for the project. ```bash npm install ``` -------------------------------- ### Example Scripts Source: https://help.sap.com/docs/leanix/ea/graphql-api_locale=en-US Links to example scripts available on the SAP LeanIX GitHub repository that utilize the GraphQL API. ```APIDOC ## Scripts **Description**: Example scripts demonstrating the use of GraphQL can be found in the public SAP LeanIX GitHub repository. These scripts cover various use cases, including: * Update Costs * Import Metrics * Create Resources ``` -------------------------------- ### Start Development Server (Shell) Source: https://help.sap.com/docs/leanix/ea/building-your-first-custom-report_locale=en-US Provides the command to start the development server for the SAP LeanIX custom report. This command compiles the project and makes the report accessible via a browser. ```shell npm start ``` -------------------------------- ### Client Configuration Examples Source: https://help.sap.com/docs/leanix/ea/connecting-to-mcp-server_locale=en-US Example configurations for connecting to the MCP server using Claude Desktop, Cline, and Cursor. ```APIDOC ## Client Configuration Examples ### Description Provides sample configurations for various clients to connect to the SAP LeanIX MCP Server. ### Claude Desktop **Sample Code** ```json { "mcpServers": { "LeanIX MCP Server Remote": { "command": "npx", "args": [ "-y", "mcp-remote", "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "--header", "Authorization: Token {YOUR-API-TOKEN}" ] } } } ``` ### Cline **Sample Code** ```json { "mcpServers": { "leanix-remote-http": { "type": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ### Cursor **Sample Code** ```json { "mcpServers": { "lx-remote-basic": { "transport": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ``` -------------------------------- ### AppUpdate Example Source: https://help.sap.com/docs/leanix/docs/LEANIX/72d375467c1e4dcb872dfa2998b6328d/advanced-use-cases-for-integration-api_locale=en-US&state=PRODUCTION&version=CLOUD This snippet shows an example of an AppUpdate configuration, including identifier search and updates to the description field. ```APIDOC ## AppUpdate Configuration ### Description This configuration defines an update for an application, specifying search criteria and how to modify its description. ### Method N/A (Configuration Example) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body ```json { "exactType": "AppUpdate" } ``` ### Request Example ```json { "exactType": "AppUpdate" } ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Client Configuration Examples Source: https://help.sap.com/docs/leanix/docs/LEANIX/72d375467c1e4dcb872dfa2998b6328d/connecting-to-mcp-server_locale=en-US&state=PRODUCTION&version=CLOUD Example configurations for connecting to the MCP server using different clients. ```APIDOC ## Client Configuration Examples ### Description Examples of how to configure various clients to connect to the SAP LeanIX MCP server. ### Claude Desktop **Prerequisites**: Ensure you have npx installed. **Sample Configuration**: ```json { "mcpServers": { "LeanIX MCP Server Remote": { "command": "npx", "args": [ "-y", "mcp-remote", "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "--header", "Authorization: Token {YOUR-API-TOKEN}" ] } } } ``` ### Cline **Sample Configuration**: ```json { "mcpServers": { "leanix-remote-http": { "type": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ### Cursor **Sample Configuration**: ```json { "mcpServers": { "lx-remote-basic": { "transport": "streamableHttp", "url": "https://{SUBDOMAIN}.leanix.net/services/mcp-server/v1/mcp", "headers": { "Authorization": "Token {YOUR-API-TOKEN}" } } } } ``` ``` -------------------------------- ### Example leanix.yaml Structure for Microservices Source: https://help.sap.com/docs/leanix/ea/setting-up-github-enterprise-integration This YAML example demonstrates the basic structure for manifest files used to describe microservices in SAP LeanIX. Place these files in project directories corresponding to your microservices. The integration automatically discovers and processes them. ```yaml backend Dockerfile leanix.yaml src main.py requirements.txt frontend Dockerfile leanix.yaml package.json src index.js ... ``` -------------------------------- ### Example leanix.yaml Structure for Microservices Source: https://help.sap.com/docs/leanix/ea/setting-up-github-enterprise-integration_locale=en-US&state=PRODUCTION&version=CLOUD This YAML example demonstrates the basic structure for manifest files used to describe microservices in GitHub projects for SAP LeanIX. It shows a hierarchical organization for backend and frontend services, each with its own Dockerfile and leanix.yaml. ```yaml backend Dockerfile leanix.yaml src main.py requirements.txt frontend Dockerfile leanix.yaml package.json src index.js ... ``` -------------------------------- ### Microservice Repository Structure Examples (LeanIX) Source: https://help.sap.com/docs/leanix/docs/LEANIX/72d375467c1e4dcb872dfa2998b6328d/manifest-file-and-schema_locale=en-US&state=PRODUCTION&version=CLOUD Examples of how to structure repositories for microservice manifest files in LeanIX. Demonstrates placement in single repositories and monorepos for optimal organization. ```shell /microservice-repo leanix.yaml src/ tests/ README.md ``` ```shell /monorepo /microservice-one leanix.yaml src/ tests/ /microservice-two leanix.yaml src/ tests/ /microservice-three leanix.yaml src/ tests/ README.md ``` -------------------------------- ### Install LeanIX Reporting CLI using npm Source: https://help.sap.com/docs/leanix/ea/setting-up-your-custom-reports-project_locale=en-US Installs the LeanIX Reporting CLI globally on your system using npm. This command requires Node.js LTS to be installed. No specific input or output is defined, but it prepares the system for subsequent CLI commands. ```shell npm install -g @leanix/reporting-cli ``` -------------------------------- ### Starting a Synchronization Run Source: https://help.sap.com/docs/leanix/ea/integration-rest-api_locale=en-US&state=PRODUCTION&version=CLOUD Start a previously created synchronization run using its unique ID. ```APIDOC ## POST /services/integration-api/v1/synchronizationRuns/{id}/start ### Description Starts a synchronization run that has been created. ### Method POST ### Endpoint `https://{SUBDOMAIN}.leanix.net/services/integration-api/v1/synchronizationRuns/{id}/start` ### Parameters #### Path Parameters - **id** (string) - Required - The unique ID of the synchronization run to start. ``` -------------------------------- ### Advanced Write to LDIF Example Source: https://help.sap.com/docs/leanix/ea/inbound-processors_locale=en-US An advanced example demonstrating how to read content from Pathfinder and write it to an LDIF using the writeToLdif processor. It includes filtering and identifier configurations. ```APIDOC ## Advanced Write to LDIF Example ### Description This configuration demonstrates a more advanced usage of the `writeToLdif` processor. It includes filtering based on Pathfinder content and uses an identifier to search for specific factsheets. This allows for targeted data export and transformation into an LDIF format. ### Method POST ### Endpoint `/integration/api/run` ### Parameters #### Request Body - **processors** (array) - Required - Contains the `writeToLdif` processor configuration. - **processorType** (string) - Required - Must be `"writeToLdif"`. - **filter** (object) - Optional - Filters for processing. - **advanced** (string) - JUEL expression for advanced filtering. - **onRead** (string) - JUEL expression for filtering on read. - **identifier** (object) - Optional - Specifies how to identify entities. - **search** (object) - Required if `identifier` is present - Defines the search criteria. - **scope** (object) - Required - The scope for the search. - **ids** (array of strings) - Required - List of IDs to search within. - **facetFilters** (array) - Optional - Facet filters for the search. - **filter** (string) - Required - JUEL expression for filtering search results. - **multipleMatchesAllowed** (boolean) - Required - Whether multiple matches are allowed. - **run** (integer) - Optional - Specifies the run level for variable access. - **updates** (array) - Required - Defines the key-value pairs to be written to the LDIF. - **key** (object) - Required - Specifies the key for the LDIF entry. - **expr** (string) - Required - JUEL expression for the key. - **values** (array) - Required - A list of values for the key. - **expr** (string) - Required - JUEL expression for the value. - **logLevel** (string) - Optional - The logging level for this processor (e.g., `"warning"`). - **read** (object) - Optional - Configuration for reading data. - **fields** (array of strings) - Required if `read` is present - List of fields to read. - **targetLdif** (object) - Required - Configuration for the target LDIF file. - **dataConsumer** (object) - Required - Specifies the data consumer for the LDIF. - **type** (string) - Required - The type of data consumer, e.g., `"leanixStorage"`. - **ldifKeys** (array) - Required - Global keys to be set in the LDIF header. - **key** (string) - Required - The name of the LDIF key. - **value** (string) - Required - The value of the LDIF key, can be a JUEL expression. ### Request Example ```json { "processors": [ { "processorType": "writeToLdif", "filter": { "advanced": "${integration.contentIndex==0}", "onRead": "${lx.factsheet.description!=''}" }, "identifier": { "search": { "scope": { "ids": [ "8de51ff7-6f13-47df-8af8-9132ada2e74d" ], "facetFilters": [] }, "filter": "${true}", "multipleMatchesAllowed": true } }, "run": 0, "updates": [ { "key": { "expr": "content.id" }, "values": [ { "expr": "${lx.factsheet.id}" } ] }, { "key": { "expr": "content.type" }, "values": [ { "expr": "${lx.factsheet.name}" } ] }, { "key": { "expr": "description" }, "values": [ { "expr": "${lx.factsheet.description}" } ] } ], "logLevel": "warning", "read": { "fields": [ "description" ] } } ], "targetLdif": { "dataConsumer": { "type": "leanixStorage" }, "ldifKeys": [ { "key": "connectorType", "value": "${header.connectorType}_export" }, { "key": "connectorId", "value": "${header.connectorId}_export" }, { "key": "description", "value": "Enriched imporeted LDIF for Applications" } ] } } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the integration run has started. #### Response Example ```json { "message": "Integration run started successfully." } ``` ### Error Handling - **400 Bad Request**: Invalid request payload or configuration. - **500 Internal Server Error**: An error occurred during processing. ``` -------------------------------- ### Advanced Write to LDIF Processor Example Source: https://help.sap.com/docs/leanix/docs/LEANIX/72d375467c1e4dcb872dfa2998b6328d/inbound-processors_locale=en-US&state=PRODUCTION&version=CLOUD Demonstrates an advanced usage of the 'writeToLdif' processor, including filtering, reading specific fields from Pathfinder, and exporting data with enriched header information. This example highlights the integration with existing Pathfinder data. ```APIDOC ## POST /integration/api/runs (Advanced Example) ### Description An advanced example of the 'writeToLdif' processor that reads content from Pathfinder and writes it to an LDIF. It includes filtering based on Pathfinder data and specifies which fields to read. This configuration requires an input LDIF with at least one data object to trigger the process. ### Method POST ### Endpoint `/integration/api/runs` ### Parameters #### Request Body - **processors** (array) - Required - An array of processor configurations. - **processorType** (string) - Required - Must be "writeToLdif". - **filter** (object) - Optional - Filters to apply before processing. - **advanced** (string) - Optional - Advanced filter expression (e.g., "${integration.contentIndex==0}"). - **onRead** (string) - Optional - Filter to apply on read (e.g., "${lx.factsheet.description!=''}"). - **identifier** (object) - Optional - Defines how to identify the data to process. - **search** (object) - Required if identifier is present - Search parameters. - **scope** (object) - Required - Defines the search scope. - **ids** (array) - Required - Array of workspace IDs to search within. - **facetFilters** (array) - Optional - Facet filters. - **filter** (string) - Optional - Filter expression (e.g., "${true}"). - **multipleMatchesAllowed** (boolean) - Optional - Allows multiple matches. - **run** (integer) - Optional - Run level for variables. - **updates** (array) - Required - An array of key-value pairs to update in the LDIF. - **key** (object) - Required - Defines the key in the LDIF. - **expr** (string) - Required - A JUEL expression for the key (e.g., "content.id"). - **values** (array) - Required - An array of values for the key. - **expr** (string) - Required - A JUEL expression for the value (e.g., "${lx.factsheet.id}"). - **logLevel** (string) - Optional - Logging level (e.g., "warning"). - **read** (object) - Optional - Specifies fields to read. - **fields** (array) - Required - Array of field names to read (e.g., ["description"]). - **targetLdif** (object) - Required - Defines the target LDIF configuration. - **dataConsumer** (object) - Required - Specifies the data consumer. - **type** (string) - Required - Must be "leanixStorage". - **ldifKeys** (array) - Required - An array of key-value pairs for the LDIF header. - **key** (string) - Required - The header key (e.g., "connectorType"). - **value** (string) - Required - The value for the header key, can be a JUEL expression (e.g., "${header.connectorType}_export"). ### Request Example ```json { "processors": [ { "processorType": "writeToLdif", "filter": { "advanced": "${integration.contentIndex==0}", "onRead": "${lx.factsheet.description!=''}" }, "identifier": { "search": { "scope": { "ids": [ "8de51ff7-6f13-47df-8af8-9132ada2e74d" ], "facetFilters": [] }, "filter": "${true}", "multipleMatchesAllowed": true } }, "run": 0, "updates": [ { "key": { "expr": "content.id" }, "values": [ { "expr": "${lx.factsheet.id}" } ] }, { "key": { "expr": "content.type" }, "values": [ { "expr": "${lx.factsheet.name}" } ] }, { "key": { "expr": "description" }, "values": [ { "expr": "${lx.factsheet.description}" } ] } ], "logLevel": "warning", "read": { "fields": [ "description" ] } } ], "targetLdif": { "dataConsumer": { "type": "leanixStorage" }, "ldifKeys": [ { "key": "connectorType", "value": "${header.connectorType}_export" }, { "key": "connectorId", "value": "${header.connectorId}_export" }, { "key": "description", "value": "Enriched imporeted LDIF for Applications" } ] } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **runId** (string) - The ID of the initiated run. #### Response Example ```json { "status": "success", "runId": "b2c3d4e5-f6a7-8901-2345-67890abcdef1" } ``` ``` -------------------------------- ### Verify LeanIX Reporting CLI Installation Source: https://help.sap.com/docs/leanix/ea/setting-up-your-custom-reports-project_locale=en-US Checks if the LeanIX Reporting CLI has been successfully installed by displaying its version. This command is used for verification after the installation step. It outputs the CLI version number. ```shell lxr --version ``` -------------------------------- ### Example Processor Configuration with Grouped Execution (JSON) Source: https://help.sap.com/docs/leanix/docs/LEANIX/72d375467c1e4dcb872dfa2998b6328d/integration-api_locale=en-US&state=PRODUCTION&version=CLOUD This JSON example demonstrates how to define an Integration API processor with the 'executionGroups' key. This allows multiple configurations to be run as a single batch. The 'filter' and 'updates' sections define the logic for processing data, and 'executionGroups' specifies which groups this configuration belongs to. ```json { "processors": [ { "processorType": "inboundTag", "processorName": "Set TIME tags", "processorDescription": "Sets the TIME tags based on existing Fact Sheet values", "filter": { "advanced": "${integration.contentIndex==0}" }, "identifier": { "search": { "scope": { "ids": [], "facetFilters": [ { "keys": [ "Application" ], "facetKey": "FactSheetTypes", "operator": "OR" } ] } } }, "run": 0, "updates": [ { "key": { "expr": "name" }, "values": [ { "expr": "${((lx.factsheet.functionalSuitability=='unreasonable' || lx.factsheet.functionalSuitability=='insufficient') && (lx.factsheet.technicalSuitability=='inappropriate' || lx.factsheet.technicalSuitability=='unreasonable'))?'Eliminate':null}" }, { "expr": "${((lx.factsheet.functionalSuitability=='appropriate' || lx.factsheet.functionalSuitability=='perfect') && (lx.factsheet.technicalSuitability=='inappropriate' || lx.factsheet.technicalSuitability=='unreasonable'))?'Migrate':null}" }, { "expr": "${((lx.factsheet.functionalSuitability=='unreasonable' || lx.factsheet.functionalSuitability=='insufficient') && (lx.factsheet.technicalSuitability=='adequate' || lx.factsheet.technicalSuitability=='fullyAppropriate'))?'Tolerate':null}" }, { "expr": "${((lx.factsheet.functionalSuitability=='appropriate' || lx.factsheet.functionalSuitability=='perfect') && (lx.factsheet.technicalSuitability=='adequate' || lx.factsheet.technicalSuitability=='fullyAppropriate'))?'Invest':null}" }, { "expr": "No Data" } ] }, { "key": { "expr": "group.name" }, "values": [ { "expr": "Time Model" } ] } ], "logLevel": "warning", "read": { "fields": [ "technicalSuitability", "name", "functionalSuitability" ] } } ], "executionGroups": [ "customGroupA", "anotherGroup", "myGroup" ] } ``` -------------------------------- ### Example JSON Response for Application Costs Source: https://help.sap.com/docs/leanix/ea/importing-and-updating-total-annual-costs-of-applications_locale=en-US&version=CLOUD This is an example JSON response obtained after executing the GraphQL query to retrieve application and IT component cost data. It details applications, their IDs, associated IT components with their names and IDs, and the annual costs. ```json { "data": { "allFactSheets": { "edges": [ { "node": { "name": "HR Management App", "id": "4d121f64-116b-4ccc-a292-eb4e4f8d1b24", "relApplicationToITComponent": { "edges": [ { "node": { "factSheet": { "name": "Storage System", "id": "a8fe4825-42b8-431b-8124-ca12c579c78b" }, "costTotalAnnual": 125 } }, { "node": { "factSheet": { "name": "Web Server", "id": "ed46809c-998a-4fd6-9185-4b25e4e77d9b" }, "costTotalAnnual": 250 } } ] } } }, { "node": { "name": "Finance Management App", "id": "28fe4aa2-6e46-41a1-a131-72afb3acf256", "relApplicationToITComponent": { "edges": [ { "node": { "factSheet": { "name": "Storage System", "id": "a8fe4825-42b8-431b-8124-ca12c579c78b" }, "costTotalAnnual": 500 } }, { "node": { "factSheet": { "name": "Web Server", "id": "ed46809c-998a-4fd6-9185-4b25e4e77d9b" }, "costTotalAnnual": 1000 } } ] } } } ] } } } ``` -------------------------------- ### SAP LeanIX Microservice Manifest File Example Source: https://help.sap.com/docs/leanix/docs/LEANIX/72d375467c1e4dcb872dfa2998b6328d/manifest-file-and-schema_locale=en-US&state=PRODUCTION&version=CLOUD An example of a SAP LeanIX manifest file, showcasing the structure and common fields used to define microservice metadata, applications, tags, teams, and resources. ```yaml version: 1 metadata: name: disputes-service-v1 externalId: disputes-service-v1 description: | A microservice responsible for payment disputes. This service handles payment transaction disputes and is an integral part of our payment ecosystem. type: Backend repository: url: https://example.com status: active visibility: private applications: - factSheetId: fa787383-7233-4896-8fad-c1f1bef30dd2 - externalId: id: applicationId value: app-002 tags: - tagGroupName: Domain tagNames: - Payments - tagGroupName: Location tagNames: - AWS-EU1 - AWS-EU2 teams: - factSheetId: 63eda74c-57f7-4768-b1c9-3b2813b11504 - factSheetId: afd1ee0f-095b-4c68-88f6-d3628070ce18 - externalId: id: teamId value: team-002 resources: - name: Disputes Process Flow type: documentation url: https://myorg.atlassian.net/wiki/spaces/disputes description: Disputes process flow and diagrams ``` -------------------------------- ### Mirror Table Synchronization Log Example Source: https://help.sap.com/docs/leanix/ea/servicenow-integration An example log message indicating the synchronization status between a mirror table in SAP LeanIX and its corresponding table in ServiceNow. This is useful for monitoring the health and progress of data synchronization. ```text Table 'cmdb_sam_sw_install' mirror is in sync with ServiceNow 'cmdb_sam_sw_install' table ``` -------------------------------- ### Shell: Start Development Server Source: https://help.sap.com/docs/leanix/ea/creating-custom-matrix-report_locale=en-US&state=PRODUCTION&version=CLOUD Command to start the local development server for building and testing the SAP LeanIX custom report. This command is typically executed in the project's root directory. ```shell npm start ``` -------------------------------- ### Apptio Read Configuration Example for SAP LeanIX Source: https://help.sap.com/docs/leanix/ea/configuration-of-apptio-connector_locale=en-US&state=PRODUCTION&version=CLOUD Example configuration for reading data from an Apptio table using a URL. This is part of the 'apptioReadConfigs' section in the main Apptio connector JSON. It specifies the data source URL and the target table name within Apptio. ```json { "type": "url", "url": "https://bizdev-r12.apptio.com/biit/api/v2.tsv?date=Jul:FY2020&dataPath=-@Cleanixpartner.com%3ACost+Transparency2/Data/.DateGoesHere/Data+Center+Detail/ExecutionSteps/Output/!SORT/!LIMIT%5B0%2C2147483647%5D/!LIMIT_COLUMNS%5B%5D&environment=stg", "tableName": "Data Center Detail" } ``` -------------------------------- ### Make Authenticated API Requests with SAP LeanIX Access Token Source: https://help.sap.com/docs/leanix/ea/authentication-to-sap-leanix-services Examples of making authenticated GET requests to SAP LeanIX services using an access token. The token is included in the 'Authorization' header with the 'Bearer' prefix. Code is provided for cURL, JavaScript (using axios), Java (using OkHttpClient), and Python (using requests). ```curl curl -H "Authorization: Bearer {ACCESS_TOKEN}" \ https://{SUBDOMAIN}.leanix.net/services/poll/v2/pollRuns ``` ```javascript const axios = require('axios'); // Replace {SUBDOMAIN} with your actual subdomain const url = 'https://{SUBDOMAIN}.leanix.net/services/poll/v2/pollRuns'; const accessToken = 'eyJhbGciOiJSUzI1NiJ9.eyJz [...] ssqaPSA'; // Replace with your actual access token // Step 2: Make a GET request to the /v1/services API endpointaxios.get(url, { headers: { 'Authorization': `Bearer ${accessToken}`, }, }) .then(response => { // Process the response as needed console.log(response.data); }) .catch(error => { console.error('Error:', error.message); }); ``` ```java OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://{SUBDOMAIN}.leanix.net/services/poll/v2/pollRuns") .get() .addHeader("Authorization", "Bearer eyJhbGciOiJSUzI1NiJ9.eyJz [...] ssqaPSA") .build(); Response response = client.newCall(request).execute(); ``` ```python import requests timeout = 20 url = 'https://{SUBDOMAIN}.leanix.net/services/poll/v2/pollRuns' headers = {'Authorization': 'Bearer eyJhbGciOiJSUzI1NiJ9.eyJz [...] ssqaPSA'} response = requests.get(url, headers=headers, timeout=timeout) # Process the response as needed print(response.text) ``` -------------------------------- ### GET /factSheets/hierarchy/{rootId} - Get Fact Sheet Hierarchy Source: https://help.sap.com/docs/leanix/ea/migrating-from-fact-sheets-rest-api-to-graphql-api_locale=en-US&version=CLOUD Retrieves a hierarchy of fact sheets starting from a specified root fact sheet ID. This allows you to fetch all fact sheets that are equal to or below a given root in the hierarchy. ```APIDOC ## GET /factSheets/hierarchy/{rootId} ### Description Retrieves a hierarchy of fact sheets, including all fact sheets that are at the same level or below the specified root fact sheet ID. ### Method GET ### Endpoint /factSheets/hierarchy/{rootId} ### Path Parameters - **rootId** (string) - Required - The ID of the root fact sheet from which to retrieve the hierarchy. ### Request Example ``` https://{SUBDOMAIN}.leanix.net/services/pathfinder/v1/factSheets/hierarchy/{rootId} ``` ### Response #### Success Response (200) - **edges** (array) - An array of fact sheet objects within the hierarchy. - **node** (object) - Represents a single fact sheet in the hierarchy. - **id** (string) - The unique identifier of the fact sheet. - **displayName** (string) - The display name of the fact sheet. ### Request Example (GraphQL) ```graphql query { allFactSheets(hierarchy: {mode: FULL_TREE} filter: {ids: ["{rootId}"]}) { edges { node { id displayName } } } } ``` ``` -------------------------------- ### Create New Python Project with Poetry Source: https://help.sap.com/docs/leanix/ea/using-graphql-with-python Initializes a new Python project named 'leanix-graphql-tutorial' using Poetry for dependency management and project structure. This command sets up the basic project files and directory. ```bash poetry new leanix-graphql-tutorial ``` -------------------------------- ### Retrieve Poll Runs for a Specific Poll using Poll REST API (GET Request) Source: https://help.sap.com/docs/leanix/ea/retrieving-survey-results This snippet shows how to get all poll runs associated with a specific poll ID using the Poll REST API. Authentication with an API token is required. The response includes details about each poll run, such as its ID and start time. ```REST https://{SUBDOMAIN}.leanix.net/services/poll/v2/polls/{id}/pollRuns ``` ```curl curl -X GET \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {ACCESS_TOKEN}' \ 'https://{SUBDOMAIN}.leanix.net/services/poll/v2/polls/0b62781b-4266-4020-g87h-4cacb7947ba8/pollRuns?page=1&size=500&sort=startTime-desc' ``` -------------------------------- ### SAP LeanIX SBOM Job Status Tracking: Response Payload Example Source: https://help.sap.com/docs/leanix/ea/api-updates-sbom-async-processing_locale=en-US Example JSON response payload for the new GET /sboms/jobs/{jobId} endpoint in the SAP LeanIX Self-Built Software Discovery API. This payload provides details about the SBOM file processing job, including its status, relevant IDs, and timestamps. ```json { "data": { "id": "1a10138e-302b-4797-9038-058e14d1a0b6", "workspaceId": "56914519-c634-41bb-b163-866333b907ee", "status": "SUCCEEDED", "errorMessage": null, "createdAt": "2025-03-06T07:33:25.833318Z", "plannedExecutionAt": "2025-03-06T07:33:31.479195Z", "updatedAt": "2025-03-06T07:33:31.479195Z" } } ``` -------------------------------- ### GET /factSheets/hierarchy/{rootId} Source: https://help.sap.com/docs/leanix/ea/migrating-from-fact-sheets-rest-api-to-graphql-api Retrieve the hierarchy of fact sheets starting from a specified root fact sheet ID. This allows you to fetch all fact sheets at or below a given root in the hierarchy. ```APIDOC ## GET /factSheets/hierarchy/{rootId} ### Description Retrieves a hierarchical list of fact sheets, starting from a specified root fact sheet. ### Method GET ### Endpoint /factSheets/hierarchy/{rootId} ### Path Parameters - **rootId** (string) - Required - The ID of the root fact sheet from which to start the hierarchy. ### Request Example ``` https://{SUBDOMAIN}.leanix.net/services/pathfinder/v1/factSheets/hierarchy/{rootId} ``` ### Response #### Success Response (200) - **edges** (array) - An array of fact sheet objects representing the hierarchy. - **node** (object) - Represents a single fact sheet in the hierarchy. - **id** (string) - The unique identifier of the fact sheet. - **displayName** (string) - The display name of the fact sheet. #### Response Example ```json { "edges": [ { "node": { "id": "root-id", "displayName": "Root Application" } }, { "node": { "id": "child-id-1", "displayName": "Child Application 1" } }, { "node": { "id": "child-id-2", "displayName": "Child Application 2" } } ] } ``` ### GraphQL Equivalent Query ```graphql query { allFactSheets(hierarchy: {mode: FULL_TREE} filter: {ids: ["{rootId}"]}) { edges { node { id displayName } } } } ``` ``` -------------------------------- ### GET /factSheets Source: https://help.sap.com/docs/leanix/ea/migrating-from-fact-sheets-rest-api-to-graphql-api Retrieve all fact sheets of a specified type and their relations to other fact sheet types. This example shows how to fetch all 'Application' fact sheets and their related 'ITComponent' fact sheets. ```APIDOC ## GET /factSheets ### Description Retrieves a list of fact sheets, optionally filtered by type and relations. This example focuses on fetching 'Application' fact sheets and their connections to 'ITComponent' fact sheets. ### Method GET ### Endpoint /factSheets ### Query Parameters - **relationTypes** (string) - Optional - Specifies the types of relations to include in the response. - **type** (string) - Optional - Filters the fact sheets by their type (e.g., 'Application'). ### Request Example ``` https://{SUBDOMAIN}.leanix.net/services/pathfinder/v1/factSheets?relationTypes=relApplicationToITComponent&type=Application ``` ### Response #### Success Response (200) - **totalCount** (integer) - The total number of fact sheets returned. - **edges** (array) - An array of fact sheet objects. - **node** (object) - Represents a single fact sheet. - **id** (string) - The unique identifier of the fact sheet. - **displayName** (string) - The display name of the fact sheet. - **description** (string) - The description of the fact sheet. - **rev** (integer) - The revision number of the fact sheet. - **type** (string) - The type of the fact sheet. - **permissions** (object) - Permissions for the fact sheet. - **qualitySeal** (string) - The quality seal status. - **lxState** (string) - The LeanIX state of the fact sheet. - **updatedAt** (string) - The timestamp of the last update. - **completion** (object) - Completion details. - **tags** (array) - Associated tags. - **subscriptions** (object) - User subscriptions. - **status** (string) - The status of the fact sheet. - **level** (string) - The level of the fact sheet. - **category** (string) - The category of the fact sheet. - **relApplicationToITComponent** (object) - Relation to ITComponent fact sheets (if applicable). #### Response Example ```json { "totalCount": 10, "edges": [ { "node": { "id": "some-app-id", "displayName": "Example Application", "description": "This is an example application.", "rev": 1, "type": "Application", "permissions": { "create": true, "read": true, "update": true, "delete": false, "self": true }, "qualitySeal": "valid", "lxState": "active", "updatedAt": "2023-10-27T10:00:00Z", "completion": { "percentage": 85 }, "tags": [], "subscriptions": { "edges": [] }, "status": "Operational", "level": "Business", "category": "Software", "relApplicationToITComponent": { "edges": [ { "node": { "factSheet": { "id": "some-it-comp-id", "name": "Example IT Component" } } } ] } } } ] } ``` ### GraphQL Equivalent Query ```graphql query { allFactSheets(filter: {responseOptions: {maxFacetDepth: 5}, facetFilters: [ {facetKey: "FactSheetTypes", keys:["Application"], operator: OR } ]}, sort: [{key: "displayName", order: asc}]) { totalCount edges { node { id displayName description rev type permissions { create read update delete self } qualitySeal lxState updatedAt completion { percentage } tags { id name description color tagGroup { id name shortName mode } } subscriptions(filter: {userId: "{userId}"}) { edges { node { id user { id firstName lastName email } type roles { id comment } } } } status level category ... on Application { relApplicationToITComponent { edges { node { factSheet { id name } } } } } } } } } ``` ``` -------------------------------- ### Interactive Project Scaffolding Prompts Source: https://help.sap.com/docs/leanix/ea/setting-up-your-custom-reports-project_locale=en-US Illustrates the interactive prompts used by the 'lxr init' command to gather project configuration details. Users provide information such as project name, ID, author, description, license, LeanIX host, workspace, and API token. This is a crucial step for setting up the project's metadata and connection details. ```shell Initializing new project... ? Name of your project for package.json My Custom Report Project ? Unique id for this report in Java package notation (e.g. net.leanix.barcharts) custom.report.demo ? Who is the author of this report (e.g. LeanIX GmbH) LeanIX GmbH ? A title to be shown in LeanIX when report is installed Custom Report Demo ? Description of your project Custom Report Demo ? Which licence do you want to use for this project? UNLICENSED ? Which host do you want to work with? app.leanix.net ? Which is the workspace you want to test your report in? test ? API-Token for Authentication (see: https://dev.leanix.net/docs/authentication#section-generate-api-tokens) {{YOUR_API_TOKEN}} ? Are you behind a proxy? No ```