Skip to content

Latest commit

 

History

History
340 lines (240 loc) · 10.4 KB

MaintenanceApi.md

File metadata and controls

340 lines (240 loc) · 10.4 KB

opsgenie_swagger.MaintenanceApi

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

cancel_maintenance

SuccessResponse cancel_maintenance(id)

Cancel Maintenance

Cancel maintenance with given id

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.MaintenanceApi(opsgenie_swagger.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)

Parameters

Name Type Description Notes
id str Identifier of the maintenance to be searched

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

create_maintenance

CreateMaintenanceResponse create_maintenance(body)

Create Maintenance

Creates a new maintenance

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.MaintenanceApi(opsgenie_swagger.ApiClient(configuration))
body = opsgenie_swagger.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)

Parameters

Name Type Description Notes
body CreateMaintenancePayload Request payload of the maintenance object

Return type

CreateMaintenanceResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_maintenance

SuccessResponse delete_maintenance(id)

Delete Maintenance

Delete maintenance with given identifier

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.MaintenanceApi(opsgenie_swagger.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)

Parameters

Name Type Description Notes
id str Identifier of the maintenance to be searched

Return type

SuccessResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_maintenance

GetMaintenanceResponse get_maintenance(id)

Get Maintenance

Returns maintenance with given id

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.MaintenanceApi(opsgenie_swagger.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)

Parameters

Name Type Description Notes
id str Identifier of the maintenance to be searched

Return type

GetMaintenanceResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_maintenance

ListMaintenanceResponse list_maintenance(type=type)

List Maintenance

List maintenance by type

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.MaintenanceApi(opsgenie_swagger.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)

Parameters

Name Type Description Notes
type str Type of the maintenance list to be searched [optional]

Return type

ListMaintenanceResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_maintenance

UpdateMaintenanceResponse update_maintenance(id, body)

Update Maintenance

Update maintenance with given id

Example

from __future__ import print_function
import time
import opsgenie_swagger
from opsgenie_swagger.rest import ApiException
from pprint import pprint

# Configure API key authorization: GenieKey
configuration = opsgenie_swagger.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 = opsgenie_swagger.MaintenanceApi(opsgenie_swagger.ApiClient(configuration))
id = 'id_example' # str | Identifier of the maintenance to be searched
body = opsgenie_swagger.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)

Parameters

Name Type Description Notes
id str Identifier of the maintenance to be searched
body UpdateMaintenancePayload Request payload of the maintenance object

Return type

UpdateMaintenanceResponse

Authorization

GenieKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]