### Start n8n via npm Source: https://docs.port.io/ai-interfaces/port-n8n-node Start your n8n instance after installing it globally with npm. Access it via http://localhost:5678. ```bash n8n start ``` -------------------------------- ### Example Slack Queries for Task Manager Agent Source: https://docs.port.io/guides/all/setup-task-manager-ai-agent Use these example queries when interacting with the Port Slack App to get information about tasks, pull requests, and more. ```text @Port What tasks are assigned to me? @Port Show me all PRs waiting for my review @Port How many tasks are currently in progress? ``` -------------------------------- ### Copy Environment File Source: https://docs.port.io/guides/all/pull-github-metrics-and-build-visualizations Copy the example environment file to start configuring the metrics exporter. This file contains placeholders for your access keys and organization details. ```bash cp .env.example .env ``` -------------------------------- ### Python Kafka Consumer Setup Source: https://docs.port.io/workflows/build-workflows/action-nodes/kafka Example Python code for setting up a Kafka consumer to listen to the organization's topic (`{orgId}.runs`). Ensure you replace placeholders like 'your-kafka-brokers' and '{orgId}'. ```python from kafka import KafkaConsumer import json consumer = KafkaConsumer( '{orgId}.runs', bootstrap_servers=['your-kafka-brokers'], group_id='{orgId}.your-consumer-group', value_deserializer=lambda m: json.loads(m.decode('utf-8')) ) for message in consumer: payload = message.value # Process the workflow event print(f"Received: {payload}") ``` -------------------------------- ### Local Installation and Configuration Source: https://docs.port.io/guides/all/keep-azure-catalog-upto-date-with-incremental-syncing Instructions for cloning the repository, installing dependencies using Poetry, and setting required environment variables for local sync operations. ```bash git clone https://github.com/port-labs/incremental-sync.git cd integrations/azure_incremental ``` ```bash pip install poetry make install ``` ```bash # Required export AZURE_CLIENT_ID="your-azure-client-id" export AZURE_CLIENT_SECRET="your-azure-client-secret" export AZURE_TENANT_ID="your-azure-tenant-id" export PORT_WEBHOOK_INGEST_URL="your-port-webhook-url" # Optional export SUBSCRIPTION_BATCH_SIZE=1000 export CHANGE_WINDOW_MINUTES=15 export RESOURCE_TYPES='["microsoft.keyvault/vaults","Microsoft.Network/virtualNetworks"]' ``` -------------------------------- ### Get Access Token and Entity using JavaScript (axios) Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-update This example shows how to authenticate and retrieve an entity using the 'axios' library in JavaScript. Make sure to install axios: `npm install axios --save`. ```javascript const axios = require("axios").default; const CLIENT_ID = "YOUR_CLIENT_ID"; const CLIENT_SECRET = "YOUR_CLIENT_SECRET"; const API_URL = "https://api.port.io/v1"; (async () => { const response = await axios.post(`${API_URL}/auth/access_token`, { clientId: CLIENT_ID, clientSecret: CLIENT_SECRET, }); const accessToken = response.data.accessToken; // You can now use the value in accessToken when making further requests const blueprintId = "MY_BLUEPRINT"; const entityId = "MY_ENTITY_IDENTIFIER"; const config = { headers: { Authorization: `Bearer ${accessToken}`, }, }; const getResponse = await axios.get( `${API_URL}/blueprints/${blueprintId}/entities/${entityId}`, config ); // getResponse.data contains the content of the resulting entity })(); ``` -------------------------------- ### Authenticate and Get Entity (cURL) Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?update-strategy=create-override This example shows how to obtain an access token and then retrieve an entity using cURL. Ensure you have 'jq' and 'sed' installed for processing the output. ```bash # Dependencies to install: # for brew: # brew install jq # For apt: # $ sudo apt-get install jq # For yum: # $ sudo yum install jq access_token=$(curl --location --request POST 'https://api.port.io/v1/auth/access_token' \ --header 'Content-Type: application/json' \ --data-raw '{ \ "clientId": "CLIENT_ID", \ "clientSecret": "CLIENT_SECRET" \ }' | jq '.accessToken' | sed 's/"//g') # The token will be available in the access_token variable blueprint_id='MY_BLUEPRINT' entity_id='MY_ENTITY_IDENTIFIER' curl --location --request GET "https://api.port.io/v1/blueprints/${blueprint_id}/entities/${entity_id}" \ --header "Authorization: Bearer $access_token" \ --header "Content-Type: application/json" # The output of the command contains the content of the resulting entity ``` -------------------------------- ### Command-line Upload Skill Examples Source: https://docs.port.io/ai-interfaces/port-mcp-server/skills Examples of how to upload a skill using different command-line interfaces. Specify the skill directory as an argument. ```bash python upload_skill.py ./my-skill # Python ``` ```bash node upload-skill.js ./my-skill # JavaScript ``` ```bash ./upload-skill.sh ./my-skill # Bash ``` -------------------------------- ### Initialize Node.js Project and Install Express Source: https://docs.port.io/actions-and-automations/setup-backend/webhook/local-debugging-webhook Initialize a new Node.js project and install the Express framework. This is required to create a local server that can receive webhook events. ```bash npm init -y npm install express ``` -------------------------------- ### Authenticate and Get Entity using cURL Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api This example shows how to authenticate with the Port.io API using cURL to obtain an access token, and then use that token to retrieve an entity. Ensure you have 'jq' and 'curl' installed. ```bash # Dependencies to install: # for brew: # brew install jq # For apt: # $ sudo apt-get install jq # For yum: # $ sudo yum install jq access_token=$(curl --location --request POST 'https://api.port.io/v1/auth/access_token' \ --header 'Content-Type: application/json' \ --data-raw '{ "clientId": "CLIENT_ID", "clientSecret": "CLIENT_SECRET" }' | jq '.accessToken' | sed 's/"//g') # The token will be available in the access_token variable blueprint_id='MY_BLUEPRINT' entity_id='MY_ENTITY_IDENTIFIER' curl --location --request GET "https://api.port.io/v1/blueprints/${blueprint_id}/entities/${entity_id}" \ --header "Authorization: Bearer $access_token" \ --header "Content-Type: application/json" # The output of the command contains the content of the resulting entity ``` -------------------------------- ### Get Access Token and Entity using cURL Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-update This example demonstrates how to obtain an access token and retrieve an entity using cURL commands. Ensure 'jq' and 'sed' are installed for JSON parsing and string manipulation. ```bash # Dependencies to install: # for brew: # brew install jq # For apt: # $ sudo apt-get install jq # For yum: # $ sudo yum install jq access_token=$(curl --location --request POST 'https://api.port.io/v1/auth/access_token' \ --header 'Content-Type: application/json' \ --data-raw '{ "clientId": "CLIENT_ID", "clientSecret": "CLIENT_SECRET" }' | jq '.accessToken' | sed 's/"//g') # The token will be available in the access_token variable blueprint_id='MY_BLUEPRINT' entity_id='MY_ENTITY_IDENTIFIER' curl --location --request GET "https://api.port.io/v1/blueprints/${blueprint_id}/entities/${entity_id}" \ --header "Authorization: Bearer $access_token" \ --header "Content-Type: application/json" # The output of the command contains the content of the resulting entity ``` -------------------------------- ### Install Port Pulumi Provider with Go Source: https://docs.port.io/build-your-software-catalog/custom-integration/iac/pulumi Install the Port Pulumi provider using Go. ```bash go get github.com/port-labs/pulumi-port/sdk ``` -------------------------------- ### Install Airbyte Locally Source: https://docs.port.io/guides/all/ingest-hibob-data-via-airbyte-s3-and-webhook Installs and sets up Airbyte for local development. The application will be accessible at http://localhost:8000. ```bash abctl local install ``` -------------------------------- ### Slack Webhook URL Example Source: https://docs.port.io/actions-and-automations/create-self-service-experiences/set-self-service-actions-rbac An example of a Slack webhook URL obtained after creating and installing a Slack app. ```text https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX ``` -------------------------------- ### Example Skill File Structure (Markdown with YAML Frontmatter) Source: https://docs.port.io/guides/all/ingest-prompts-skills-from-github-using-gitops Store each skill in its own folder under `skills/`, including a `SKILL.md` file with YAML frontmatter and instructions. Supporting files can be placed in `references/` and `assets/`. ```markdown --- name: my-skill-name description: A clear description of what this skill does and when to use it --- # My skill name Add your instructions here that the AI should follow when this skill is active. ``` -------------------------------- ### Create agent installation directory Source: https://docs.port.io/actions-and-automations/setup-backend/webhook/port-execution-agent/installation-methods/argocd Inside the 'argocd' directory, create a specific directory for your Port agent installation, for example, 'my-port-agent'. ```bash mkdir -p argocd/my-port-agent ``` -------------------------------- ### Database Connection Issues Troubleshooting Guide Source: https://docs.port.io/guides/all/find-internal-documentation-with-ai Example of a troubleshooting guide for common database connection problems, including symptoms, diagnosis, and solutions. ```APIDOC # Database Connection Issues Troubleshooting ## Common Issues ### Connection Timeout **Symptoms:** - API requests timing out - Database connection errors in logs - High response times **Diagnosis:** 1. Check database connection pool status 2. Review connection timeout settings 3. Monitor database server resources **Solutions:** 1. Increase connection pool size 2. Adjust timeout values 3. Scale database resources ### Connection Pool Exhaustion **Symptoms:** - "No available connections" errors - Application hangs - Database locks **Diagnosis:** 1. Check active connections 2. Review connection leak patterns 3. Analyze connection usage **Solutions:** 1. Fix connection leaks in code 2. Implement connection monitoring 3. Add connection pool alerts ## Prevention - Regular connection pool monitoring - Code reviews for connection management - Load testing with realistic scenarios ``` -------------------------------- ### Create Onboarding Guide Documentation Source: https://docs.port.io/guides/all/find-internal-documentation-with-ai Use this JSON structure to create a new internal documentation entity for a developer onboarding guide. Ensure all properties are correctly populated. ```json { "properties": { "content": "# New Developer Onboarding Guide\n\n## Week 1: Environment Setup\n\n### Day 1-2: Development Environment\n1. **Access Setup**\n - Request VPN access\n - Set up development machine\n - Install required tools (Docker, Git, IDE)\n\n2. **Repository Access**\n - Clone main repositories\n - Set up SSH keys\n - Configure Git settings\n\n### Day 3-5: First Project\n1. **Choose Starter Task**\n - Pick from \"good first issue\" list\n - Set up local development environment\n - Make first contribution\n\n## Week 2: Team Integration\n\n### Meetings and Processes\n1. **Team Meetings**\n - Daily standups (9:30 AM)\n - Weekly planning (Monday 2 PM)\n - Retrospectives (Friday 4 PM)\n\n2. **Development Process**\n - Code review process\n - Testing requirements\n - Deployment procedures\n\n## Resources\n- [Internal Wiki](https://wiki.company.com)\n- [API Documentation](/docs/api)\n- [Architecture Overview](/docs/architecture)\n- [Team Slack Channel](#dev-team)", "documentType": "Onboarding", "product": "Engineering", "team": "Engineering", "owner": "hr@company.com", "lastUpdated": "2024-01-10T09:00:00.000Z", "version": "3.0.0", "status": "Approved", "tags": ["onboarding", "new-hires", "development", "process"], "summary": "Complete onboarding guide for new developers joining the engineering team", "audience": "New Hires", "priority": "High" }, "relations": {}, "icon": "FileText", "identifier": "dev-onboarding-guide", "title": "New Developer Onboarding Guide" } ``` -------------------------------- ### Get Access Token with Javascript (Axios) Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-override This snippet demonstrates how to get an access token using Axios in Javascript. Make sure to install the 'axios' package. ```javascript const axios = require("axios").default; const CLIENT_ID = "YOUR_CLIENT_ID"; const CLIENT_SECRET = "YOUR_CLIENT_SECRET"; const API_URL = "https://api.port.io/v1"; (async () => { const response = await axios.post(`${API_URL}/auth/access_token`, { clientId: CLIENT_ID, clientSecret: CLIENT_SECRET, }); const accessToken = response.data.accessToken; // You can now use the value in accessToken when making further requests const config = { headers: { Authorization: `Bearer ${accessToken}`, }, }; // ... rest of the code to use accessToken ``` -------------------------------- ### Basic Webhook Example Source: https://docs.port.io/workflows/build-workflows/action-nodes/webhook A basic example demonstrating how to send a POST request to an external API with service deployment details from trigger inputs. ```APIDOC ## Basic Webhook Example This example shows sending a POST request to an external API, passing service deployment details. ```json { "identifier": "send-webhook", "title": "Send Webhook", "config": { "type": "WEBHOOK", "url": "https://api.example.com/deploy", "method": "POST", "body": { "service": "{{ .outputs.trigger.service }}", "version": "{{ .outputs.trigger.version }}", "environment": "{{ .outputs.trigger.environment }}" } } } ``` ``` -------------------------------- ### Comprehensive Deployment Form Configuration Source: https://docs.port.io/workflows/build-workflows/self-service-trigger/advanced-input-configurations Example configuration for a deployment form, demonstrating input dependencies, conditional defaults, visibility controls, disabled inputs, and form validations. ```json { "userInputs": { "properties": { "environment": { "type": "string", "title": "Environment", "enum": ["development", "staging", "production"], "enumColors": { "development": "blue", "staging": "orange", "production": "green" } }, "service": { "type": "string", "format": "entity", "blueprint": "service", "title": "Service", "dataset": { "combinator": "and", "rules": [ { "property": "environment", "operator": "=", "value": { "jqQuery": ".form.environment" } } ] } }, "version": { "type": "string", "title": "Version", "description": "Version tag to deploy" }, "replicas": { "type": "number", "title": "Replicas", "default": { "jqQuery": "if .form.environment == \"production\" then 3 else 1 end" }, "minimum": 1, "maximum": 10 }, "enableMonitoring": { "type": "boolean", "title": "Enable Monitoring", "default": { "jqQuery": ".form.environment == \"production\"" } }, "monitoringEndpoint": { "type": "string", "format": "url", "title": "Monitoring Endpoint", "visible": { "jqQuery": ".form.enableMonitoring == true" } }, "approver": { "type": "string", "format": "user", "title": "Approver", "disabled": { "jqQuery": ".form.environment != \"production\"" } } }, "required": ["environment", "service", "version", "approver"], "order": [ "environment", "service", "version", "replicas", "enableMonitoring", "monitoringEndpoint", "approver" ], "validations": [ { "constraint": "if .form.environment == \"production\" then .form.replicas >= 2 else true end", "message": "Production deployments require at least 2 replicas" } ] } } ``` -------------------------------- ### get_integration_kinds_with_examples Source: https://docs.port.io/ai-interfaces/port-mcp-server/available-tools Get a list of kinds associated with an integration, along with example data for each kind. ```APIDOC ## get_integration_kinds_with_examples ### Description Get a list of kinds associated with an integration, along with example data for each kind. ### Method GET ### Endpoint /integrations/{integrationIdentifier}/kinds/examples ### Parameters #### Path Parameters - **integrationIdentifier** (string) - Required - The identifier of the integration. ### Response #### Success Response (200) - **kinds** (object) - An object where keys are kind names and values are example data for that kind. #### Response Example ```json { "kinds": { "user": { "id": "user_id_example", "name": "User Name Example" }, "repository": { "id": "repo_id_example", "url": "http://example.com/repo" } } } ``` ``` -------------------------------- ### Get Access Token using Python Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api This Python script uses the 'requests' library to authenticate with the Port API and retrieve an access token. Ensure 'requests' is installed (`pip install requests`). ```python # Dependencies to install: # $ python -m pip install requests import requests CLIENT_ID = 'YOUR_CLIENT_ID' CLIENT_SECRET = 'YOUR_CLIENT_SECRET' API_URL = 'https://api.port.io/v1' credentials = {'clientId': CLIENT_ID, 'clientSecret': CLIENT_SECRET} token_response = requests.post(f'{API_URL}/auth/access_token', json=credentials) access_token = token_response.json()['accessToken'] # You can now use the value in access_token when making further requests ``` -------------------------------- ### Create Deployment Summary Source: https://docs.port.io/build-your-software-catalog/manage-port-across-environments This script generates a summary of the resource promotion process, including the resource type and name, and appends it to the GitHub step summary. ```bash echo "## 🚀 Resource Promotion Summary" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Resource Type:** ${{ github.event.inputs.resource_type }}" >> $GITHUB_STEP_SUMMARY if [ -n "${{ github.event.inputs.resource_name }}" ]; then echo "**Resource Name:** ${{ github.event.inputs.resource_name }}" >> $GITHUB_STEP_SUMMARY else echo "**Resource Name:** All resources of type" >> $GITHUB_STEP_SUMMARY fi ``` -------------------------------- ### Initialize Port API Client Source: https://docs.port.io/build-your-software-catalog/custom-integration/webhook/examples/jfrog Load environment variables, initialize logging, and set up Port API credentials to obtain an access token. ```python import logging import os import time from datetime import datetime import dotenv import requests dotenv.load_dotenv() logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) PORT_API_URL = "https://api.port.io/v1" PORT_CLIENT_ID = os.getenv("PORT_CLIENT_ID") PORT_CLIENT_SECRET = os.getenv("PORT_CLIENT_SECRET") JFROG_ACCESS_TOKEN = os.getenv("JFROG_ACCESS_TOKEN") JFROG_HOST_URL = os.getenv("JFROG_HOST_URL") class Blueprint: REPOSITORY = "jfrogRepository" BUILD = "jfrogBuild" PROJECT = "jfrogProject" CONTAINER_IMAGE = "containerImage" CONTAINER_VULNERABILITY = "containerVulnerability" ## Get Port Access Token credentials = {"clientId": PORT_CLIENT_ID, "clientSecret": PORT_CLIENT_SECRET} token_response = requests.post(f"{PORT_API_URL}/auth/access_token", json=credentials) access_token = token_response.json()["accessToken"] ``` -------------------------------- ### Get Access Token using JavaScript (axios) Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/api This JavaScript code snippet uses the 'axios' library to authenticate with the Port API and retrieve an access token. Ensure 'axios' is installed (`npm install axios`). ```javascript // Dependencies to install: // $ npm install axios --save const axios = require("axios").default; const CLIENT_ID = "YOUR_CLIENT_ID"; const CLIENT_SECRET = "YOUR_CLIENT_SECRET"; const API_URL = "https://api.port.io/v1"; (async () => { const response = await axios.post(`${API_URL}/auth/access_token`, { clientId: CLIENT_ID, clientSecret: CLIENT_SECRET, }); const accessToken = response.data.accessToken; // You can now use the value in accessToken when making further requests ``` -------------------------------- ### Install and Build Metrics Exporter CLI Source: https://docs.port.io/guides/all/pull-github-metrics-and-build-visualizations Install the necessary dependencies, build the project, and link the command-line interface for the GitHub metrics exporter. This prepares the tool for execution. ```bash npm install npm run build npm link ``` -------------------------------- ### Create or Override Entity using Javascript Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-override This Javascript example uses `axios` to create or override an entity. Install `axios` with `npm install axios --save`. The `upsert=true` query parameter is essential for this operation. ```javascript const axios = require("axios").default; const CLIENT_ID = "YOUR_CLIENT_ID"; const CLIENT_SECRET = "YOUR_CLIENT_SECRET"; const API_URL = "https://api.port.io/v1"; (async () => { const response = await axios.post(`${API_URL}/auth/access_token`, { clientId: CLIENT_ID, clientSecret: CLIENT_SECRET, }); const accessToken = response.data.accessToken; const blueprintId = "MY_BLUEPRINT"; const config = { headers: { Authorization: `Bearer ${accessToken}`, }, }; const entity = { identifier: "MY_ENTITY_IDENTIFIER", title: "MY TITLE", properties: { MY_STRING_PROP: "MY VALUE", MY_BOOLEAN_PROP: false, }, relations: {}, }; const postResponse = await axios.post( `${API_URL}/blueprints/${blueprintId}/entities?upsert=true`, entity, config ); })(); ``` -------------------------------- ### Install with Certificate File Reference Source: https://docs.port.io/actions-and-automations/setup-backend/webhook/port-execution-agent/usage Install the Port Agent using Helm, providing a custom values.yaml file and using '--set-file' to specify the path to the self-signed certificate file. ```bash helm install my-port-agent port-labs/port-agent \ --create-namespace --namespace port-agent \ -f custom_values.yaml \ --set selfSignedCertificate.enabled=true \ --set-file selfSignedCertificate.certificate=/PATH/TO/CERTIFICATE.crt ``` -------------------------------- ### Get Current Kubernetes Context Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/kubernetes-stack/kubernetes/templates/full-kubernetes-exporter Use this command to check the name of the Kubernetes cluster context where the exporter will be installed. ```bash kubectl config current-context ``` -------------------------------- ### JavaScript (Node.js): Search Entities Source: https://docs.port.io/search-and-query/examples This Node.js example demonstrates how to authenticate and then search for entities. Ensure 'axios' is installed. ```javascript // Dependencies to install: // $ npm install axios --save const axios = require("axios").default; const CLIENT_ID = "YOUR_CLIENT_ID"; const CLIENT_SECRET = "YOUR_CLIENT_SECRET"; const API_URL = "https://api.port.io/v1"; (async () => { const tokenResp = await axios.post(`${API_URL}/auth/access_token`, { clientId: CLIENT_ID, clientSecret: CLIENT_SECRET, }); const accessToken = tokenResp.data.accessToken; // You can now use the value in accessToken when making further requests const config = { headers: { Authorization: `Bearer ${accessToken}`, }, }; const query = { combinator: "or", rules: [ { property: "$title", operator: "=", value: "admin-prod", }, { property: "$title", operator: "=", value: "admin-test", }, ], }; const response = await axios.post( `${API_URL}/entities/search`, query, config ); console.log(response.data["entities"]); })(); ``` -------------------------------- ### Filter Lambda Functions by Name Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/cloud-providers/aws/aws-exporter Example JQ query to sync only Lambda functions whose names do not start with 'amplify'. ```json query: .FunctionName | startswith("amplify") | not ``` -------------------------------- ### Initialize Port Client and Read File Source: https://docs.port.io/customize-pages-dashboards-and-plugins/page/dashboard-page Sets up the Port client and reads markdown content from a file using Node.js 'fs' module. ```typescript import * as pulumi from "@pulumi/pulumi"; import * as port from "@port-labs/port"; import * as fs from "fs"; // Assuming we use Node's 'fs' module for file reading ``` -------------------------------- ### Install AWS Integration with Helm Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/cloud-providers/aws/installations/installation Use this command to install the AWS integration via Helm. Ensure you have set the PORT_CLIENT_ID, PORT_CLIENT_SECRET_ID, and AWS access keys as environment variables. This configuration enables resource initialization and raw data examples. ```bash helm repo add --force-update port-labs https://port-labs.github.io/helm-charts helm upgrade --install aws port-labs/port-ocean \ --set port.clientId="$PORT_CLIENT_ID" \ --set port.clientSecret="$PORT_CLIENT_SECRET_ID" \ --set port.baseUrl="https://api.port.io" \ --set initializePortResources=true \ --set sendRawDataExamples=true \ --set scheduledResyncInterval=1440 \ --set integration.identifier="my-aws" \ --set integration.type="aws" \ --set integration.eventListener.type="POLLING" \ --set integration.config.awsAccessKeyId="$AWS_ACCESS_KEY_ID" \ --set integration.config.awsSecretAccessKey="$AWS_SECRET_ACCESS_KEY" \ --set integration.config.maximumConcurrentAccounts=50 ``` -------------------------------- ### Install Port Kubernetes Exporter Source: https://docs.port.io/build-your-software-catalog/sync-data-to-catalog/kubernetes-stack/kubernetes/templates/full-kubernetes-exporter Configure cluster name and Port credentials, then download and execute the installation script to deploy the Kubernetes exporter. ```bash export CLUSTER_NAME="my-cluster" export PORT_CLIENT_ID="my-port-client-id" export PORT_CLIENT_SECRET="my-port-client-secret" curl -s https://raw.githubusercontent.com/port-labs/template-assets/main/kubernetes/install.sh | bash ``` -------------------------------- ### Get Entity with Javascript (Axios) Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-override Fetch a specific entity using Axios. This example assumes you have already obtained an access token. ```javascript const blueprintId = "MY_BLUEPRINT"; const entityId = "MY_ENTITY_IDENTIFIER"; const getResponse = await axios.get( `${API_URL}/blueprints/${blueprintId}/entities/${entityId}`, config ); // getResponse.data contains the content of the resulting entity ``` -------------------------------- ### Initialize Git Repository and Commit Source: https://docs.port.io/guides/all/scaffold-repositories-using-cookiecutter Initializes a Git repository in the scaffolded directory, adds all files, and makes the initial commit. ```bash git config --global user.name "Mighty Scaffolder" git config --global init.defaultBranch "main" cd "scaffold_out/$SERVICE_NAME" git init git add . git commit -m "Initial commit" ``` -------------------------------- ### Create GitHub (Ocean) Action to Start EC2 Instance Source: https://docs.port.io/guides/all/visualize-and-manage-aws-ec2-instances Configure this Port action to initiate a GitHub workflow for starting an EC2 instance using an integration. Ensure you replace the placeholder for your GitHub Ocean integration installation ID, organization, and repository. ```json { "identifier": "start_ec2_instance", "title": "Start EC2 Instance", "icon": "EC2", "description": "Start an EC2 Instance", "trigger": { "type": "self-service", "operation": "DAY-2", "userInputs": { "properties": {}, "required": [] }, "blueprintIdentifier": "ec2Instance" }, "invocationMethod": { "type": "INTEGRATION_ACTION", "installationId": "", "integrationActionType": "dispatch_workflow", "integrationActionExecutionProperties": { "org": "", "repo": "", "workflow": "start-instance.yaml", "workflowInputs": { "port_context": { "entity": "{{ .entity }}", "blueprint": "{{ .action.blueprint }}", "runId": "{{ .run.id }}" } }, "reportWorkflowStatus": true } }, "requiredApproval": false } ``` -------------------------------- ### Get Access Token with Python Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-override Use this snippet to obtain an access token for authenticating API requests. Ensure you have the 'requests' library installed. ```python import requests CLIENT_ID = 'YOUR_CLIENT_ID' CLIENT_SECRET = 'YOUR_CLIENT_SECRET' API_URL = 'https://api.port.io/v1' credentials = {'clientId': CLIENT_ID, 'clientSecret': CLIENT_SECRET} token_response = requests.post(f'{API_URL}/auth/access_token', json=credentials) access_token = token_response.json()['accessToken'] # You can now use the value in access_token when making further requests headers = { 'Authorization': f'Bearer {access_token}' } ``` -------------------------------- ### Install Airbyte CLI Source: https://docs.port.io/guides/all/ingest-hibob-data-via-airbyte-s3-and-webhook Installs the Airbyte command-line interface tool. Ensure Docker is running. ```bash curl -LsfS https://get.airbyte.com | bash - ``` -------------------------------- ### Install Port Pulumi Provider with NPM Source: https://docs.port.io/build-your-software-catalog/custom-integration/iac/pulumi Install the Port Pulumi provider using NPM. ```bash npm install @port-labs/port ``` -------------------------------- ### Get Access Token using Python Source: https://docs.port.io/build-your-software-catalog/custom-integration/api?operation=create-update This snippet shows how to obtain an access token using client credentials in Python. Ensure you have the 'requests' library installed. ```python import requests CLIENT_ID = 'YOUR_CLIENT_ID' CLIENT_SECRET = 'YOUR_CLIENT_SECRET' API_URL = 'https://api.port.io/v1' credentials = {'clientId': CLIENT_ID, 'clientSecret': CLIENT_SECRET} token_response = requests.post(f'{API_URL}/auth/access_token', json=credentials) access_token = token_response.json()['accessToken'] # You can now use the value in access_token when making further requests ```