diff --git a/CHANGELOG.md b/CHANGELOG.md index c31c8024..379458fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ - `iaas`: [v0.5.0](services/iaas/CHANGELOG.md#v050-2025-03-24) - **Improvement:** Upgrading from IaaS **beta** endpoints to **v1** - **Feature:** Add new method to filter `ListMachineTypes`: `Filter` +- `observability`: [v0.3.0](services/observability/CHANGELOG.md#v030-2025-03-27) + - **Feature:** Added support for alert groups and alert rules. ## Release (2025-03-05) diff --git a/services/observability/CHANGELOG.md b/services/observability/CHANGELOG.md index 57a007cd..34cccdd9 100644 --- a/services/observability/CHANGELOG.md +++ b/services/observability/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.3.0 (2025-03-27) + +- **Feature:** Added support for alert groups and alert rules. + ## v0.2.0 (2025-01-13) - **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL. diff --git a/services/observability/pyproject.toml b/services/observability/pyproject.toml index 2961d9a2..c1eeb87b 100644 --- a/services/observability/pyproject.toml +++ b/services/observability/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-observability" [tool.poetry] name = "stackit-observability" -version = "v0.2.0" +version = "v0.3.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/observability/src/stackit/observability/__init__.py b/services/observability/src/stackit/observability/__init__.py index a68883b8..6c897ffd 100644 --- a/services/observability/src/stackit/observability/__init__.py +++ b/services/observability/src/stackit/observability/__init__.py @@ -41,6 +41,12 @@ from stackit.observability.models.alert_config_route_response import ( AlertConfigRouteResponse, ) +from stackit.observability.models.alert_group import AlertGroup +from stackit.observability.models.alert_group_response import AlertGroupResponse +from stackit.observability.models.alert_groups_response import AlertGroupsResponse +from stackit.observability.models.alert_rule import AlertRule +from stackit.observability.models.alert_rule_record import AlertRuleRecord +from stackit.observability.models.alert_rules_response import AlertRulesResponse from stackit.observability.models.basic_auth import BasicAuth from stackit.observability.models.create_alert_config_receiver_payload import ( CreateAlertConfigReceiverPayload, @@ -60,6 +66,12 @@ from stackit.observability.models.create_alert_config_route_payload_routes_inner import ( CreateAlertConfigRoutePayloadRoutesInner, ) +from stackit.observability.models.create_alertgroups_payload import ( + CreateAlertgroupsPayload, +) +from stackit.observability.models.create_alertrules_payload import ( + CreateAlertrulesPayload, +) from stackit.observability.models.create_credentials_response import ( CreateCredentialsResponse, ) @@ -168,6 +180,15 @@ from stackit.observability.models.update_alert_configs_response import ( UpdateAlertConfigsResponse, ) +from stackit.observability.models.update_alertgroup_payload import ( + UpdateAlertgroupPayload, +) +from stackit.observability.models.update_alertgroups_request_inner import ( + UpdateAlertgroupsRequestInner, +) +from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( + UpdateAlertgroupsRequestInnerRulesInner, +) from stackit.observability.models.update_credentials_remote_write_config_payload import ( UpdateCredentialsRemoteWriteConfigPayload, ) diff --git a/services/observability/src/stackit/observability/api/default_api.py b/services/observability/src/stackit/observability/api/default_api.py index 89110b67..f21d5a64 100644 --- a/services/observability/src/stackit/observability/api/default_api.py +++ b/services/observability/src/stackit/observability/api/default_api.py @@ -26,12 +26,21 @@ from stackit.observability.models.alert_config_route_response import ( AlertConfigRouteResponse, ) +from stackit.observability.models.alert_group_response import AlertGroupResponse +from stackit.observability.models.alert_groups_response import AlertGroupsResponse +from stackit.observability.models.alert_rules_response import AlertRulesResponse from stackit.observability.models.create_alert_config_receiver_payload import ( CreateAlertConfigReceiverPayload, ) from stackit.observability.models.create_alert_config_route_payload import ( CreateAlertConfigRoutePayload, ) +from stackit.observability.models.create_alertgroups_payload import ( + CreateAlertgroupsPayload, +) +from stackit.observability.models.create_alertrules_payload import ( + CreateAlertrulesPayload, +) from stackit.observability.models.create_credentials_response import ( CreateCredentialsResponse, ) @@ -87,6 +96,15 @@ from stackit.observability.models.update_alert_configs_response import ( UpdateAlertConfigsResponse, ) +from stackit.observability.models.update_alertgroup_payload import ( + UpdateAlertgroupPayload, +) +from stackit.observability.models.update_alertgroups_request_inner import ( + UpdateAlertgroupsRequestInner, +) +from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( + UpdateAlertgroupsRequestInnerRulesInner, +) from stackit.observability.models.update_credentials_remote_write_config_payload import ( UpdateCredentialsRemoteWriteConfigPayload, ) @@ -657,10 +675,11 @@ def _create_alert_config_route_serialize( ) @validate_call - def create_credentials( + def create_alertgroups( self, instance_id: StrictStr, project_id: StrictStr, + create_alertgroups_payload: CreateAlertgroupsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -670,15 +689,17 @@ def create_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateCredentialsResponse: - """create_credentials + ) -> AlertGroupsResponse: + """create_alertgroups - Create technical user credentials. + Create alert group. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param create_alertgroups_payload: (required) + :type create_alertgroups_payload: CreateAlertgroupsPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -701,9 +722,10 @@ def create_credentials( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_credentials_serialize( + _param = self._create_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + create_alertgroups_payload=create_alertgroups_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -711,7 +733,8 @@ def create_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateCredentialsResponse", + "202": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -722,10 +745,11 @@ def create_credentials( ).data @validate_call - def create_credentials_with_http_info( + def create_alertgroups_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + create_alertgroups_payload: CreateAlertgroupsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -735,15 +759,17 @@ def create_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateCredentialsResponse]: - """create_credentials + ) -> ApiResponse[AlertGroupsResponse]: + """create_alertgroups - Create technical user credentials. + Create alert group. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param create_alertgroups_payload: (required) + :type create_alertgroups_payload: CreateAlertgroupsPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -766,9 +792,10 @@ def create_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_credentials_serialize( + _param = self._create_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + create_alertgroups_payload=create_alertgroups_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -776,7 +803,8 @@ def create_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateCredentialsResponse", + "202": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -787,10 +815,11 @@ def create_credentials_with_http_info( ) @validate_call - def create_credentials_without_preload_content( + def create_alertgroups_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + create_alertgroups_payload: CreateAlertgroupsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -801,14 +830,16 @@ def create_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_credentials + """create_alertgroups - Create technical user credentials. + Create alert group. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param create_alertgroups_payload: (required) + :type create_alertgroups_payload: CreateAlertgroupsPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -831,9 +862,10 @@ def create_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_credentials_serialize( + _param = self._create_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + create_alertgroups_payload=create_alertgroups_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -841,16 +873,18 @@ def create_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateCredentialsResponse", + "202": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_credentials_serialize( + def _create_alertgroups_serialize( self, instance_id, project_id, + create_alertgroups_payload, _request_auth, _content_type, _headers, @@ -877,17 +911,27 @@ def _create_credentials_serialize( # process the header parameters # process the form parameters # process the body parameter + if create_alertgroups_payload is not None: + _body_params = create_alertgroups_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -901,10 +945,12 @@ def _create_credentials_serialize( ) @validate_call - def create_instance( + def create_alertrules( self, + group_name: StrictStr, + instance_id: StrictStr, project_id: StrictStr, - create_instance_payload: CreateInstancePayload, + create_alertrules_payload: CreateAlertrulesPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -914,15 +960,19 @@ def create_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateInstanceResponse: - """create_instance + ) -> AlertRulesResponse: + """create_alertrules - Create new instance. + Create alert rule. + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param create_alertrules_payload: (required) + :type create_alertrules_payload: CreateAlertrulesPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -945,9 +995,11 @@ def create_instance( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_instance_serialize( + _param = self._create_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, project_id=project_id, - create_instance_payload=create_instance_payload, + create_alertrules_payload=create_alertrules_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -955,7 +1007,7 @@ def create_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "CreateInstanceResponse", + "202": "AlertRulesResponse", "400": "Error", "403": "PermissionDenied", } @@ -967,10 +1019,12 @@ def create_instance( ).data @validate_call - def create_instance_with_http_info( + def create_alertrules_with_http_info( self, + group_name: StrictStr, + instance_id: StrictStr, project_id: StrictStr, - create_instance_payload: CreateInstancePayload, + create_alertrules_payload: CreateAlertrulesPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -980,15 +1034,19 @@ def create_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateInstanceResponse]: - """create_instance + ) -> ApiResponse[AlertRulesResponse]: + """create_alertrules - Create new instance. + Create alert rule. + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param create_alertrules_payload: (required) + :type create_alertrules_payload: CreateAlertrulesPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1011,9 +1069,11 @@ def create_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_instance_serialize( + _param = self._create_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, project_id=project_id, - create_instance_payload=create_instance_payload, + create_alertrules_payload=create_alertrules_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1021,7 +1081,7 @@ def create_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "CreateInstanceResponse", + "202": "AlertRulesResponse", "400": "Error", "403": "PermissionDenied", } @@ -1033,10 +1093,12 @@ def create_instance_with_http_info( ) @validate_call - def create_instance_without_preload_content( + def create_alertrules_without_preload_content( self, + group_name: StrictStr, + instance_id: StrictStr, project_id: StrictStr, - create_instance_payload: CreateInstancePayload, + create_alertrules_payload: CreateAlertrulesPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1047,14 +1109,18 @@ def create_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_instance + """create_alertrules - Create new instance. + Create alert rule. + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param create_alertrules_payload: (required) + :type create_alertrules_payload: CreateAlertrulesPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1077,9 +1143,11 @@ def create_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_instance_serialize( + _param = self._create_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, project_id=project_id, - create_instance_payload=create_instance_payload, + create_alertrules_payload=create_alertrules_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1087,17 +1155,19 @@ def create_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "CreateInstanceResponse", + "202": "AlertRulesResponse", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_instance_serialize( + def _create_alertrules_serialize( self, + group_name, + instance_id, project_id, - create_instance_payload, + create_alertrules_payload, _request_auth, _content_type, _headers, @@ -1116,14 +1186,18 @@ def _create_instance_serialize( _body_params: Optional[bytes] = None # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name + if instance_id is not None: + _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_instance_payload is not None: - _body_params = create_instance_payload + if create_alertrules_payload is not None: + _body_params = create_alertrules_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -1142,7 +1216,7 @@ def _create_instance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1156,11 +1230,10 @@ def _create_instance_serialize( ) @validate_call - def create_scrape_config( + def create_credentials( self, instance_id: StrictStr, project_id: StrictStr, - create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1170,17 +1243,15 @@ def create_scrape_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ScrapeConfigsResponse: - """create_scrape_config + ) -> CreateCredentialsResponse: + """create_credentials - Create scrape config. + Create technical user credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_scrape_config_payload: (required) - :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1203,10 +1274,9 @@ def create_scrape_config( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_scrape_config_serialize( + _param = self._create_credentials_serialize( instance_id=instance_id, project_id=project_id, - create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1214,8 +1284,7 @@ def create_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Error", + "201": "CreateCredentialsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1226,11 +1295,10 @@ def create_scrape_config( ).data @validate_call - def create_scrape_config_with_http_info( + def create_credentials_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1240,17 +1308,15 @@ def create_scrape_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ScrapeConfigsResponse]: - """create_scrape_config + ) -> ApiResponse[CreateCredentialsResponse]: + """create_credentials - Create scrape config. + Create technical user credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_scrape_config_payload: (required) - :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1273,10 +1339,9 @@ def create_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_scrape_config_serialize( + _param = self._create_credentials_serialize( instance_id=instance_id, project_id=project_id, - create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1284,8 +1349,7 @@ def create_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Error", + "201": "CreateCredentialsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1296,11 +1360,10 @@ def create_scrape_config_with_http_info( ) @validate_call - def create_scrape_config_without_preload_content( + def create_credentials_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1311,16 +1374,14 @@ def create_scrape_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_scrape_config + """create_credentials - Create scrape config. + Create technical user credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_scrape_config_payload: (required) - :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1343,10 +1404,9 @@ def create_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._create_scrape_config_serialize( + _param = self._create_credentials_serialize( instance_id=instance_id, project_id=project_id, - create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1354,18 +1414,16 @@ def create_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Error", + "201": "CreateCredentialsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_scrape_config_serialize( + def _create_credentials_serialize( self, instance_id, project_id, - create_scrape_config_payload, _request_auth, _content_type, _headers, @@ -1392,27 +1450,17 @@ def _create_scrape_config_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_scrape_config_payload is not None: - _body_params = create_scrape_config_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1426,11 +1474,10 @@ def _create_scrape_config_serialize( ) @validate_call - def delete_alert_config_receiver( + def create_instance( self, - instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1440,17 +1487,15 @@ def delete_alert_config_receiver( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigReceiversResponse: - """delete_alert_config_receiver + ) -> CreateInstanceResponse: + """create_instance - Delete alert config receiver. + Create new instance. - :param instance_id: (required) - :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1473,10 +1518,9 @@ def delete_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_alert_config_receiver_serialize( - instance_id=instance_id, + _param = self._create_instance_serialize( project_id=project_id, - receiver=receiver, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1484,9 +1528,9 @@ def delete_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "202": "CreateInstanceResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1496,11 +1540,10 @@ def delete_alert_config_receiver( ).data @validate_call - def delete_alert_config_receiver_with_http_info( + def create_instance_with_http_info( self, - instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1510,17 +1553,15 @@ def delete_alert_config_receiver_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigReceiversResponse]: - """delete_alert_config_receiver + ) -> ApiResponse[CreateInstanceResponse]: + """create_instance - Delete alert config receiver. + Create new instance. - :param instance_id: (required) - :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1543,10 +1584,9 @@ def delete_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_alert_config_receiver_serialize( - instance_id=instance_id, + _param = self._create_instance_serialize( project_id=project_id, - receiver=receiver, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1554,9 +1594,9 @@ def delete_alert_config_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "202": "CreateInstanceResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1566,11 +1606,10 @@ def delete_alert_config_receiver_with_http_info( ) @validate_call - def delete_alert_config_receiver_without_preload_content( + def create_instance_without_preload_content( self, - instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1581,16 +1620,14 @@ def delete_alert_config_receiver_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alert_config_receiver + """create_instance - Delete alert config receiver. + Create new instance. - :param instance_id: (required) - :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1613,10 +1650,9 @@ def delete_alert_config_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_alert_config_receiver_serialize( - instance_id=instance_id, + _param = self._create_instance_serialize( project_id=project_id, - receiver=receiver, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1624,18 +1660,17 @@ def delete_alert_config_receiver_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "202": "CreateInstanceResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alert_config_receiver_serialize( + def _create_instance_serialize( self, - instance_id, project_id, - receiver, + create_instance_payload, _request_auth, _content_type, _headers, @@ -1654,27 +1689,33 @@ def _delete_alert_config_receiver_serialize( _body_params: Optional[bytes] = None # process the path parameters - if instance_id is not None: - _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_instance_payload is not None: + _body_params = create_instance_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", + method="POST", + resource_path="/v1/projects/{projectId}/instances", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1688,11 +1729,11 @@ def _delete_alert_config_receiver_serialize( ) @validate_call - def delete_alert_config_route( + def create_scrape_config( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1702,17 +1743,17 @@ def delete_alert_config_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigRouteResponse: - """delete_alert_config_route + ) -> ScrapeConfigsResponse: + """create_scrape_config - Delete alert receiver for route. + Create scrape config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_scrape_config_payload: (required) + :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1735,10 +1776,10 @@ def delete_alert_config_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_alert_config_route_serialize( + _param = self._create_scrape_config_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1746,9 +1787,9 @@ def delete_alert_config_route( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", + "202": "ScrapeConfigsResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1758,11 +1799,11 @@ def delete_alert_config_route( ).data @validate_call - def delete_alert_config_route_with_http_info( + def create_scrape_config_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1772,17 +1813,17 @@ def delete_alert_config_route_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigRouteResponse]: - """delete_alert_config_route + ) -> ApiResponse[ScrapeConfigsResponse]: + """create_scrape_config - Delete alert receiver for route. + Create scrape config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_scrape_config_payload: (required) + :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1805,10 +1846,10 @@ def delete_alert_config_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_alert_config_route_serialize( + _param = self._create_scrape_config_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1816,9 +1857,9 @@ def delete_alert_config_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", + "202": "ScrapeConfigsResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -1828,11 +1869,11 @@ def delete_alert_config_route_with_http_info( ) @validate_call - def delete_alert_config_route_without_preload_content( + def create_scrape_config_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1843,16 +1884,16 @@ def delete_alert_config_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alert_config_route + """create_scrape_config - Delete alert receiver for route. + Create scrape config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_scrape_config_payload: (required) + :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1875,10 +1916,10 @@ def delete_alert_config_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_alert_config_route_serialize( + _param = self._create_scrape_config_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1886,18 +1927,18 @@ def delete_alert_config_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", + "202": "ScrapeConfigsResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alert_config_route_serialize( + def _create_scrape_config_serialize( self, instance_id, project_id, - receiver, + create_scrape_config_payload, _request_auth, _content_type, _headers, @@ -1920,23 +1961,31 @@ def _delete_alert_config_route_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_scrape_config_payload is not None: + _body_params = create_scrape_config_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1950,11 +1999,11 @@ def _delete_alert_config_route_serialize( ) @validate_call - def delete_credentials( + def delete_alert_config_receiver( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1964,17 +2013,17 @@ def delete_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Message: - """delete_credentials + ) -> AlertConfigReceiversResponse: + """delete_alert_config_receiver - Delete technical credentials. + Delete alert config receiver. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1997,10 +2046,10 @@ def delete_credentials( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_credentials_serialize( + _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, project_id=project_id, - username=username, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2008,10 +2057,9 @@ def delete_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Message", + "202": "AlertConfigReceiversResponse", "403": "PermissionDenied", "404": "Message", - "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2021,11 +2069,11 @@ def delete_credentials( ).data @validate_call - def delete_credentials_with_http_info( + def delete_alert_config_receiver_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2035,17 +2083,17 @@ def delete_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Message]: - """delete_credentials + ) -> ApiResponse[AlertConfigReceiversResponse]: + """delete_alert_config_receiver - Delete technical credentials. + Delete alert config receiver. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2068,10 +2116,10 @@ def delete_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_credentials_serialize( + _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, project_id=project_id, - username=username, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2079,10 +2127,9 @@ def delete_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Message", + "202": "AlertConfigReceiversResponse", "403": "PermissionDenied", "404": "Message", - "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2092,11 +2139,11 @@ def delete_credentials_with_http_info( ) @validate_call - def delete_credentials_without_preload_content( + def delete_alert_config_receiver_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2107,16 +2154,16 @@ def delete_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_credentials + """delete_alert_config_receiver - Delete technical credentials. + Delete alert config receiver. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2139,10 +2186,10 @@ def delete_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_credentials_serialize( + _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, project_id=project_id, - username=username, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2150,19 +2197,18 @@ def delete_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Message", + "202": "AlertConfigReceiversResponse", "403": "PermissionDenied", "404": "Message", - "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_credentials_serialize( + def _delete_alert_config_receiver_serialize( self, instance_id, project_id, - username, + receiver, _request_auth, _content_type, _headers, @@ -2185,8 +2231,8 @@ def _delete_credentials_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if username is not None: - _path_params["username"] = username + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters @@ -2201,7 +2247,7 @@ def _delete_credentials_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2215,11 +2261,11 @@ def _delete_credentials_serialize( ) @validate_call - def delete_credentials_remote_write_config( + def delete_alert_config_route( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2229,17 +2275,17 @@ def delete_credentials_remote_write_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CredentialsRemoteWriteDeleteResponse: - """delete_credentials_remote_write_config + ) -> AlertConfigRouteResponse: + """delete_alert_config_route - Delete remote write config for credentials. + Delete alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2262,10 +2308,10 @@ def delete_credentials_remote_write_config( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_credentials_remote_write_config_serialize( + _param = self._delete_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, - username=username, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2273,11 +2319,9 @@ def delete_credentials_remote_write_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteDeleteResponse", - "400": "Error", + "202": "AlertConfigRouteResponse", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2287,11 +2331,11 @@ def delete_credentials_remote_write_config( ).data @validate_call - def delete_credentials_remote_write_config_with_http_info( + def delete_alert_config_route_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2301,17 +2345,17 @@ def delete_credentials_remote_write_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CredentialsRemoteWriteDeleteResponse]: - """delete_credentials_remote_write_config + ) -> ApiResponse[AlertConfigRouteResponse]: + """delete_alert_config_route - Delete remote write config for credentials. + Delete alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2334,10 +2378,10 @@ def delete_credentials_remote_write_config_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_credentials_remote_write_config_serialize( + _param = self._delete_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, - username=username, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2345,11 +2389,9 @@ def delete_credentials_remote_write_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteDeleteResponse", - "400": "Error", + "202": "AlertConfigRouteResponse", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2359,11 +2401,11 @@ def delete_credentials_remote_write_config_with_http_info( ) @validate_call - def delete_credentials_remote_write_config_without_preload_content( + def delete_alert_config_route_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2374,16 +2416,16 @@ def delete_credentials_remote_write_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_credentials_remote_write_config + """delete_alert_config_route - Delete remote write config for credentials. + Delete alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2406,10 +2448,10 @@ def delete_credentials_remote_write_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_credentials_remote_write_config_serialize( + _param = self._delete_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, - username=username, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2417,20 +2459,18 @@ def delete_credentials_remote_write_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteDeleteResponse", - "400": "Error", + "202": "AlertConfigRouteResponse", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_credentials_remote_write_config_serialize( + def _delete_alert_config_route_serialize( self, instance_id, project_id, - username, + receiver, _request_auth, _content_type, _headers, @@ -2453,8 +2493,8 @@ def _delete_credentials_remote_write_config_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if username is not None: - _path_params["username"] = username + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters @@ -2469,7 +2509,7 @@ def _delete_credentials_remote_write_config_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2483,8 +2523,9 @@ def _delete_credentials_remote_write_config_serialize( ) @validate_call - def delete_instance( + def delete_alertgroup( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -2496,11 +2537,13 @@ def delete_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceResponse: - """delete_instance + ) -> AlertGroupsResponse: + """delete_alertgroup - Delete instance. + Delete alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -2527,7 +2570,8 @@ def delete_instance( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_instance_serialize( + _param = self._delete_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -2537,8 +2581,10 @@ def delete_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2548,8 +2594,9 @@ def delete_instance( ).data @validate_call - def delete_instance_with_http_info( + def delete_alertgroup_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -2561,11 +2608,13 @@ def delete_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceResponse]: - """delete_instance + ) -> ApiResponse[AlertGroupsResponse]: + """delete_alertgroup - Delete instance. + Delete alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -2592,7 +2641,8 @@ def delete_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_instance_serialize( + _param = self._delete_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -2602,8 +2652,10 @@ def delete_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2613,8 +2665,9 @@ def delete_instance_with_http_info( ) @validate_call - def delete_instance_without_preload_content( + def delete_alertgroup_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -2627,10 +2680,12 @@ def delete_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_instance + """delete_alertgroup - Delete instance. + Delete alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -2657,7 +2712,8 @@ def delete_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_instance_serialize( + _param = self._delete_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -2667,14 +2723,17 @@ def delete_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_instance_serialize( + def _delete_alertgroup_serialize( self, + group_name, instance_id, project_id, _request_auth, @@ -2695,6 +2754,8 @@ def _delete_instance_serialize( _body_params: Optional[bytes] = None # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -2713,7 +2774,7 @@ def _delete_instance_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2727,11 +2788,11 @@ def _delete_instance_serialize( ) @validate_call - def delete_scrape_config( + def delete_alertgroups( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2741,17 +2802,17 @@ def delete_scrape_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeleteScrapeConfigResponse: - """delete_scrape_config + ) -> AlertGroupsResponse: + """delete_alertgroups - Delete scrape config. + Delete alert groups. :param instance_id: (required) :type instance_id: str - :param job_name: (required) - :type job_name: str :param project_id: (required) :type project_id: str + :param group_name: Name of the groups that should be deleted (required) + :type group_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2774,10 +2835,10 @@ def delete_scrape_config( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_scrape_config_serialize( + _param = self._delete_alertgroups_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + group_name=group_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2785,9 +2846,8 @@ def delete_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "DeleteScrapeConfigResponse", + "202": "AlertGroupsResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2797,11 +2857,11 @@ def delete_scrape_config( ).data @validate_call - def delete_scrape_config_with_http_info( + def delete_alertgroups_with_http_info( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2811,17 +2871,17 @@ def delete_scrape_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DeleteScrapeConfigResponse]: - """delete_scrape_config + ) -> ApiResponse[AlertGroupsResponse]: + """delete_alertgroups - Delete scrape config. + Delete alert groups. :param instance_id: (required) :type instance_id: str - :param job_name: (required) - :type job_name: str :param project_id: (required) :type project_id: str + :param group_name: Name of the groups that should be deleted (required) + :type group_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2844,10 +2904,10 @@ def delete_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_scrape_config_serialize( + _param = self._delete_alertgroups_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + group_name=group_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2855,9 +2915,8 @@ def delete_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "DeleteScrapeConfigResponse", + "202": "AlertGroupsResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2867,11 +2926,11 @@ def delete_scrape_config_with_http_info( ) @validate_call - def delete_scrape_config_without_preload_content( + def delete_alertgroups_without_preload_content( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2882,16 +2941,16 @@ def delete_scrape_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_scrape_config + """delete_alertgroups - Delete scrape config. + Delete alert groups. :param instance_id: (required) :type instance_id: str - :param job_name: (required) - :type job_name: str :param project_id: (required) :type project_id: str + :param group_name: Name of the groups that should be deleted (required) + :type group_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2914,10 +2973,10 @@ def delete_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._delete_scrape_config_serialize( + _param = self._delete_alertgroups_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + group_name=group_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2925,18 +2984,17 @@ def delete_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "DeleteScrapeConfigResponse", + "202": "AlertGroupsResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_scrape_config_serialize( + def _delete_alertgroups_serialize( self, instance_id, - job_name, project_id, + group_name, _request_auth, _content_type, _headers, @@ -2945,7 +3003,9 @@ def _delete_scrape_config_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "groupName": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2957,11 +3017,13 @@ def _delete_scrape_config_serialize( # process the path parameters if instance_id is not None: _path_params["instanceId"] = instance_id - if job_name is not None: - _path_params["jobName"] = job_name if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if group_name is not None: + + _query_params.append(("groupName", group_name)) + # process the header parameters # process the form parameters # process the body parameter @@ -2975,7 +3037,7 @@ def _delete_scrape_config_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2989,11 +3051,12 @@ def _delete_scrape_config_serialize( ) @validate_call - def get_alert_config_receiver( + def delete_alertrules( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3003,17 +3066,19 @@ def get_alert_config_receiver( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Receiver: - """get_alert_config_receiver + ) -> AlertRulesResponse: + """delete_alertrules - Get alert config receivers. + Delete alert rules. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param alert_name: Name of the alert rules that should be deleted (required) + :type alert_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3036,10 +3101,11 @@ def get_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_config_receiver_serialize( + _param = self._delete_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, + alert_name=alert_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3047,9 +3113,8 @@ def get_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Receiver", + "202": "AlertRulesResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3059,11 +3124,12 @@ def get_alert_config_receiver( ).data @validate_call - def get_alert_config_receiver_with_http_info( + def delete_alertrules_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3073,17 +3139,19 @@ def get_alert_config_receiver_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Receiver]: - """get_alert_config_receiver + ) -> ApiResponse[AlertRulesResponse]: + """delete_alertrules - Get alert config receivers. + Delete alert rules. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param alert_name: Name of the alert rules that should be deleted (required) + :type alert_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3106,10 +3174,11 @@ def get_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_config_receiver_serialize( + _param = self._delete_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, + alert_name=alert_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3117,9 +3186,8 @@ def get_alert_config_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Receiver", + "202": "AlertRulesResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3129,11 +3197,12 @@ def get_alert_config_receiver_with_http_info( ) @validate_call - def get_alert_config_receiver_without_preload_content( + def delete_alertrules_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3144,16 +3213,18 @@ def get_alert_config_receiver_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alert_config_receiver + """delete_alertrules - Get alert config receivers. + Delete alert rules. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param alert_name: Name of the alert rules that should be deleted (required) + :type alert_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3176,10 +3247,11 @@ def get_alert_config_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_config_receiver_serialize( + _param = self._delete_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, + alert_name=alert_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3187,18 +3259,18 @@ def get_alert_config_receiver_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Receiver", + "202": "AlertRulesResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_alert_config_receiver_serialize( + def _delete_alertrules_serialize( self, + group_name, instance_id, project_id, - receiver, + alert_name, _request_auth, _content_type, _headers, @@ -3207,7 +3279,9 @@ def _get_alert_config_receiver_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "alertName": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3217,13 +3291,17 @@ def _get_alert_config_receiver_serialize( _body_params: Optional[bytes] = None # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver # process the query parameters + if alert_name is not None: + + _query_params.append(("alertName", alert_name)) + # process the header parameters # process the form parameters # process the body parameter @@ -3236,8 +3314,8 @@ def _get_alert_config_receiver_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3251,11 +3329,11 @@ def _get_alert_config_receiver_serialize( ) @validate_call - def get_alert_config_route( + def delete_credentials( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3265,17 +3343,17 @@ def get_alert_config_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigRouteResponse: - """get_alert_config_route + ) -> Message: + """delete_credentials - Get alert receiver for route. + Delete technical credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3298,10 +3376,10 @@ def get_alert_config_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_config_route_serialize( + _param = self._delete_credentials_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3309,8 +3387,10 @@ def get_alert_config_route( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "Message", "403": "PermissionDenied", + "404": "Message", + "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3320,11 +3400,11 @@ def get_alert_config_route( ).data @validate_call - def get_alert_config_route_with_http_info( + def delete_credentials_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3334,17 +3414,17 @@ def get_alert_config_route_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigRouteResponse]: - """get_alert_config_route + ) -> ApiResponse[Message]: + """delete_credentials - Get alert receiver for route. + Delete technical credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3367,10 +3447,10 @@ def get_alert_config_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_config_route_serialize( + _param = self._delete_credentials_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3378,8 +3458,10 @@ def get_alert_config_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "Message", "403": "PermissionDenied", + "404": "Message", + "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3389,11 +3471,11 @@ def get_alert_config_route_with_http_info( ) @validate_call - def get_alert_config_route_without_preload_content( + def delete_credentials_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3404,16 +3486,16 @@ def get_alert_config_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alert_config_route + """delete_credentials - Get alert receiver for route. + Delete technical credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3436,10 +3518,10 @@ def get_alert_config_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_config_route_serialize( + _param = self._delete_credentials_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3447,17 +3529,19 @@ def get_alert_config_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "Message", "403": "PermissionDenied", + "404": "Message", + "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_alert_config_route_serialize( + def _delete_credentials_serialize( self, instance_id, project_id, - receiver, + username, _request_auth, _content_type, _headers, @@ -3480,8 +3564,8 @@ def _get_alert_config_route_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -3495,8 +3579,8 @@ def _get_alert_config_route_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3510,10 +3594,11 @@ def _get_alert_config_route_serialize( ) @validate_call - def get_alert_configs( + def delete_credentials_remote_write_config( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3523,15 +3608,17 @@ def get_alert_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetAlertConfigsResponse: - """get_alert_configs + ) -> CredentialsRemoteWriteDeleteResponse: + """delete_credentials_remote_write_config - Get alert config. + Delete remote write config for credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3554,9 +3641,10 @@ def get_alert_configs( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_configs_serialize( + _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3564,8 +3652,11 @@ def get_alert_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAlertConfigsResponse", + "200": "CredentialsRemoteWriteDeleteResponse", + "400": "Error", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3575,10 +3666,11 @@ def get_alert_configs( ).data @validate_call - def get_alert_configs_with_http_info( + def delete_credentials_remote_write_config_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3588,15 +3680,17 @@ def get_alert_configs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetAlertConfigsResponse]: - """get_alert_configs + ) -> ApiResponse[CredentialsRemoteWriteDeleteResponse]: + """delete_credentials_remote_write_config - Get alert config. + Delete remote write config for credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3619,9 +3713,10 @@ def get_alert_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_configs_serialize( + _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3629,8 +3724,11 @@ def get_alert_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAlertConfigsResponse", + "200": "CredentialsRemoteWriteDeleteResponse", + "400": "Error", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3640,10 +3738,11 @@ def get_alert_configs_with_http_info( ) @validate_call - def get_alert_configs_without_preload_content( + def delete_credentials_remote_write_config_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3654,14 +3753,16 @@ def get_alert_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alert_configs + """delete_credentials_remote_write_config - Get alert config. + Delete remote write config for credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3684,9 +3785,10 @@ def get_alert_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_alert_configs_serialize( + _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3694,16 +3796,20 @@ def get_alert_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAlertConfigsResponse", + "200": "CredentialsRemoteWriteDeleteResponse", + "400": "Error", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_alert_configs_serialize( + def _delete_credentials_remote_write_config_serialize( self, instance_id, project_id, + username, _request_auth, _content_type, _headers, @@ -3726,6 +3832,8 @@ def _get_alert_configs_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -3739,8 +3847,8 @@ def _get_alert_configs_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3754,11 +3862,10 @@ def _get_alert_configs_serialize( ) @validate_call - def get_credentials( + def delete_instance( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3768,17 +3875,15 @@ def get_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetCredentialsResponse: - """get_credentials + ) -> InstanceResponse: + """delete_instance - Get single technical credentials. + Delete instance. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3801,10 +3906,9 @@ def get_credentials( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_credentials_serialize( + _param = self._delete_instance_serialize( instance_id=instance_id, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3812,9 +3916,8 @@ def get_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialsResponse", + "202": "InstanceResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3824,11 +3927,10 @@ def get_credentials( ).data @validate_call - def get_credentials_with_http_info( + def delete_instance_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3838,17 +3940,15 @@ def get_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetCredentialsResponse]: - """get_credentials + ) -> ApiResponse[InstanceResponse]: + """delete_instance - Get single technical credentials. + Delete instance. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3871,10 +3971,9 @@ def get_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_credentials_serialize( + _param = self._delete_instance_serialize( instance_id=instance_id, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3882,9 +3981,8 @@ def get_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialsResponse", + "202": "InstanceResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3894,11 +3992,10 @@ def get_credentials_with_http_info( ) @validate_call - def get_credentials_without_preload_content( + def delete_instance_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3909,16 +4006,14 @@ def get_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_credentials + """delete_instance - Get single technical credentials. + Delete instance. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3941,10 +4036,9 @@ def get_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_credentials_serialize( + _param = self._delete_instance_serialize( instance_id=instance_id, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3952,18 +4046,16 @@ def get_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialsResponse", + "202": "InstanceResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_credentials_serialize( + def _delete_instance_serialize( self, instance_id, project_id, - username, _request_auth, _content_type, _headers, @@ -3986,8 +4078,6 @@ def _get_credentials_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if username is not None: - _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -4001,8 +4091,8 @@ def _get_credentials_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4016,11 +4106,11 @@ def _get_credentials_serialize( ) @validate_call - def get_credentials_remote_write_config( + def delete_scrape_config( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4030,17 +4120,17 @@ def get_credentials_remote_write_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CredentialsRemoteWriteConfig: - """get_credentials_remote_write_config + ) -> DeleteScrapeConfigResponse: + """delete_scrape_config - Get remote write config. + Delete scrape config. :param instance_id: (required) :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4063,10 +4153,10 @@ def get_credentials_remote_write_config( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_credentials_remote_write_config_serialize( + _param = self._delete_scrape_config_serialize( instance_id=instance_id, + job_name=job_name, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4074,10 +4164,9 @@ def get_credentials_remote_write_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "DeleteScrapeConfigResponse", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4087,11 +4176,11 @@ def get_credentials_remote_write_config( ).data @validate_call - def get_credentials_remote_write_config_with_http_info( + def delete_scrape_config_with_http_info( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4101,17 +4190,17 @@ def get_credentials_remote_write_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CredentialsRemoteWriteConfig]: - """get_credentials_remote_write_config + ) -> ApiResponse[DeleteScrapeConfigResponse]: + """delete_scrape_config - Get remote write config. + Delete scrape config. :param instance_id: (required) :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4134,10 +4223,10 @@ def get_credentials_remote_write_config_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_credentials_remote_write_config_serialize( + _param = self._delete_scrape_config_serialize( instance_id=instance_id, + job_name=job_name, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4145,10 +4234,9 @@ def get_credentials_remote_write_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "DeleteScrapeConfigResponse", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4158,11 +4246,11 @@ def get_credentials_remote_write_config_with_http_info( ) @validate_call - def get_credentials_remote_write_config_without_preload_content( + def delete_scrape_config_without_preload_content( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4173,16 +4261,16 @@ def get_credentials_remote_write_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_credentials_remote_write_config + """delete_scrape_config - Get remote write config. + Delete scrape config. :param instance_id: (required) :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4205,10 +4293,10 @@ def get_credentials_remote_write_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_credentials_remote_write_config_serialize( + _param = self._delete_scrape_config_serialize( instance_id=instance_id, + job_name=job_name, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4216,19 +4304,18 @@ def get_credentials_remote_write_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "DeleteScrapeConfigResponse", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_credentials_remote_write_config_serialize( + def _delete_scrape_config_serialize( self, instance_id, + job_name, project_id, - username, _request_auth, _content_type, _headers, @@ -4249,10 +4336,10 @@ def _get_credentials_remote_write_config_serialize( # process the path parameters if instance_id is not None: _path_params["instanceId"] = instance_id + if job_name is not None: + _path_params["jobName"] = job_name if project_id is not None: _path_params["projectId"] = project_id - if username is not None: - _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -4266,8 +4353,8 @@ def _get_credentials_remote_write_config_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4281,10 +4368,11 @@ def _get_credentials_remote_write_config_serialize( ) @validate_call - def get_grafana_configs( + def get_alert_config_receiver( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4294,15 +4382,17 @@ def get_grafana_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GrafanaConfigs: - """get_grafana_configs + ) -> Receiver: + """get_alert_config_receiver - Get grafana config. + Get alert config receivers. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4325,9 +4415,10 @@ def get_grafana_configs( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_grafana_configs_serialize( + _param = self._get_alert_config_receiver_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4335,8 +4426,9 @@ def get_grafana_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GrafanaConfigs", + "200": "Receiver", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4346,10 +4438,11 @@ def get_grafana_configs( ).data @validate_call - def get_grafana_configs_with_http_info( + def get_alert_config_receiver_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4359,15 +4452,17 @@ def get_grafana_configs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GrafanaConfigs]: - """get_grafana_configs + ) -> ApiResponse[Receiver]: + """get_alert_config_receiver - Get grafana config. + Get alert config receivers. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4390,9 +4485,10 @@ def get_grafana_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_grafana_configs_serialize( + _param = self._get_alert_config_receiver_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4400,8 +4496,9 @@ def get_grafana_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GrafanaConfigs", + "200": "Receiver", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4411,10 +4508,11 @@ def get_grafana_configs_with_http_info( ) @validate_call - def get_grafana_configs_without_preload_content( + def get_alert_config_receiver_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4425,14 +4523,16 @@ def get_grafana_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_grafana_configs + """get_alert_config_receiver - Get grafana config. + Get alert config receivers. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4455,9 +4555,10 @@ def get_grafana_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_grafana_configs_serialize( + _param = self._get_alert_config_receiver_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4465,16 +4566,18 @@ def get_grafana_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GrafanaConfigs", + "200": "Receiver", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_grafana_configs_serialize( + def _get_alert_config_receiver_serialize( self, instance_id, project_id, + receiver, _request_auth, _content_type, _headers, @@ -4497,6 +4600,8 @@ def _get_grafana_configs_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters @@ -4511,7 +4616,7 @@ def _get_grafana_configs_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/grafana-configs", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4525,10 +4630,11 @@ def _get_grafana_configs_serialize( ) @validate_call - def get_instance( + def get_alert_config_route( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4538,15 +4644,17 @@ def get_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetInstanceResponse: - """get_instance + ) -> AlertConfigRouteResponse: + """get_alert_config_route - Get instance information. + Get alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4569,9 +4677,10 @@ def get_instance( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_instance_serialize( + _param = self._get_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4579,7 +4688,7 @@ def get_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4590,10 +4699,11 @@ def get_instance( ).data @validate_call - def get_instance_with_http_info( + def get_alert_config_route_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4603,15 +4713,17 @@ def get_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetInstanceResponse]: - """get_instance + ) -> ApiResponse[AlertConfigRouteResponse]: + """get_alert_config_route - Get instance information. + Get alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4634,9 +4746,10 @@ def get_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_instance_serialize( + _param = self._get_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4644,7 +4757,7 @@ def get_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4655,10 +4768,11 @@ def get_instance_with_http_info( ) @validate_call - def get_instance_without_preload_content( + def get_alert_config_route_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4669,14 +4783,16 @@ def get_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_instance + """get_alert_config_route - Get instance information. + Get alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4699,9 +4815,10 @@ def get_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_instance_serialize( + _param = self._get_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4709,16 +4826,17 @@ def get_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_instance_serialize( + def _get_alert_config_route_serialize( self, instance_id, project_id, + receiver, _request_auth, _content_type, _headers, @@ -4741,6 +4859,8 @@ def _get_instance_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters @@ -4755,7 +4875,7 @@ def _get_instance_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4769,7 +4889,7 @@ def _get_instance_serialize( ) @validate_call - def get_metrics_storage_retention( + def get_alert_configs( self, instance_id: StrictStr, project_id: StrictStr, @@ -4782,10 +4902,10 @@ def get_metrics_storage_retention( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetMetricsStorageRetentionResponse: - """get_metrics_storage_retention + ) -> GetAlertConfigsResponse: + """get_alert_configs - Get metric storage retention time. + Get alert config. :param instance_id: (required) :type instance_id: str @@ -4813,7 +4933,7 @@ def get_metrics_storage_retention( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_metrics_storage_retention_serialize( + _param = self._get_alert_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -4823,7 +4943,7 @@ def get_metrics_storage_retention( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "GetAlertConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4834,7 +4954,7 @@ def get_metrics_storage_retention( ).data @validate_call - def get_metrics_storage_retention_with_http_info( + def get_alert_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -4847,10 +4967,10 @@ def get_metrics_storage_retention_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetMetricsStorageRetentionResponse]: - """get_metrics_storage_retention + ) -> ApiResponse[GetAlertConfigsResponse]: + """get_alert_configs - Get metric storage retention time. + Get alert config. :param instance_id: (required) :type instance_id: str @@ -4878,7 +4998,7 @@ def get_metrics_storage_retention_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_metrics_storage_retention_serialize( + _param = self._get_alert_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -4888,7 +5008,7 @@ def get_metrics_storage_retention_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "GetAlertConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4899,7 +5019,7 @@ def get_metrics_storage_retention_with_http_info( ) @validate_call - def get_metrics_storage_retention_without_preload_content( + def get_alert_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -4913,9 +5033,9 @@ def get_metrics_storage_retention_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_metrics_storage_retention + """get_alert_configs - Get metric storage retention time. + Get alert config. :param instance_id: (required) :type instance_id: str @@ -4943,7 +5063,7 @@ def get_metrics_storage_retention_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_metrics_storage_retention_serialize( + _param = self._get_alert_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -4953,13 +5073,13 @@ def get_metrics_storage_retention_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "GetAlertConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_metrics_storage_retention_serialize( + def _get_alert_configs_serialize( self, instance_id, project_id, @@ -4999,7 +5119,7 @@ def _get_metrics_storage_retention_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5013,10 +5133,10 @@ def _get_metrics_storage_retention_serialize( ) @validate_call - def get_scrape_config( + def get_alertgroup( self, + group_name: StrictStr, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -5027,15 +5147,15 @@ def get_scrape_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetScrapeConfigResponse: - """get_scrape_config + ) -> AlertGroupResponse: + """get_alertgroup - Get scrape config. + Get alert group. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str - :param job_name: (required) - :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -5060,9 +5180,9 @@ def get_scrape_config( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_scrape_config_serialize( + _param = self._get_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, - job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -5071,8 +5191,10 @@ def get_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "AlertGroupResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5082,10 +5204,10 @@ def get_scrape_config( ).data @validate_call - def get_scrape_config_with_http_info( + def get_alertgroup_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -5096,15 +5218,15 @@ def get_scrape_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetScrapeConfigResponse]: - """get_scrape_config + ) -> ApiResponse[AlertGroupResponse]: + """get_alertgroup - Get scrape config. + Get alert group. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str - :param job_name: (required) - :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -5129,9 +5251,9 @@ def get_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_scrape_config_serialize( + _param = self._get_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, - job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -5140,8 +5262,10 @@ def get_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "AlertGroupResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5151,10 +5275,10 @@ def get_scrape_config_with_http_info( ) @validate_call - def get_scrape_config_without_preload_content( + def get_alertgroup_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -5166,14 +5290,14 @@ def get_scrape_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_scrape_config + """get_alertgroup - Get scrape config. + Get alert group. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str - :param job_name: (required) - :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -5198,9 +5322,9 @@ def get_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._get_scrape_config_serialize( + _param = self._get_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, - job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -5209,16 +5333,18 @@ def get_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "AlertGroupResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_scrape_config_serialize( + def _get_alertgroup_serialize( self, + group_name, instance_id, - job_name, project_id, _request_auth, _content_type, @@ -5238,10 +5364,10 @@ def _get_scrape_config_serialize( _body_params: Optional[bytes] = None # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name if instance_id is not None: _path_params["instanceId"] = instance_id - if job_name is not None: - _path_params["jobName"] = job_name if project_id is not None: _path_params["projectId"] = project_id # process the query parameters @@ -5258,7 +5384,7 @@ def _get_scrape_config_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5272,10 +5398,11 @@ def _get_scrape_config_serialize( ) @validate_call - def list_acl( + def get_credentials( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5285,15 +5412,17 @@ def list_acl( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListACLResponse: - """list_acl + ) -> GetCredentialsResponse: + """get_credentials - Get acl for instance. + Get single technical credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5316,9 +5445,10 @@ def list_acl( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_acl_serialize( + _param = self._get_credentials_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5326,8 +5456,9 @@ def list_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "200": "GetCredentialsResponse", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5337,10 +5468,11 @@ def list_acl( ).data @validate_call - def list_acl_with_http_info( + def get_credentials_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5350,15 +5482,17 @@ def list_acl_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListACLResponse]: - """list_acl + ) -> ApiResponse[GetCredentialsResponse]: + """get_credentials - Get acl for instance. + Get single technical credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5381,9 +5515,10 @@ def list_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_acl_serialize( + _param = self._get_credentials_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5391,8 +5526,9 @@ def list_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "200": "GetCredentialsResponse", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5402,10 +5538,11 @@ def list_acl_with_http_info( ) @validate_call - def list_acl_without_preload_content( + def get_credentials_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5416,14 +5553,16 @@ def list_acl_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_acl + """get_credentials - Get acl for instance. + Get single technical credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5446,9 +5585,10 @@ def list_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_acl_serialize( + _param = self._get_credentials_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5456,16 +5596,18 @@ def list_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "200": "GetCredentialsResponse", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_acl_serialize( + def _get_credentials_serialize( self, instance_id, project_id, + username, _request_auth, _content_type, _headers, @@ -5488,6 +5630,8 @@ def _list_acl_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -5502,7 +5646,7 @@ def _list_acl_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acl", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5516,10 +5660,11 @@ def _list_acl_serialize( ) @validate_call - def list_alert_config_receivers( + def get_credentials_remote_write_config( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5529,15 +5674,17 @@ def list_alert_config_receivers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigReceiversResponse: - """list_alert_config_receivers + ) -> CredentialsRemoteWriteConfig: + """get_credentials_remote_write_config - Get alert config receivers. + Get remote write config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5560,9 +5707,10 @@ def list_alert_config_receivers( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_alert_config_receivers_serialize( + _param = self._get_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5570,8 +5718,10 @@ def list_alert_config_receivers( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "CredentialsRemoteWriteConfig", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5581,10 +5731,11 @@ def list_alert_config_receivers( ).data @validate_call - def list_alert_config_receivers_with_http_info( + def get_credentials_remote_write_config_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5594,15 +5745,17 @@ def list_alert_config_receivers_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigReceiversResponse]: - """list_alert_config_receivers + ) -> ApiResponse[CredentialsRemoteWriteConfig]: + """get_credentials_remote_write_config - Get alert config receivers. + Get remote write config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5625,9 +5778,10 @@ def list_alert_config_receivers_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_alert_config_receivers_serialize( + _param = self._get_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5635,8 +5789,10 @@ def list_alert_config_receivers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "CredentialsRemoteWriteConfig", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5646,10 +5802,11 @@ def list_alert_config_receivers_with_http_info( ) @validate_call - def list_alert_config_receivers_without_preload_content( + def get_credentials_remote_write_config_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5660,14 +5817,16 @@ def list_alert_config_receivers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_alert_config_receivers + """get_credentials_remote_write_config - Get alert config receivers. + Get remote write config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5690,9 +5849,10 @@ def list_alert_config_receivers_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_alert_config_receivers_serialize( + _param = self._get_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5700,16 +5860,19 @@ def list_alert_config_receivers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "CredentialsRemoteWriteConfig", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alert_config_receivers_serialize( + def _get_credentials_remote_write_config_serialize( self, instance_id, project_id, + username, _request_auth, _content_type, _headers, @@ -5732,6 +5895,8 @@ def _list_alert_config_receivers_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -5746,7 +5911,7 @@ def _list_alert_config_receivers_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5760,7 +5925,7 @@ def _list_alert_config_receivers_serialize( ) @validate_call - def list_alert_config_routes( + def get_grafana_configs( self, instance_id: StrictStr, project_id: StrictStr, @@ -5773,10 +5938,10 @@ def list_alert_config_routes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigRouteResponse: - """list_alert_config_routes + ) -> GrafanaConfigs: + """get_grafana_configs - Get alert config route. + Get grafana config. :param instance_id: (required) :type instance_id: str @@ -5804,7 +5969,7 @@ def list_alert_config_routes( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_alert_config_routes_serialize( + _param = self._get_grafana_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -5814,7 +5979,7 @@ def list_alert_config_routes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "GrafanaConfigs", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5825,7 +5990,7 @@ def list_alert_config_routes( ).data @validate_call - def list_alert_config_routes_with_http_info( + def get_grafana_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -5838,10 +6003,10 @@ def list_alert_config_routes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigRouteResponse]: - """list_alert_config_routes + ) -> ApiResponse[GrafanaConfigs]: + """get_grafana_configs - Get alert config route. + Get grafana config. :param instance_id: (required) :type instance_id: str @@ -5869,7 +6034,7 @@ def list_alert_config_routes_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_alert_config_routes_serialize( + _param = self._get_grafana_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -5879,7 +6044,7 @@ def list_alert_config_routes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "GrafanaConfigs", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5890,7 +6055,7 @@ def list_alert_config_routes_with_http_info( ) @validate_call - def list_alert_config_routes_without_preload_content( + def get_grafana_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -5904,9 +6069,9 @@ def list_alert_config_routes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_alert_config_routes + """get_grafana_configs - Get alert config route. + Get grafana config. :param instance_id: (required) :type instance_id: str @@ -5934,7 +6099,7 @@ def list_alert_config_routes_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_alert_config_routes_serialize( + _param = self._get_grafana_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -5944,13 +6109,13 @@ def list_alert_config_routes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "GrafanaConfigs", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alert_config_routes_serialize( + def _get_grafana_configs_serialize( self, instance_id, project_id, @@ -5990,7 +6155,7 @@ def _list_alert_config_routes_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/grafana-configs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6004,7 +6169,7 @@ def _list_alert_config_routes_serialize( ) @validate_call - def list_credentials( + def get_instance( self, instance_id: StrictStr, project_id: StrictStr, @@ -6017,10 +6182,10 @@ def list_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListCredentialsResponse: - """list_credentials + ) -> GetInstanceResponse: + """get_instance - Get all technical user credentials. + Get instance information. :param instance_id: (required) :type instance_id: str @@ -6048,7 +6213,7 @@ def list_credentials( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_credentials_serialize( + _param = self._get_instance_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -6058,7 +6223,7 @@ def list_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "GetInstanceResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6069,7 +6234,7 @@ def list_credentials( ).data @validate_call - def list_credentials_with_http_info( + def get_instance_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -6082,10 +6247,10 @@ def list_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListCredentialsResponse]: - """list_credentials + ) -> ApiResponse[GetInstanceResponse]: + """get_instance - Get all technical user credentials. + Get instance information. :param instance_id: (required) :type instance_id: str @@ -6113,7 +6278,7 @@ def list_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_credentials_serialize( + _param = self._get_instance_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -6123,7 +6288,7 @@ def list_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "GetInstanceResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6134,7 +6299,7 @@ def list_credentials_with_http_info( ) @validate_call - def list_credentials_without_preload_content( + def get_instance_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -6148,9 +6313,9 @@ def list_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_credentials + """get_instance - Get all technical user credentials. + Get instance information. :param instance_id: (required) :type instance_id: str @@ -6178,7 +6343,7 @@ def list_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_credentials_serialize( + _param = self._get_instance_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -6188,13 +6353,13 @@ def list_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "GetInstanceResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_credentials_serialize( + def _get_instance_serialize( self, instance_id, project_id, @@ -6234,7 +6399,7 @@ def _list_credentials_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6248,8 +6413,9 @@ def _list_credentials_serialize( ) @validate_call - def list_instances( + def get_metrics_storage_retention( self, + instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -6260,11 +6426,13 @@ def list_instances( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListInstancesResponse: - """list_instances + ) -> GetMetricsStorageRetentionResponse: + """get_metrics_storage_retention - Get all instances for a project. + Get metric storage retention time. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -6289,7 +6457,8 @@ def list_instances( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_instances_serialize( + _param = self._get_metrics_storage_retention_serialize( + instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -6298,7 +6467,7 @@ def list_instances( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "200": "GetMetricsStorageRetentionResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6309,8 +6478,9 @@ def list_instances( ).data @validate_call - def list_instances_with_http_info( + def get_metrics_storage_retention_with_http_info( self, + instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -6321,11 +6491,13 @@ def list_instances_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListInstancesResponse]: - """list_instances + ) -> ApiResponse[GetMetricsStorageRetentionResponse]: + """get_metrics_storage_retention - Get all instances for a project. + Get metric storage retention time. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -6350,7 +6522,8 @@ def list_instances_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_instances_serialize( + _param = self._get_metrics_storage_retention_serialize( + instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -6359,7 +6532,7 @@ def list_instances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "200": "GetMetricsStorageRetentionResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6370,8 +6543,9 @@ def list_instances_with_http_info( ) @validate_call - def list_instances_without_preload_content( + def get_metrics_storage_retention_without_preload_content( self, + instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -6383,10 +6557,12 @@ def list_instances_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_instances + """get_metrics_storage_retention - Get all instances for a project. + Get metric storage retention time. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -6411,7 +6587,8 @@ def list_instances_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_instances_serialize( + _param = self._get_metrics_storage_retention_serialize( + instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -6420,14 +6597,15 @@ def list_instances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "200": "GetMetricsStorageRetentionResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_instances_serialize( + def _get_metrics_storage_retention_serialize( self, + instance_id, project_id, _request_auth, _content_type, @@ -6447,6 +6625,8 @@ def _list_instances_serialize( _body_params: Optional[bytes] = None # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id # process the query parameters @@ -6463,7 +6643,7 @@ def _list_instances_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6477,8 +6657,10 @@ def _list_instances_serialize( ) @validate_call - def list_plans( + def get_scrape_config( self, + instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -6489,11 +6671,15 @@ def list_plans( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> PlansResponse: - """list_plans + ) -> GetScrapeConfigResponse: + """get_scrape_config - Get all plans. + Get scrape config. + :param instance_id: (required) + :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -6518,7 +6704,9 @@ def list_plans( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_plans_serialize( + _param = self._get_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -6527,7 +6715,7 @@ def list_plans( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "GetScrapeConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6538,8 +6726,10 @@ def list_plans( ).data @validate_call - def list_plans_with_http_info( + def get_scrape_config_with_http_info( self, + instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -6550,11 +6740,15 @@ def list_plans_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[PlansResponse]: - """list_plans + ) -> ApiResponse[GetScrapeConfigResponse]: + """get_scrape_config - Get all plans. + Get scrape config. + :param instance_id: (required) + :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -6579,7 +6773,9 @@ def list_plans_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_plans_serialize( + _param = self._get_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -6588,7 +6784,7 @@ def list_plans_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "GetScrapeConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6599,8 +6795,10 @@ def list_plans_with_http_info( ) @validate_call - def list_plans_without_preload_content( + def get_scrape_config_without_preload_content( self, + instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -6612,10 +6810,14 @@ def list_plans_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_plans + """get_scrape_config - Get all plans. + Get scrape config. + :param instance_id: (required) + :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -6640,7 +6842,9 @@ def list_plans_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_plans_serialize( + _param = self._get_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -6649,14 +6853,16 @@ def list_plans_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "GetScrapeConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_plans_serialize( + def _get_scrape_config_serialize( self, + instance_id, + job_name, project_id, _request_auth, _content_type, @@ -6676,6 +6882,10 @@ def _list_plans_serialize( _body_params: Optional[bytes] = None # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if job_name is not None: + _path_params["jobName"] = job_name if project_id is not None: _path_params["projectId"] = project_id # process the query parameters @@ -6692,7 +6902,7 @@ def _list_plans_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/plans", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6706,7 +6916,7 @@ def _list_plans_serialize( ) @validate_call - def list_scrape_configs( + def list_acl( self, instance_id: StrictStr, project_id: StrictStr, @@ -6719,10 +6929,10 @@ def list_scrape_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListScrapeConfigsResponse: - """list_scrape_configs + ) -> ListACLResponse: + """list_acl - Get scrape configs. + Get acl for instance. :param instance_id: (required) :type instance_id: str @@ -6750,7 +6960,7 @@ def list_scrape_configs( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_scrape_configs_serialize( + _param = self._list_acl_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -6760,7 +6970,7 @@ def list_scrape_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "ListACLResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6771,7 +6981,7 @@ def list_scrape_configs( ).data @validate_call - def list_scrape_configs_with_http_info( + def list_acl_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -6784,10 +6994,10 @@ def list_scrape_configs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListScrapeConfigsResponse]: - """list_scrape_configs + ) -> ApiResponse[ListACLResponse]: + """list_acl - Get scrape configs. + Get acl for instance. :param instance_id: (required) :type instance_id: str @@ -6815,7 +7025,7 @@ def list_scrape_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_scrape_configs_serialize( + _param = self._list_acl_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -6825,7 +7035,7 @@ def list_scrape_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "ListACLResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6836,7 +7046,7 @@ def list_scrape_configs_with_http_info( ) @validate_call - def list_scrape_configs_without_preload_content( + def list_acl_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -6850,9 +7060,9 @@ def list_scrape_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_scrape_configs + """list_acl - Get scrape configs. + Get acl for instance. :param instance_id: (required) :type instance_id: str @@ -6880,7 +7090,7 @@ def list_scrape_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._list_scrape_configs_serialize( + _param = self._list_acl_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -6890,13 +7100,13 @@ def list_scrape_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "ListACLResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_scrape_configs_serialize( + def _list_acl_serialize( self, instance_id, project_id, @@ -6936,7 +7146,7 @@ def _list_scrape_configs_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/acl", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6950,11 +7160,10 @@ def _list_scrape_configs_serialize( ) @validate_call - def update_acl( + def list_alert_config_receivers( self, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6964,17 +7173,3078 @@ def update_acl( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Message: - """update_acl + ) -> AlertConfigReceiversResponse: + """list_alert_config_receivers + + Get alert config receivers. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alert_config_receivers_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigReceiversResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alert_config_receivers_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertConfigReceiversResponse]: + """list_alert_config_receivers + + Get alert config receivers. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alert_config_receivers_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigReceiversResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alert_config_receivers_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alert_config_receivers + + Get alert config receivers. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alert_config_receivers_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigReceiversResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alert_config_receivers_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alert_config_routes( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertConfigRouteResponse: + """list_alert_config_routes + + Get alert config route. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alert_config_routes_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigRouteResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alert_config_routes_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertConfigRouteResponse]: + """list_alert_config_routes + + Get alert config route. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alert_config_routes_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigRouteResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alert_config_routes_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alert_config_routes + + Get alert config route. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alert_config_routes_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigRouteResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alert_config_routes_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alertgroups( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertGroupsResponse: + """list_alertgroups + + Get alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alertgroups_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertGroupsResponse]: + """list_alertgroups + + Get alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alertgroups_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alertgroups + + Get alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alertgroups_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alertrules( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertRulesResponse: + """list_alertrules + + Get alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRulesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alertrules_with_http_info( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertRulesResponse]: + """list_alertrules + + Get alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRulesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alertrules_without_preload_content( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alertrules + + Get alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRulesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alertrules_serialize( + self, + group_name, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_credentials( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListCredentialsResponse: + """list_credentials + + Get all technical user credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ListCredentialsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_credentials_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListCredentialsResponse]: + """list_credentials + + Get all technical user credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ListCredentialsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_credentials_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_credentials + + Get all technical user credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ListCredentialsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_credentials_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_instances( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstancesResponse: + """list_instances + + Get all instances for a project. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstancesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_instances_with_http_info( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstancesResponse]: + """list_instances + + Get all instances for a project. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstancesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_instances_without_preload_content( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_instances + + Get all instances for a project. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstancesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_instances_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_plans( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlansResponse: + """list_plans + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_plans_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlansResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_plans_with_http_info( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlansResponse]: + """list_plans + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_plans_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlansResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_plans_without_preload_content( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_plans + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_plans_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlansResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_plans_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/plans", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_scrape_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListScrapeConfigsResponse: + """list_scrape_configs + + Get scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListScrapeConfigsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_scrape_configs_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListScrapeConfigsResponse]: + """list_scrape_configs + + Get scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListScrapeConfigsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_scrape_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_scrape_configs + + Get scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._list_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListScrapeConfigsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_scrape_configs_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def partial_update_alertgroups( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertGroupsResponse: + """partial_update_alertgroups + + Patch alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._partial_update_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner=update_alertgroups_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def partial_update_alertgroups_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertGroupsResponse]: + """partial_update_alertgroups + + Patch alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._partial_update_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner=update_alertgroups_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def partial_update_alertgroups_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """partial_update_alertgroups + + Patch alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._partial_update_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner=update_alertgroups_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _partial_update_alertgroups_serialize( + self, + instance_id, + project_id, + update_alertgroups_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "UpdateAlertgroupsRequestInner": "", + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_alertgroups_request_inner is not None: + _body_params = update_alertgroups_request_inner + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def partial_update_alertrules( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertRulesResponse: + """partial_update_alertrules + + Patch alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner_rules_inner: (required) + :type update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._partial_update_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner_rules_inner=update_alertgroups_request_inner_rules_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertRulesResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def partial_update_alertrules_with_http_info( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertRulesResponse]: + """partial_update_alertrules + + Patch alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner_rules_inner: (required) + :type update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._partial_update_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner_rules_inner=update_alertgroups_request_inner_rules_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertRulesResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def partial_update_alertrules_without_preload_content( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """partial_update_alertrules + + Patch alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner_rules_inner: (required) + :type update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._partial_update_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner_rules_inner=update_alertgroups_request_inner_rules_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertRulesResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _partial_update_alertrules_serialize( + self, + group_name, + instance_id, + project_id, + update_alertgroups_request_inner_rules_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "UpdateAlertgroupsRequestInnerRulesInner": "", + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_alertgroups_request_inner_rules_inner is not None: + _body_params = update_alertgroups_request_inner_rules_inner + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_acl( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_acl_payload: Optional[UpdateACLPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Message: + """update_acl + + Update acl config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_acl_payload: + :type update_acl_payload: UpdateACLPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_acl_serialize( + instance_id=instance_id, + project_id=project_id, + update_acl_payload=update_acl_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Message", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_acl_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_acl_payload: Optional[UpdateACLPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Message]: + """update_acl + + Update acl config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_acl_payload: + :type update_acl_payload: UpdateACLPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_acl_serialize( + instance_id=instance_id, + project_id=project_id, + update_acl_payload=update_acl_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Message", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_acl_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_acl_payload: Optional[UpdateACLPayload] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_acl + + Update acl config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_acl_payload: + :type update_acl_payload: UpdateACLPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_acl_serialize( + instance_id=instance_id, + project_id=project_id, + update_acl_payload=update_acl_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Message", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_acl_serialize( + self, + instance_id, + project_id, + update_acl_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_acl_payload is not None: + _body_params = update_acl_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/acl", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_alert_config_receiver( + self, + instance_id: StrictStr, + project_id: StrictStr, + receiver: StrictStr, + update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertConfigReceiversResponse: + """update_alert_config_receiver + + Update alert config receiver. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param receiver: (required) + :type receiver: str + :param update_alert_config_receiver_payload: (required) + :type update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_alert_config_receiver_serialize( + instance_id=instance_id, + project_id=project_id, + receiver=receiver, + update_alert_config_receiver_payload=update_alert_config_receiver_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertConfigReceiversResponse", + "400": "Error", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_alert_config_receiver_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + receiver: StrictStr, + update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertConfigReceiversResponse]: + """update_alert_config_receiver + + Update alert config receiver. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param receiver: (required) + :type receiver: str + :param update_alert_config_receiver_payload: (required) + :type update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_alert_config_receiver_serialize( + instance_id=instance_id, + project_id=project_id, + receiver=receiver, + update_alert_config_receiver_payload=update_alert_config_receiver_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertConfigReceiversResponse", + "400": "Error", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_alert_config_receiver_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + receiver: StrictStr, + update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_alert_config_receiver + + Update alert config receiver. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param receiver: (required) + :type receiver: str + :param update_alert_config_receiver_payload: (required) + :type update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 docstring might be too long + + _param = self._update_alert_config_receiver_serialize( + instance_id=instance_id, + project_id=project_id, + receiver=receiver, + update_alert_config_receiver_payload=update_alert_config_receiver_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertConfigReceiversResponse", + "400": "Error", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_alert_config_receiver_serialize( + self, + instance_id, + project_id, + receiver, + update_alert_config_receiver_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + if receiver is not None: + _path_params["receiver"] = receiver + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_alert_config_receiver_payload is not None: + _body_params = update_alert_config_receiver_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def update_alert_config_route( + self, + instance_id: StrictStr, + project_id: StrictStr, + receiver: StrictStr, + update_alert_config_route_payload: UpdateAlertConfigRoutePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertConfigRouteResponse: + """update_alert_config_route - Update acl config. + Update alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_acl_payload: - :type update_acl_payload: UpdateACLPayload + :param receiver: (required) + :type receiver: str + :param update_alert_config_route_payload: (required) + :type update_alert_config_route_payload: UpdateAlertConfigRoutePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6997,10 +10267,11 @@ def update_acl( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_acl_serialize( + _param = self._update_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, + receiver=receiver, + update_alert_config_route_payload=update_alert_config_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7008,9 +10279,10 @@ def update_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "202": "AlertConfigRouteResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7020,11 +10292,12 @@ def update_acl( ).data @validate_call - def update_acl_with_http_info( + def update_alert_config_route_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, + receiver: StrictStr, + update_alert_config_route_payload: UpdateAlertConfigRoutePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7034,17 +10307,19 @@ def update_acl_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Message]: - """update_acl + ) -> ApiResponse[AlertConfigRouteResponse]: + """update_alert_config_route - Update acl config. + Update alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_acl_payload: - :type update_acl_payload: UpdateACLPayload + :param receiver: (required) + :type receiver: str + :param update_alert_config_route_payload: (required) + :type update_alert_config_route_payload: UpdateAlertConfigRoutePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7067,10 +10342,11 @@ def update_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_acl_serialize( + _param = self._update_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, + receiver=receiver, + update_alert_config_route_payload=update_alert_config_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7078,9 +10354,10 @@ def update_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "202": "AlertConfigRouteResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7090,11 +10367,12 @@ def update_acl_with_http_info( ) @validate_call - def update_acl_without_preload_content( + def update_alert_config_route_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, + receiver: StrictStr, + update_alert_config_route_payload: UpdateAlertConfigRoutePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7105,16 +10383,18 @@ def update_acl_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_acl + """update_alert_config_route - Update acl config. + Update alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_acl_payload: - :type update_acl_payload: UpdateACLPayload + :param receiver: (required) + :type receiver: str + :param update_alert_config_route_payload: (required) + :type update_alert_config_route_payload: UpdateAlertConfigRoutePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7137,10 +10417,11 @@ def update_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_acl_serialize( + _param = self._update_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, + receiver=receiver, + update_alert_config_route_payload=update_alert_config_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7148,18 +10429,20 @@ def update_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "202": "AlertConfigRouteResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_acl_serialize( + def _update_alert_config_route_serialize( self, instance_id, project_id, - update_acl_payload, + receiver, + update_alert_config_route_payload, _request_auth, _content_type, _headers, @@ -7182,12 +10465,14 @@ def _update_acl_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_acl_payload is not None: - _body_params = update_acl_payload + if update_alert_config_route_payload is not None: + _body_params = update_alert_config_route_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -7206,7 +10491,7 @@ def _update_acl_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acl", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7220,12 +10505,11 @@ def _update_acl_serialize( ) @validate_call - def update_alert_config_receiver( + def update_alert_configs( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + update_alert_configs_payload: UpdateAlertConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7235,19 +10519,17 @@ def update_alert_config_receiver( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigReceiversResponse: - """update_alert_config_receiver + ) -> UpdateAlertConfigsResponse: + """update_alert_configs - Update alert config receiver. + Update alert config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str - :param update_alert_config_receiver_payload: (required) - :type update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload + :param update_alert_configs_payload: (required) + :type update_alert_configs_payload: UpdateAlertConfigsPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7270,11 +10552,10 @@ def update_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_config_receiver_serialize( + _param = self._update_alert_configs_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, - update_alert_config_receiver_payload=update_alert_config_receiver_payload, + update_alert_configs_payload=update_alert_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7282,10 +10563,9 @@ def update_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "202": "UpdateAlertConfigsResponse", "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7295,12 +10575,11 @@ def update_alert_config_receiver( ).data @validate_call - def update_alert_config_receiver_with_http_info( + def update_alert_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + update_alert_configs_payload: UpdateAlertConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7310,19 +10589,17 @@ def update_alert_config_receiver_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigReceiversResponse]: - """update_alert_config_receiver + ) -> ApiResponse[UpdateAlertConfigsResponse]: + """update_alert_configs - Update alert config receiver. + Update alert config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str - :param update_alert_config_receiver_payload: (required) - :type update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload + :param update_alert_configs_payload: (required) + :type update_alert_configs_payload: UpdateAlertConfigsPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7345,11 +10622,10 @@ def update_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_config_receiver_serialize( + _param = self._update_alert_configs_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, - update_alert_config_receiver_payload=update_alert_config_receiver_payload, + update_alert_configs_payload=update_alert_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7357,10 +10633,9 @@ def update_alert_config_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "202": "UpdateAlertConfigsResponse", "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7370,12 +10645,11 @@ def update_alert_config_receiver_with_http_info( ) @validate_call - def update_alert_config_receiver_without_preload_content( + def update_alert_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + update_alert_configs_payload: UpdateAlertConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7386,18 +10660,16 @@ def update_alert_config_receiver_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alert_config_receiver + """update_alert_configs - Update alert config receiver. + Update alert config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str - :param update_alert_config_receiver_payload: (required) - :type update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload + :param update_alert_configs_payload: (required) + :type update_alert_configs_payload: UpdateAlertConfigsPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7420,11 +10692,10 @@ def update_alert_config_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_config_receiver_serialize( + _param = self._update_alert_configs_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, - update_alert_config_receiver_payload=update_alert_config_receiver_payload, + update_alert_configs_payload=update_alert_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7432,20 +10703,18 @@ def update_alert_config_receiver_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "202": "UpdateAlertConfigsResponse", "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_alert_config_receiver_serialize( + def _update_alert_configs_serialize( self, instance_id, project_id, - receiver, - update_alert_config_receiver_payload, + update_alert_configs_payload, _request_auth, _content_type, _headers, @@ -7468,14 +10737,12 @@ def _update_alert_config_receiver_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_alert_config_receiver_payload is not None: - _body_params = update_alert_config_receiver_payload + if update_alert_configs_payload is not None: + _body_params = update_alert_configs_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -7494,7 +10761,7 @@ def _update_alert_config_receiver_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7508,12 +10775,12 @@ def _update_alert_config_receiver_serialize( ) @validate_call - def update_alert_config_route( + def update_alertgroup( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_route_payload: UpdateAlertConfigRoutePayload, + update_alertgroup_payload: UpdateAlertgroupPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7523,19 +10790,19 @@ def update_alert_config_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigRouteResponse: - """update_alert_config_route + ) -> AlertGroupsResponse: + """update_alertgroup - Update alert receiver for route. + Update alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str - :param update_alert_config_route_payload: (required) - :type update_alert_config_route_payload: UpdateAlertConfigRoutePayload + :param update_alertgroup_payload: (required) + :type update_alertgroup_payload: UpdateAlertgroupPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7558,11 +10825,11 @@ def update_alert_config_route( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_config_route_serialize( + _param = self._update_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, - update_alert_config_route_payload=update_alert_config_route_payload, + update_alertgroup_payload=update_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7570,8 +10837,8 @@ def update_alert_config_route( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", - "400": "Error", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", "404": "Message", } @@ -7583,12 +10850,12 @@ def update_alert_config_route( ).data @validate_call - def update_alert_config_route_with_http_info( + def update_alertgroup_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_route_payload: UpdateAlertConfigRoutePayload, + update_alertgroup_payload: UpdateAlertgroupPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7598,19 +10865,19 @@ def update_alert_config_route_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigRouteResponse]: - """update_alert_config_route + ) -> ApiResponse[AlertGroupsResponse]: + """update_alertgroup - Update alert receiver for route. + Update alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str - :param update_alert_config_route_payload: (required) - :type update_alert_config_route_payload: UpdateAlertConfigRoutePayload + :param update_alertgroup_payload: (required) + :type update_alertgroup_payload: UpdateAlertgroupPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7633,11 +10900,11 @@ def update_alert_config_route_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_config_route_serialize( + _param = self._update_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, - update_alert_config_route_payload=update_alert_config_route_payload, + update_alertgroup_payload=update_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7645,8 +10912,8 @@ def update_alert_config_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", - "400": "Error", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", "404": "Message", } @@ -7658,12 +10925,12 @@ def update_alert_config_route_with_http_info( ) @validate_call - def update_alert_config_route_without_preload_content( + def update_alertgroup_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_route_payload: UpdateAlertConfigRoutePayload, + update_alertgroup_payload: UpdateAlertgroupPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7674,18 +10941,18 @@ def update_alert_config_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alert_config_route + """update_alertgroup - Update alert receiver for route. + Update alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str - :param update_alert_config_route_payload: (required) - :type update_alert_config_route_payload: UpdateAlertConfigRoutePayload + :param update_alertgroup_payload: (required) + :type update_alertgroup_payload: UpdateAlertgroupPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7708,11 +10975,11 @@ def update_alert_config_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_config_route_serialize( + _param = self._update_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, - update_alert_config_route_payload=update_alert_config_route_payload, + update_alertgroup_payload=update_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7720,20 +10987,20 @@ def update_alert_config_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", - "400": "Error", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_alert_config_route_serialize( + def _update_alertgroup_serialize( self, + group_name, instance_id, project_id, - receiver, - update_alert_config_route_payload, + update_alertgroup_payload, _request_auth, _content_type, _headers, @@ -7752,18 +11019,18 @@ def _update_alert_config_route_serialize( _body_params: Optional[bytes] = None # process the path parameters + if group_name is not None: + _path_params["groupName"] = group_name if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_alert_config_route_payload is not None: - _body_params = update_alert_config_route_payload + if update_alertgroup_payload is not None: + _body_params = update_alertgroup_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -7782,7 +11049,7 @@ def _update_alert_config_route_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7796,11 +11063,11 @@ def _update_alert_config_route_serialize( ) @validate_call - def update_alert_configs( + def update_alertgroups( self, instance_id: StrictStr, project_id: StrictStr, - update_alert_configs_payload: UpdateAlertConfigsPayload, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7810,17 +11077,17 @@ def update_alert_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UpdateAlertConfigsResponse: - """update_alert_configs + ) -> AlertGroupsResponse: + """update_alertgroups - Update alert config. + Update alert groups. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_alert_configs_payload: (required) - :type update_alert_configs_payload: UpdateAlertConfigsPayload + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7843,10 +11110,10 @@ def update_alert_configs( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_configs_serialize( + _param = self._update_alertgroups_serialize( instance_id=instance_id, project_id=project_id, - update_alert_configs_payload=update_alert_configs_payload, + update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7854,7 +11121,7 @@ def update_alert_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -7866,11 +11133,11 @@ def update_alert_configs( ).data @validate_call - def update_alert_configs_with_http_info( + def update_alertgroups_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - update_alert_configs_payload: UpdateAlertConfigsPayload, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7880,17 +11147,17 @@ def update_alert_configs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UpdateAlertConfigsResponse]: - """update_alert_configs + ) -> ApiResponse[AlertGroupsResponse]: + """update_alertgroups - Update alert config. + Update alert groups. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_alert_configs_payload: (required) - :type update_alert_configs_payload: UpdateAlertConfigsPayload + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7913,10 +11180,10 @@ def update_alert_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_configs_serialize( + _param = self._update_alertgroups_serialize( instance_id=instance_id, project_id=project_id, - update_alert_configs_payload=update_alert_configs_payload, + update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7924,7 +11191,7 @@ def update_alert_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -7936,11 +11203,11 @@ def update_alert_configs_with_http_info( ) @validate_call - def update_alert_configs_without_preload_content( + def update_alertgroups_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - update_alert_configs_payload: UpdateAlertConfigsPayload, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7951,16 +11218,16 @@ def update_alert_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alert_configs + """update_alertgroups - Update alert config. + Update alert groups. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_alert_configs_payload: (required) - :type update_alert_configs_payload: UpdateAlertConfigsPayload + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7983,10 +11250,10 @@ def update_alert_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 docstring might be too long - _param = self._update_alert_configs_serialize( + _param = self._update_alertgroups_serialize( instance_id=instance_id, project_id=project_id, - update_alert_configs_payload=update_alert_configs_payload, + update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7994,18 +11261,18 @@ def update_alert_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_alert_configs_serialize( + def _update_alertgroups_serialize( self, instance_id, project_id, - update_alert_configs_payload, + update_alertgroups_request_inner, _request_auth, _content_type, _headers, @@ -8014,7 +11281,9 @@ def _update_alert_configs_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "UpdateAlertgroupsRequestInner": "", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -8032,8 +11301,8 @@ def _update_alert_configs_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_alert_configs_payload is not None: - _body_params = update_alert_configs_payload + if update_alertgroups_request_inner is not None: + _body_params = update_alertgroups_request_inner # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -8052,7 +11321,7 @@ def _update_alert_configs_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/observability/src/stackit/observability/models/__init__.py b/services/observability/src/stackit/observability/models/__init__.py index ce801f76..a7649dce 100644 --- a/services/observability/src/stackit/observability/models/__init__.py +++ b/services/observability/src/stackit/observability/models/__init__.py @@ -22,6 +22,12 @@ from stackit.observability.models.alert_config_route_response import ( AlertConfigRouteResponse, ) +from stackit.observability.models.alert_group import AlertGroup +from stackit.observability.models.alert_group_response import AlertGroupResponse +from stackit.observability.models.alert_groups_response import AlertGroupsResponse +from stackit.observability.models.alert_rule import AlertRule +from stackit.observability.models.alert_rule_record import AlertRuleRecord +from stackit.observability.models.alert_rules_response import AlertRulesResponse from stackit.observability.models.basic_auth import BasicAuth from stackit.observability.models.create_alert_config_receiver_payload import ( CreateAlertConfigReceiverPayload, @@ -41,6 +47,12 @@ from stackit.observability.models.create_alert_config_route_payload_routes_inner import ( CreateAlertConfigRoutePayloadRoutesInner, ) +from stackit.observability.models.create_alertgroups_payload import ( + CreateAlertgroupsPayload, +) +from stackit.observability.models.create_alertrules_payload import ( + CreateAlertrulesPayload, +) from stackit.observability.models.create_credentials_response import ( CreateCredentialsResponse, ) @@ -149,6 +161,15 @@ from stackit.observability.models.update_alert_configs_response import ( UpdateAlertConfigsResponse, ) +from stackit.observability.models.update_alertgroup_payload import ( + UpdateAlertgroupPayload, +) +from stackit.observability.models.update_alertgroups_request_inner import ( + UpdateAlertgroupsRequestInner, +) +from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( + UpdateAlertgroupsRequestInnerRulesInner, +) from stackit.observability.models.update_credentials_remote_write_config_payload import ( UpdateCredentialsRemoteWriteConfigPayload, ) diff --git a/services/observability/src/stackit/observability/models/alert_group.py b/services/observability/src/stackit/observability/models/alert_group.py new file mode 100644 index 00000000..78f21fbd --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_group.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.alert_rule_record import AlertRuleRecord + + +class AlertGroup(BaseModel): + """ + AlertGroup + """ + + interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = "60s" + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] + rules: List[AlertRuleRecord] + __properties: ClassVar[List[str]] = ["interval", "name", "rules"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item in self.rules: + if _item: + _items.append(_item.to_dict()) + _dict["rules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "interval": obj.get("interval") if obj.get("interval") is not None else "60s", + "name": obj.get("name"), + "rules": ( + [AlertRuleRecord.from_dict(_item) for _item in obj["rules"]] + if obj.get("rules") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_group_response.py b/services/observability/src/stackit/observability/models/alert_group_response.py new file mode 100644 index 00000000..39af35bd --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_group_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.alert_group import AlertGroup + + +class AlertGroupResponse(BaseModel): + """ + AlertGroupResponse + """ + + data: AlertGroup + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["data", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertGroupResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict["data"] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": AlertGroup.from_dict(obj["data"]) if obj.get("data") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_groups_response.py b/services/observability/src/stackit/observability/models/alert_groups_response.py new file mode 100644 index 00000000..0dcd4210 --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_groups_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.alert_group import AlertGroup + + +class AlertGroupsResponse(BaseModel): + """ + AlertGroupsResponse + """ + + data: List[AlertGroup] + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["data", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertGroupsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict["data"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertGroupsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": [AlertGroup.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_rule.py b/services/observability/src/stackit/observability/models/alert_rule.py new file mode 100644 index 00000000..fbd889d4 --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_rule.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class AlertRule(BaseModel): + """ + AlertRule + """ + + alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] + annotations: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None + expr: Annotated[str, Field(min_length=1, strict=True, max_length=600)] + var_for: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(default="0s", alias="for") + labels: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None + __properties: ClassVar[List[str]] = ["alert", "annotations", "expr", "for", "labels"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertRule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alert": obj.get("alert"), + "annotations": obj.get("annotations"), + "expr": obj.get("expr"), + "for": obj.get("for") if obj.get("for") is not None else "0s", + "labels": obj.get("labels"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_rule_record.py b/services/observability/src/stackit/observability/models/alert_rule_record.py new file mode 100644 index 00000000..b250147b --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_rule_record.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class AlertRuleRecord(BaseModel): + """ + AlertRuleRecord + """ + + alert: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = None + annotations: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None + expr: Annotated[str, Field(min_length=1, strict=True, max_length=600)] + var_for: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field(default=None, alias="for") + labels: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None + record: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=300)]] = None + __properties: ClassVar[List[str]] = ["alert", "annotations", "expr", "for", "labels", "record"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertRuleRecord from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertRuleRecord from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alert": obj.get("alert"), + "annotations": obj.get("annotations"), + "expr": obj.get("expr"), + "for": obj.get("for"), + "labels": obj.get("labels"), + "record": obj.get("record"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_rules_response.py b/services/observability/src/stackit/observability/models/alert_rules_response.py new file mode 100644 index 00000000..35af04a3 --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_rules_response.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.alert_rule import AlertRule + + +class AlertRulesResponse(BaseModel): + """ + AlertRulesResponse + """ + + data: List[AlertRule] + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["data", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertRulesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict["data"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertRulesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": [AlertRule.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_alertgroups_payload.py b/services/observability/src/stackit/observability/models/create_alertgroups_payload.py new file mode 100644 index 00000000..5e6d5c34 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_alertgroups_payload.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( + UpdateAlertgroupsRequestInnerRulesInner, +) + + +class CreateAlertgroupsPayload(BaseModel): + """ + Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ + + interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( + default="60s", + description="How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s", + ) + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The name of the group. Must be unique. `Additional Validators:` * is the identifier and so unique * should only include the characters: a-zA-Z0-9-" + ) + rules: List[UpdateAlertgroupsRequestInnerRulesInner] = Field(description="rules for the alert group") + __properties: ClassVar[List[str]] = ["interval", "name", "rules"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateAlertgroupsPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item in self.rules: + if _item: + _items.append(_item.to_dict()) + _dict["rules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateAlertgroupsPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "interval": obj.get("interval") if obj.get("interval") is not None else "60s", + "name": obj.get("name"), + "rules": ( + [UpdateAlertgroupsRequestInnerRulesInner.from_dict(_item) for _item in obj["rules"]] + if obj.get("rules") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_alertrules_payload.py b/services/observability/src/stackit/observability/models/create_alertrules_payload.py new file mode 100644 index 00000000..94cd5cba --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_alertrules_payload.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class CreateAlertrulesPayload(BaseModel): + """ + Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ + + alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The name of the alert. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9-" + ) + annotations: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters", + ) + expr: Annotated[str, Field(min_length=1, strict=True, max_length=600)] = Field( + description="The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts." + ) + var_for: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( + default="0s", + description="Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string", + alias="for", + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters", + ) + __properties: ClassVar[List[str]] = ["alert", "annotations", "expr", "for", "labels"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateAlertrulesPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateAlertrulesPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alert": obj.get("alert"), + "annotations": obj.get("annotations"), + "expr": obj.get("expr"), + "for": obj.get("for") if obj.get("for") is not None else "0s", + "labels": obj.get("labels"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_alertgroup_payload.py b/services/observability/src/stackit/observability/models/update_alertgroup_payload.py new file mode 100644 index 00000000..b387f61f --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_alertgroup_payload.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( + UpdateAlertgroupsRequestInnerRulesInner, +) + + +class UpdateAlertgroupPayload(BaseModel): + """ + Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ + + interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( + default="60s", + description="How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s", + ) + rules: List[UpdateAlertgroupsRequestInnerRulesInner] = Field(description="rules for the alert group") + __properties: ClassVar[List[str]] = ["interval", "rules"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateAlertgroupPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item in self.rules: + if _item: + _items.append(_item.to_dict()) + _dict["rules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAlertgroupPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "interval": obj.get("interval") if obj.get("interval") is not None else "60s", + "rules": ( + [UpdateAlertgroupsRequestInnerRulesInner.from_dict(_item) for _item in obj["rules"]] + if obj.get("rules") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py new file mode 100644 index 00000000..7ee1ed1e --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( + UpdateAlertgroupsRequestInnerRulesInner, +) + + +class UpdateAlertgroupsRequestInner(BaseModel): + """ + Alert group that should be created or updated `Additional Validators:` * total config should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ + + interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( + default="60s", + description="How often rules in the group are evaluated. `Additional Validators:` * must be a valid time string * should be >=60s", + ) + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The name of the group. Must be unique. `Additional Validators:` * is the identifier and so unique * should only include the characters: a-zA-Z0-9-" + ) + rules: List[UpdateAlertgroupsRequestInnerRulesInner] = Field(description="rules for the alert group") + __properties: ClassVar[List[str]] = ["interval", "name", "rules"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateAlertgroupsRequestInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item in self.rules: + if _item: + _items.append(_item.to_dict()) + _dict["rules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAlertgroupsRequestInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "interval": obj.get("interval") if obj.get("interval") is not None else "60s", + "name": obj.get("name"), + "rules": ( + [UpdateAlertgroupsRequestInnerRulesInner.from_dict(_item) for _item in obj["rules"]] + if obj.get("rules") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py new file mode 100644 index 00000000..0c0796cf --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_alertgroups_request_inner_rules_inner.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 docstring might be too long + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class UpdateAlertgroupsRequestInnerRulesInner(BaseModel): + """ + Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ + + alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The name of the alert. `Additional Validators:` * is the identifier and so unique in the group * should only include the characters: a-zA-Z0-9-" + ) + annotations: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters", + ) + expr: Annotated[str, Field(min_length=1, strict=True, max_length=600)] = Field( + description="The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts." + ) + var_for: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( + default="0s", + description="Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string", + alias="for", + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters", + ) + __properties: ClassVar[List[str]] = ["alert", "annotations", "expr", "for", "labels"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateAlertgroupsRequestInnerRulesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAlertgroupsRequestInnerRulesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alert": obj.get("alert"), + "annotations": obj.get("annotations"), + "expr": obj.get("expr"), + "for": obj.get("for") if obj.get("for") is not None else "0s", + "labels": obj.get("labels"), + } + ) + return _obj