Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PORT-4584 tigger page and more fixes #99

Merged
merged 13 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ Please leave one option from the following and delete the rest:
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Non-breaking change (fix of existing functionality that will not change current behavior)
- [ ] Documentation (added/updated documentation)

Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ headers = {
"Content-Type": "application/json"
}

payload = {
"key": "new_value"
}

response = requests.patch(url, headers=headers, json=payload)
response = requests.patch(url, headers=headers, json={})

```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This section explains the structure of the `config.yaml` file.

The `config.yaml` file is used to specify the default configuration and parameters for the integration during its deployment phase.

When an integration is first started, it registers itself with [Port's REST API](https://api.getport.io/static/index.html#/Integrations/post_v1_integration), via the `https://api.getport.io/v1/integration` route.
When an integration is first started, it registers itself with [Port's REST API](https://api.getport.io/static/index.html#/Integrations/post_v1_integration), using the `https://api.getport.io/v1/integration` route.

During this first boot registration, it uses the configuration specified in the `config.yaml` file for its default inputs and parameters (unless those are overridden by the environment variables of the running environment/shell)

Expand All @@ -27,8 +27,8 @@ Here is a brand new `config.yaml` file created as part of the `ocean new` comman
# Please copy this file to config.yaml file in the integration folder and edit it to your needs.

port:
clientId: "{{ from env PORT_CLIENT_ID }}" # Can be loaded via environment variable: PORT_CLIENT_ID
clientSecret: "{{ from env PORT_CLIENT_SECRET }}" # Can be loaded via environment variable: PORT_CLIENT_SECRET
clientId: "{{ from env PORT_CLIENT_ID }}" # Can be loaded using environment variable: PORT_CLIENT_ID
clientSecret: "{{ from env PORT_CLIENT_SECRET }}" # Can be loaded using environment variable: PORT_CLIENT_SECRET
# The event listener to use for the integration service.
eventListener:
type: KAFKA
Expand All @@ -48,8 +48,8 @@ Let's go over the different sections and their allowed values:

```yaml showLineNumbers
port:
clientId: "{{ from env PORT_CLIENT_ID }}" # Can be loaded via environment variable: PORT_CLIENT_ID
clientSecret: "{{ from env PORT_CLIENT_SECRET }}" # Can be loaded via environment variable: PORT_CLIENT_SECRET
clientId: "{{ from env PORT_CLIENT_ID }}" # Can be loaded using environment variable: PORT_CLIENT_ID
clientSecret: "{{ from env PORT_CLIENT_SECRET }}" # Can be loaded using environment variable: PORT_CLIENT_SECRET
```

This section is used to provide the integration with [credentials](https://docs.getport.io/build-your-software-catalog/sync-data-to-catalog/api/#find-your-port-credentials) to Port's API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,43 @@ import SwaggerGuide from './\_mdx/trigger-swagger-guide.md';
import CurlGuide from './\_mdx/trigger-curl-guide.md';
import PythonGuide from './\_mdx/trigger-python-guide.md';

This guide explains how you can trigger your integration using the [Port](https://app.getport.io).
This guide explains how you can trigger your integration using [Port](https://app.getport.io).

After setting up & running your integration, you can trigger it using the Port UI/ Port API.
After setting up & running your integration, you can trigger it using Port's UI/API.

Triggering your integration will run the integration resync and will resync all the data from the source into port and
creating new data, update existing data and delete data that no longer exists in the source by doing so.

## Triggering using the Port UI
## Triggering using Port's UI

1. Navigate to the [Port](https://app.getport.io) and login to your account.
2. Click on the
1. Login to [Port](https://app.getport.io) and browse to the [builder page](https://app.getport.io/dev-portal).

## Triggering using the Port API
2. Open the ingest modal by expanding one of the [blueprints](https://docs.getport.io/build-your-software-catalog/define-your-data-model/setup-blueprint/) and clicking the ingest button on the blueprint.

![Ingest Button](@site/static/img/ingest-button-1.png)

or

![Ingest Button](@site/static/img/ingest-button-2.png)

3. Select the integration you want to trigger a resync for from the list of your installed integrations.
4. Click on the `Resync` button.

![Installation Page](@site/static/img/resync-button.png)

## Triggering using Port's API

By patching the integration either with a new configuration or by patching it with no changes, The integration will
detect the trigger and will run the integration resync.
detect the trigger and perform a resync.

<Tabs>
<TabItem value="swagger" label="swagger" default>
<TabItem value="swagger" label="Swagger" default>
<SwaggerGuide/>
</TabItem>
<TabItem value="curl" label="curl">
<TabItem value="curl" label="cURL">
<CurlGuide/>
</TabItem>
<TabItem value="python" label="python">
<TabItem value="python" label="Python">
<PythonGuide/>
</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This file serves as the entrypoint for the integration logic, when you scaffold
Of course since this file is only the entrypoint, you can add as many other `.py` files as needed and construct your own directory structure including classes and modules when developing your integration.

:::tip OCEAN SAIL
When running the command `ocean sail`, the Ocean CLI triggers a run of the integration via the `main.py` file, after loading all of the necessary context and resources required by the Ocean framework.
When running the command `ocean sail`, the Ocean CLI triggers a run of the integration using the `main.py` file, after loading all of the necessary context and resources required by the Ocean framework.

:::

Expand Down
4 changes: 2 additions & 2 deletions docs/framework-guides/docs/framework/features/user-agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ Because the `UserAgentType.gitops` is specified then Ocean will query only the `

By default an integration will query entities marked with the `exporter` feature and user agent.

When a different feature is specified via the user agent, the integration performs an entity state sync only for entities managed by the specified feature.
When a different feature is specified using the user agent, the integration performs an entity state sync only for entities managed by the specified feature.
:::

### Available user agent and features

The following features use the user agent header to ingest their own managed entities:

- `exporter` - the exporter feature is used for integrations that perform a simple export and sync of entities from the 3rd-party service into Port (via queries to the 3rd-party API for example). This is the default user agent feature. This feature is used by the [sync entities state](../features/sync.md) functions
- `exporter` - the exporter feature is used for integrations that perform a simple export and sync of entities from the 3rd-party service into Port (using queries to the 3rd-party API for example). This is the default user agent feature. This feature is used by the [sync entities state](../features/sync.md) functions
when no user agent was specified
- `gitops` - the GitOps feature is used for integrations that perform an entity sync based on the state of files and entity in a Git provider (by reading the content of specification files for example)

Expand Down
6 changes: 3 additions & 3 deletions docs/framework-guides/docs/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ configurations:
# Please copy this file to config.yaml file in the integration folder and edit it to your needs.

port:
clientId: "{{ from env PORT_CLIENT_ID }}" # Can be loaded via environment variable: PORT_CLIENT_ID or OCEAN__PORT__CLIENT_ID
clientSecret: "{{ from env PORT_CLIENT_SECRET }}" # Can be loaded via environment variable: PORT_CLIENT_SECRET or OCEAN__PORT__CLIENT_SECRET
clientId: "{{ from env PORT_CLIENT_ID }}" # Can be loaded using environment variable: PORT_CLIENT_ID or OCEAN__PORT__CLIENT_ID
clientSecret: "{{ from env PORT_CLIENT_SECRET }}" # Can be loaded using environment variable: PORT_CLIENT_SECRET or OCEAN__PORT__CLIENT_SECRET
# The event listener to use for the integration service.
eventListener:
type: POLLING
integration:
# The identifier of this integration instance.
# Can be loaded via environment variable: INTEGRATION_IDENTIFIER or OCEAN__INTEGRATION__IDENTIFIER
# Can be loaded using environment variable: INTEGRATION_IDENTIFIER or OCEAN__INTEGRATION__IDENTIFIER
identifier: "{{ from env INTEGRATION_IDENTIFIER }}"
# These two should match the values in the .port/spec.yaml file
type: "My Integration type (Gitlab, Jira, etc.)"
Expand Down
30 changes: 15 additions & 15 deletions docs/framework-guides/docs/ocean-overview.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
sidebar_position: 1
slug: /
title: Ocean Overview
sidebar_label: 🌊 Ocean Overview
title: Overview
sidebar_label: 🌊 Overview
---

# 🌊 Ocean Overview
# Overview

![Thumbnail](https://github.com/port-labs/ocean/blob/f61343caa69d886f8ffe48fe05326f7442bca294/assets/Thumbnail.jpg?raw=true)

Expand All @@ -27,7 +27,7 @@ sidebar_label: 🌊 Ocean Overview

## What is Ocean?

Ocean is an open source integration framework for [Port](https://getport.io). Ocean is meant to make it easy to connect Port with your existing infrastructure and 3rd-party tools.
Ocean is an open source extensibility framework for [Port](https://getport.io). Ocean is meant to make it easy to connect Port with your existing infrastructure and 3rd-party tools.

Ocean does this by providing a streamlined interface to interact with Port, including abstractions and commonly required functionality to interact with [Port's REST API](https://api.getport.io/).

Expand All @@ -40,20 +40,20 @@ This documentation is meant to describe two main use cases for the Ocean framewo

### Why Ocean?

Port aims to be the hub for everything developers, platform, DevOps teams and other personas require in an organization, by providing an open developer portal. Because Port aims to be such a central element of an organization's R&D, it aims to truly be a virtual Port - providing a safe, organized and intuitive way to store data, enable visibility, provide self-service actions, and expose scorecards and insights.
Port aims to be the hub for everything developers, platform, DevOps teams and other personas require in an organization, by providing an open developer portal. Because Port aims to be such a central element of an organization's R&D, it aims to truly be a virtual Port - providing a safe, organized and intuitive way to store data, enable visibility, provide self-service actions, and expose scorecards, initiatives and insights.

To build on this goal, Port follows a theme of nautical elements, including in its own name, design, names of internal services and teams in the R&D department.
To build on this goal, Port follows a theme of nautical elements, including in its name, design, names of internal services and teams in the R&D department.

Following that theme, we wanted Ocean to be the ultimate framework to integrate Port with the rest of your environment, and make it easy to connect Port with your organization and infrastructure, in whichever way made sense to you. In a way, it is meant to open you an _Ocean_ of possibilities.
Following that theme, we wanted Ocean to be the ultimate framework to integrate Port with the rest of your environment, and make it easy to connect Port with your organization and infrastructure, in whichever way made sense to you. In a way, Ocean opens an _Ocean_ of possibilities (pun intended).

## How does Ocean work?

Ocean is made up of two distinct pieces:

- Ocean CLI - used to create boilerplate for new Ocean integrations, and to aid in their development.
- Ocean framework - provides common functionality and interfaces to make the development of new Port integrations faster and easier.
- Ocean framework - provides common functionalities and interfaces to make the development of new Port integrations faster and easier.

The following section explains specifically about the Ocean framework, to learn more about the Ocean CLI, refer to the [CLI](./framework/cli/cli.md) docs
The following section provides a deep dive into the Ocean framework, To learn more about the Ocean CLI, refer to the [CLI](./framework/cli/cli.md) docs

### The Ocean framework

Expand All @@ -70,24 +70,24 @@ The goal of Ocean is to provide a layer of abstraction for a multitude of common
- Trigger by querying configuration from Port
- Trigger by reading a message from a Kafka topic provided by Port
- Support a multitude of deployment methods to account for any environment, infrastructure or architecture:
- Kubernetes (via helm)
- AWS ECS (via Terraform module)
- Azure Container App (via Terraform module)
- Kubernetes (using helm)
- AWS ECS (using Terraform module)
- Azure Container App (using Terraform module)

To learn more about the tools and abstractions provided by the Ocean framework to make it easier to develop new integrations, refer to the [features](./framework/features/features.md) docs.

## How do integrations powered by the Ocean framework work?

Since Ocean provides so many abstractions and common functionality out-of-the-box, creating a new integration for Port, powered by the Ocean framework is as easy as:
Since Ocean provides many abstractions and common functionality out-of-the-box, creating a new integration for Port, powered by the Ocean framework is as easy as:

1. Scaffolding a new integration
2. Defining the inputs required by the integration
3. Writing the business logic to query information from the 3rd-party service
4. Testing the integration locally
5. Opening a PR to the Port team via the [Port Ocean](https://github.com/port-labs/port-ocean) repository on GitHub
5. Opening a PR to the Port team using the [Port Ocean](https://github.com/port-labs/port-ocean) repository on GitHub
6. Done! once the PR is approved and merged, the new integration will appear for all users in the list of available data sources

Port encourages the community to contribute their own integrations, as well as improve existing integrations and the core of the Ocean framework itself.
Port encourages members of its community to contribute their own integrations, as well as improve existing integrations and the core of the Ocean framework itself.

## Next steps

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.