lib/endpoints/escalation_policies.js
/**
 * Create an escalation policy.
 *
 * @param {Object} policyInfo Escalation policy information.
 * @returns {Promise<Object>} VictorOps API response.
 *
 */
Create an escalation policy.
@param {Object} policyInfo Escalation policy information.
@returns {Promise} VictorOps API response.
Create an escalation policy . @param { Object } policyInfo Escalation policy information . @returns { Promise } VictorOps API response .
async function createPolicy(policyInfo = {}) {
  try {
    const apiPrefix = this.getApiPrefix();
    const options = this._getRequestOptions('POST',
      `${apiPrefix}/policies`, null, policyInfo);
    return await this._performRequest(options);
  } catch (err) {
    throw this._handleError(err);
  }
}
async function createPolicy ( policyInfo = { } ) { try { const apiPrefix = this . getApiPrefix ( ) ; const options = this . _getRequestOptions ( 'POST' , ` ${ apiPrefix } ` , null , policyInfo ) ; return await this . _performRequest ( options ) ; } catch ( err ) { throw this . _handleError ( err ) ; } }
Create an escalation policy.
Create an escalation policy .
// Get the API prefix. // Get the request options. // Peform the request.