Skip to content

Latest commit

 

History

History
448 lines (317 loc) · 14 KB

DeprecatedPolicyApi.md

File metadata and controls

448 lines (317 loc) · 14 KB

swagger_client.DeprecatedPolicyApi

All URIs are relative to https://api.opsgenie.com

Method HTTP request Description
change_alert_policy_order POST /v1/policies/{policyId}/change-order Change Alert Policy Order
create_alert_policy POST /v1/policies Create Alert Policy
delete_alert_policy DELETE /v1/policies/{policyId} Delete Alert Policy
disable_alert_policy POST /v1/policies/{policyId}/disable Disable Alert Policy
enable_alert_policy POST /v1/policies/{policyId}/enable Enable Alert Policy
get_alert_policy GET /v1/policies/{policyId} Get Alert Policy
list_alert_policies GET /v1/policies List Alert Policies
update_alert_policy PUT /v1/policies/{policyId} Update Alert Policy

change_alert_policy_order

SuccessResponse change_alert_policy_order(policy_id, body)

Change Alert Policy Order

Change execution order of the alert policy with given id

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
policy_id = 'policy_id_example' # str | Id of the requested policy
body = swagger_client.DeprecatedChangeAlertPolicyOrderPayload() # DeprecatedChangeAlertPolicyOrderPayload | Change order payload

try:
    # Change Alert Policy Order
    api_response = api_instance.change_alert_policy_order(policy_id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->change_alert_policy_order: %s\n" % e)

Parameters

Name Type Description Notes
policy_id str Id of the requested policy
body DeprecatedChangeAlertPolicyOrderPayload Change order payload

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_alert_policy

DeprecatedCreateAlertPolicyResponse create_alert_policy(body)

Create Alert Policy

Creates a new alert policy

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
body = swagger_client.DeprecatedAlertPolicy() # DeprecatedAlertPolicy | Payload of created alert policy

try:
    # Create Alert Policy
    api_response = api_instance.create_alert_policy(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->create_alert_policy: %s\n" % e)

Parameters

Name Type Description Notes
body DeprecatedAlertPolicy Payload of created alert policy

Return type

DeprecatedCreateAlertPolicyResponse

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_alert_policy

SuccessResponse delete_alert_policy(policy_id)

Delete Alert Policy

Delete alert policy with given id

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
policy_id = 'policy_id_example' # str | Id of the requested policy

try:
    # Delete Alert Policy
    api_response = api_instance.delete_alert_policy(policy_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->delete_alert_policy: %s\n" % e)

Parameters

Name Type Description Notes
policy_id str Id of the requested policy

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]

disable_alert_policy

SuccessResponse disable_alert_policy(policy_id)

Disable Alert Policy

Disable the alert policy with given id

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
policy_id = 'policy_id_example' # str | Id of the requested policy

try:
    # Disable Alert Policy
    api_response = api_instance.disable_alert_policy(policy_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->disable_alert_policy: %s\n" % e)

Parameters

Name Type Description Notes
policy_id str Id of the requested policy

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]

enable_alert_policy

SuccessResponse enable_alert_policy(policy_id)

Enable Alert Policy

Enable the alert policy with given id

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
policy_id = 'policy_id_example' # str | Id of the requested policy

try:
    # Enable Alert Policy
    api_response = api_instance.enable_alert_policy(policy_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->enable_alert_policy: %s\n" % e)

Parameters

Name Type Description Notes
policy_id str Id of the requested policy

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_alert_policy

DeprecatedGetAlertPolicyResponse get_alert_policy(policy_id)

Get Alert Policy

Used to get details of a single policy with id

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
policy_id = 'policy_id_example' # str | Id of the requested policy

try:
    # Get Alert Policy
    api_response = api_instance.get_alert_policy(policy_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->get_alert_policy: %s\n" % e)

Parameters

Name Type Description Notes
policy_id str Id of the requested policy

Return type

DeprecatedGetAlertPolicyResponse

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_alert_policies

DeprecatedListAlertPoliciesResponse list_alert_policies()

List Alert Policies

Returns list alert policies

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))

try:
    # List Alert Policies
    api_response = api_instance.list_alert_policies()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->list_alert_policies: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

DeprecatedListAlertPoliciesResponse

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_alert_policy

SuccessResponse update_alert_policy(policy_id, body)

Update Alert Policy

Update alert policy with given id

Example

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.DeprecatedPolicyApi(swagger_client.ApiClient(configuration))
policy_id = 'policy_id_example' # str | Id of the requested policy
body = swagger_client.DeprecatedAlertPolicy() # DeprecatedAlertPolicy | Payload of updated alert policy

try:
    # Update Alert Policy
    api_response = api_instance.update_alert_policy(policy_id, body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DeprecatedPolicyApi->update_alert_policy: %s\n" % e)

Parameters

Name Type Description Notes
policy_id str Id of the requested policy
body DeprecatedAlertPolicy Payload of updated alert policy

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]