notification-management (1.0)

Download OpenAPI specification:Download

Notification Management

pipeline status license docs

Handles notifications, alerts, webhooks, and other communication-related tasks for the 3dverse platform.

logo

Toolchain

  • direnv >=2.34 - used to automatically load environment variables defined in .envrc
  • golang >=1.24 - programming language
  • npm >=10.8 - package manager for JavaScript

Configuration

Environment Variable Type Required Default Value Description
API_SERVER_PORT int 3615 Port the server will listen on.
API_SERVER_READ_TIMEOUT time.Duration 5s Maximum duration for reading requests.
API_SERVER_WRITE_TIMEOUT time.Duration 10s Maximum duration for writing responses.
DB_URI string localhost:5432 SQL server URI.
DB_AUTH_USER string postgres SQL authentication username.
DB_AUTH_PASS string "" SQL authentication password.
DB_DATABASE string notificationmanagement SQL database to connect to.
DB_ENCRYPTION_SECRET string Secret used to encrypt some sensitive data before storing in database. Must be 32 characters in length.
DEBUG string false Enables debug routes if set to true.
ENV string development Environment the application runs in.
KAFKA_BROKERS string localhost:9092 Kafka brokers URI. Multiple addresses can be specified using , as delimiter.
KAFKA_CONSUMER_FETCH_BYTES int 1048576 Best-effort number of bytes needed before fetching from Kafka.
KAFKA_CONSUMER_FETCH_FREQUENCY time.Duration 250ms Best-effort frequency of fetches from Kafka.
KAFKA_TOPIC_PREFIX string "" Prefix to prepend to Kafka topics.
KAFKA_TOPIC_REPLICATION_FACTOR int 1 Number of copies of a topic's partitions across the cluster.
OPS_SERVER_PORT int 3616 Port the server will listen on.
OPS_SERVER_READ_TIMEOUT time.Duration 5s Maximum duration for reading requests.
OPS_SERVER_WRITE_TIMEOUT time.Duration 10s Maximum duration for writing responses.
POD_IP string 127.0.0.1 IP address of the instance. This value is set in a Kubernetes manifest.
POD_NAME string localhost Hostname of the instance. This value is set in a Kubernetes manifest.
PROJECT_MANAGEMENT_API_URI string http://localhost:8101/api URI for the Project Management API.
TZ string America/Montreal The timezone used by the application when working with dates.
WEBHOOKS_MAX_RETRIES int 3 Maximum number of retries for a webhook.
WEBHOOKS_RETRY_INTERVAL time.Duration 1s Interval between retries.
WEBHOOKS_WRITE_TIMEOUT time.Duration 10s Maximum duration for writing responses.
WEBHOOKS_PUBLIC_VERIFICATION_KEY_SIGNATURE_HEADER string X-3dverse-Signature HTTP header where the signature is stored.
WEBHOOKS_PUBLIC_VERIFICATION_KEY_SIGNATURE_TIMESTAMP_HEADER string X-3dverse-Signature-Timestamp HTTP header where the signature timestamp is stored.

How To

Start the server

Running the below command will start the API server:

go run ./main.go

Build the application

Building binaries is made using the make.go file for convenience as for example ldflags are used to set certain variables.

Other commands are available as defined below:

$ go run make.go

Tool that replaces Makefile for cross-platform development.

Usage:
    go run make.go <command> [options]

The commands are:
    build           compile packages and dependencies
    build-all       compile packages and dependencies for most platforms
    clean           remove build and test artifacts
    coverage        test packages and generate test coverage report
    coverage-html   test packages and generate test coverage report in HTML format
    generate        generate code
    init            initialize project such as setting up Git hooks
    test            test packages

Build binary for the current OS & architecture:

go run make.go build

Build multiple binaries for different OSes & architectures:

go run make.go build-all

Clean build directory:

go run make.go clean

Authors

License

This project is licensed under a proprietary license - see the LICENSE file for details.

Webhooks

Webhooks management such as creating, updating and deleting webhooks.

List all environment webhooks

List all webhooks for a specific environment.

path Parameters
environment_id
required
string <uuid> (Ext_EnvironmentId)

Target environment ID.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create webhook for environment

Create a new webhook for a specific environment.

