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": {
"command": {
"data": {
"cmdline": "path-to-entrypoint-file/entrypoint --service-path=\"$SERVICE_PATH\"",
"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": {
"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 agent-backed scopes, set this toservice.type: The type of notification channel. For agent-backed scopes, useagent.configuration: Configuration options for the agent.api_key(optional): Your own API key for the channel. Leave it out, and nullplatform creates and manages the credential. See Channel credential.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.