Creates the given NRQL alert condition.
@param policyId The id of the policy to add the alert condition to
@param condition The alert condition to create
@return The alert condition that was created
352503
public Optional<NrqlAlertCondition> create(long policyId, NrqlAlertCondition condition)
    {
        return HTTP.POST(String.format("/v2/alerts_nrql_conditions/policies/%d.json", policyId), condition, NRQL_ALERT_CONDITION);
    }
723490
def set_policy_threshold(zap_helper, policy_ids, threshold):
    """"""
    if not policy_ids:
        policy_ids = _get_all_policy_ids(zap_helper)

    with zap_error_handler():
        zap_helper.set_policy_alert_threshold(policy_ids, threshold)

    console.info('Set alert threshold to {0}.'.format(threshold))
801330
@Override
	public synchronized List<RecordAlert> getAlertsBySourceHistoryId(int historyId) throws DatabaseException {
        try {
			List<RecordAlert> result = new ArrayList<>();
			psGetAlertsForHistoryId.setLong(1, historyId);
			try (ResultSet rs = psGetAlertsForHistoryId.executeQuery()) {
			    RecordAlert ra = build(rs);
			    while (ra != null) {
			        result.add(ra);
			        ra = build(rs);
			    }
			}
			
			return result;
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
1233491
public WebElementFinder condition(final Predicate<WebElement> theCondition) {
		Fields fields = new Fields(this);
		fields.condition = theCondition;
		return new WebElementFinder(fields);
	}
717223
public Optional<PluginsAlertCondition> update(PluginsAlertCondition condition)
    {
        return HTTP.PUT(String.format("/v2/alerts_plugins_conditions/%d.json", condition.getId()), condition, PLUGINS_ALERT_CONDITION);
    }
941165
public Collection<InfraAlertCondition> list(List<String> queryParams)
    {
        return HTTP.GET("/v2/alerts/conditions", null, queryParams, INFRA_ALERT_CONDITIONS).get();
    }
449309
public void add(Collection<InfraAlertCondition> conditions)
    {
        for(InfraAlertCondition condition : conditions)
            this.conditions.put(condition.getId(), condition);
    }
794350
public void add(Collection<AlertPolicy> policies)
    {
        for(AlertPolicy policy : policies)
            this.policies.put(policy.getId(), policy);
    }
1248808
public static RuleProviderBuilder begin(String id)
    {
        MetadataBuilder builder = MetadataBuilder.forProvider(RuleProviderBuilder.class, id);
        return new RuleProviderBuilder(builder).setMetadataBuilder(builder);
    }
1361294
public B activationCondition(String conditionExpression) {
    ActivationCondition activationCondition = createInstance(ActivationCondition.class);
    activationCondition.setTextContent(conditionExpression);
    element.setActivationCondition(activationCondition);
    return myself;
  }
177040
public Optional<ExternalServiceAlertCondition> create(long policyId, ExternalServiceAlertCondition condition)
    {
        return HTTP.POST(String.format("/v2/alerts_external_service_conditions/policies/%d.json", policyId), condition, EXTERNAL_SERVICE_ALERT_CONDITION);
    }
559607
public void add(Collection<NrqlAlertCondition> conditions)
    {
        for(NrqlAlertCondition condition : conditions)
            this.conditions.put(condition.getId(), condition);
    }
1366992
public AlertPolicyFilter where(Predicate<AlertPolicyMetadata> filter) {
        checkNotNull(filter, "Filter predicate must be not a null");

        this.predicate = this.predicate.and(filter);

        return this;
    }
69375
public static Condition createCondition(String expression) {
        try {
            return INSTANCE.ctorCondition.newInstance(expression);
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
545994
static function createNew( $policyID, $identifier )
    {
        $policyParameter = new eZPolicyLimitation( array() );
        $policyParameter->setAttribute( 'policy_id', $policyID );
        $policyParameter->setAttribute( 'identifier', $identifier );
        $policyParameter->store();

        return $policyParameter;
    }
1284287
protected void prepareResourceCondition(CmsUUID projectId, int mode, StringBuffer conditions) {

        if ((mode & CmsDriverManager.READMODE_ONLY_FOLDERS) > 0) {
            // C_READMODE_ONLY_FOLDERS: add condition to match only folders
            conditions.append(BEGIN_INCLUDE_CONDITION);
            conditions.append(m_sqlManager.readQuery(projectId, "C_RESOURCES_SELECT_ONLY_FOLDERS"));
            conditions.append(END_CONDITION);
        } else if ((mode & CmsDriverManager.READMODE_ONLY_FILES) > 0) {
            // C_READMODE_ONLY_FILES: add condition to match only files
            conditions.append(BEGIN_INCLUDE_CONDITION);
            conditions.append(m_sqlManager.readQuery(projectId, "C_RESOURCES_SELECT_ONLY_FILES"));
            conditions.append(END_CONDITION);
        }
    }
729653
public Optional<SyntheticsAlertCondition> update(SyntheticsAlertCondition condition)
    {
        return HTTP.PUT(String.format("/v2/alerts_synthetics_conditions/%d.json", condition.getId()), condition, SYNTHETICS_ALERT_CONDITION);
    }