|
26 | 26 | from stackit.observability.models.alert_config_route_response import ( |
27 | 27 | AlertConfigRouteResponse, |
28 | 28 | ) |
| 29 | +from stackit.observability.models.alert_groups_response import AlertGroupsResponse |
29 | 30 | from stackit.observability.models.create_alert_config_receiver_payload import ( |
30 | 31 | CreateAlertConfigReceiverPayload, |
31 | 32 | ) |
@@ -9453,3 +9454,250 @@ def _update_scrape_config_serialize( |
9453 | 9454 | _host=_host, |
9454 | 9455 | _request_auth=_request_auth, |
9455 | 9456 | ) |
| 9457 | + |
| 9458 | + @validate_call |
| 9459 | + def v1_projects_instances_alertgroups_list( |
| 9460 | + self, |
| 9461 | + instance_id: StrictStr, |
| 9462 | + project_id: StrictStr, |
| 9463 | + _request_timeout: Union[ |
| 9464 | + None, |
| 9465 | + Annotated[StrictFloat, Field(gt=0)], |
| 9466 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 9467 | + ] = None, |
| 9468 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 9469 | + _content_type: Optional[StrictStr] = None, |
| 9470 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 9471 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 9472 | + ) -> AlertGroupsResponse: |
| 9473 | + """v1_projects_instances_alertgroups_list |
| 9474 | +
|
| 9475 | + Get alert groups. |
| 9476 | +
|
| 9477 | + :param instance_id: (required) |
| 9478 | + :type instance_id: str |
| 9479 | + :param project_id: (required) |
| 9480 | + :type project_id: str |
| 9481 | + :param _request_timeout: timeout setting for this request. If one |
| 9482 | + number provided, it will be total request |
| 9483 | + timeout. It can also be a pair (tuple) of |
| 9484 | + (connection, read) timeouts. |
| 9485 | + :type _request_timeout: int, tuple(int, int), optional |
| 9486 | + :param _request_auth: set to override the auth_settings for an a single |
| 9487 | + request; this effectively ignores the |
| 9488 | + authentication in the spec for a single request. |
| 9489 | + :type _request_auth: dict, optional |
| 9490 | + :param _content_type: force content-type for the request. |
| 9491 | + :type _content_type: str, Optional |
| 9492 | + :param _headers: set to override the headers for a single |
| 9493 | + request; this effectively ignores the headers |
| 9494 | + in the spec for a single request. |
| 9495 | + :type _headers: dict, optional |
| 9496 | + :param _host_index: set to override the host_index for a single |
| 9497 | + request; this effectively ignores the host_index |
| 9498 | + in the spec for a single request. |
| 9499 | + :type _host_index: int, optional |
| 9500 | + :return: Returns the result object. |
| 9501 | + """ # noqa: E501 docstring might be too long |
| 9502 | + |
| 9503 | + _param = self._v1_projects_instances_alertgroups_list_serialize( |
| 9504 | + instance_id=instance_id, |
| 9505 | + project_id=project_id, |
| 9506 | + _request_auth=_request_auth, |
| 9507 | + _content_type=_content_type, |
| 9508 | + _headers=_headers, |
| 9509 | + _host_index=_host_index, |
| 9510 | + ) |
| 9511 | + |
| 9512 | + _response_types_map: Dict[str, Optional[str]] = { |
| 9513 | + "200": "AlertGroupsResponse", |
| 9514 | + "400": "Error", |
| 9515 | + "403": "PermissionDenied", |
| 9516 | + } |
| 9517 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 9518 | + response_data.read() |
| 9519 | + return self.api_client.response_deserialize( |
| 9520 | + response_data=response_data, |
| 9521 | + response_types_map=_response_types_map, |
| 9522 | + ).data |
| 9523 | + |
| 9524 | + @validate_call |
| 9525 | + def v1_projects_instances_alertgroups_list_with_http_info( |
| 9526 | + self, |
| 9527 | + instance_id: StrictStr, |
| 9528 | + project_id: StrictStr, |
| 9529 | + _request_timeout: Union[ |
| 9530 | + None, |
| 9531 | + Annotated[StrictFloat, Field(gt=0)], |
| 9532 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 9533 | + ] = None, |
| 9534 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 9535 | + _content_type: Optional[StrictStr] = None, |
| 9536 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 9537 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 9538 | + ) -> ApiResponse[AlertGroupsResponse]: |
| 9539 | + """v1_projects_instances_alertgroups_list |
| 9540 | +
|
| 9541 | + Get alert groups. |
| 9542 | +
|
| 9543 | + :param instance_id: (required) |
| 9544 | + :type instance_id: str |
| 9545 | + :param project_id: (required) |
| 9546 | + :type project_id: str |
| 9547 | + :param _request_timeout: timeout setting for this request. If one |
| 9548 | + number provided, it will be total request |
| 9549 | + timeout. It can also be a pair (tuple) of |
| 9550 | + (connection, read) timeouts. |
| 9551 | + :type _request_timeout: int, tuple(int, int), optional |
| 9552 | + :param _request_auth: set to override the auth_settings for an a single |
| 9553 | + request; this effectively ignores the |
| 9554 | + authentication in the spec for a single request. |
| 9555 | + :type _request_auth: dict, optional |
| 9556 | + :param _content_type: force content-type for the request. |
| 9557 | + :type _content_type: str, Optional |
| 9558 | + :param _headers: set to override the headers for a single |
| 9559 | + request; this effectively ignores the headers |
| 9560 | + in the spec for a single request. |
| 9561 | + :type _headers: dict, optional |
| 9562 | + :param _host_index: set to override the host_index for a single |
| 9563 | + request; this effectively ignores the host_index |
| 9564 | + in the spec for a single request. |
| 9565 | + :type _host_index: int, optional |
| 9566 | + :return: Returns the result object. |
| 9567 | + """ # noqa: E501 docstring might be too long |
| 9568 | + |
| 9569 | + _param = self._v1_projects_instances_alertgroups_list_serialize( |
| 9570 | + instance_id=instance_id, |
| 9571 | + project_id=project_id, |
| 9572 | + _request_auth=_request_auth, |
| 9573 | + _content_type=_content_type, |
| 9574 | + _headers=_headers, |
| 9575 | + _host_index=_host_index, |
| 9576 | + ) |
| 9577 | + |
| 9578 | + _response_types_map: Dict[str, Optional[str]] = { |
| 9579 | + "200": "AlertGroupsResponse", |
| 9580 | + "400": "Error", |
| 9581 | + "403": "PermissionDenied", |
| 9582 | + } |
| 9583 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 9584 | + response_data.read() |
| 9585 | + return self.api_client.response_deserialize( |
| 9586 | + response_data=response_data, |
| 9587 | + response_types_map=_response_types_map, |
| 9588 | + ) |
| 9589 | + |
| 9590 | + @validate_call |
| 9591 | + def v1_projects_instances_alertgroups_list_without_preload_content( |
| 9592 | + self, |
| 9593 | + instance_id: StrictStr, |
| 9594 | + project_id: StrictStr, |
| 9595 | + _request_timeout: Union[ |
| 9596 | + None, |
| 9597 | + Annotated[StrictFloat, Field(gt=0)], |
| 9598 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 9599 | + ] = None, |
| 9600 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 9601 | + _content_type: Optional[StrictStr] = None, |
| 9602 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 9603 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 9604 | + ) -> RESTResponseType: |
| 9605 | + """v1_projects_instances_alertgroups_list |
| 9606 | +
|
| 9607 | + Get alert groups. |
| 9608 | +
|
| 9609 | + :param instance_id: (required) |
| 9610 | + :type instance_id: str |
| 9611 | + :param project_id: (required) |
| 9612 | + :type project_id: str |
| 9613 | + :param _request_timeout: timeout setting for this request. If one |
| 9614 | + number provided, it will be total request |
| 9615 | + timeout. It can also be a pair (tuple) of |
| 9616 | + (connection, read) timeouts. |
| 9617 | + :type _request_timeout: int, tuple(int, int), optional |
| 9618 | + :param _request_auth: set to override the auth_settings for an a single |
| 9619 | + request; this effectively ignores the |
| 9620 | + authentication in the spec for a single request. |
| 9621 | + :type _request_auth: dict, optional |
| 9622 | + :param _content_type: force content-type for the request. |
| 9623 | + :type _content_type: str, Optional |
| 9624 | + :param _headers: set to override the headers for a single |
| 9625 | + request; this effectively ignores the headers |
| 9626 | + in the spec for a single request. |
| 9627 | + :type _headers: dict, optional |
| 9628 | + :param _host_index: set to override the host_index for a single |
| 9629 | + request; this effectively ignores the host_index |
| 9630 | + in the spec for a single request. |
| 9631 | + :type _host_index: int, optional |
| 9632 | + :return: Returns the result object. |
| 9633 | + """ # noqa: E501 docstring might be too long |
| 9634 | + |
| 9635 | + _param = self._v1_projects_instances_alertgroups_list_serialize( |
| 9636 | + instance_id=instance_id, |
| 9637 | + project_id=project_id, |
| 9638 | + _request_auth=_request_auth, |
| 9639 | + _content_type=_content_type, |
| 9640 | + _headers=_headers, |
| 9641 | + _host_index=_host_index, |
| 9642 | + ) |
| 9643 | + |
| 9644 | + _response_types_map: Dict[str, Optional[str]] = { |
| 9645 | + "200": "AlertGroupsResponse", |
| 9646 | + "400": "Error", |
| 9647 | + "403": "PermissionDenied", |
| 9648 | + } |
| 9649 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 9650 | + return response_data.response |
| 9651 | + |
| 9652 | + def _v1_projects_instances_alertgroups_list_serialize( |
| 9653 | + self, |
| 9654 | + instance_id, |
| 9655 | + project_id, |
| 9656 | + _request_auth, |
| 9657 | + _content_type, |
| 9658 | + _headers, |
| 9659 | + _host_index, |
| 9660 | + ) -> RequestSerialized: |
| 9661 | + |
| 9662 | + _host = None |
| 9663 | + |
| 9664 | + _collection_formats: Dict[str, str] = {} |
| 9665 | + |
| 9666 | + _path_params: Dict[str, str] = {} |
| 9667 | + _query_params: List[Tuple[str, str]] = [] |
| 9668 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 9669 | + _form_params: List[Tuple[str, str]] = [] |
| 9670 | + _files: Dict[str, Union[str, bytes]] = {} |
| 9671 | + _body_params: Optional[bytes] = None |
| 9672 | + |
| 9673 | + # process the path parameters |
| 9674 | + if instance_id is not None: |
| 9675 | + _path_params["instanceId"] = instance_id |
| 9676 | + if project_id is not None: |
| 9677 | + _path_params["projectId"] = project_id |
| 9678 | + # process the query parameters |
| 9679 | + # process the header parameters |
| 9680 | + # process the form parameters |
| 9681 | + # process the body parameter |
| 9682 | + |
| 9683 | + # set the HTTP header `Accept` |
| 9684 | + if "Accept" not in _header_params: |
| 9685 | + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) |
| 9686 | + |
| 9687 | + # authentication setting |
| 9688 | + _auth_settings: List[str] = [] |
| 9689 | + |
| 9690 | + return self.api_client.param_serialize( |
| 9691 | + method="GET", |
| 9692 | + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", |
| 9693 | + path_params=_path_params, |
| 9694 | + query_params=_query_params, |
| 9695 | + header_params=_header_params, |
| 9696 | + body=_body_params, |
| 9697 | + post_params=_form_params, |
| 9698 | + files=_files, |
| 9699 | + auth_settings=_auth_settings, |
| 9700 | + collection_formats=_collection_formats, |
| 9701 | + _host=_host, |
| 9702 | + _request_auth=_request_auth, |
| 9703 | + ) |
0 commit comments