php-docs-samples icon indicating copy to clipboard operation
php-docs-samples copied to clipboard

Error Create an Alert (via api + MQL)

Open frelle opened this issue 5 years ago • 1 comments

Hello, After literally 24h of trying almost everything, I open this issue because I think there is a gap between the doc API and this library.

USE CASE : create policy I want to add a condition using MQL language.

In the doc online, item is "ConditionTimeSeriesQueryLanguage"

condition_monitoring_query_language -> MonitoringQueryLanguageCondition

In the php doc, reference is (I guess)

condition_time_series_query_language -> TimeSeriesQueryLanguageCondition

I'm using the TimeSeries, but i have this error :

Fatal error: Uncaught Google\ApiCore\ApiException: { "message": "Field alert_policy.conditions[0].condition_case had an invalid value of \"0\": Condition subtype (e.g. \"condition_absent\",\"condition_threshold\", etc.) is absent or unknown.", "code": 3, "status": "INVALID_ARGUMENT", "details": [] } thrown in ...\vendor\google\gax\src\ApiException.php on line 139

So looks like the condition is not considered, and is expected an other condition.

So finally, the question is : How to use a condition with MQL language please ?

Thank you for the help

frelle avatar Nov 30 '20 09:11 frelle

Hello @frelle can you please paste the code you're using to construct the condition and API call?

bshaffer avatar Dec 07 '20 19:12 bshaffer