diff --git a/services/observability/src/stackit/observability/__init__.py b/services/observability/src/stackit/observability/__init__.py index 2c06e2ca..ed4a582d 100644 --- a/services/observability/src/stackit/observability/__init__.py +++ b/services/observability/src/stackit/observability/__init__.py @@ -81,6 +81,8 @@ "ListCredentialsResponse", "ListInstancesResponse", "ListScrapeConfigsResponse", + "LogsConfig", + "LogsConfigResponse", "Message", "MetricsRelabelConfig", "ModelGlobal", @@ -99,6 +101,8 @@ "ServiceKeysList", "StaticConfigs", "TLSConfig", + "TraceConfig", + "TracesConfigResponse", "UpdateACLPayload", "UpdateAlertConfigReceiverPayload", "UpdateAlertConfigRoutePayload", @@ -116,9 +120,11 @@ "UpdateGrafanaConfigsPayloadGenericOauth", "UpdateInstancePayload", "UpdateLogsAlertgroupPayload", + "UpdateLogsConfigsPayload", "UpdateMetricsStorageRetentionPayload", "UpdateScrapeConfigPayload", "UpdateScrapeConfigPayloadStaticConfigsInner", + "UpdateTracesConfigsPayload", "WebHook", ] @@ -269,6 +275,10 @@ from stackit.observability.models.list_scrape_configs_response import ( ListScrapeConfigsResponse as ListScrapeConfigsResponse, ) +from stackit.observability.models.logs_config import LogsConfig as LogsConfig +from stackit.observability.models.logs_config_response import ( + LogsConfigResponse as LogsConfigResponse, +) from stackit.observability.models.message import Message as Message from stackit.observability.models.metrics_relabel_config import ( MetricsRelabelConfig as MetricsRelabelConfig, @@ -301,6 +311,10 @@ ) from stackit.observability.models.static_configs import StaticConfigs as StaticConfigs from stackit.observability.models.tls_config import TLSConfig as TLSConfig +from stackit.observability.models.trace_config import TraceConfig as TraceConfig +from stackit.observability.models.traces_config_response import ( + TracesConfigResponse as TracesConfigResponse, +) from stackit.observability.models.update_acl_payload import ( UpdateACLPayload as UpdateACLPayload, ) @@ -352,6 +366,9 @@ from stackit.observability.models.update_logs_alertgroup_payload import ( UpdateLogsAlertgroupPayload as UpdateLogsAlertgroupPayload, ) +from stackit.observability.models.update_logs_configs_payload import ( + UpdateLogsConfigsPayload as UpdateLogsConfigsPayload, +) from stackit.observability.models.update_metrics_storage_retention_payload import ( UpdateMetricsStorageRetentionPayload as UpdateMetricsStorageRetentionPayload, ) @@ -361,4 +378,7 @@ from stackit.observability.models.update_scrape_config_payload_static_configs_inner import ( UpdateScrapeConfigPayloadStaticConfigsInner as UpdateScrapeConfigPayloadStaticConfigsInner, ) +from stackit.observability.models.update_traces_configs_payload import ( + UpdateTracesConfigsPayload as UpdateTracesConfigsPayload, +) from stackit.observability.models.web_hook import WebHook as WebHook diff --git a/services/observability/src/stackit/observability/api/default_api.py b/services/observability/src/stackit/observability/api/default_api.py index 8ca22fd8..2752f1dd 100644 --- a/services/observability/src/stackit/observability/api/default_api.py +++ b/services/observability/src/stackit/observability/api/default_api.py @@ -82,10 +82,12 @@ from stackit.observability.models.list_scrape_configs_response import ( ListScrapeConfigsResponse, ) +from stackit.observability.models.logs_config_response import LogsConfigResponse from stackit.observability.models.message import Message from stackit.observability.models.plans_response import PlansResponse from stackit.observability.models.receiver import Receiver from stackit.observability.models.scrape_configs_response import ScrapeConfigsResponse +from stackit.observability.models.traces_config_response import TracesConfigResponse from stackit.observability.models.update_acl_payload import UpdateACLPayload from stackit.observability.models.update_alert_config_receiver_payload import ( UpdateAlertConfigReceiverPayload, @@ -118,12 +120,18 @@ from stackit.observability.models.update_logs_alertgroup_payload import ( UpdateLogsAlertgroupPayload, ) +from stackit.observability.models.update_logs_configs_payload import ( + UpdateLogsConfigsPayload, +) from stackit.observability.models.update_metrics_storage_retention_payload import ( UpdateMetricsStorageRetentionPayload, ) from stackit.observability.models.update_scrape_config_payload import ( UpdateScrapeConfigPayload, ) +from stackit.observability.models.update_traces_configs_payload import ( + UpdateTracesConfigsPayload, +) from stackit.observability.rest import RESTResponseType @@ -7219,7 +7227,7 @@ def _get_logs_alertgroup_serialize( ) @validate_call - def get_metrics_storage_retention( + def get_logs_configs( self, instance_id: StrictStr, project_id: StrictStr, @@ -7232,10 +7240,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 + ) -> LogsConfigResponse: + """get_logs_configs - Get metric storage retention time. + Get logs configuration. :param instance_id: (required) :type instance_id: str @@ -7263,7 +7271,7 @@ def get_metrics_storage_retention( :return: Returns the result object. """ # noqa: E501 - _param = self._get_metrics_storage_retention_serialize( + _param = self._get_logs_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -7273,7 +7281,7 @@ def get_metrics_storage_retention( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "LogsConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7284,7 +7292,7 @@ def get_metrics_storage_retention( ).data @validate_call - def get_metrics_storage_retention_with_http_info( + def get_logs_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -7297,10 +7305,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[LogsConfigResponse]: + """get_logs_configs - Get metric storage retention time. + Get logs configuration. :param instance_id: (required) :type instance_id: str @@ -7328,7 +7336,7 @@ def get_metrics_storage_retention_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_metrics_storage_retention_serialize( + _param = self._get_logs_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -7338,7 +7346,7 @@ def get_metrics_storage_retention_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "LogsConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7349,7 +7357,7 @@ def get_metrics_storage_retention_with_http_info( ) @validate_call - def get_metrics_storage_retention_without_preload_content( + def get_logs_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -7363,9 +7371,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_logs_configs - Get metric storage retention time. + Get logs configuration. :param instance_id: (required) :type instance_id: str @@ -7393,7 +7401,7 @@ def get_metrics_storage_retention_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_metrics_storage_retention_serialize( + _param = self._get_logs_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -7403,13 +7411,13 @@ def get_metrics_storage_retention_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "LogsConfigResponse", "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_logs_configs_serialize( self, instance_id, project_id, @@ -7449,7 +7457,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}/logs-configs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7463,10 +7471,9 @@ def _get_metrics_storage_retention_serialize( ) @validate_call - def get_scrape_config( + def get_metrics_storage_retention( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -7477,15 +7484,13 @@ 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 + ) -> GetMetricsStorageRetentionResponse: + """get_metrics_storage_retention - Get scrape config. + Get metric storage retention time. :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 @@ -7510,9 +7515,8 @@ def get_scrape_config( :return: Returns the result object. """ # noqa: E501 - _param = self._get_scrape_config_serialize( + _param = self._get_metrics_storage_retention_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7521,7 +7525,7 @@ def get_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "GetMetricsStorageRetentionResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7532,10 +7536,9 @@ def get_scrape_config( ).data @validate_call - def get_scrape_config_with_http_info( + def get_metrics_storage_retention_with_http_info( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -7546,15 +7549,13 @@ 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[GetMetricsStorageRetentionResponse]: + """get_metrics_storage_retention - Get scrape config. + Get metric storage retention time. :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 @@ -7579,9 +7580,8 @@ def get_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_scrape_config_serialize( + _param = self._get_metrics_storage_retention_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7590,7 +7590,7 @@ def get_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "GetMetricsStorageRetentionResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7601,10 +7601,9 @@ def get_scrape_config_with_http_info( ) @validate_call - def get_scrape_config_without_preload_content( + def get_metrics_storage_retention_without_preload_content( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -7616,14 +7615,12 @@ 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_metrics_storage_retention - Get scrape config. + Get metric storage retention time. :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 @@ -7648,9 +7645,8 @@ def get_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_scrape_config_serialize( + _param = self._get_metrics_storage_retention_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -7659,16 +7655,15 @@ def get_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "GetMetricsStorageRetentionResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_scrape_config_serialize( + def _get_metrics_storage_retention_serialize( self, instance_id, - job_name, project_id, _request_auth, _content_type, @@ -7690,8 +7685,6 @@ def _get_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 @@ -7708,7 +7701,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}/metrics-storage-retentions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7722,9 +7715,10 @@ def _get_scrape_config_serialize( ) @validate_call - def list_acl( + def get_scrape_config( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -7735,13 +7729,15 @@ 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 + ) -> GetScrapeConfigResponse: + """get_scrape_config - Get acl for instance. + 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 @@ -7766,8 +7762,9 @@ def list_acl( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acl_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, @@ -7776,7 +7773,7 @@ def list_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "200": "GetScrapeConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7787,9 +7784,10 @@ def list_acl( ).data @validate_call - def list_acl_with_http_info( + def get_scrape_config_with_http_info( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -7800,13 +7798,15 @@ 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[GetScrapeConfigResponse]: + """get_scrape_config - Get acl for instance. + 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 @@ -7831,8 +7831,9 @@ def list_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acl_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, @@ -7841,7 +7842,7 @@ def list_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "200": "GetScrapeConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7852,9 +7853,10 @@ def list_acl_with_http_info( ) @validate_call - def list_acl_without_preload_content( + def get_scrape_config_without_preload_content( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -7866,12 +7868,14 @@ 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_scrape_config - Get acl for instance. + 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 @@ -7896,8 +7900,9 @@ def list_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acl_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, @@ -7906,15 +7911,16 @@ def list_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "200": "GetScrapeConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_acl_serialize( + def _get_scrape_config_serialize( self, instance_id, + job_name, project_id, _request_auth, _content_type, @@ -7936,6 +7942,8 @@ def _list_acl_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 @@ -7952,7 +7960,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}/scrapeconfigs/{jobName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7966,7 +7974,7 @@ def _list_acl_serialize( ) @validate_call - def list_alert_config_receivers( + def get_traces_configs( self, instance_id: StrictStr, project_id: StrictStr, @@ -7979,10 +7987,10 @@ 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 + ) -> TracesConfigResponse: + """get_traces_configs - Get alert config receivers. + Get traces config. :param instance_id: (required) :type instance_id: str @@ -8010,7 +8018,7 @@ def list_alert_config_receivers( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_receivers_serialize( + _param = self._get_traces_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8020,7 +8028,7 @@ def list_alert_config_receivers( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "TracesConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8031,7 +8039,7 @@ def list_alert_config_receivers( ).data @validate_call - def list_alert_config_receivers_with_http_info( + def get_traces_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -8044,10 +8052,10 @@ 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[TracesConfigResponse]: + """get_traces_configs - Get alert config receivers. + Get traces config. :param instance_id: (required) :type instance_id: str @@ -8075,7 +8083,7 @@ def list_alert_config_receivers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_receivers_serialize( + _param = self._get_traces_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8085,7 +8093,7 @@ def list_alert_config_receivers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "TracesConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8096,7 +8104,7 @@ def list_alert_config_receivers_with_http_info( ) @validate_call - def list_alert_config_receivers_without_preload_content( + def get_traces_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -8110,9 +8118,9 @@ 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_traces_configs - Get alert config receivers. + Get traces config. :param instance_id: (required) :type instance_id: str @@ -8140,7 +8148,7 @@ def list_alert_config_receivers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_receivers_serialize( + _param = self._get_traces_configs_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8150,13 +8158,13 @@ def list_alert_config_receivers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "TracesConfigResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alert_config_receivers_serialize( + def _get_traces_configs_serialize( self, instance_id, project_id, @@ -8196,7 +8204,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}/traces-configs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8210,7 +8218,7 @@ def _list_alert_config_receivers_serialize( ) @validate_call - def list_alert_config_routes( + def list_acl( self, instance_id: StrictStr, project_id: StrictStr, @@ -8223,10 +8231,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 + ) -> ListACLResponse: + """list_acl - Get alert config route. + Get acl for instance. :param instance_id: (required) :type instance_id: str @@ -8254,7 +8262,7 @@ def list_alert_config_routes( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_routes_serialize( + _param = self._list_acl_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8264,7 +8272,7 @@ def list_alert_config_routes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "ListACLResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8275,7 +8283,7 @@ def list_alert_config_routes( ).data @validate_call - def list_alert_config_routes_with_http_info( + def list_acl_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -8288,10 +8296,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[ListACLResponse]: + """list_acl - Get alert config route. + Get acl for instance. :param instance_id: (required) :type instance_id: str @@ -8319,7 +8327,7 @@ def list_alert_config_routes_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_routes_serialize( + _param = self._list_acl_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8329,7 +8337,7 @@ def list_alert_config_routes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "ListACLResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8340,7 +8348,7 @@ def list_alert_config_routes_with_http_info( ) @validate_call - def list_alert_config_routes_without_preload_content( + def list_acl_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -8354,9 +8362,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 + """list_acl - Get alert config route. + Get acl for instance. :param instance_id: (required) :type instance_id: str @@ -8384,7 +8392,7 @@ def list_alert_config_routes_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_routes_serialize( + _param = self._list_acl_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8394,13 +8402,13 @@ def list_alert_config_routes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "ListACLResponse", "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 _list_acl_serialize( self, instance_id, project_id, @@ -8440,7 +8448,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}/acl", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8454,7 +8462,7 @@ def _list_alert_config_routes_serialize( ) @validate_call - def list_alertgroups( + def list_alert_config_receivers( self, instance_id: StrictStr, project_id: StrictStr, @@ -8467,10 +8475,10 @@ def list_alertgroups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """list_alertgroups + ) -> AlertConfigReceiversResponse: + """list_alert_config_receivers - Get alert groups. + Get alert config receivers. :param instance_id: (required) :type instance_id: str @@ -8498,7 +8506,7 @@ def list_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertgroups_serialize( + _param = self._list_alert_config_receivers_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8508,8 +8516,7 @@ def list_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "200": "AlertConfigReceiversResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8520,7 +8527,7 @@ def list_alertgroups( ).data @validate_call - def list_alertgroups_with_http_info( + def list_alert_config_receivers_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -8533,10 +8540,10 @@ def list_alertgroups_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[AlertGroupsResponse]: - """list_alertgroups + ) -> ApiResponse[AlertConfigReceiversResponse]: + """list_alert_config_receivers - Get alert groups. + Get alert config receivers. :param instance_id: (required) :type instance_id: str @@ -8564,7 +8571,7 @@ def list_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertgroups_serialize( + _param = self._list_alert_config_receivers_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8574,8 +8581,7 @@ def list_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "200": "AlertConfigReceiversResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8586,7 +8592,7 @@ def list_alertgroups_with_http_info( ) @validate_call - def list_alertgroups_without_preload_content( + def list_alert_config_receivers_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -8600,9 +8606,9 @@ def list_alertgroups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_alertgroups + """list_alert_config_receivers - Get alert groups. + Get alert config receivers. :param instance_id: (required) :type instance_id: str @@ -8630,7 +8636,7 @@ def list_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertgroups_serialize( + _param = self._list_alert_config_receivers_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8640,14 +8646,13 @@ def list_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "200": "AlertConfigReceiversResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alertgroups_serialize( + def _list_alert_config_receivers_serialize( self, instance_id, project_id, @@ -8687,7 +8692,7 @@ def _list_alertgroups_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8701,9 +8706,8 @@ def _list_alertgroups_serialize( ) @validate_call - def list_alertrules( + def list_alert_config_routes( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -8715,13 +8719,11 @@ def list_alertrules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertRulesResponse: - """list_alertrules + ) -> AlertConfigRouteResponse: + """list_alert_config_routes - Get alert rules. + Get alert config route. - :param group_name: (required) - :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -8748,8 +8750,7 @@ def list_alertrules( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertrules_serialize( - group_name=group_name, + _param = self._list_alert_config_routes_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8759,7 +8760,7 @@ def list_alertrules( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertRulesResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8770,9 +8771,8 @@ def list_alertrules( ).data @validate_call - def list_alertrules_with_http_info( + def list_alert_config_routes_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -8784,13 +8784,11 @@ def list_alertrules_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[AlertRulesResponse]: - """list_alertrules + ) -> ApiResponse[AlertConfigRouteResponse]: + """list_alert_config_routes - Get alert rules. + Get alert config route. - :param group_name: (required) - :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -8817,8 +8815,7 @@ def list_alertrules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertrules_serialize( - group_name=group_name, + _param = self._list_alert_config_routes_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8828,7 +8825,7 @@ def list_alertrules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertRulesResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8839,9 +8836,8 @@ def list_alertrules_with_http_info( ) @validate_call - def list_alertrules_without_preload_content( + def list_alert_config_routes_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -8854,12 +8850,10 @@ def list_alertrules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_alertrules + """list_alert_config_routes - Get alert rules. + Get alert config route. - :param group_name: (required) - :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -8886,8 +8880,7 @@ def list_alertrules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertrules_serialize( - group_name=group_name, + _param = self._list_alert_config_routes_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8897,15 +8890,14 @@ def list_alertrules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertRulesResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alertrules_serialize( + def _list_alert_config_routes_serialize( self, - group_name, instance_id, project_id, _request_auth, @@ -8926,8 +8918,6 @@ def _list_alertrules_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: @@ -8946,7 +8936,7 @@ def _list_alertrules_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8960,7 +8950,7 @@ def _list_alertrules_serialize( ) @validate_call - def list_credentials( + def list_alertgroups( self, instance_id: StrictStr, project_id: StrictStr, @@ -8973,10 +8963,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 + ) -> AlertGroupsResponse: + """list_alertgroups - Get all technical user credentials. + Get alert groups. :param instance_id: (required) :type instance_id: str @@ -9004,7 +8994,7 @@ def list_credentials( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_serialize( + _param = self._list_alertgroups_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9014,7 +9004,8 @@ def list_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9025,7 +9016,7 @@ def list_credentials( ).data @validate_call - def list_credentials_with_http_info( + def list_alertgroups_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -9038,10 +9029,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[AlertGroupsResponse]: + """list_alertgroups - Get all technical user credentials. + Get alert groups. :param instance_id: (required) :type instance_id: str @@ -9069,7 +9060,7 @@ def list_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_serialize( + _param = self._list_alertgroups_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9079,7 +9070,8 @@ def list_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9090,7 +9082,7 @@ def list_credentials_with_http_info( ) @validate_call - def list_credentials_without_preload_content( + def list_alertgroups_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -9104,9 +9096,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 + """list_alertgroups - Get all technical user credentials. + Get alert groups. :param instance_id: (required) :type instance_id: str @@ -9134,7 +9126,7 @@ def list_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_serialize( + _param = self._list_alertgroups_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9144,13 +9136,14 @@ def list_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_credentials_serialize( + def _list_alertgroups_serialize( self, instance_id, project_id, @@ -9190,7 +9183,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}/alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9204,8 +9197,10 @@ def _list_credentials_serialize( ) @validate_call - def list_instances( + def list_alertrules( self, + group_name: StrictStr, + instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -9216,11 +9211,15 @@ 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 + ) -> AlertRulesResponse: + """list_alertrules - Get all instances for a project. + 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 @@ -9245,7 +9244,9 @@ def list_instances( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _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, @@ -9254,7 +9255,7 @@ def list_instances( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "200": "AlertRulesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9265,8 +9266,10 @@ def list_instances( ).data @validate_call - def list_instances_with_http_info( + def list_alertrules_with_http_info( self, + group_name: StrictStr, + instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -9277,11 +9280,15 @@ 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[AlertRulesResponse]: + """list_alertrules - Get all instances for a project. + 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 @@ -9306,7 +9313,9 @@ def list_instances_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _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, @@ -9315,7 +9324,7 @@ def list_instances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "200": "AlertRulesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9326,8 +9335,10 @@ def list_instances_with_http_info( ) @validate_call - def list_instances_without_preload_content( + def list_alertrules_without_preload_content( self, + group_name: StrictStr, + instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -9339,10 +9350,14 @@ 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 + """list_alertrules - Get all instances for a project. + 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 @@ -9367,7 +9382,9 @@ def list_instances_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _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, @@ -9376,14 +9393,16 @@ def list_instances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "200": "AlertRulesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_instances_serialize( + def _list_alertrules_serialize( self, + group_name, + instance_id, project_id, _request_auth, _content_type, @@ -9403,6 +9422,10 @@ def _list_instances_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 @@ -9419,7 +9442,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}/alertgroups/{groupName}/alertrules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9433,7 +9456,7 @@ def _list_instances_serialize( ) @validate_call - def list_logs_alertgroups( + def list_credentials( self, instance_id: StrictStr, project_id: StrictStr, @@ -9446,10 +9469,10 @@ def list_logs_alertgroups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """list_logs_alertgroups + ) -> ListCredentialsResponse: + """list_credentials - Get logs alert groups config. + Get all technical user credentials. :param instance_id: (required) :type instance_id: str @@ -9477,7 +9500,7 @@ def list_logs_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_alertgroups_serialize( + _param = self._list_credentials_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9487,8 +9510,7 @@ def list_logs_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "201": "ListCredentialsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9499,7 +9521,7 @@ def list_logs_alertgroups( ).data @validate_call - def list_logs_alertgroups_with_http_info( + def list_credentials_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -9512,10 +9534,10 @@ def list_logs_alertgroups_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[AlertGroupsResponse]: - """list_logs_alertgroups + ) -> ApiResponse[ListCredentialsResponse]: + """list_credentials - Get logs alert groups config. + Get all technical user credentials. :param instance_id: (required) :type instance_id: str @@ -9543,7 +9565,7 @@ def list_logs_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_alertgroups_serialize( + _param = self._list_credentials_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9553,8 +9575,7 @@ def list_logs_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "201": "ListCredentialsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9565,7 +9586,7 @@ def list_logs_alertgroups_with_http_info( ) @validate_call - def list_logs_alertgroups_without_preload_content( + def list_credentials_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -9579,9 +9600,9 @@ def list_logs_alertgroups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_logs_alertgroups + """list_credentials - Get logs alert groups config. + Get all technical user credentials. :param instance_id: (required) :type instance_id: str @@ -9609,7 +9630,7 @@ def list_logs_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_alertgroups_serialize( + _param = self._list_credentials_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9619,14 +9640,13 @@ def list_logs_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "201": "ListCredentialsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_logs_alertgroups_serialize( + def _list_credentials_serialize( self, instance_id, project_id, @@ -9666,7 +9686,7 @@ def _list_logs_alertgroups_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9680,7 +9700,7 @@ def _list_logs_alertgroups_serialize( ) @validate_call - def list_plans( + def list_instances( self, project_id: StrictStr, _request_timeout: Union[ @@ -9692,10 +9712,10 @@ 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 + ) -> ListInstancesResponse: + """list_instances - Get all plans. + Get all instances for a project. :param project_id: (required) :type project_id: str @@ -9721,7 +9741,7 @@ def list_plans( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._list_instances_serialize( project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -9730,7 +9750,7 @@ def list_plans( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "ListInstancesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9741,7 +9761,7 @@ def list_plans( ).data @validate_call - def list_plans_with_http_info( + def list_instances_with_http_info( self, project_id: StrictStr, _request_timeout: Union[ @@ -9753,10 +9773,10 @@ 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[ListInstancesResponse]: + """list_instances - Get all plans. + Get all instances for a project. :param project_id: (required) :type project_id: str @@ -9782,7 +9802,7 @@ def list_plans_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._list_instances_serialize( project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -9791,7 +9811,7 @@ def list_plans_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "ListInstancesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9802,7 +9822,7 @@ def list_plans_with_http_info( ) @validate_call - def list_plans_without_preload_content( + def list_instances_without_preload_content( self, project_id: StrictStr, _request_timeout: Union[ @@ -9815,9 +9835,9 @@ 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 + """list_instances - Get all plans. + Get all instances for a project. :param project_id: (required) :type project_id: str @@ -9843,7 +9863,7 @@ def list_plans_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._list_instances_serialize( project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -9852,13 +9872,13 @@ def list_plans_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "ListInstancesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_plans_serialize( + def _list_instances_serialize( self, project_id, _request_auth, @@ -9895,7 +9915,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", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9909,7 +9929,7 @@ def _list_plans_serialize( ) @validate_call - def list_scrape_configs( + def list_logs_alertgroups( self, instance_id: StrictStr, project_id: StrictStr, @@ -9922,10 +9942,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 + ) -> AlertGroupsResponse: + """list_logs_alertgroups - Get scrape configs. + Get logs alert groups config. :param instance_id: (required) :type instance_id: str @@ -9953,7 +9973,7 @@ def list_scrape_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._list_scrape_configs_serialize( + _param = self._list_logs_alertgroups_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9963,7 +9983,8 @@ def list_scrape_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9974,7 +9995,7 @@ def list_scrape_configs( ).data @validate_call - def list_scrape_configs_with_http_info( + def list_logs_alertgroups_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -9987,10 +10008,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[AlertGroupsResponse]: + """list_logs_alertgroups - Get scrape configs. + Get logs alert groups config. :param instance_id: (required) :type instance_id: str @@ -10018,7 +10039,7 @@ def list_scrape_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_scrape_configs_serialize( + _param = self._list_logs_alertgroups_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10028,7 +10049,8 @@ def list_scrape_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "AlertGroupsResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10039,7 +10061,7 @@ def list_scrape_configs_with_http_info( ) @validate_call - def list_scrape_configs_without_preload_content( + def list_logs_alertgroups_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -10053,9 +10075,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_logs_alertgroups - Get scrape configs. + Get logs alert groups config. :param instance_id: (required) :type instance_id: str @@ -10083,7 +10105,7 @@ def list_scrape_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_scrape_configs_serialize( + _param = self._list_logs_alertgroups_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10093,13 +10115,14 @@ def list_scrape_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "AlertGroupsResponse", + "400": "Error", "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_logs_alertgroups_serialize( self, instance_id, project_id, @@ -10139,7 +10162,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}/logs-alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10153,11 +10176,9 @@ def _list_scrape_configs_serialize( ) @validate_call - def partial_update_alertgroups( + def list_plans( self, - instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10167,17 +10188,13 @@ def partial_update_alertgroups( _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 + ) -> PlansResponse: + """list_plans - Patch alert groups. + Get all plans. - :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 @@ -10200,10 +10217,8 @@ def partial_update_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertgroups_serialize( - instance_id=instance_id, + _param = self._list_plans_serialize( project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10211,8 +10226,7 @@ def partial_update_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Error", + "200": "PlansResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10223,11 +10237,9 @@ def partial_update_alertgroups( ).data @validate_call - def partial_update_alertgroups_with_http_info( + def list_plans_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)], @@ -10237,17 +10249,13 @@ def partial_update_alertgroups_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[AlertGroupsResponse]: - """partial_update_alertgroups + ) -> ApiResponse[PlansResponse]: + """list_plans - Patch alert groups. + Get all plans. - :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 @@ -10270,10 +10278,8 @@ def partial_update_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertgroups_serialize( - instance_id=instance_id, + _param = self._list_plans_serialize( project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10281,8 +10287,7 @@ def partial_update_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Error", + "200": "PlansResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10293,11 +10298,9 @@ def partial_update_alertgroups_with_http_info( ) @validate_call - def partial_update_alertgroups_without_preload_content( + def list_plans_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)], @@ -10308,16 +10311,12 @@ def partial_update_alertgroups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """partial_update_alertgroups + """list_plans - Patch alert groups. + Get all plans. - :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 @@ -10340,10 +10339,8 @@ def partial_update_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertgroups_serialize( - instance_id=instance_id, + _param = self._list_plans_serialize( project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10351,18 +10348,15 @@ def partial_update_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Error", + "200": "PlansResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _partial_update_alertgroups_serialize( + def _list_plans_serialize( self, - instance_id, project_id, - update_alertgroups_request_inner, _request_auth, _content_type, _headers, @@ -10371,9 +10365,7 @@ def _partial_update_alertgroups_serialize( _host = None - _collection_formats: Dict[str, str] = { - "UpdateAlertgroupsRequestInner": "", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -10383,35 +10375,23 @@ def _partial_update_alertgroups_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 # 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", + method="GET", + resource_path="/v1/projects/{projectId}/plans", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10425,12 +10405,10 @@ def _partial_update_alertgroups_serialize( ) @validate_call - def partial_update_alertrules( + def list_scrape_configs( 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)], @@ -10440,19 +10418,15 @@ def partial_update_alertrules( _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 + ) -> ListScrapeConfigsResponse: + """list_scrape_configs - Patch alert rules. + Get scrape configs. - :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 @@ -10475,11 +10449,9 @@ def partial_update_alertrules( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertrules_serialize( - group_name=group_name, + _param = self._list_scrape_configs_serialize( 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, @@ -10487,8 +10459,7 @@ def partial_update_alertrules( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", - "400": "Error", + "200": "ListScrapeConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10499,12 +10470,10 @@ def partial_update_alertrules( ).data @validate_call - def partial_update_alertrules_with_http_info( + def list_scrape_configs_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)], @@ -10514,19 +10483,15 @@ def partial_update_alertrules_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[AlertRulesResponse]: - """partial_update_alertrules + ) -> ApiResponse[ListScrapeConfigsResponse]: + """list_scrape_configs - Patch alert rules. + Get scrape configs. - :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 @@ -10549,11 +10514,9 @@ def partial_update_alertrules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertrules_serialize( - group_name=group_name, + _param = self._list_scrape_configs_serialize( 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, @@ -10561,8 +10524,7 @@ def partial_update_alertrules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", - "400": "Error", + "200": "ListScrapeConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10573,12 +10535,10 @@ def partial_update_alertrules_with_http_info( ) @validate_call - def partial_update_alertrules_without_preload_content( + def list_scrape_configs_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)], @@ -10589,18 +10549,14 @@ def partial_update_alertrules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """partial_update_alertrules + """list_scrape_configs - Patch alert rules. + Get scrape configs. - :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 @@ -10623,11 +10579,9 @@ def partial_update_alertrules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertrules_serialize( - group_name=group_name, + _param = self._list_scrape_configs_serialize( 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, @@ -10635,19 +10589,16 @@ def partial_update_alertrules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", - "400": "Error", + "200": "ListScrapeConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _partial_update_alertrules_serialize( + def _list_scrape_configs_serialize( self, - group_name, instance_id, project_id, - update_alertgroups_request_inner_rules_inner, _request_auth, _content_type, _headers, @@ -10656,9 +10607,7 @@ def _partial_update_alertrules_serialize( _host = None - _collection_formats: Dict[str, str] = { - "UpdateAlertgroupsRequestInnerRulesInner": "", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -10668,8 +10617,6 @@ def _partial_update_alertrules_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: @@ -10678,27 +10625,17 @@ def _partial_update_alertrules_serialize( # 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", + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10712,11 +10649,11 @@ def _partial_update_alertrules_serialize( ) @validate_call - def update_acl( + def partial_update_alertgroups( self, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10726,17 +10663,17 @@ 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 + ) -> AlertGroupsResponse: + """partial_update_alertgroups - Update acl config. + Patch alert groups. :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 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 @@ -10759,10 +10696,10 @@ def update_acl( :return: Returns the result object. """ # noqa: E501 - _param = self._update_acl_serialize( + _param = self._partial_update_alertgroups_serialize( instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, + update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10770,7 +10707,7 @@ def update_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -10782,11 +10719,11 @@ def update_acl( ).data @validate_call - def update_acl_with_http_info( + def partial_update_alertgroups_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10796,17 +10733,17 @@ 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[AlertGroupsResponse]: + """partial_update_alertgroups - Update acl config. + Patch alert groups. :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 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 @@ -10829,10 +10766,10 @@ def update_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_acl_serialize( + _param = self._partial_update_alertgroups_serialize( instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, + update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10840,7 +10777,7 @@ def update_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -10852,11 +10789,11 @@ def update_acl_with_http_info( ) @validate_call - def update_acl_without_preload_content( + def partial_update_alertgroups_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10867,16 +10804,16 @@ 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 + """partial_update_alertgroups - Update acl config. + Patch alert groups. :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 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 @@ -10899,10 +10836,10 @@ def update_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_acl_serialize( + _param = self._partial_update_alertgroups_serialize( instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, + update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -10910,18 +10847,18 @@ def update_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_acl_serialize( + def _partial_update_alertgroups_serialize( self, instance_id, project_id, - update_acl_payload, + update_alertgroups_request_inner, _request_auth, _content_type, _headers, @@ -10930,7 +10867,9 @@ def _update_acl_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]] = [] @@ -10948,8 +10887,8 @@ def _update_acl_serialize( # 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_alertgroups_request_inner is not None: + _body_params = update_alertgroups_request_inner # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -10967,8 +10906,8 @@ def _update_acl_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acl", + method="PATCH", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10982,12 +10921,12 @@ def _update_acl_serialize( ) @validate_call - def update_alert_config_receiver( + def partial_update_alertrules( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, + update_alertgroups_request_inner_rules_inner: List[UpdateAlertgroupsRequestInnerRulesInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -10997,18 +10936,725 @@ 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 + ) -> AlertRulesResponse: + """partial_update_alertrules - Update alert config receiver. + 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 receiver: (required) - :type receiver: str - :param update_alert_config_receiver_payload: (required) + :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 + + _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 + + _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 + + _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, List[str], List[bytes], List[Tuple[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 + + _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 + + _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 + + _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, List[str], List[bytes], List[Tuple[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 + + _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 + + _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 @@ -11032,11 +11678,299 @@ def update_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_config_receiver_serialize( + _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, List[str], List[bytes], List[Tuple[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 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 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 + (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 + + _param = self._update_alert_config_route_serialize( + instance_id=instance_id, + project_id=project_id, + receiver=receiver, + update_alert_config_route_payload=update_alert_config_route_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertConfigRouteResponse", + "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_route_with_http_info( + 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, + ) -> ApiResponse[AlertConfigRouteResponse]: + """update_alert_config_route + + Update 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 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 + (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 + + _param = self._update_alert_config_route_serialize( + instance_id=instance_id, + project_id=project_id, + receiver=receiver, + update_alert_config_route_payload=update_alert_config_route_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertConfigRouteResponse", + "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_route_without_preload_content( + 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, + ) -> RESTResponseType: + """update_alert_config_route + + Update 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 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 + (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 + + _param = self._update_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, receiver=receiver, - update_alert_config_receiver_payload=update_alert_config_receiver_payload, + update_alert_config_route_payload=update_alert_config_route_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11044,12 +11978,145 @@ def update_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "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_alert_config_route_serialize( + self, + instance_id, + project_id, + receiver, + update_alert_config_route_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, List[str], List[bytes], List[Tuple[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_route_payload is not None: + _body_params = update_alert_config_route_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/routes/{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_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alert_configs_payload: UpdateAlertConfigsPayload, + _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, + ) -> UpdateAlertConfigsResponse: + """update_alert_configs + + Update alert config. + + :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 _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 + + _param = self._update_alert_configs_serialize( + instance_id=instance_id, + project_id=project_id, + update_alert_configs_payload=update_alert_configs_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "UpdateAlertConfigsResponse", + "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, @@ -11057,12 +12124,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)], @@ -11072,19 +12138,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 @@ -11107,11 +12171,10 @@ def update_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11119,10 +12182,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() @@ -11132,12 +12194,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)], @@ -11148,18 +12209,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 @@ -11182,11 +12241,10 @@ def update_alert_config_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11194,20 +12252,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, @@ -11230,14 +12286,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: @@ -11256,7 +12310,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, @@ -11270,12 +12324,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)], @@ -11285,19 +12339,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 @@ -11320,11 +12374,11 @@ def update_alert_config_route( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11332,8 +12386,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", } @@ -11345,12 +12399,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)], @@ -11360,19 +12414,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 @@ -11395,11 +12449,11 @@ def update_alert_config_route_with_http_info( :return: Returns the result object. """ # noqa: E501 - _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, + project_id=project_id, + update_alertgroup_payload=update_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11407,8 +12461,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", } @@ -11420,12 +12474,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)], @@ -11436,18 +12490,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 @@ -11470,11 +12524,11 @@ def update_alert_config_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11482,20 +12536,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, @@ -11514,18 +12568,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: @@ -11544,7 +12598,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, @@ -11558,11 +12612,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)], @@ -11572,17 +12626,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 @@ -11605,10 +12659,10 @@ def update_alert_configs( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11616,7 +12670,7 @@ def update_alert_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -11628,11 +12682,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)], @@ -11642,17 +12696,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 @@ -11675,10 +12729,10 @@ def update_alert_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11686,7 +12740,7 @@ def update_alert_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -11698,11 +12752,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)], @@ -11713,16 +12767,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 @@ -11745,10 +12799,10 @@ def update_alert_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _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, @@ -11756,18 +12810,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, @@ -11776,7 +12830,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]] = [] @@ -11794,8 +12850,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: @@ -11814,7 +12870,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, @@ -11828,12 +12884,12 @@ def _update_alert_configs_serialize( ) @validate_call - def update_alertgroup( + def update_credentials_remote_write_config( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroup_payload: UpdateAlertgroupPayload, + username: StrictStr, + update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11843,19 +12899,19 @@ def update_alertgroup( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """update_alertgroup + ) -> CredentialsRemoteWriteConfig: + """update_credentials_remote_write_config - Update alert group config. + Update remote write config for credentials. - :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_alertgroup_payload: (required) - :type update_alertgroup_payload: UpdateAlertgroupPayload + :param username: (required) + :type username: str + :param update_credentials_remote_write_config_payload: (required) + :type update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload :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 @@ -11878,11 +12934,11 @@ def update_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroup_serialize( - group_name=group_name, + _param = self._update_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroup_payload=update_alertgroup_payload, + username=username, + update_credentials_remote_write_config_payload=update_credentials_remote_write_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11890,10 +12946,11 @@ def update_alertgroup( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "200": "CredentialsRemoteWriteConfig", + "400": "Error", "403": "PermissionDenied", "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -11903,12 +12960,12 @@ def update_alertgroup( ).data @validate_call - def update_alertgroup_with_http_info( + def update_credentials_remote_write_config_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroup_payload: UpdateAlertgroupPayload, + username: StrictStr, + update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11918,19 +12975,19 @@ def update_alertgroup_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[AlertGroupsResponse]: - """update_alertgroup + ) -> ApiResponse[CredentialsRemoteWriteConfig]: + """update_credentials_remote_write_config - Update alert group config. + Update remote write config for credentials. - :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_alertgroup_payload: (required) - :type update_alertgroup_payload: UpdateAlertgroupPayload + :param username: (required) + :type username: str + :param update_credentials_remote_write_config_payload: (required) + :type update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload :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 @@ -11953,11 +13010,11 @@ def update_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroup_serialize( - group_name=group_name, + _param = self._update_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroup_payload=update_alertgroup_payload, + username=username, + update_credentials_remote_write_config_payload=update_credentials_remote_write_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11965,10 +13022,11 @@ def update_alertgroup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "200": "CredentialsRemoteWriteConfig", + "400": "Error", "403": "PermissionDenied", "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -11978,12 +13036,12 @@ def update_alertgroup_with_http_info( ) @validate_call - def update_alertgroup_without_preload_content( + def update_credentials_remote_write_config_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroup_payload: UpdateAlertgroupPayload, + username: StrictStr, + update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11994,18 +13052,18 @@ def update_alertgroup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alertgroup + """update_credentials_remote_write_config - Update alert group config. + Update remote write config for credentials. - :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_alertgroup_payload: (required) - :type update_alertgroup_payload: UpdateAlertgroupPayload + :param username: (required) + :type username: str + :param update_credentials_remote_write_config_payload: (required) + :type update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload :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 @@ -12028,11 +13086,11 @@ def update_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroup_serialize( - group_name=group_name, + _param = self._update_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroup_payload=update_alertgroup_payload, + username=username, + update_credentials_remote_write_config_payload=update_credentials_remote_write_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12040,20 +13098,21 @@ def update_alertgroup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "200": "CredentialsRemoteWriteConfig", + "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 _update_alertgroup_serialize( + def _update_credentials_remote_write_config_serialize( self, - group_name, instance_id, project_id, - update_alertgroup_payload, + username, + update_credentials_remote_write_config_payload, _request_auth, _content_type, _headers, @@ -12072,18 +13131,18 @@ def _update_alertgroup_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 username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_alertgroup_payload is not None: - _body_params = update_alertgroup_payload + if update_credentials_remote_write_config_payload is not None: + _body_params = update_credentials_remote_write_config_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -12102,7 +13161,7 @@ def _update_alertgroup_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12116,11 +13175,11 @@ def _update_alertgroup_serialize( ) @validate_call - def update_alertgroups( + def update_grafana_configs( self, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + update_grafana_configs_payload: UpdateGrafanaConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12130,17 +13189,17 @@ def update_alertgroups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """update_alertgroups + ) -> Message: + """update_grafana_configs - Update alert groups. + Update grafana config. :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 update_grafana_configs_payload: (required) + :type update_grafana_configs_payload: UpdateGrafanaConfigsPayload :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 @@ -12163,10 +13222,10 @@ def update_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroups_serialize( + _param = self._update_grafana_configs_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, + update_grafana_configs_payload=update_grafana_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12174,7 +13233,7 @@ def update_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } @@ -12186,11 +13245,11 @@ def update_alertgroups( ).data @validate_call - def update_alertgroups_with_http_info( + def update_grafana_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + update_grafana_configs_payload: UpdateGrafanaConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12200,17 +13259,17 @@ def update_alertgroups_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[AlertGroupsResponse]: - """update_alertgroups + ) -> ApiResponse[Message]: + """update_grafana_configs - Update alert groups. + Update grafana config. :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 update_grafana_configs_payload: (required) + :type update_grafana_configs_payload: UpdateGrafanaConfigsPayload :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 @@ -12233,10 +13292,10 @@ def update_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroups_serialize( + _param = self._update_grafana_configs_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, + update_grafana_configs_payload=update_grafana_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12244,7 +13303,7 @@ def update_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } @@ -12256,11 +13315,11 @@ def update_alertgroups_with_http_info( ) @validate_call - def update_alertgroups_without_preload_content( + def update_grafana_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + update_grafana_configs_payload: UpdateGrafanaConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12271,16 +13330,16 @@ def update_alertgroups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alertgroups + """update_grafana_configs - Update alert groups. + Update grafana config. :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 update_grafana_configs_payload: (required) + :type update_grafana_configs_payload: UpdateGrafanaConfigsPayload :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 @@ -12303,10 +13362,10 @@ def update_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroups_serialize( + _param = self._update_grafana_configs_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, + update_grafana_configs_payload=update_grafana_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12314,18 +13373,18 @@ def update_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_alertgroups_serialize( + def _update_grafana_configs_serialize( self, instance_id, project_id, - update_alertgroups_request_inner, + update_grafana_configs_payload, _request_auth, _content_type, _headers, @@ -12334,9 +13393,7 @@ def _update_alertgroups_serialize( _host = None - _collection_formats: Dict[str, str] = { - "UpdateAlertgroupsRequestInner": "", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -12354,8 +13411,8 @@ def _update_alertgroups_serialize( # 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 + if update_grafana_configs_payload is not None: + _body_params = update_grafana_configs_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -12374,7 +13431,7 @@ def _update_alertgroups_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/grafana-configs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12388,12 +13445,11 @@ def _update_alertgroups_serialize( ) @validate_call - def update_credentials_remote_write_config( + def update_instance( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, - update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload, + update_instance_payload: UpdateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12403,19 +13459,17 @@ def update_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: - """update_credentials_remote_write_config + ) -> InstanceResponse: + """update_instance - Update remote write config for credentials. + Update instance. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str - :param update_credentials_remote_write_config_payload: (required) - :type update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload + :param update_instance_payload: (required) + :type update_instance_payload: UpdateInstancePayload :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 @@ -12438,11 +13492,10 @@ def update_credentials_remote_write_config( :return: Returns the result object. """ # noqa: E501 - _param = self._update_credentials_remote_write_config_serialize( + _param = self._update_instance_serialize( instance_id=instance_id, project_id=project_id, - username=username, - update_credentials_remote_write_config_payload=update_credentials_remote_write_config_payload, + update_instance_payload=update_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12450,11 +13503,9 @@ def update_credentials_remote_write_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "InstanceResponse", "400": "Error", "403": "PermissionDenied", - "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12464,12 +13515,11 @@ def update_credentials_remote_write_config( ).data @validate_call - def update_credentials_remote_write_config_with_http_info( + def update_instance_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, - update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload, + update_instance_payload: UpdateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12479,19 +13529,17 @@ def update_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]: - """update_credentials_remote_write_config + ) -> ApiResponse[InstanceResponse]: + """update_instance - Update remote write config for credentials. + Update instance. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str - :param update_credentials_remote_write_config_payload: (required) - :type update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload + :param update_instance_payload: (required) + :type update_instance_payload: UpdateInstancePayload :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 @@ -12514,11 +13562,10 @@ def update_credentials_remote_write_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_credentials_remote_write_config_serialize( + _param = self._update_instance_serialize( instance_id=instance_id, project_id=project_id, - username=username, - update_credentials_remote_write_config_payload=update_credentials_remote_write_config_payload, + update_instance_payload=update_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12526,11 +13573,9 @@ def update_credentials_remote_write_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "InstanceResponse", "400": "Error", "403": "PermissionDenied", - "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12540,12 +13585,11 @@ def update_credentials_remote_write_config_with_http_info( ) @validate_call - def update_credentials_remote_write_config_without_preload_content( + def update_instance_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, - update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload, + update_instance_payload: UpdateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12556,18 +13600,16 @@ def update_credentials_remote_write_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_credentials_remote_write_config + """update_instance - Update remote write config for credentials. + Update instance. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str - :param update_credentials_remote_write_config_payload: (required) - :type update_credentials_remote_write_config_payload: UpdateCredentialsRemoteWriteConfigPayload + :param update_instance_payload: (required) + :type update_instance_payload: UpdateInstancePayload :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 @@ -12590,11 +13632,10 @@ def update_credentials_remote_write_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_credentials_remote_write_config_serialize( + _param = self._update_instance_serialize( instance_id=instance_id, project_id=project_id, - username=username, - update_credentials_remote_write_config_payload=update_credentials_remote_write_config_payload, + update_instance_payload=update_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12602,21 +13643,18 @@ def update_credentials_remote_write_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "InstanceResponse", "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 _update_credentials_remote_write_config_serialize( + def _update_instance_serialize( self, instance_id, project_id, - username, - update_credentials_remote_write_config_payload, + update_instance_payload, _request_auth, _content_type, _headers, @@ -12639,14 +13677,12 @@ def _update_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 # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_credentials_remote_write_config_payload is not None: - _body_params = update_credentials_remote_write_config_payload + if update_instance_payload is not None: + _body_params = update_instance_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -12665,7 +13701,7 @@ def _update_credentials_remote_write_config_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12679,11 +13715,12 @@ def _update_credentials_remote_write_config_serialize( ) @validate_call - def update_grafana_configs( + def update_logs_alertgroup( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_grafana_configs_payload: UpdateGrafanaConfigsPayload, + update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12693,17 +13730,19 @@ def update_grafana_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Message: - """update_grafana_configs + ) -> AlertGroupsResponse: + """update_logs_alertgroup - Update grafana config. + Update logs 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 update_grafana_configs_payload: (required) - :type update_grafana_configs_payload: UpdateGrafanaConfigsPayload + :param update_logs_alertgroup_payload: (required) + :type update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload :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 @@ -12726,10 +13765,11 @@ def update_grafana_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._update_grafana_configs_serialize( + _param = self._update_logs_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_grafana_configs_payload=update_grafana_configs_payload, + update_logs_alertgroup_payload=update_logs_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12737,9 +13777,10 @@ def update_grafana_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", - "400": "Error", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12749,11 +13790,12 @@ def update_grafana_configs( ).data @validate_call - def update_grafana_configs_with_http_info( + def update_logs_alertgroup_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_grafana_configs_payload: UpdateGrafanaConfigsPayload, + update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12763,17 +13805,19 @@ def update_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[Message]: - """update_grafana_configs + ) -> ApiResponse[AlertGroupsResponse]: + """update_logs_alertgroup - Update grafana config. + Update logs 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 update_grafana_configs_payload: (required) - :type update_grafana_configs_payload: UpdateGrafanaConfigsPayload + :param update_logs_alertgroup_payload: (required) + :type update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload :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 @@ -12796,10 +13840,11 @@ def update_grafana_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_grafana_configs_serialize( + _param = self._update_logs_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_grafana_configs_payload=update_grafana_configs_payload, + update_logs_alertgroup_payload=update_logs_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12807,9 +13852,10 @@ def update_grafana_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", - "400": "Error", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12819,11 +13865,12 @@ def update_grafana_configs_with_http_info( ) @validate_call - def update_grafana_configs_without_preload_content( + def update_logs_alertgroup_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_grafana_configs_payload: UpdateGrafanaConfigsPayload, + update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12834,16 +13881,18 @@ def update_grafana_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_grafana_configs + """update_logs_alertgroup - Update grafana config. + Update logs 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 update_grafana_configs_payload: (required) - :type update_grafana_configs_payload: UpdateGrafanaConfigsPayload + :param update_logs_alertgroup_payload: (required) + :type update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload :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 @@ -12866,10 +13915,11 @@ def update_grafana_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_grafana_configs_serialize( + _param = self._update_logs_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_grafana_configs_payload=update_grafana_configs_payload, + update_logs_alertgroup_payload=update_logs_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12877,18 +13927,20 @@ def update_grafana_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", - "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_grafana_configs_serialize( + def _update_logs_alertgroup_serialize( self, + group_name, instance_id, project_id, - update_grafana_configs_payload, + update_logs_alertgroup_payload, _request_auth, _content_type, _headers, @@ -12907,6 +13959,8 @@ def _update_grafana_configs_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: @@ -12915,8 +13969,8 @@ def _update_grafana_configs_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_grafana_configs_payload is not None: - _body_params = update_grafana_configs_payload + if update_logs_alertgroup_payload is not None: + _body_params = update_logs_alertgroup_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -12935,7 +13989,7 @@ def _update_grafana_configs_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/grafana-configs", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12949,11 +14003,11 @@ def _update_grafana_configs_serialize( ) @validate_call - def update_instance( + def update_logs_configs( self, instance_id: StrictStr, project_id: StrictStr, - update_instance_payload: UpdateInstancePayload, + update_logs_configs_payload: UpdateLogsConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12963,17 +14017,17 @@ def update_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceResponse: - """update_instance + ) -> Message: + """update_logs_configs - Update instance. + Update logs config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_instance_payload: (required) - :type update_instance_payload: UpdateInstancePayload + :param update_logs_configs_payload: (required) + :type update_logs_configs_payload: UpdateLogsConfigsPayload :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 @@ -12996,10 +14050,10 @@ def update_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._update_instance_serialize( + _param = self._update_logs_configs_serialize( instance_id=instance_id, project_id=project_id, - update_instance_payload=update_instance_payload, + update_logs_configs_payload=update_logs_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13007,7 +14061,7 @@ def update_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } @@ -13019,11 +14073,11 @@ def update_instance( ).data @validate_call - def update_instance_with_http_info( + def update_logs_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - update_instance_payload: UpdateInstancePayload, + update_logs_configs_payload: UpdateLogsConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13033,17 +14087,17 @@ def update_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]: - """update_instance + ) -> ApiResponse[Message]: + """update_logs_configs - Update instance. + Update logs config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_instance_payload: (required) - :type update_instance_payload: UpdateInstancePayload + :param update_logs_configs_payload: (required) + :type update_logs_configs_payload: UpdateLogsConfigsPayload :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 @@ -13066,10 +14120,10 @@ def update_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_instance_serialize( + _param = self._update_logs_configs_serialize( instance_id=instance_id, project_id=project_id, - update_instance_payload=update_instance_payload, + update_logs_configs_payload=update_logs_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13077,7 +14131,7 @@ def update_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } @@ -13089,11 +14143,11 @@ def update_instance_with_http_info( ) @validate_call - def update_instance_without_preload_content( + def update_logs_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - update_instance_payload: UpdateInstancePayload, + update_logs_configs_payload: UpdateLogsConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13104,16 +14158,16 @@ def update_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_instance + """update_logs_configs - Update instance. + Update logs config. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param update_instance_payload: (required) - :type update_instance_payload: UpdateInstancePayload + :param update_logs_configs_payload: (required) + :type update_logs_configs_payload: UpdateLogsConfigsPayload :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 @@ -13136,10 +14190,10 @@ def update_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_instance_serialize( + _param = self._update_logs_configs_serialize( instance_id=instance_id, project_id=project_id, - update_instance_payload=update_instance_payload, + update_logs_configs_payload=update_logs_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13147,18 +14201,18 @@ def update_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_instance_serialize( + def _update_logs_configs_serialize( self, instance_id, project_id, - update_instance_payload, + update_logs_configs_payload, _request_auth, _content_type, _headers, @@ -13185,8 +14239,8 @@ def _update_instance_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_instance_payload is not None: - _body_params = update_instance_payload + if update_logs_configs_payload is not None: + _body_params = update_logs_configs_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -13205,7 +14259,7 @@ def _update_instance_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-configs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13219,12 +14273,11 @@ def _update_instance_serialize( ) @validate_call - def update_logs_alertgroup( + def update_metrics_storage_retention( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload, + update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13234,19 +14287,17 @@ def update_logs_alertgroup( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """update_logs_alertgroup + ) -> Message: + """update_metrics_storage_retention - Update logs alert group config. + Update metric update retention time. - :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_logs_alertgroup_payload: (required) - :type update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload + :param update_metrics_storage_retention_payload: (required) + :type update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload :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 @@ -13269,11 +14320,10 @@ def update_logs_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._update_logs_alertgroup_serialize( - group_name=group_name, + _param = self._update_metrics_storage_retention_serialize( instance_id=instance_id, project_id=project_id, - update_logs_alertgroup_payload=update_logs_alertgroup_payload, + update_metrics_storage_retention_payload=update_metrics_storage_retention_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13281,10 +14331,9 @@ def update_logs_alertgroup( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -13294,12 +14343,11 @@ def update_logs_alertgroup( ).data @validate_call - def update_logs_alertgroup_with_http_info( + def update_metrics_storage_retention_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload, + update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13309,19 +14357,17 @@ def update_logs_alertgroup_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[AlertGroupsResponse]: - """update_logs_alertgroup + ) -> ApiResponse[Message]: + """update_metrics_storage_retention - Update logs alert group config. + Update metric update retention time. - :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_logs_alertgroup_payload: (required) - :type update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload + :param update_metrics_storage_retention_payload: (required) + :type update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload :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 @@ -13344,11 +14390,10 @@ def update_logs_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_logs_alertgroup_serialize( - group_name=group_name, + _param = self._update_metrics_storage_retention_serialize( instance_id=instance_id, project_id=project_id, - update_logs_alertgroup_payload=update_logs_alertgroup_payload, + update_metrics_storage_retention_payload=update_metrics_storage_retention_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13356,10 +14401,9 @@ def update_logs_alertgroup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -13369,12 +14413,11 @@ def update_logs_alertgroup_with_http_info( ) @validate_call - def update_logs_alertgroup_without_preload_content( + def update_metrics_storage_retention_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload, + update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13385,18 +14428,16 @@ def update_logs_alertgroup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_logs_alertgroup + """update_metrics_storage_retention - Update logs alert group config. + Update metric update retention time. - :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_logs_alertgroup_payload: (required) - :type update_logs_alertgroup_payload: UpdateLogsAlertgroupPayload + :param update_metrics_storage_retention_payload: (required) + :type update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload :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 @@ -13419,11 +14460,10 @@ def update_logs_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_logs_alertgroup_serialize( - group_name=group_name, + _param = self._update_metrics_storage_retention_serialize( instance_id=instance_id, project_id=project_id, - update_logs_alertgroup_payload=update_logs_alertgroup_payload, + update_metrics_storage_retention_payload=update_metrics_storage_retention_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13431,20 +14471,18 @@ def update_logs_alertgroup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_logs_alertgroup_serialize( + def _update_metrics_storage_retention_serialize( self, - group_name, instance_id, project_id, - update_logs_alertgroup_payload, + update_metrics_storage_retention_payload, _request_auth, _content_type, _headers, @@ -13463,8 +14501,6 @@ def _update_logs_alertgroup_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: @@ -13473,8 +14509,8 @@ def _update_logs_alertgroup_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_logs_alertgroup_payload is not None: - _body_params = update_logs_alertgroup_payload + if update_metrics_storage_retention_payload is not None: + _body_params = update_metrics_storage_retention_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -13493,7 +14529,7 @@ def _update_logs_alertgroup_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13507,11 +14543,12 @@ def _update_logs_alertgroup_serialize( ) @validate_call - def update_metrics_storage_retention( + def update_scrape_config( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, - update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload, + update_scrape_config_payload: UpdateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13521,17 +14558,19 @@ def update_metrics_storage_retention( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Message: - """update_metrics_storage_retention + ) -> ScrapeConfigsResponse: + """update_scrape_config - Update metric update retention time. + Update 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 update_metrics_storage_retention_payload: (required) - :type update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload + :param update_scrape_config_payload: (required) + :type update_scrape_config_payload: UpdateScrapeConfigPayload :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 @@ -13554,10 +14593,11 @@ def update_metrics_storage_retention( :return: Returns the result object. """ # noqa: E501 - _param = self._update_metrics_storage_retention_serialize( + _param = self._update_scrape_config_serialize( instance_id=instance_id, + job_name=job_name, project_id=project_id, - update_metrics_storage_retention_payload=update_metrics_storage_retention_payload, + update_scrape_config_payload=update_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13565,9 +14605,10 @@ def update_metrics_storage_retention( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", - "400": "Error", + "202": "ScrapeConfigsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -13577,11 +14618,12 @@ def update_metrics_storage_retention( ).data @validate_call - def update_metrics_storage_retention_with_http_info( + def update_scrape_config_with_http_info( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, - update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload, + update_scrape_config_payload: UpdateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13591,17 +14633,19 @@ def update_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[Message]: - """update_metrics_storage_retention + ) -> ApiResponse[ScrapeConfigsResponse]: + """update_scrape_config - Update metric update retention time. + Update 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 update_metrics_storage_retention_payload: (required) - :type update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload + :param update_scrape_config_payload: (required) + :type update_scrape_config_payload: UpdateScrapeConfigPayload :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 @@ -13624,10 +14668,11 @@ def update_metrics_storage_retention_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_metrics_storage_retention_serialize( + _param = self._update_scrape_config_serialize( instance_id=instance_id, + job_name=job_name, project_id=project_id, - update_metrics_storage_retention_payload=update_metrics_storage_retention_payload, + update_scrape_config_payload=update_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13635,9 +14680,10 @@ def update_metrics_storage_retention_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", - "400": "Error", + "202": "ScrapeConfigsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -13647,11 +14693,12 @@ def update_metrics_storage_retention_with_http_info( ) @validate_call - def update_metrics_storage_retention_without_preload_content( + def update_scrape_config_without_preload_content( self, instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, - update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload, + update_scrape_config_payload: UpdateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13662,16 +14709,18 @@ def update_metrics_storage_retention_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_metrics_storage_retention + """update_scrape_config - Update metric update retention time. + Update 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 update_metrics_storage_retention_payload: (required) - :type update_metrics_storage_retention_payload: UpdateMetricsStorageRetentionPayload + :param update_scrape_config_payload: (required) + :type update_scrape_config_payload: UpdateScrapeConfigPayload :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 @@ -13694,10 +14743,11 @@ def update_metrics_storage_retention_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_metrics_storage_retention_serialize( + _param = self._update_scrape_config_serialize( instance_id=instance_id, + job_name=job_name, project_id=project_id, - update_metrics_storage_retention_payload=update_metrics_storage_retention_payload, + update_scrape_config_payload=update_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13705,18 +14755,20 @@ def update_metrics_storage_retention_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", - "400": "Error", + "202": "ScrapeConfigsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_metrics_storage_retention_serialize( + def _update_scrape_config_serialize( self, instance_id, + job_name, project_id, - update_metrics_storage_retention_payload, + update_scrape_config_payload, _request_auth, _content_type, _headers, @@ -13737,14 +14789,16 @@ def _update_metrics_storage_retention_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 # process the header parameters # process the form parameters # process the body parameter - if update_metrics_storage_retention_payload is not None: - _body_params = update_metrics_storage_retention_payload + if update_scrape_config_payload is not None: + _body_params = update_scrape_config_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -13763,7 +14817,7 @@ def _update_metrics_storage_retention_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13777,12 +14831,11 @@ def _update_metrics_storage_retention_serialize( ) @validate_call - def update_scrape_config( + def update_traces_configs( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, - update_scrape_config_payload: UpdateScrapeConfigPayload, + update_traces_configs_payload: UpdateTracesConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13792,19 +14845,17 @@ def update_scrape_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ScrapeConfigsResponse: - """update_scrape_config + ) -> Message: + """update_traces_configs - Update scrape config. + Update traces 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 update_scrape_config_payload: (required) - :type update_scrape_config_payload: UpdateScrapeConfigPayload + :param update_traces_configs_payload: (required) + :type update_traces_configs_payload: UpdateTracesConfigsPayload :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 @@ -13827,11 +14878,10 @@ def update_scrape_config( :return: Returns the result object. """ # noqa: E501 - _param = self._update_scrape_config_serialize( + _param = self._update_traces_configs_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, - update_scrape_config_payload=update_scrape_config_payload, + update_traces_configs_payload=update_traces_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13839,10 +14889,9 @@ def update_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Message", + "202": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -13852,12 +14901,11 @@ def update_scrape_config( ).data @validate_call - def update_scrape_config_with_http_info( + def update_traces_configs_with_http_info( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, - update_scrape_config_payload: UpdateScrapeConfigPayload, + update_traces_configs_payload: UpdateTracesConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13867,19 +14915,17 @@ def update_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]: - """update_scrape_config + ) -> ApiResponse[Message]: + """update_traces_configs - Update scrape config. + Update traces 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 update_scrape_config_payload: (required) - :type update_scrape_config_payload: UpdateScrapeConfigPayload + :param update_traces_configs_payload: (required) + :type update_traces_configs_payload: UpdateTracesConfigsPayload :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 @@ -13902,11 +14948,10 @@ def update_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_scrape_config_serialize( + _param = self._update_traces_configs_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, - update_scrape_config_payload=update_scrape_config_payload, + update_traces_configs_payload=update_traces_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13914,10 +14959,9 @@ def update_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Message", + "202": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -13927,12 +14971,11 @@ def update_scrape_config_with_http_info( ) @validate_call - def update_scrape_config_without_preload_content( + def update_traces_configs_without_preload_content( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, - update_scrape_config_payload: UpdateScrapeConfigPayload, + update_traces_configs_payload: UpdateTracesConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13943,18 +14986,16 @@ def update_scrape_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_scrape_config + """update_traces_configs - Update scrape config. + Update traces 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 update_scrape_config_payload: (required) - :type update_scrape_config_payload: UpdateScrapeConfigPayload + :param update_traces_configs_payload: (required) + :type update_traces_configs_payload: UpdateTracesConfigsPayload :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 @@ -13977,11 +15018,10 @@ def update_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_scrape_config_serialize( + _param = self._update_traces_configs_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, - update_scrape_config_payload=update_scrape_config_payload, + update_traces_configs_payload=update_traces_configs_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13989,20 +15029,18 @@ def update_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Message", + "202": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_scrape_config_serialize( + def _update_traces_configs_serialize( self, instance_id, - job_name, project_id, - update_scrape_config_payload, + update_traces_configs_payload, _request_auth, _content_type, _headers, @@ -14023,16 +15061,14 @@ def _update_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 # process the header parameters # process the form parameters # process the body parameter - if update_scrape_config_payload is not None: - _body_params = update_scrape_config_payload + if update_traces_configs_payload is not None: + _body_params = update_traces_configs_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -14051,7 +15087,7 @@ def _update_scrape_config_serialize( return self.api_client.param_serialize( method="PUT", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/traces-configs", 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 88dc8726..92929947 100644 --- a/services/observability/src/stackit/observability/models/__init__.py +++ b/services/observability/src/stackit/observability/models/__init__.py @@ -121,6 +121,8 @@ from stackit.observability.models.list_scrape_configs_response import ( ListScrapeConfigsResponse, ) +from stackit.observability.models.logs_config import LogsConfig +from stackit.observability.models.logs_config_response import LogsConfigResponse from stackit.observability.models.message import Message from stackit.observability.models.metrics_relabel_config import MetricsRelabelConfig from stackit.observability.models.model_global import ModelGlobal @@ -139,6 +141,8 @@ from stackit.observability.models.service_keys_list import ServiceKeysList from stackit.observability.models.static_configs import StaticConfigs from stackit.observability.models.tls_config import TLSConfig +from stackit.observability.models.trace_config import TraceConfig +from stackit.observability.models.traces_config_response import TracesConfigResponse from stackit.observability.models.update_acl_payload import UpdateACLPayload from stackit.observability.models.update_alert_config_receiver_payload import ( UpdateAlertConfigReceiverPayload, @@ -186,6 +190,9 @@ from stackit.observability.models.update_logs_alertgroup_payload import ( UpdateLogsAlertgroupPayload, ) +from stackit.observability.models.update_logs_configs_payload import ( + UpdateLogsConfigsPayload, +) from stackit.observability.models.update_metrics_storage_retention_payload import ( UpdateMetricsStorageRetentionPayload, ) @@ -195,4 +202,7 @@ from stackit.observability.models.update_scrape_config_payload_static_configs_inner import ( UpdateScrapeConfigPayloadStaticConfigsInner, ) +from stackit.observability.models.update_traces_configs_payload import ( + UpdateTracesConfigsPayload, +) from stackit.observability.models.web_hook import WebHook diff --git a/services/observability/src/stackit/observability/models/logs_config.py b/services/observability/src/stackit/observability/models/logs_config.py new file mode 100644 index 00000000..e7db18fb --- /dev/null +++ b/services/observability/src/stackit/observability/models/logs_config.py @@ -0,0 +1,82 @@ +# 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 + +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 LogsConfig(BaseModel): + """ + LogsConfig + """ # noqa: E501 + + retention: Annotated[str, Field(min_length=2, strict=True, max_length=10)] + __properties: ClassVar[List[str]] = ["retention"] + + 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 LogsConfig 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 LogsConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"retention": obj.get("retention")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/logs_config_response.py b/services/observability/src/stackit/observability/models/logs_config_response.py new file mode 100644 index 00000000..e16b7864 --- /dev/null +++ b/services/observability/src/stackit/observability/models/logs_config_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 + +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.logs_config import LogsConfig + + +class LogsConfigResponse(BaseModel): + """ + LogsConfigResponse + """ # noqa: E501 + + config: LogsConfig + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["config", "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 LogsConfigResponse 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 config + if self.config: + _dict["config"] = self.config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LogsConfigResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "config": LogsConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/trace_config.py b/services/observability/src/stackit/observability/models/trace_config.py new file mode 100644 index 00000000..4ba97f8a --- /dev/null +++ b/services/observability/src/stackit/observability/models/trace_config.py @@ -0,0 +1,82 @@ +# 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 + +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 TraceConfig(BaseModel): + """ + TraceConfig + """ # noqa: E501 + + retention: Annotated[str, Field(min_length=2, strict=True, max_length=10)] + __properties: ClassVar[List[str]] = ["retention"] + + 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 TraceConfig 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 TraceConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"retention": obj.get("retention")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/traces_config_response.py b/services/observability/src/stackit/observability/models/traces_config_response.py new file mode 100644 index 00000000..2d2dd2ae --- /dev/null +++ b/services/observability/src/stackit/observability/models/traces_config_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 + +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.trace_config import TraceConfig + + +class TracesConfigResponse(BaseModel): + """ + TracesConfigResponse + """ # noqa: E501 + + config: TraceConfig + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["config", "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 TracesConfigResponse 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 config + if self.config: + _dict["config"] = self.config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TracesConfigResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "config": TraceConfig.from_dict(obj["config"]) if obj.get("config") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_logs_configs_payload.py b/services/observability/src/stackit/observability/models/update_logs_configs_payload.py new file mode 100644 index 00000000..0f0c428a --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_logs_configs_payload.py @@ -0,0 +1,84 @@ +# 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 + +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 UpdateLogsConfigsPayload(BaseModel): + """ + UpdateLogsConfigsPayload + """ # noqa: E501 + + retention: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + description="How long to keep the logs `Additional Validators:` * Should be a valid time string * Should not be longer than 30 days" + ) + __properties: ClassVar[List[str]] = ["retention"] + + 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 UpdateLogsConfigsPayload 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 UpdateLogsConfigsPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"retention": obj.get("retention")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_traces_configs_payload.py b/services/observability/src/stackit/observability/models/update_traces_configs_payload.py new file mode 100644 index 00000000..3a630fa6 --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_traces_configs_payload.py @@ -0,0 +1,84 @@ +# 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 + +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 UpdateTracesConfigsPayload(BaseModel): + """ + UpdateTracesConfigsPayload + """ # noqa: E501 + + retention: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + description="How long to keep the traces `Additional Validators:` * Should be a valid time string * Should not be bigger than 30 days" + ) + __properties: ClassVar[List[str]] = ["retention"] + + 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 UpdateTracesConfigsPayload 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 UpdateTracesConfigsPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"retention": obj.get("retention")}) + return _obj