Set up a notification channel
Set up a notification channel so nullplatform can send scope service actions to your runner.
Create an agent notification channel
To configure this, use our CLI or send a POST request with the endpoint details.
Example request
- CLI
- cURL
np notification channel create \
--body '{
"nrn": "organization=1:account=2:namespace=3:application=4",
"source": ["service"],
"type": "agent",
"configuration": {
"api_key": "AAAA.1234567890abcdef1234567890abcdefPTs=",
"command": {
"data": {
"cmdline": "/root/.np/services/entrypoint --service-path=/root/.np/services/kubernetes",
"environment": { "NP_ACTION_CONTEXT": "${NOTIFICATION_CONTEXT}" }
},
"type": "exec"
},
"selector": {}
},
"filters": {
"service.specification.slug": "$service-spec-slug"
}
}'
curl -L -X POST 'https://api.nullplatform.com/notification/channel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"nrn": "organization=1:account=2:namespace=3:application=4",
"source": ["service"],
"type": "agent",
"configuration": {
"api_key": "AAAA.1234567890abcdef1234567890abcdefPTs=",
"command": {
"data": {
"cmdline": "/root/.np/services/entrypoint --service-path=/root/.np/services/kubernetes",
"environment": { "NP_ACTION_CONTEXT": "${NOTIFICATION_CONTEXT}" }
},
"type": "exec"
},
"selector": {}
},
"filters": {
"service.specification.slug": "$service-spec-slug"
}
}'
Request details
nrn
: The NRN of the resource (including child resources) where the action applies.source
: The system emitting the notification. For custom scopes, set this toservice
.type
: The type of notification channel. For custom scopes, useagent
.configuration
: Configuration options for the agent.api_key
: The API key for the agent.command
: Describes the command the agent will execute.
filters
: MongoDB-style query that filters which service notifications trigger the runner.
See the API docs for more information on this request.
Once your channel is set up, nullplatform will start relaying events to your runner when relevant service actions are triggered.