OpsGenie REST API v0.1.0 OpsGenieRESTAPI.Api.Policy

API calls for all endpoints tagged Policy.

Link to this section Summary

Functions

Change Policy Order Change execution order of the policy with given id

Create Policy Creates a new policy

Delete Policy Delete policy with given id

Disable Policy Disable the policy with given id

Enable Policy Enable the policy with given id

Get Policy Used to get details of a single policy with id

List Alert Policies Returns the list of alert policies

List Notification Policies Returns the list of notification policies

Update Policy Update alert policy with given id

Link to this section Functions

Link to this function change_policy_order(connection, policy_id, body, opts \\ [])

Change Policy Order Change execution order of the policy with given id

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • policy_id (String.t): Id of the requested policy
  • body (ChangePolicyOrderPayload): Change order payload
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (String.t): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success {:error, info} on failure

Link to this function create_policy(connection, body, opts \\ [])

Create Policy Creates a new policy

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • body (Policy): Payload of created policy
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.CreatePolicyResponse{}} on success {:error, info} on failure

Link to this function delete_policy(connection, policy_id, opts \\ [])
delete_policy(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t()} | {:error, Tesla.Env.t()}

Delete Policy Delete policy with given id

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • policy_id (String.t): Id of the requested policy
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success {:error, info} on failure

Link to this function disable_policy(connection, policy_id, opts \\ [])
disable_policy(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t()} | {:error, Tesla.Env.t()}

Disable Policy Disable the policy with given id

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • policy_id (String.t): Id of the requested policy
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success {:error, info} on failure

Link to this function enable_policy(connection, policy_id, opts \\ [])
enable_policy(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, OpsGenieRESTAPI.Model.SuccessResponse.t()} | {:error, Tesla.Env.t()}

Enable Policy Enable the policy with given id

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • policy_id (String.t): Id of the requested policy
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success {:error, info} on failure

Link to this function get_policy(connection, policy_id, opts \\ [])

Get Policy Used to get details of a single policy with id

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • policy_id (String.t): Id of the requested policy
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.GetPolicyResponse{}} on success {:error, info} on failure

Link to this function list_alert_policies(connection, opts \\ [])
list_alert_policies(Tesla.Env.client(), keyword()) ::
  {:ok, OpsGenieRESTAPI.Model.ListPoliciesResponse.t()}
  | {:error, Tesla.Env.t()}

List Alert Policies Returns the list of alert policies

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.ListPoliciesResponse{}} on success {:error, info} on failure

Link to this function list_notification_policies(connection, opts \\ [])
list_notification_policies(Tesla.Env.client(), keyword()) ::
  {:ok, OpsGenieRESTAPI.Model.ListPoliciesResponse.t()}
  | {:error, Tesla.Env.t()}

List Notification Policies Returns the list of notification policies

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (ErrorUnknown): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.ListPoliciesResponse{}} on success {:error, info} on failure

Link to this function update_policy(connection, policy_id, body, opts \\ [])

Update Policy Update alert policy with given id

Parameters

  • connection (OpsGenieRESTAPI.Connection): Connection to server
  • policy_id (String.t): Id of the requested policy
  • body (Policy): Payload of updated policy
  • opts (KeywordList): [optional] Optional parameters

    • :team_id (String.t): TeamId of policy created if it belongs to a team

Returns

{:ok, %OpsGenieRESTAPI.Model.SuccessResponse{}} on success {:error, info} on failure