All URIs are relative to http://localhost/api
Method | HTTP request | Description |
---|---|---|
webhooks_get | GET /webhooks | List webhooks |
webhooks_id_delete | DELETE /webhooks/{id} | Delete a webhook |
webhooks_post | POST /webhooks | Create a webhook |
webhooks_token_post | POST /webhooks/{token} | Execute a webhook |
list[PortainerWebhook] webhooks_get(body, endpoint_id=endpoint_id, resource_id=resource_id)
List webhooks
from __future__ import print_function
import time
import portainer_ce_api
from portainer_ce_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: jwt
configuration = portainer_ce_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = portainer_ce_api.WebhooksApi(portainer_ce_api.ApiClient(configuration))
body = portainer_ce_api.WebhooksWebhookCreatePayload() # WebhooksWebhookCreatePayload | Webhook data
endpoint_id = 56 # int | (optional)
resource_id = 'resource_id_example' # str | (optional)
try:
# List webhooks
api_response = api_instance.webhooks_get(body, endpoint_id=endpoint_id, resource_id=resource_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->webhooks_get: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | WebhooksWebhookCreatePayload | Webhook data | |
endpoint_id | int | [optional] | |
resource_id | str | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
webhooks_id_delete(id)
Delete a webhook
from __future__ import print_function
import time
import portainer_ce_api
from portainer_ce_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: jwt
configuration = portainer_ce_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = portainer_ce_api.WebhooksApi(portainer_ce_api.ApiClient(configuration))
id = 56 # int | Webhook id
try:
# Delete a webhook
api_instance.webhooks_id_delete(id)
except ApiException as e:
print("Exception when calling WebhooksApi->webhooks_id_delete: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | int | Webhook id |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PortainerWebhook webhooks_post(body)
Create a webhook
from __future__ import print_function
import time
import portainer_ce_api
from portainer_ce_api.rest import ApiException
from pprint import pprint
# Configure API key authorization: jwt
configuration = portainer_ce_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = portainer_ce_api.WebhooksApi(portainer_ce_api.ApiClient(configuration))
body = portainer_ce_api.WebhooksWebhookCreatePayload() # WebhooksWebhookCreatePayload | Webhook data
try:
# Create a webhook
api_response = api_instance.webhooks_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhooksApi->webhooks_post: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | WebhooksWebhookCreatePayload | Webhook data |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
webhooks_token_post(token)
Execute a webhook
Acts on a passed in token UUID to restart the docker service
from __future__ import print_function
import time
import portainer_ce_api
from portainer_ce_api.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = portainer_ce_api.WebhooksApi()
token = 'token_example' # str | Webhook token
try:
# Execute a webhook
api_instance.webhooks_token_post(token)
except ApiException as e:
print("Exception when calling WebhooksApi->webhooks_token_post: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
token | str | Webhook token |
void (empty response body)
No authorization required
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]