Package ai.shipeasy.admin.api
Class AlertsApi
java.lang.Object
ai.shipeasy.admin.api.AlertsApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAlertRule(CreateAlertRuleRequest createAlertRuleRequest, String xProjectId) Create an alert rule Creates a metric-threshold alert rule.okhttp3.CallcreateAlertRuleAsync(CreateAlertRuleRequest createAlertRuleRequest, String xProjectId, ApiCallback<CreateAlertRuleResponse> _callback) Create an alert rule (asynchronously) Creates a metric-threshold alert rule.okhttp3.CallcreateAlertRuleCall(CreateAlertRuleRequest createAlertRuleRequest, String xProjectId, ApiCallback _callback) Build call for createAlertRulecreateAlertRuleWithHttpInfo(CreateAlertRuleRequest createAlertRuleRequest, String xProjectId) Create an alert rule Creates a metric-threshold alert rule.deleteAlertRule(String id, String xProjectId) Delete an alert rule Deletes the alert rule.okhttp3.CalldeleteAlertRuleAsync(String id, String xProjectId, ApiCallback<DeleteAlertRuleResponse> _callback) Delete an alert rule (asynchronously) Deletes the alert rule.okhttp3.CalldeleteAlertRuleCall(String id, String xProjectId, ApiCallback _callback) Build call for deleteAlertRuledeleteAlertRuleWithHttpInfo(String id, String xProjectId) Delete an alert rule Deletes the alert rule.intlistAlertRules(String xProjectId, String q) List alert rules Returns every alert rule in the project (not paginated).okhttp3.CalllistAlertRulesAsync(String xProjectId, String q, ApiCallback<List<ListAlertRulesResponseInner>> _callback) List alert rules (asynchronously) Returns every alert rule in the project (not paginated).okhttp3.CalllistAlertRulesCall(String xProjectId, String q, ApiCallback _callback) Build call for listAlertRuleslistAlertRulesWithHttpInfo(String xProjectId, String q) List alert rules Returns every alert rule in the project (not paginated).listSlackChannels(String xProjectId) List Slack channels List the project's connected Slack channels — used to resolve an alert rule's notification target.okhttp3.CalllistSlackChannelsAsync(String xProjectId, ApiCallback<ListSlackChannelsResponse> _callback) List Slack channels (asynchronously) List the project's connected Slack channels — used to resolve an alert rule's notification target.okhttp3.CalllistSlackChannelsCall(String xProjectId, ApiCallback _callback) Build call for listSlackChannelslistSlackChannelsWithHttpInfo(String xProjectId) List Slack channels List the project's connected Slack channels — used to resolve an alert rule's notification target.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex) updateAlertRule(String id, UpdateAlertRuleRequest updateAlertRuleRequest, String xProjectId) Update an alert rule Partial update of a rule's tunable knobs.okhttp3.CallupdateAlertRuleAsync(String id, UpdateAlertRuleRequest updateAlertRuleRequest, String xProjectId, ApiCallback<UpdateAlertRuleResponse> _callback) Update an alert rule (asynchronously) Partial update of a rule's tunable knobs.okhttp3.CallupdateAlertRuleCall(String id, UpdateAlertRuleRequest updateAlertRuleRequest, String xProjectId, ApiCallback _callback) Build call for updateAlertRuleupdateAlertRuleWithHttpInfo(String id, UpdateAlertRuleRequest updateAlertRuleRequest, String xProjectId) Update an alert rule Partial update of a rule's tunable knobs.
-
Constructor Details
-
AlertsApi
public AlertsApi() -
AlertsApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
createAlertRuleCall
public okhttp3.Call createAlertRuleCall(@Nonnull CreateAlertRuleRequest createAlertRuleRequest, @Nullable String xProjectId, ApiCallback _callback) throws ApiException Build call for createAlertRule- Parameters:
createAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
createAlertRule
public CreateAlertRuleResponse createAlertRule(@Nonnull CreateAlertRuleRequest createAlertRuleRequest, @Nullable String xProjectId) throws ApiException Create an alert rule Creates a metric-threshold alert rule. `name`, `metricId`, `comparator`, and `threshold` are required; `windowHours` defaults to `24`, `severity` to `warn`, and `enabled` to `true`. Returns `404` if `metricId` does not resolve, and `400` for a metric with no scalar form over a window (e.g. retention metrics) — the cron can't evaluate those. **Use cases** - **Threshold alert** — warn when an error/latency metric crosses a value over a rolling window. - **Routed alert** — set `notify` to page a specific Slack channel or on-call email instead of the project default.- Parameters:
createAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- CreateAlertRuleResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createAlertRuleWithHttpInfo
public ApiResponse<CreateAlertRuleResponse> createAlertRuleWithHttpInfo(@Nonnull CreateAlertRuleRequest createAlertRuleRequest, @Nullable String xProjectId) throws ApiException Create an alert rule Creates a metric-threshold alert rule. `name`, `metricId`, `comparator`, and `threshold` are required; `windowHours` defaults to `24`, `severity` to `warn`, and `enabled` to `true`. Returns `404` if `metricId` does not resolve, and `400` for a metric with no scalar form over a window (e.g. retention metrics) — the cron can't evaluate those. **Use cases** - **Threshold alert** — warn when an error/latency metric crosses a value over a rolling window. - **Routed alert** — set `notify` to page a specific Slack channel or on-call email instead of the project default.- Parameters:
createAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ApiResponse<CreateAlertRuleResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createAlertRuleAsync
public okhttp3.Call createAlertRuleAsync(@Nonnull CreateAlertRuleRequest createAlertRuleRequest, @Nullable String xProjectId, ApiCallback<CreateAlertRuleResponse> _callback) throws ApiException Create an alert rule (asynchronously) Creates a metric-threshold alert rule. `name`, `metricId`, `comparator`, and `threshold` are required; `windowHours` defaults to `24`, `severity` to `warn`, and `enabled` to `true`. Returns `404` if `metricId` does not resolve, and `400` for a metric with no scalar form over a window (e.g. retention metrics) — the cron can't evaluate those. **Use cases** - **Threshold alert** — warn when an error/latency metric crosses a value over a rolling window. - **Routed alert** — set `notify` to page a specific Slack channel or on-call email instead of the project default.- Parameters:
createAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
deleteAlertRuleCall
public okhttp3.Call deleteAlertRuleCall(@Nonnull String id, @Nullable String xProjectId, ApiCallback _callback) throws ApiException Build call for deleteAlertRule- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
deleteAlertRule
public DeleteAlertRuleResponse deleteAlertRule(@Nonnull String id, @Nullable String xProjectId) throws ApiException Delete an alert rule Deletes the alert rule. The cron stops evaluating it immediately. Use this (then create a new rule) to repoint alerting at a different metric, since `metricId` is immutable. **Use case:** Remove an alert rule that is no longer needed, or as the first half of repointing a rule at a different metric.- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- DeleteAlertRuleResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
deleteAlertRuleWithHttpInfo
public ApiResponse<DeleteAlertRuleResponse> deleteAlertRuleWithHttpInfo(@Nonnull String id, @Nullable String xProjectId) throws ApiException Delete an alert rule Deletes the alert rule. The cron stops evaluating it immediately. Use this (then create a new rule) to repoint alerting at a different metric, since `metricId` is immutable. **Use case:** Remove an alert rule that is no longer needed, or as the first half of repointing a rule at a different metric.- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ApiResponse<DeleteAlertRuleResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
deleteAlertRuleAsync
public okhttp3.Call deleteAlertRuleAsync(@Nonnull String id, @Nullable String xProjectId, ApiCallback<DeleteAlertRuleResponse> _callback) throws ApiException Delete an alert rule (asynchronously) Deletes the alert rule. The cron stops evaluating it immediately. Use this (then create a new rule) to repoint alerting at a different metric, since `metricId` is immutable. **Use case:** Remove an alert rule that is no longer needed, or as the first half of repointing a rule at a different metric.- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
listAlertRulesCall
public okhttp3.Call listAlertRulesCall(@Nullable String xProjectId, @Nullable String q, ApiCallback _callback) throws ApiException Build call for listAlertRules- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
listAlertRules
public List<ListAlertRulesResponseInner> listAlertRules(@Nullable String xProjectId, @Nullable String q) throws ApiException List alert rules Returns every alert rule in the project (not paginated). Each rule carries its bound `metricId`, the denormalised `metricName` (or `null` if the metric was removed), the comparator/threshold/window, severity, enabled flag, and delivery target. **Use case:** Audit which metrics have alerting configured — for example to confirm an on-call threshold is set before a launch.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)- Returns:
- List<ListAlertRulesResponseInner>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listAlertRulesWithHttpInfo
public ApiResponse<List<ListAlertRulesResponseInner>> listAlertRulesWithHttpInfo(@Nullable String xProjectId, @Nullable String q) throws ApiException List alert rules Returns every alert rule in the project (not paginated). Each rule carries its bound `metricId`, the denormalised `metricName` (or `null` if the metric was removed), the comparator/threshold/window, severity, enabled flag, and delivery target. **Use case:** Audit which metrics have alerting configured — for example to confirm an on-call threshold is set before a launch.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)- Returns:
- ApiResponse<List<ListAlertRulesResponseInner>>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listAlertRulesAsync
public okhttp3.Call listAlertRulesAsync(@Nullable String xProjectId, @Nullable String q, ApiCallback<List<ListAlertRulesResponseInner>> _callback) throws ApiException List alert rules (asynchronously) Returns every alert rule in the project (not paginated). Each rule carries its bound `metricId`, the denormalised `metricName` (or `null` if the metric was removed), the comparator/threshold/window, severity, enabled flag, and delivery target. **Use case:** Audit which metrics have alerting configured — for example to confirm an on-call threshold is set before a launch.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
listSlackChannelsCall
public okhttp3.Call listSlackChannelsCall(@Nullable String xProjectId, ApiCallback _callback) throws ApiException Build call for listSlackChannels- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
listSlackChannels
List Slack channels List the project's connected Slack channels — used to resolve an alert rule's notification target. **Use case:** Populate a channel picker, or validate an alert rule's `--slack-channel` before saving.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ListSlackChannelsResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listSlackChannelsWithHttpInfo
public ApiResponse<ListSlackChannelsResponse> listSlackChannelsWithHttpInfo(@Nullable String xProjectId) throws ApiException List Slack channels List the project's connected Slack channels — used to resolve an alert rule's notification target. **Use case:** Populate a channel picker, or validate an alert rule's `--slack-channel` before saving.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ApiResponse<ListSlackChannelsResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listSlackChannelsAsync
public okhttp3.Call listSlackChannelsAsync(@Nullable String xProjectId, ApiCallback<ListSlackChannelsResponse> _callback) throws ApiException List Slack channels (asynchronously) List the project's connected Slack channels — used to resolve an alert rule's notification target. **Use case:** Populate a channel picker, or validate an alert rule's `--slack-channel` before saving.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
updateAlertRuleCall
public okhttp3.Call updateAlertRuleCall(@Nonnull String id, @Nonnull UpdateAlertRuleRequest updateAlertRuleRequest, @Nullable String xProjectId, ApiCallback _callback) throws ApiException Build call for updateAlertRule- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)updateAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
updateAlertRule
public UpdateAlertRuleResponse updateAlertRule(@Nonnull String id, @Nonnull UpdateAlertRuleRequest updateAlertRuleRequest, @Nullable String xProjectId) throws ApiException Update an alert rule Partial update of a rule's tunable knobs. `metricId` is immutable — the metric also pins the aggregation, so a body carrying `metricId` is rejected with `409 IMMUTABLE_FIELD`; create a new rule bound to the other metric instead (rule deletion is dashboard-only). Pass `\"notify\": null` to revert the rule's delivery target back to the project default. **Use cases** - **Tune sensitivity** — change `threshold`/`comparator`/`windowHours` as the metric's baseline shifts. - **Pause without losing config** — `{ \"enabled\": false }` instead of deleting the rule.- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)updateAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- UpdateAlertRuleResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
updateAlertRuleWithHttpInfo
public ApiResponse<UpdateAlertRuleResponse> updateAlertRuleWithHttpInfo(@Nonnull String id, @Nonnull UpdateAlertRuleRequest updateAlertRuleRequest, @Nullable String xProjectId) throws ApiException Update an alert rule Partial update of a rule's tunable knobs. `metricId` is immutable — the metric also pins the aggregation, so a body carrying `metricId` is rejected with `409 IMMUTABLE_FIELD`; create a new rule bound to the other metric instead (rule deletion is dashboard-only). Pass `\"notify\": null` to revert the rule's delivery target back to the project default. **Use cases** - **Tune sensitivity** — change `threshold`/`comparator`/`windowHours` as the metric's baseline shifts. - **Pause without losing config** — `{ \"enabled\": false }` instead of deleting the rule.- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)updateAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ApiResponse<UpdateAlertRuleResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
updateAlertRuleAsync
public okhttp3.Call updateAlertRuleAsync(@Nonnull String id, @Nonnull UpdateAlertRuleRequest updateAlertRuleRequest, @Nullable String xProjectId, ApiCallback<UpdateAlertRuleResponse> _callback) throws ApiException Update an alert rule (asynchronously) Partial update of a rule's tunable knobs. `metricId` is immutable — the metric also pins the aggregation, so a body carrying `metricId` is rejected with `409 IMMUTABLE_FIELD`; create a new rule bound to the other metric instead (rule deletion is dashboard-only). Pass `\"notify\": null` to revert the rule's delivery target back to the project default. **Use cases** - **Tune sensitivity** — change `threshold`/`comparator`/`windowHours` as the metric's baseline shifts. - **Pause without losing config** — `{ \"enabled\": false }` instead of deleting the rule.- Parameters:
id- Stable opaque alert-rule id (`ar_…`) or the rule's `name`. (required)updateAlertRuleRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-