All URIs are relative to https://api.opsgenie.com
Method | HTTP request | Description |
---|---|---|
cancel_maintenance | POST /v1/maintenance/{id}/cancel | Cancel Maintenance |
create_maintenance | POST /v1/maintenance | Create Maintenance |
delete_maintenance | DELETE /v1/maintenance/{id} | Delete Maintenance |
get_maintenance | GET /v1/maintenance/{id} | Get Maintenance |
list_maintenance | GET /v1/maintenance | List Maintenance |
update_maintenance | PUT /v1/maintenance/{id} | Update Maintenance |
SuccessResponse cancel_maintenance(id)
Cancel Maintenance
Cancel maintenance with given id
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.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 = swagger_client.MaintenanceApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | Identifier of the maintenance to be searched
try:
# Cancel Maintenance
api_response = api_instance.cancel_maintenance(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling MaintenanceApi->cancel_maintenance: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the maintenance to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateMaintenanceResponse create_maintenance(body)
Create Maintenance
Creates a new maintenance
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.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 = swagger_client.MaintenanceApi(swagger_client.ApiClient(configuration))
body = swagger_client.CreateMaintenancePayload() # CreateMaintenancePayload | Request payload of the maintenance object
try:
# Create Maintenance
api_response = api_instance.create_maintenance(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling MaintenanceApi->create_maintenance: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | CreateMaintenancePayload | Request payload of the maintenance object |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuccessResponse delete_maintenance(id)
Delete Maintenance
Delete maintenance with given identifier
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.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 = swagger_client.MaintenanceApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | Identifier of the maintenance to be searched
try:
# Delete Maintenance
api_response = api_instance.delete_maintenance(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling MaintenanceApi->delete_maintenance: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the maintenance to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetMaintenanceResponse get_maintenance(id)
Get Maintenance
Returns maintenance with given id
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.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 = swagger_client.MaintenanceApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | Identifier of the maintenance to be searched
try:
# Get Maintenance
api_response = api_instance.get_maintenance(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling MaintenanceApi->get_maintenance: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the maintenance to be searched |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListMaintenanceResponse list_maintenance(type=type)
List Maintenance
List maintenance by type
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.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 = swagger_client.MaintenanceApi(swagger_client.ApiClient(configuration))
type = 'type_example' # str | Type of the maintenance list to be searched (optional)
try:
# List Maintenance
api_response = api_instance.list_maintenance(type=type)
pprint(api_response)
except ApiException as e:
print("Exception when calling MaintenanceApi->list_maintenance: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
type | str | Type of the maintenance list to be searched | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateMaintenanceResponse update_maintenance(id, body)
Update Maintenance
Update maintenance with given id
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: GenieKey
configuration = swagger_client.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 = swagger_client.MaintenanceApi(swagger_client.ApiClient(configuration))
id = 'id_example' # str | Identifier of the maintenance to be searched
body = swagger_client.UpdateMaintenancePayload() # UpdateMaintenancePayload | Request payload of the maintenance object
try:
# Update Maintenance
api_response = api_instance.update_maintenance(id, body)
pprint(api_response)
except ApiException as e:
print("Exception when calling MaintenanceApi->update_maintenance: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | str | Identifier of the maintenance to be searched | |
body | UpdateMaintenancePayload | Request payload of the maintenance object |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]