path Parameters
environment_id
required
string <uuid> (Ext_EnvironmentId)

Target environment ID.

Request Body schema: application/json

Webhook properties.

name
required
string

Name of the webhook.

url
required
string

URL of the webhook.

method
string (HTTPMethod)
Default: "post"
Enum: "get" "post" "put" "patch" "delete"

HTTP method to be used for the webhook.

events
required
Array of strings (Event Type) non-empty
Items Enum: "pipeline-created" "pipeline-download-progress" "pipeline-extraction-progress" "pipeline-status-changed" "pipeline-completed" "job-created" "job-status-changed" "job-completed"

List of events that trigger the webhook.

description
string

Description of the webhook.

disabled_until
string <date-time>

Date and time until the webhook is disabled.

object [ 1 .. 10 ] properties

Custom headers to be sent with the webhook.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "url": "string",
  • "method": "get",
  • "events": [
    ],
  • "description": "string",
  • "disabled_until": "2019-08-24T14:15:22Z",
  • "custom_headers": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "url": "string",
  • "method": "get",
  • "events": [
    ],
  • "webhook_id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
  • "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "description": "string",
  • "disabled_until": "2019-08-24T14:15:22Z",
  • "custom_headers": {
    },
  • "last_triggered": {
    },
  • "last_errored": {
    }
}

List all webhooks events

List all events that can trigger webhooks.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get webhook by ID

Get a specific webhook by its ID.

path Parameters
webhook_id
required
string <uuid> (Webhook ID)

Target webhook ID.

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "url": "string",
  • "method": "get",
  • "events": [
    ],
  • "webhook_id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
  • "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "description": "string",
  • "disabled_until": "2019-08-24T14:15:22Z",
  • "custom_headers": {
    },
  • "last_triggered": {
    },
  • "last_errored": {
    }
}

Update webhook by ID

Update a specific webhook by its ID.

path Parameters
webhook_id
required
string <uuid> (Webhook ID)

Target webhook ID.

Request Body schema: application/json

Webhook properties.

name
required
string

Name of the webhook.

url
required
string

URL of the webhook.

method
string (HTTPMethod)
Default: "post"
Enum: "get" "post" "put" "patch" "delete"

HTTP method to be used for the webhook.

events
required
Array of strings (Event Type) non-empty
Items Enum: "pipeline-created" "pipeline-download-progress" "pipeline-extraction-progress" "pipeline-status-changed" "pipeline-completed" "job-created" "job-status-changed" "job-completed"

List of events that trigger the webhook.

description
string

Description of the webhook.

disabled_until
string <date-time>

Date and time until the webhook is disabled.

object [ 1 .. 10 ] properties

Custom headers to be sent with the webhook.

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "url": "string",
  • "method": "get",
  • "events": [
    ],
  • "description": "string",
  • "disabled_until": "2019-08-24T14:15:22Z",
  • "custom_headers": {
    }
}

Response samples

Content type
application/json
{
  • "name": "string",
  • "url": "string",
  • "method": "get",
  • "events": [
    ],
  • "webhook_id": "a47606a1-5b39-4a81-9480-c2cb738ff675",
  • "environment_id": "40ef0e48-a11f-4963-a229-e396c9f7e7c4",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "description": "string",
  • "disabled_until": "2019-08-24T14:15:22Z",
  • "custom_headers": {
    },
  • "last_triggered": {
    },
  • "last_errored": {
    }
}

Delete webhook by ID

Delete a specific webhook by its ID.

path Parameters
webhook_id
required
string <uuid> (Webhook ID)

Target webhook ID.

Responses

Response samples

Content type
application/json
{
  • "error_code": 0,
  • "http_code": 0,
  • "internal_message": "string",
  • "message": "string",
  • "stacktrace": [
    ]
}

List webhook logs

List logs for a specific webhook.

path Parameters
webhook_id
required
string <uuid> (Webhook ID)

Target webhook ID.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Settings

Get all environment settings

Get all settings for a specific environment, such as the public encryption key used to verify webhook payloads, etc.

path Parameters
environment_id
required
string <uuid> (Ext_EnvironmentId)

Unique identifier of an environment

Responses

Response samples

Content type
application/json
{
  • "public_verification_key": {
    }
}