Usage methods
Port supports a variety integrations, apps and tools that allow you to model your software catalog, ingest data and invoke actions, some of the core setup methods are:
- Port's API;
- Port's Terraform provider;
- Port's web UI.
See the section below to understand how to use the different methods to define your blueprints and relations:
To use Port's API and Terraform provider, you will need API credentials.
To get your Port API credentials go to your Port application, click on the ...
button in the top right corner, and select Credentials
. Here you can view and copy your CLIENT_ID
and CLIENT_SECRET
:
- API
- Terraform
- UI
Port's API provides a convenient REST interface to perform CRUD operations in your software catalog.
Port's API base URL is: https://api.getport.io/v1
The API supports all common HTTP methods: GET
, POST
, PUT
, PATCH
, DELETE
All API endpoints follow a resource based access schema, for example:
- Blueprint based routes start with:
https://api.getport.io/v1/blueprints
; - Entity based routes start with:
https://api.getport.io/v1/blueprints/{blueprint_identifier}/entities
(because they are a resource tied to blueprints); - Self-service action based routes start with:
https://api.getport.io/v1/blueprints/{blueprint_identifier}/actions
; - Scorecards based routes start with:
https://api.getport.io/v1/blueprints/{blueprint_identifier}/scorecards
; - etc.
To learn more about the JSON structure of different API objects, refer to their respective category and structure reference, for example - blueprint structure.
Check out Port's API reference to learn more.
Port's Terraform provider allows you to configure your software catalog using Infrastructure-as-Code (IaC).
To install and use Port's Terraform provider, you will need to install the Terraform CLI
To install the Terraform provider, create a .tf
file specifying the provider and the required Port credentials:
terraform {
required_providers {
port = {
source = "port-labs/port-labs"
version = "~> 2.0.3"
}
}
}
provider "port" {
client_id = "{YOUR CLIENT ID}" # or set the environment variable PORT_CLIENT_ID
secret = "{YOUR CLIENT SECRET}" # or set the environment variable PORT_CLIENT_SECRET
base_url = "https://api.getport.io"
}
The baseUrl
, port_region
, port.baseUrl
, portBaseUrl
, port_base_url
and OCEAN__PORT__BASE_URL
parameters are used to select which instance or Port API will be used.
Port exposes two API instances, one for the EU region of Port, and one for the US region of Port.
- If you use the EU region of Port, available at https://app.getport.io, your Port API URL is
https://api.getport.io
- If you use the US region of Port, available at https://app.us.getport.io, your Port API URL is
https://api.us.getport.io
Then run the following command to install the provider in your Terraform workspace:
terraform init
To create a blueprint using Port's Terraform provider you need a .tf
file defining a port_blueprint
resource:
resource "port_blueprint" "myBlueprint" {
title = "My blueprint"
icon = "My icon"
identifier = "myIdentifier"
description = "My description"
}
Then run terraform plan
to view the new blueprint that will be created, and terraform apply
to create the blueprint you defined, inside Port's software catalog.
To learn more about the Terraform resource definition of different API objects, refer to their respective category and structure reference, for example - configure blueprints in Port and Terraform provider.
To configure your software catalog using the UI, go to the DevPortal Builder page and follow the add blueprint
UI, ingest data
modal and other visual tools that help you configure Port.