Nautobot ChatOps App API Package¶
nautobot_chatops.api
¶
REST API module for nautobot_chatops app.
serializers
¶
API Serializers for ChatOps App.
AccessGrantSerializer
¶
Bases: NautobotModelSerializer
API serializer for interacting with AccessGrant objects.
Source code in nautobot_chatops/api/serializers.py
CommandLogSerializer
¶
Bases: NautobotModelSerializer
API serializer for interacting with CommandLog objects.
Source code in nautobot_chatops/api/serializers.py
CommandTokenSerializer
¶
Bases: NautobotModelSerializer
API serializer for interacting with CommandToken objects.
Source code in nautobot_chatops/api/serializers.py
urls
¶
Django urlpatterns declaration for nautobot_chatops app.
views
¶
API Views module for the nautobot_chatops Nautobot App.
The views implemented in this module act as endpoints for various chat platforms to send requests and notifications to.
generic
¶
API Views for Nautobot Chatops.
AccessGrantViewSet
¶
Bases: NautobotModelViewSet
API viewset for interacting with AccessGrant objects.
Source code in nautobot_chatops/api/views/generic.py
CommandLogViewSet
¶
Bases: NautobotModelViewSet
API viewset for interacting with CommandLog objects.
Source code in nautobot_chatops/api/views/generic.py
CommandTokenViewSet
¶
Bases: NautobotModelViewSet
API viewset for interacting with CommandToken objects.
Source code in nautobot_chatops/api/views/generic.py
NautobotChatopsRootView
¶
Bases: APIRootView
Nautobot Chatops API root view.
Source code in nautobot_chatops/api/views/generic.py
lookup
¶
API views for dynamic lookup of platform-specific data.
AccessLookupView
¶
Bases: View
Look up a given access grant value by name.
Source code in nautobot_chatops/api/views/lookup.py
get(request, *args, **kwargs)
¶
Handle an inbound GET request for a specific access grant value.
Source code in nautobot_chatops/api/views/lookup.py
UserEmailLookupView
¶
Bases: View
Look up a user_id by email.
Source code in nautobot_chatops/api/views/lookup.py
get(request, *args, **kwargs)
¶
Handle an inbound GET request for a specific access grant value.
Source code in nautobot_chatops/api/views/lookup.py
mattermost
¶
Views to receive inbound notifications from Mattermost, parse them, and enqueue worker actions.
MattermostInteractionView
¶
Bases: View
Handle notifications resulting from a Mattermost interactive block.
Source code in nautobot_chatops/api/views/mattermost.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
get_selected_value(cmd)
staticmethod
¶
post(request, *args, **kwargs)
¶
Handle an inbound HTTP POST request representing a user interaction with a UI element.
Source code in nautobot_chatops/api/views/mattermost.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
MattermostSlashCommandView
¶
Bases: View
Handle notifications from a Mattermost /command.
Source code in nautobot_chatops/api/views/mattermost.py
post(request, *args, **kwargs)
¶
Handle an inbound HTTP POST request representing a user-issued /command.
Source code in nautobot_chatops/api/views/mattermost.py
verify_signature(request)
¶
Verify that a given request was legitimately signed by Mattermost.
https://developers.mattermost.com/integrate/slash-commands/
Returns:
Name | Type | Description |
---|---|---|
valid |
tuple
|
(valid, reason) |
Source code in nautobot_chatops/api/views/mattermost.py
ms_teams
¶
Views to receive inbound notifications from Microsoft Teams, parse them, and enqueue worker actions.
MSTeamsMessagesView
¶
Bases: View
Handle notifications from a Microsoft Teams bot.
Source code in nautobot_chatops/api/views/ms_teams.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
post(request, *args, **kwargs)
¶
Process an inbound HTTP POST request.
Source code in nautobot_chatops/api/views/ms_teams.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
get_bot_signing_keys(metadata_uri=BOT_CONNECTOR_METADATA_URI)
¶
Get the keys used by the Bot Connector service to sign requests and the associated algorithms.
Source code in nautobot_chatops/api/views/ms_teams.py
verify_jwt_token(request_headers, request_json)
¶
Verify that an inbound HTTP request is appropriately signed with a valid JWT token.
References
- https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-authentication? view=azure-bot-service-4.0#step-4-verify-the-jwt-token
- https://github.com/microsoft/BotFramework-Emulator/pull/324
Returns:
Name | Type | Description |
---|---|---|
valid |
tuple
|
(valid, reason) |
Source code in nautobot_chatops/api/views/ms_teams.py
slack
¶
Views to receive inbound notifications from Slack, parse them, and enqueue worker actions.
SlackEventAPIView
¶
Bases: View
Handle notifications resulting from a mention of the Slack app.
Source code in nautobot_chatops/api/views/slack.py
post(request, *args, **kwargs)
¶
Handle an inbound HTTP POST request representing an app mention.
Source code in nautobot_chatops/api/views/slack.py
SlackInteractionView
¶
Bases: View
Handle notifications resulting from a Slack interactive block or modal.
Source code in nautobot_chatops/api/views/slack.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
|
post(request, *args, **kwargs)
¶
Handle an inbound HTTP POST request representing a user interaction with a UI element.
Source code in nautobot_chatops/api/views/slack.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
|
SlackSlashCommandView
¶
Bases: View
Handle notifications from a Slack /command.
Source code in nautobot_chatops/api/views/slack.py
post(request, *args, **kwargs)
¶
Handle an inbound HTTP POST request representing a user-issued /command.
Source code in nautobot_chatops/api/views/slack.py
generate_signature(request)
¶
Calculate the expected signature of a given request.
Source code in nautobot_chatops/api/views/slack.py
verify_signature(request)
¶
Verify that a given request was legitimately signed by Slack.
https://api.slack.com/authentication/verifying-requests-from-slack
Returns:
Name | Type | Description |
---|---|---|
valid |
tuple
|
(valid, reason) |
Source code in nautobot_chatops/api/views/slack.py
webex
¶
Views to receive inbound notifications from Webex, parse them, and enqueue worker actions.
WebexView
¶
Bases: View
Handle all supported inbound notifications from Webex.
Source code in nautobot_chatops/api/views/webex.py
post(request, *args, **kwargs)
¶
Process an inbound HTTP POST request.
Source code in nautobot_chatops/api/views/webex.py
generate_signature(request)
¶
Calculate the expected signature of a given request.
Source code in nautobot_chatops/api/views/webex.py
verify_signature(request)
¶
Verify that a given request was legitimately signed by Webex.
https://developer.webex.com/docs/api/guides/webhooks#handling-requests-from-webex-teams
Returns:
Name | Type | Description |
---|---|---|
valid |
tuple
|
(valid, reason) |