diff --git a/services/observability/oas_commit b/services/observability/oas_commit new file mode 100644 index 000000000..dae2e9711 --- /dev/null +++ b/services/observability/oas_commit @@ -0,0 +1 @@ +37a42cf953f45e686cd9c2710e3f25de6c99e11c diff --git a/services/observability/src/stackit/observability/__init__.py b/services/observability/src/stackit/observability/__init__.py index 91a206f72..4692e2ef9 100644 --- a/services/observability/src/stackit/observability/__init__.py +++ b/services/observability/src/stackit/observability/__init__.py @@ -35,9 +35,18 @@ "AlertGroup", "AlertGroupResponse", "AlertGroupsResponse", - "AlertRule", + "AlertRecordResponse", + "AlertRecordsResponse", "AlertRuleRecord", + "AlertRuleResponse", "AlertRulesResponse", + "AlertrecordResponse", + "AlertruleResponse", + "BackupResponse", + "BackupRetentionResponse", + "BackupSchedule", + "BackupSchedulePostResponse", + "BackupScheduleResponse", "BasicAuth", "CertCheckChildResponse", "CertCheckResponse", @@ -48,27 +57,33 @@ "CreateAlertConfigRoutePayload", "CreateAlertConfigRoutePayloadRoutesInner", "CreateAlertgroupsPayload", + "CreateAlertrecordPayload", "CreateAlertrulesPayload", + "CreateBackupSchedulePayload", "CreateCertCheck400Response", "CreateCertCheckPayload", "CreateCredentialsPayload", "CreateCredentialsResponse", + "CreateElasticsearchCheckPayload", "CreateHttpCheckPayload", "CreateInstancePayload", "CreateInstanceResponse", "CreateLogsAlertgroupsPayload", "CreateLogsAlertgroupsPayloadRulesInner", + "CreateMongodbCheckPayload", + "CreateMysqlCheckPayload", + "CreateNetworkCheckPayload", + "CreatePingCheckPayload", + "CreatePostgresqlCheckPayload", + "CreateRabbitmqCheckPayload", + "CreateRedisCheckPayload", "CreateScrapeConfigPayload", - "CreateScrapeConfigPayloadBasicAuth", - "CreateScrapeConfigPayloadHttpSdConfigsInner", - "CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2", - "CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig", - "CreateScrapeConfigPayloadMetricsRelabelConfigsInner", - "CreateScrapeConfigPayloadStaticConfigsInner", "Credentials", "CredentialsRemoteWriteConfig", "CredentialsRemoteWriteDeleteResponse", "DeleteScrapeConfigResponse", + "ElasticsearchCheckChildResponse", + "ElasticsearchCheckResponse", "EmailConfig", "Error", "GetAlertConfigsResponse", @@ -95,16 +110,39 @@ "Message", "MetricsRelabelConfig", "ModelGlobal", + "MongodbCheckChildResponse", + "MongodbCheckResponse", + "MysqlCheckChildResponse", + "MysqlCheckResponse", + "NetworkCheckChildResponse", + "NetworkCheckResponse", "OAuth2", + "Offerings", "OpsgenieConfig", + "PartialUpdateAlertrecordsRequestInner", "PartialUpdateAlertrulesRequestInner", + "PartialUpdateScrapeConfigsRequestInner", + "PartialUpdateScrapeConfigsRequestInnerBasicAuth", + "PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner", + "PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2", + "PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig", + "PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner", + "PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner", "PermissionDenied", + "PingCheckChildResponse", + "PingCheckResponse", "Plan", "PlanModel", "PlansResponse", + "PostgresqlCheckChildResponse", + "PostgresqlCheckResponse", "ProjectInstanceFull", + "RabbitMQCheckChildResponse", + "RabbitmqCheckResponse", "Receiver", "Receivers", + "RedisCheckChildResponse", + "RedisCheckResponse", "Route", "RouteSerializer", "ScrapeConfigsResponse", @@ -126,6 +164,8 @@ "UpdateAlertgroupPayload", "UpdateAlertgroupsRequestInner", "UpdateAlertgroupsRequestInnerRulesInner", + "UpdateAlertrecordPayload", + "UpdateAlertrulePayload", "UpdateCredentialsRemoteWriteConfigPayload", "UpdateGrafanaConfigsPayload", "UpdateGrafanaConfigsPayloadGenericOauth", @@ -168,13 +208,42 @@ from stackit.observability.models.alert_groups_response import ( AlertGroupsResponse as AlertGroupsResponse, ) -from stackit.observability.models.alert_rule import AlertRule as AlertRule +from stackit.observability.models.alert_record_response import ( + AlertRecordResponse as AlertRecordResponse, +) +from stackit.observability.models.alert_records_response import ( + AlertRecordsResponse as AlertRecordsResponse, +) from stackit.observability.models.alert_rule_record import ( AlertRuleRecord as AlertRuleRecord, ) +from stackit.observability.models.alert_rule_response import ( + AlertRuleResponse as AlertRuleResponse, +) from stackit.observability.models.alert_rules_response import ( AlertRulesResponse as AlertRulesResponse, ) +from stackit.observability.models.alertrecord_response import ( + AlertrecordResponse as AlertrecordResponse, +) +from stackit.observability.models.alertrule_response import ( + AlertruleResponse as AlertruleResponse, +) +from stackit.observability.models.backup_response import ( + BackupResponse as BackupResponse, +) +from stackit.observability.models.backup_retention_response import ( + BackupRetentionResponse as BackupRetentionResponse, +) +from stackit.observability.models.backup_schedule import ( + BackupSchedule as BackupSchedule, +) +from stackit.observability.models.backup_schedule_post_response import ( + BackupSchedulePostResponse as BackupSchedulePostResponse, +) +from stackit.observability.models.backup_schedule_response import ( + BackupScheduleResponse as BackupScheduleResponse, +) from stackit.observability.models.basic_auth import BasicAuth as BasicAuth from stackit.observability.models.cert_check_child_response import ( CertCheckChildResponse as CertCheckChildResponse, @@ -203,9 +272,15 @@ from stackit.observability.models.create_alertgroups_payload import ( CreateAlertgroupsPayload as CreateAlertgroupsPayload, ) +from stackit.observability.models.create_alertrecord_payload import ( + CreateAlertrecordPayload as CreateAlertrecordPayload, +) from stackit.observability.models.create_alertrules_payload import ( CreateAlertrulesPayload as CreateAlertrulesPayload, ) +from stackit.observability.models.create_backup_schedule_payload import ( + CreateBackupSchedulePayload as CreateBackupSchedulePayload, +) from stackit.observability.models.create_cert_check400_response import ( CreateCertCheck400Response as CreateCertCheck400Response, ) @@ -218,6 +293,9 @@ from stackit.observability.models.create_credentials_response import ( CreateCredentialsResponse as CreateCredentialsResponse, ) +from stackit.observability.models.create_elasticsearch_check_payload import ( + CreateElasticsearchCheckPayload as CreateElasticsearchCheckPayload, +) from stackit.observability.models.create_http_check_payload import ( CreateHttpCheckPayload as CreateHttpCheckPayload, ) @@ -233,26 +311,29 @@ from stackit.observability.models.create_logs_alertgroups_payload_rules_inner import ( CreateLogsAlertgroupsPayloadRulesInner as CreateLogsAlertgroupsPayloadRulesInner, ) -from stackit.observability.models.create_scrape_config_payload import ( - CreateScrapeConfigPayload as CreateScrapeConfigPayload, +from stackit.observability.models.create_mongodb_check_payload import ( + CreateMongodbCheckPayload as CreateMongodbCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_basic_auth import ( - CreateScrapeConfigPayloadBasicAuth as CreateScrapeConfigPayloadBasicAuth, +from stackit.observability.models.create_mysql_check_payload import ( + CreateMysqlCheckPayload as CreateMysqlCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner import ( - CreateScrapeConfigPayloadHttpSdConfigsInner as CreateScrapeConfigPayloadHttpSdConfigsInner, +from stackit.observability.models.create_network_check_payload import ( + CreateNetworkCheckPayload as CreateNetworkCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2 import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 as CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2, +from stackit.observability.models.create_ping_check_payload import ( + CreatePingCheckPayload as CreatePingCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig as CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, +from stackit.observability.models.create_postgresql_check_payload import ( + CreatePostgresqlCheckPayload as CreatePostgresqlCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_metrics_relabel_configs_inner import ( - CreateScrapeConfigPayloadMetricsRelabelConfigsInner as CreateScrapeConfigPayloadMetricsRelabelConfigsInner, +from stackit.observability.models.create_rabbitmq_check_payload import ( + CreateRabbitmqCheckPayload as CreateRabbitmqCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_static_configs_inner import ( - CreateScrapeConfigPayloadStaticConfigsInner as CreateScrapeConfigPayloadStaticConfigsInner, +from stackit.observability.models.create_redis_check_payload import ( + CreateRedisCheckPayload as CreateRedisCheckPayload, +) +from stackit.observability.models.create_scrape_config_payload import ( + CreateScrapeConfigPayload as CreateScrapeConfigPayload, ) from stackit.observability.models.credentials import Credentials as Credentials from stackit.observability.models.credentials_remote_write_config import ( @@ -264,6 +345,12 @@ from stackit.observability.models.delete_scrape_config_response import ( DeleteScrapeConfigResponse as DeleteScrapeConfigResponse, ) +from stackit.observability.models.elasticsearch_check_child_response import ( + ElasticsearchCheckChildResponse as ElasticsearchCheckChildResponse, +) +from stackit.observability.models.elasticsearch_check_response import ( + ElasticsearchCheckResponse as ElasticsearchCheckResponse, +) from stackit.observability.models.email_config import EmailConfig as EmailConfig from stackit.observability.models.error import Error as Error from stackit.observability.models.get_alert_configs_response import ( @@ -322,24 +409,91 @@ MetricsRelabelConfig as MetricsRelabelConfig, ) from stackit.observability.models.model_global import ModelGlobal as ModelGlobal +from stackit.observability.models.mongodb_check_child_response import ( + MongodbCheckChildResponse as MongodbCheckChildResponse, +) +from stackit.observability.models.mongodb_check_response import ( + MongodbCheckResponse as MongodbCheckResponse, +) +from stackit.observability.models.mysql_check_child_response import ( + MysqlCheckChildResponse as MysqlCheckChildResponse, +) +from stackit.observability.models.mysql_check_response import ( + MysqlCheckResponse as MysqlCheckResponse, +) +from stackit.observability.models.network_check_child_response import ( + NetworkCheckChildResponse as NetworkCheckChildResponse, +) +from stackit.observability.models.network_check_response import ( + NetworkCheckResponse as NetworkCheckResponse, +) from stackit.observability.models.o_auth2 import OAuth2 as OAuth2 +from stackit.observability.models.offerings import Offerings as Offerings from stackit.observability.models.opsgenie_config import ( OpsgenieConfig as OpsgenieConfig, ) +from stackit.observability.models.partial_update_alertrecords_request_inner import ( + PartialUpdateAlertrecordsRequestInner as PartialUpdateAlertrecordsRequestInner, +) from stackit.observability.models.partial_update_alertrules_request_inner import ( PartialUpdateAlertrulesRequestInner as PartialUpdateAlertrulesRequestInner, ) +from stackit.observability.models.partial_update_scrape_configs_request_inner import ( + PartialUpdateScrapeConfigsRequestInner as PartialUpdateScrapeConfigsRequestInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_basic_auth import ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth as PartialUpdateScrapeConfigsRequestInnerBasicAuth, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner as PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2 import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 as PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig as PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner as PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_static_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner as PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner, +) from stackit.observability.models.permission_denied import ( PermissionDenied as PermissionDenied, ) +from stackit.observability.models.ping_check_child_response import ( + PingCheckChildResponse as PingCheckChildResponse, +) +from stackit.observability.models.ping_check_response import ( + PingCheckResponse as PingCheckResponse, +) from stackit.observability.models.plan import Plan as Plan from stackit.observability.models.plan_model import PlanModel as PlanModel from stackit.observability.models.plans_response import PlansResponse as PlansResponse +from stackit.observability.models.postgresql_check_child_response import ( + PostgresqlCheckChildResponse as PostgresqlCheckChildResponse, +) +from stackit.observability.models.postgresql_check_response import ( + PostgresqlCheckResponse as PostgresqlCheckResponse, +) from stackit.observability.models.project_instance_full import ( ProjectInstanceFull as ProjectInstanceFull, ) +from stackit.observability.models.rabbit_mq_check_child_response import ( + RabbitMQCheckChildResponse as RabbitMQCheckChildResponse, +) +from stackit.observability.models.rabbitmq_check_response import ( + RabbitmqCheckResponse as RabbitmqCheckResponse, +) from stackit.observability.models.receiver import Receiver as Receiver from stackit.observability.models.receivers import Receivers as Receivers +from stackit.observability.models.redis_check_child_response import ( + RedisCheckChildResponse as RedisCheckChildResponse, +) +from stackit.observability.models.redis_check_response import ( + RedisCheckResponse as RedisCheckResponse, +) from stackit.observability.models.route import Route as Route from stackit.observability.models.route_serializer import ( RouteSerializer as RouteSerializer, @@ -395,6 +549,12 @@ from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( UpdateAlertgroupsRequestInnerRulesInner as UpdateAlertgroupsRequestInnerRulesInner, ) +from stackit.observability.models.update_alertrecord_payload import ( + UpdateAlertrecordPayload as UpdateAlertrecordPayload, +) +from stackit.observability.models.update_alertrule_payload import ( + UpdateAlertrulePayload as UpdateAlertrulePayload, +) from stackit.observability.models.update_credentials_remote_write_config_payload import ( UpdateCredentialsRemoteWriteConfigPayload as UpdateCredentialsRemoteWriteConfigPayload, ) diff --git a/services/observability/src/stackit/observability/api/default_api.py b/services/observability/src/stackit/observability/api/default_api.py index e8eab162b..a4493ad6f 100644 --- a/services/observability/src/stackit/observability/api/default_api.py +++ b/services/observability/src/stackit/observability/api/default_api.py @@ -14,7 +14,13 @@ from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import ( + Field, + StrictFloat, + StrictInt, + StrictStr, + validate_call, +) from stackit.core.configuration import Configuration from typing_extensions import Annotated @@ -28,7 +34,18 @@ ) from stackit.observability.models.alert_group_response import AlertGroupResponse from stackit.observability.models.alert_groups_response import AlertGroupsResponse +from stackit.observability.models.alert_record_response import AlertRecordResponse +from stackit.observability.models.alert_records_response import AlertRecordsResponse +from stackit.observability.models.alert_rule_response import AlertRuleResponse from stackit.observability.models.alert_rules_response import AlertRulesResponse +from stackit.observability.models.backup_response import BackupResponse +from stackit.observability.models.backup_retention_response import ( + BackupRetentionResponse, +) +from stackit.observability.models.backup_schedule_post_response import ( + BackupSchedulePostResponse, +) +from stackit.observability.models.backup_schedule_response import BackupScheduleResponse from stackit.observability.models.cert_check_response import CertCheckResponse from stackit.observability.models.create_alert_config_receiver_payload import ( CreateAlertConfigReceiverPayload, @@ -39,9 +56,15 @@ from stackit.observability.models.create_alertgroups_payload import ( CreateAlertgroupsPayload, ) +from stackit.observability.models.create_alertrecord_payload import ( + CreateAlertrecordPayload, +) from stackit.observability.models.create_alertrules_payload import ( CreateAlertrulesPayload, ) +from stackit.observability.models.create_backup_schedule_payload import ( + CreateBackupSchedulePayload, +) from stackit.observability.models.create_cert_check_payload import ( CreateCertCheckPayload, ) @@ -51,6 +74,9 @@ from stackit.observability.models.create_credentials_response import ( CreateCredentialsResponse, ) +from stackit.observability.models.create_elasticsearch_check_payload import ( + CreateElasticsearchCheckPayload, +) from stackit.observability.models.create_http_check_payload import ( CreateHttpCheckPayload, ) @@ -59,6 +85,27 @@ from stackit.observability.models.create_logs_alertgroups_payload import ( CreateLogsAlertgroupsPayload, ) +from stackit.observability.models.create_mongodb_check_payload import ( + CreateMongodbCheckPayload, +) +from stackit.observability.models.create_mysql_check_payload import ( + CreateMysqlCheckPayload, +) +from stackit.observability.models.create_network_check_payload import ( + CreateNetworkCheckPayload, +) +from stackit.observability.models.create_ping_check_payload import ( + CreatePingCheckPayload, +) +from stackit.observability.models.create_postgresql_check_payload import ( + CreatePostgresqlCheckPayload, +) +from stackit.observability.models.create_rabbitmq_check_payload import ( + CreateRabbitmqCheckPayload, +) +from stackit.observability.models.create_redis_check_payload import ( + CreateRedisCheckPayload, +) from stackit.observability.models.create_scrape_config_payload import ( CreateScrapeConfigPayload, ) @@ -71,6 +118,9 @@ from stackit.observability.models.delete_scrape_config_response import ( DeleteScrapeConfigResponse, ) +from stackit.observability.models.elasticsearch_check_response import ( + ElasticsearchCheckResponse, +) from stackit.observability.models.get_alert_configs_response import ( GetAlertConfigsResponse, ) @@ -95,11 +145,27 @@ ) from stackit.observability.models.logs_config_response import LogsConfigResponse from stackit.observability.models.message import Message +from stackit.observability.models.mongodb_check_response import MongodbCheckResponse +from stackit.observability.models.mysql_check_response import MysqlCheckResponse +from stackit.observability.models.network_check_response import NetworkCheckResponse +from stackit.observability.models.offerings import Offerings +from stackit.observability.models.partial_update_alertrecords_request_inner import ( + PartialUpdateAlertrecordsRequestInner, +) from stackit.observability.models.partial_update_alertrules_request_inner import ( PartialUpdateAlertrulesRequestInner, ) +from stackit.observability.models.partial_update_scrape_configs_request_inner import ( + PartialUpdateScrapeConfigsRequestInner, +) +from stackit.observability.models.ping_check_response import PingCheckResponse from stackit.observability.models.plans_response import PlansResponse +from stackit.observability.models.postgresql_check_response import ( + PostgresqlCheckResponse, +) +from stackit.observability.models.rabbitmq_check_response import RabbitmqCheckResponse from stackit.observability.models.receiver import Receiver +from stackit.observability.models.redis_check_response import RedisCheckResponse 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 @@ -121,6 +187,10 @@ from stackit.observability.models.update_alertgroups_request_inner import ( UpdateAlertgroupsRequestInner, ) +from stackit.observability.models.update_alertrecord_payload import ( + UpdateAlertrecordPayload, +) +from stackit.observability.models.update_alertrule_payload import UpdateAlertrulePayload from stackit.observability.models.update_credentials_remote_write_config_payload import ( UpdateCredentialsRemoteWriteConfigPayload, ) @@ -970,12 +1040,12 @@ def _create_alertgroups_serialize( ) @validate_call - def create_alertrules( + def create_alertrecord( self, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - create_alertrules_payload: CreateAlertrulesPayload, + create_alertrecord_payload: CreateAlertrecordPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -985,10 +1055,10 @@ def create_alertrules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertRulesResponse: - """create_alertrules + ) -> AlertRecordsResponse: + """create_alertrecord - Create alert rule. + Create alert record. :param group_name: (required) :type group_name: str @@ -996,8 +1066,8 @@ def create_alertrules( :type instance_id: str :param project_id: (required) :type project_id: str - :param create_alertrules_payload: (required) - :type create_alertrules_payload: CreateAlertrulesPayload + :param create_alertrecord_payload: (required) + :type create_alertrecord_payload: CreateAlertrecordPayload :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 @@ -1020,11 +1090,11 @@ def create_alertrules( :return: Returns the result object. """ # noqa: E501 - _param = self._create_alertrules_serialize( + _param = self._create_alertrecord_serialize( group_name=group_name, instance_id=instance_id, project_id=project_id, - create_alertrules_payload=create_alertrules_payload, + create_alertrecord_payload=create_alertrecord_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1032,7 +1102,7 @@ def create_alertrules( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", + "202": "AlertRecordsResponse", "400": "Error", "403": "PermissionDenied", } @@ -1044,12 +1114,12 @@ def create_alertrules( ).data @validate_call - def create_alertrules_with_http_info( + def create_alertrecord_with_http_info( self, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - create_alertrules_payload: CreateAlertrulesPayload, + create_alertrecord_payload: CreateAlertrecordPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1059,10 +1129,10 @@ def create_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]: - """create_alertrules + ) -> ApiResponse[AlertRecordsResponse]: + """create_alertrecord - Create alert rule. + Create alert record. :param group_name: (required) :type group_name: str @@ -1070,8 +1140,8 @@ def create_alertrules_with_http_info( :type instance_id: str :param project_id: (required) :type project_id: str - :param create_alertrules_payload: (required) - :type create_alertrules_payload: CreateAlertrulesPayload + :param create_alertrecord_payload: (required) + :type create_alertrecord_payload: CreateAlertrecordPayload :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 @@ -1094,11 +1164,11 @@ def create_alertrules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_alertrules_serialize( + _param = self._create_alertrecord_serialize( group_name=group_name, instance_id=instance_id, project_id=project_id, - create_alertrules_payload=create_alertrules_payload, + create_alertrecord_payload=create_alertrecord_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1106,7 +1176,7 @@ def create_alertrules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", + "202": "AlertRecordsResponse", "400": "Error", "403": "PermissionDenied", } @@ -1118,12 +1188,12 @@ def create_alertrules_with_http_info( ) @validate_call - def create_alertrules_without_preload_content( + def create_alertrecord_without_preload_content( self, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - create_alertrules_payload: CreateAlertrulesPayload, + create_alertrecord_payload: CreateAlertrecordPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1134,9 +1204,9 @@ def create_alertrules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_alertrules + """create_alertrecord - Create alert rule. + Create alert record. :param group_name: (required) :type group_name: str @@ -1144,8 +1214,8 @@ def create_alertrules_without_preload_content( :type instance_id: str :param project_id: (required) :type project_id: str - :param create_alertrules_payload: (required) - :type create_alertrules_payload: CreateAlertrulesPayload + :param create_alertrecord_payload: (required) + :type create_alertrecord_payload: CreateAlertrecordPayload :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 @@ -1168,11 +1238,11 @@ def create_alertrules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_alertrules_serialize( + _param = self._create_alertrecord_serialize( group_name=group_name, instance_id=instance_id, project_id=project_id, - create_alertrules_payload=create_alertrules_payload, + create_alertrecord_payload=create_alertrecord_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1180,19 +1250,19 @@ def create_alertrules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", + "202": "AlertRecordsResponse", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_alertrules_serialize( + def _create_alertrecord_serialize( self, group_name, instance_id, project_id, - create_alertrules_payload, + create_alertrecord_payload, _request_auth, _content_type, _headers, @@ -1221,8 +1291,8 @@ def _create_alertrules_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_alertrules_payload is not None: - _body_params = create_alertrules_payload + if create_alertrecord_payload is not None: + _body_params = create_alertrecord_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -1241,7 +1311,7 @@ def _create_alertrules_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1255,11 +1325,12 @@ def _create_alertrules_serialize( ) @validate_call - def create_cert_check( + def create_alertrules( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - create_cert_check_payload: CreateCertCheckPayload, + create_alertrules_payload: CreateAlertrulesPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1269,17 +1340,19 @@ def create_cert_check( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CertCheckResponse: - """create_cert_check + ) -> AlertRulesResponse: + """create_alertrules - Create cert check. + Create alert rule. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_cert_check_payload: (required) - :type create_cert_check_payload: CreateCertCheckPayload + :param create_alertrules_payload: (required) + :type create_alertrules_payload: CreateAlertrulesPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1302,10 +1375,11 @@ def create_cert_check( :return: Returns the result object. """ # noqa: E501 - _param = self._create_cert_check_serialize( + _param = self._create_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - create_cert_check_payload=create_cert_check_payload, + create_alertrules_payload=create_alertrules_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1313,8 +1387,8 @@ def create_cert_check( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", - "400": "CreateCertCheck400Response", + "202": "AlertRulesResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1325,11 +1399,12 @@ def create_cert_check( ).data @validate_call - def create_cert_check_with_http_info( + def create_alertrules_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - create_cert_check_payload: CreateCertCheckPayload, + create_alertrules_payload: CreateAlertrulesPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1339,17 +1414,19 @@ def create_cert_check_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[CertCheckResponse]: - """create_cert_check + ) -> ApiResponse[AlertRulesResponse]: + """create_alertrules - Create cert check. + Create alert rule. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_cert_check_payload: (required) - :type create_cert_check_payload: CreateCertCheckPayload + :param create_alertrules_payload: (required) + :type create_alertrules_payload: CreateAlertrulesPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1372,10 +1449,11 @@ def create_cert_check_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_cert_check_serialize( + _param = self._create_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - create_cert_check_payload=create_cert_check_payload, + create_alertrules_payload=create_alertrules_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1383,8 +1461,8 @@ def create_cert_check_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", - "400": "CreateCertCheck400Response", + "202": "AlertRulesResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1395,11 +1473,12 @@ def create_cert_check_with_http_info( ) @validate_call - def create_cert_check_without_preload_content( + def create_alertrules_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - create_cert_check_payload: CreateCertCheckPayload, + create_alertrules_payload: CreateAlertrulesPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1410,16 +1489,18 @@ def create_cert_check_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_cert_check + """create_alertrules - Create cert check. + Create alert rule. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_cert_check_payload: (required) - :type create_cert_check_payload: CreateCertCheckPayload + :param create_alertrules_payload: (required) + :type create_alertrules_payload: CreateAlertrulesPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1442,10 +1523,11 @@ def create_cert_check_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_cert_check_serialize( + _param = self._create_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - create_cert_check_payload=create_cert_check_payload, + create_alertrules_payload=create_alertrules_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1453,18 +1535,19 @@ def create_cert_check_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", - "400": "CreateCertCheck400Response", + "202": "AlertRulesResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_cert_check_serialize( + def _create_alertrules_serialize( self, + group_name, instance_id, project_id, - create_cert_check_payload, + create_alertrules_payload, _request_auth, _content_type, _headers, @@ -1483,6 +1566,8 @@ def _create_cert_check_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: @@ -1491,8 +1576,8 @@ def _create_cert_check_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_cert_check_payload is not None: - _body_params = create_cert_check_payload + if create_alertrules_payload is not None: + _body_params = create_alertrules_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -1511,7 +1596,7 @@ def _create_cert_check_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/cert-checks", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1525,11 +1610,11 @@ def _create_cert_check_serialize( ) @validate_call - def create_credentials( + def create_backup( self, instance_id: StrictStr, project_id: StrictStr, - create_credentials_payload: Optional[CreateCredentialsPayload] = None, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1539,17 +1624,17 @@ def create_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateCredentialsResponse: - """create_credentials + ) -> Message: + """create_backup - Create technical user credentials. + Create a backup. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_credentials_payload: - :type create_credentials_payload: CreateCredentialsPayload + :param backup_target: List of backup targets + :type backup_target: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1572,10 +1657,10 @@ def create_credentials( :return: Returns the result object. """ # noqa: E501 - _param = self._create_credentials_serialize( + _param = self._create_backup_serialize( instance_id=instance_id, project_id=project_id, - create_credentials_payload=create_credentials_payload, + backup_target=backup_target, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1583,7 +1668,7 @@ def create_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateCredentialsResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } @@ -1595,11 +1680,11 @@ def create_credentials( ).data @validate_call - def create_credentials_with_http_info( + def create_backup_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - create_credentials_payload: Optional[CreateCredentialsPayload] = None, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1609,17 +1694,17 @@ def create_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateCredentialsResponse]: - """create_credentials + ) -> ApiResponse[Message]: + """create_backup - Create technical user credentials. + Create a backup. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_credentials_payload: - :type create_credentials_payload: CreateCredentialsPayload + :param backup_target: List of backup targets + :type backup_target: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1642,10 +1727,10 @@ def create_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_credentials_serialize( + _param = self._create_backup_serialize( instance_id=instance_id, project_id=project_id, - create_credentials_payload=create_credentials_payload, + backup_target=backup_target, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1653,7 +1738,7 @@ def create_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateCredentialsResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } @@ -1665,11 +1750,11 @@ def create_credentials_with_http_info( ) @validate_call - def create_credentials_without_preload_content( + def create_backup_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - create_credentials_payload: Optional[CreateCredentialsPayload] = None, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1680,16 +1765,16 @@ def create_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_credentials + """create_backup - Create technical user credentials. + Create a backup. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_credentials_payload: - :type create_credentials_payload: CreateCredentialsPayload + :param backup_target: List of backup targets + :type backup_target: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1712,10 +1797,10 @@ def create_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_credentials_serialize( + _param = self._create_backup_serialize( instance_id=instance_id, project_id=project_id, - create_credentials_payload=create_credentials_payload, + backup_target=backup_target, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1723,18 +1808,18 @@ def create_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "CreateCredentialsResponse", + "202": "Message", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_credentials_serialize( + def _create_backup_serialize( self, instance_id, project_id, - create_credentials_payload, + backup_target, _request_auth, _content_type, _headers, @@ -1743,7 +1828,9 @@ def _create_credentials_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "backupTarget": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -1758,30 +1845,24 @@ def _create_credentials_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if backup_target is not None: + + _query_params.append(("backupTarget", backup_target)) + # process the header parameters # process the form parameters # process the body parameter - if create_credentials_payload is not None: - _body_params = create_credentials_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/backups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1795,11 +1876,12 @@ def _create_credentials_serialize( ) @validate_call - def create_http_check( + def create_backup_schedule( self, instance_id: StrictStr, project_id: StrictStr, - create_http_check_payload: CreateHttpCheckPayload, + create_backup_schedule_payload: CreateBackupSchedulePayload, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1809,17 +1891,19 @@ def create_http_check( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> HttpCheckResponse: - """create_http_check + ) -> BackupSchedulePostResponse: + """create_backup_schedule - Create http check. + Create backup schedule. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_http_check_payload: (required) - :type create_http_check_payload: CreateHttpCheckPayload + :param create_backup_schedule_payload: (required) + :type create_backup_schedule_payload: CreateBackupSchedulePayload + :param backup_target: List of backup targets + :type backup_target: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1842,10 +1926,11 @@ def create_http_check( :return: Returns the result object. """ # noqa: E501 - _param = self._create_http_check_serialize( + _param = self._create_backup_schedule_serialize( instance_id=instance_id, project_id=project_id, - create_http_check_payload=create_http_check_payload, + create_backup_schedule_payload=create_backup_schedule_payload, + backup_target=backup_target, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1853,8 +1938,8 @@ def create_http_check( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", - "400": "CreateCertCheck400Response", + "202": "BackupSchedulePostResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1865,11 +1950,12 @@ def create_http_check( ).data @validate_call - def create_http_check_with_http_info( + def create_backup_schedule_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - create_http_check_payload: CreateHttpCheckPayload, + create_backup_schedule_payload: CreateBackupSchedulePayload, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1879,17 +1965,19 @@ def create_http_check_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[HttpCheckResponse]: - """create_http_check + ) -> ApiResponse[BackupSchedulePostResponse]: + """create_backup_schedule - Create http check. + Create backup schedule. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_http_check_payload: (required) - :type create_http_check_payload: CreateHttpCheckPayload + :param create_backup_schedule_payload: (required) + :type create_backup_schedule_payload: CreateBackupSchedulePayload + :param backup_target: List of backup targets + :type backup_target: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1912,10 +2000,11 @@ def create_http_check_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_http_check_serialize( + _param = self._create_backup_schedule_serialize( instance_id=instance_id, project_id=project_id, - create_http_check_payload=create_http_check_payload, + create_backup_schedule_payload=create_backup_schedule_payload, + backup_target=backup_target, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1923,8 +2012,8 @@ def create_http_check_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", - "400": "CreateCertCheck400Response", + "202": "BackupSchedulePostResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1935,11 +2024,12 @@ def create_http_check_with_http_info( ) @validate_call - def create_http_check_without_preload_content( + def create_backup_schedule_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - create_http_check_payload: CreateHttpCheckPayload, + create_backup_schedule_payload: CreateBackupSchedulePayload, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1950,16 +2040,18 @@ def create_http_check_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_http_check + """create_backup_schedule - Create http check. + Create backup schedule. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_http_check_payload: (required) - :type create_http_check_payload: CreateHttpCheckPayload + :param create_backup_schedule_payload: (required) + :type create_backup_schedule_payload: CreateBackupSchedulePayload + :param backup_target: List of backup targets + :type backup_target: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1982,10 +2074,11 @@ def create_http_check_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_http_check_serialize( + _param = self._create_backup_schedule_serialize( instance_id=instance_id, project_id=project_id, - create_http_check_payload=create_http_check_payload, + create_backup_schedule_payload=create_backup_schedule_payload, + backup_target=backup_target, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1993,18 +2086,19 @@ def create_http_check_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", - "400": "CreateCertCheck400Response", + "202": "BackupSchedulePostResponse", + "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_http_check_serialize( + def _create_backup_schedule_serialize( self, instance_id, project_id, - create_http_check_payload, + create_backup_schedule_payload, + backup_target, _request_auth, _content_type, _headers, @@ -2013,7 +2107,9 @@ def _create_http_check_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "backupTarget": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -2028,11 +2124,15 @@ def _create_http_check_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if backup_target is not None: + + _query_params.append(("backupTarget", backup_target)) + # process the header parameters # process the form parameters # process the body parameter - if create_http_check_payload is not None: - _body_params = create_http_check_payload + if create_backup_schedule_payload is not None: + _body_params = create_backup_schedule_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2051,7 +2151,7 @@ def _create_http_check_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/http-checks", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/backup-schedules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2065,10 +2165,11 @@ def _create_http_check_serialize( ) @validate_call - def create_instance( + def create_cert_check( self, + instance_id: StrictStr, project_id: StrictStr, - create_instance_payload: CreateInstancePayload, + create_cert_check_payload: CreateCertCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2078,15 +2179,17 @@ def create_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateInstanceResponse: - """create_instance + ) -> CertCheckResponse: + """create_cert_check - Create new instance. + Create cert check. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param create_cert_check_payload: (required) + :type create_cert_check_payload: CreateCertCheckPayload :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 @@ -2109,9 +2212,10 @@ def create_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._create_instance_serialize( + _param = self._create_cert_check_serialize( + instance_id=instance_id, project_id=project_id, - create_instance_payload=create_instance_payload, + create_cert_check_payload=create_cert_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2119,8 +2223,8 @@ def create_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "CreateInstanceResponse", - "400": "Error", + "200": "CertCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2131,10 +2235,11 @@ def create_instance( ).data @validate_call - def create_instance_with_http_info( + def create_cert_check_with_http_info( self, + instance_id: StrictStr, project_id: StrictStr, - create_instance_payload: CreateInstancePayload, + create_cert_check_payload: CreateCertCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2144,15 +2249,17 @@ def create_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateInstanceResponse]: - """create_instance + ) -> ApiResponse[CertCheckResponse]: + """create_cert_check - Create new instance. + Create cert check. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param create_cert_check_payload: (required) + :type create_cert_check_payload: CreateCertCheckPayload :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 @@ -2175,9 +2282,10 @@ def create_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_instance_serialize( + _param = self._create_cert_check_serialize( + instance_id=instance_id, project_id=project_id, - create_instance_payload=create_instance_payload, + create_cert_check_payload=create_cert_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2185,8 +2293,8 @@ def create_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "CreateInstanceResponse", - "400": "Error", + "200": "CertCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2197,10 +2305,11 @@ def create_instance_with_http_info( ) @validate_call - def create_instance_without_preload_content( + def create_cert_check_without_preload_content( self, + instance_id: StrictStr, project_id: StrictStr, - create_instance_payload: CreateInstancePayload, + create_cert_check_payload: CreateCertCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2211,14 +2320,16 @@ def create_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_instance + """create_cert_check - Create new instance. + Create cert check. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param create_cert_check_payload: (required) + :type create_cert_check_payload: CreateCertCheckPayload :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 @@ -2241,9 +2352,10 @@ def create_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_instance_serialize( + _param = self._create_cert_check_serialize( + instance_id=instance_id, project_id=project_id, - create_instance_payload=create_instance_payload, + create_cert_check_payload=create_cert_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2251,17 +2363,18 @@ def create_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "CreateInstanceResponse", - "400": "Error", + "200": "CertCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_instance_serialize( + def _create_cert_check_serialize( self, + instance_id, project_id, - create_instance_payload, + create_cert_check_payload, _request_auth, _content_type, _headers, @@ -2280,14 +2393,16 @@ def _create_instance_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 create_instance_payload is not None: - _body_params = create_instance_payload + if create_cert_check_payload is not None: + _body_params = create_cert_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2306,7 +2421,7 @@ def _create_instance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/cert-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2320,11 +2435,11 @@ def _create_instance_serialize( ) @validate_call - def create_logs_alertgroups( + def create_credentials( self, instance_id: StrictStr, project_id: StrictStr, - create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload, + create_credentials_payload: Optional[CreateCredentialsPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2334,17 +2449,17 @@ def create_logs_alertgroups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """create_logs_alertgroups + ) -> CreateCredentialsResponse: + """create_credentials - Create logs alert group config. + Create technical user credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_logs_alertgroups_payload: (required) - :type create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload + :param create_credentials_payload: + :type create_credentials_payload: CreateCredentialsPayload :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 @@ -2367,10 +2482,10 @@ def create_logs_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._create_logs_alertgroups_serialize( + _param = self._create_credentials_serialize( instance_id=instance_id, project_id=project_id, - create_logs_alertgroups_payload=create_logs_alertgroups_payload, + create_credentials_payload=create_credentials_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2378,7 +2493,7 @@ def create_logs_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "201": "CreateCredentialsResponse", "400": "Error", "403": "PermissionDenied", } @@ -2390,11 +2505,11 @@ def create_logs_alertgroups( ).data @validate_call - def create_logs_alertgroups_with_http_info( + def create_credentials_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload, + create_credentials_payload: Optional[CreateCredentialsPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2404,17 +2519,17 @@ def create_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]: - """create_logs_alertgroups + ) -> ApiResponse[CreateCredentialsResponse]: + """create_credentials - Create logs alert group config. + Create technical user credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_logs_alertgroups_payload: (required) - :type create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload + :param create_credentials_payload: + :type create_credentials_payload: CreateCredentialsPayload :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 @@ -2437,10 +2552,10 @@ def create_logs_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_logs_alertgroups_serialize( + _param = self._create_credentials_serialize( instance_id=instance_id, project_id=project_id, - create_logs_alertgroups_payload=create_logs_alertgroups_payload, + create_credentials_payload=create_credentials_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2448,7 +2563,7 @@ def create_logs_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "201": "CreateCredentialsResponse", "400": "Error", "403": "PermissionDenied", } @@ -2460,11 +2575,11 @@ def create_logs_alertgroups_with_http_info( ) @validate_call - def create_logs_alertgroups_without_preload_content( + def create_credentials_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload, + create_credentials_payload: Optional[CreateCredentialsPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2475,16 +2590,16 @@ def create_logs_alertgroups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_logs_alertgroups + """create_credentials - Create logs alert group config. + Create technical user credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_logs_alertgroups_payload: (required) - :type create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload + :param create_credentials_payload: + :type create_credentials_payload: CreateCredentialsPayload :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 @@ -2507,10 +2622,10 @@ def create_logs_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_logs_alertgroups_serialize( + _param = self._create_credentials_serialize( instance_id=instance_id, project_id=project_id, - create_logs_alertgroups_payload=create_logs_alertgroups_payload, + create_credentials_payload=create_credentials_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2518,18 +2633,18 @@ def create_logs_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "201": "CreateCredentialsResponse", "400": "Error", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_logs_alertgroups_serialize( + def _create_credentials_serialize( self, instance_id, project_id, - create_logs_alertgroups_payload, + create_credentials_payload, _request_auth, _content_type, _headers, @@ -2556,8 +2671,8 @@ def _create_logs_alertgroups_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_logs_alertgroups_payload is not None: - _body_params = create_logs_alertgroups_payload + if create_credentials_payload is not None: + _body_params = create_credentials_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2576,7 +2691,7 @@ def _create_logs_alertgroups_serialize( return self.api_client.param_serialize( method="POST", - 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, @@ -2590,11 +2705,11 @@ def _create_logs_alertgroups_serialize( ) @validate_call - def create_scrape_config( + def create_elasticsearch_check( self, instance_id: StrictStr, project_id: StrictStr, - create_scrape_config_payload: CreateScrapeConfigPayload, + create_elasticsearch_check_payload: CreateElasticsearchCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2604,17 +2719,17 @@ def create_scrape_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ScrapeConfigsResponse: - """create_scrape_config + ) -> ElasticsearchCheckResponse: + """create_elasticsearch_check - Create scrape config. + Create elasticsearch check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_scrape_config_payload: (required) - :type create_scrape_config_payload: CreateScrapeConfigPayload + :param create_elasticsearch_check_payload: (required) + :type create_elasticsearch_check_payload: CreateElasticsearchCheckPayload :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 @@ -2637,10 +2752,10 @@ def create_scrape_config( :return: Returns the result object. """ # noqa: E501 - _param = self._create_scrape_config_serialize( + _param = self._create_elasticsearch_check_serialize( instance_id=instance_id, project_id=project_id, - create_scrape_config_payload=create_scrape_config_payload, + create_elasticsearch_check_payload=create_elasticsearch_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2648,8 +2763,8 @@ def create_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Error", + "200": "ElasticsearchCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2660,11 +2775,11 @@ def create_scrape_config( ).data @validate_call - def create_scrape_config_with_http_info( + def create_elasticsearch_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - create_scrape_config_payload: CreateScrapeConfigPayload, + create_elasticsearch_check_payload: CreateElasticsearchCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2674,17 +2789,17 @@ def create_scrape_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ScrapeConfigsResponse]: - """create_scrape_config + ) -> ApiResponse[ElasticsearchCheckResponse]: + """create_elasticsearch_check - Create scrape config. + Create elasticsearch check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_scrape_config_payload: (required) - :type create_scrape_config_payload: CreateScrapeConfigPayload + :param create_elasticsearch_check_payload: (required) + :type create_elasticsearch_check_payload: CreateElasticsearchCheckPayload :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 @@ -2707,10 +2822,10 @@ def create_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_scrape_config_serialize( + _param = self._create_elasticsearch_check_serialize( instance_id=instance_id, project_id=project_id, - create_scrape_config_payload=create_scrape_config_payload, + create_elasticsearch_check_payload=create_elasticsearch_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2718,8 +2833,8 @@ def create_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Error", + "200": "ElasticsearchCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2730,11 +2845,11 @@ def create_scrape_config_with_http_info( ) @validate_call - def create_scrape_config_without_preload_content( + def create_elasticsearch_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - create_scrape_config_payload: CreateScrapeConfigPayload, + create_elasticsearch_check_payload: CreateElasticsearchCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2745,16 +2860,16 @@ def create_scrape_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_scrape_config + """create_elasticsearch_check - Create scrape config. + Create elasticsearch check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param create_scrape_config_payload: (required) - :type create_scrape_config_payload: CreateScrapeConfigPayload + :param create_elasticsearch_check_payload: (required) + :type create_elasticsearch_check_payload: CreateElasticsearchCheckPayload :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 @@ -2777,10 +2892,10 @@ def create_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_scrape_config_serialize( + _param = self._create_elasticsearch_check_serialize( instance_id=instance_id, project_id=project_id, - create_scrape_config_payload=create_scrape_config_payload, + create_elasticsearch_check_payload=create_elasticsearch_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2788,18 +2903,18 @@ def create_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "ScrapeConfigsResponse", - "400": "Error", + "200": "ElasticsearchCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_scrape_config_serialize( + def _create_elasticsearch_check_serialize( self, instance_id, project_id, - create_scrape_config_payload, + create_elasticsearch_check_payload, _request_auth, _content_type, _headers, @@ -2826,8 +2941,8 @@ def _create_scrape_config_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_scrape_config_payload is not None: - _body_params = create_scrape_config_payload + if create_elasticsearch_check_payload is not None: + _body_params = create_elasticsearch_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -2846,7 +2961,7 @@ def _create_scrape_config_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/elasticsearch-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2860,11 +2975,11 @@ def _create_scrape_config_serialize( ) @validate_call - def delete_alert_config_receiver( + def create_http_check( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_http_check_payload: CreateHttpCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2874,17 +2989,17 @@ def delete_alert_config_receiver( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigReceiversResponse: - """delete_alert_config_receiver + ) -> HttpCheckResponse: + """create_http_check - Delete alert config receiver. + Create http check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_http_check_payload: (required) + :type create_http_check_payload: CreateHttpCheckPayload :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 @@ -2907,10 +3022,10 @@ def delete_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_config_receiver_serialize( + _param = self._create_http_check_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + create_http_check_payload=create_http_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2918,9 +3033,9 @@ def delete_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "200": "HttpCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2930,11 +3045,11 @@ def delete_alert_config_receiver( ).data @validate_call - def delete_alert_config_receiver_with_http_info( + def create_http_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_http_check_payload: CreateHttpCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2944,17 +3059,17 @@ def delete_alert_config_receiver_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigReceiversResponse]: - """delete_alert_config_receiver + ) -> ApiResponse[HttpCheckResponse]: + """create_http_check - Delete alert config receiver. + Create http check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_http_check_payload: (required) + :type create_http_check_payload: CreateHttpCheckPayload :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 @@ -2977,10 +3092,10 @@ def delete_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_config_receiver_serialize( + _param = self._create_http_check_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + create_http_check_payload=create_http_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2988,9 +3103,9 @@ def delete_alert_config_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "200": "HttpCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3000,11 +3115,11 @@ def delete_alert_config_receiver_with_http_info( ) @validate_call - def delete_alert_config_receiver_without_preload_content( + def create_http_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_http_check_payload: CreateHttpCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3015,16 +3130,16 @@ def delete_alert_config_receiver_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alert_config_receiver + """create_http_check - Delete alert config receiver. + Create http check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_http_check_payload: (required) + :type create_http_check_payload: CreateHttpCheckPayload :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 @@ -3047,10 +3162,10 @@ def delete_alert_config_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_config_receiver_serialize( + _param = self._create_http_check_serialize( instance_id=instance_id, project_id=project_id, - receiver=receiver, + create_http_check_payload=create_http_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3058,18 +3173,18 @@ def delete_alert_config_receiver_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", + "200": "HttpCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alert_config_receiver_serialize( + def _create_http_check_serialize( self, instance_id, project_id, - receiver, + create_http_check_payload, _request_auth, _content_type, _headers, @@ -3092,23 +3207,31 @@ def _delete_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 create_http_check_payload is not None: + _body_params = create_http_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/http-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3122,11 +3245,10 @@ def _delete_alert_config_receiver_serialize( ) @validate_call - def delete_alert_config_route( + def create_instance( self, - instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3136,17 +3258,15 @@ def delete_alert_config_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigRouteResponse: - """delete_alert_config_route + ) -> CreateInstanceResponse: + """create_instance - Delete alert receiver for route. + Create new instance. - :param instance_id: (required) - :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3169,10 +3289,9 @@ def delete_alert_config_route( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_config_route_serialize( - instance_id=instance_id, + _param = self._create_instance_serialize( project_id=project_id, - receiver=receiver, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3180,9 +3299,9 @@ def delete_alert_config_route( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", + "202": "CreateInstanceResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3192,11 +3311,10 @@ def delete_alert_config_route( ).data @validate_call - def delete_alert_config_route_with_http_info( + def create_instance_with_http_info( self, - instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3206,17 +3324,15 @@ def delete_alert_config_route_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigRouteResponse]: - """delete_alert_config_route + ) -> ApiResponse[CreateInstanceResponse]: + """create_instance - Delete alert receiver for route. + Create new instance. - :param instance_id: (required) - :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3239,10 +3355,9 @@ def delete_alert_config_route_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_config_route_serialize( - instance_id=instance_id, + _param = self._create_instance_serialize( project_id=project_id, - receiver=receiver, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3250,9 +3365,9 @@ def delete_alert_config_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", + "202": "CreateInstanceResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3262,11 +3377,10 @@ def delete_alert_config_route_with_http_info( ) @validate_call - def delete_alert_config_route_without_preload_content( + def create_instance_without_preload_content( self, - instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3277,16 +3391,14 @@ def delete_alert_config_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alert_config_route + """create_instance - Delete alert receiver for route. + Create new instance. - :param instance_id: (required) - :type instance_id: str :param project_id: (required) :type project_id: str - :param receiver: (required) - :type receiver: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3309,10 +3421,9 @@ def delete_alert_config_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_config_route_serialize( - instance_id=instance_id, + _param = self._create_instance_serialize( project_id=project_id, - receiver=receiver, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3320,18 +3431,17 @@ def delete_alert_config_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigRouteResponse", + "202": "CreateInstanceResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alert_config_route_serialize( + def _create_instance_serialize( self, - instance_id, project_id, - receiver, + create_instance_payload, _request_auth, _content_type, _headers, @@ -3350,27 +3460,33 @@ def _delete_alert_config_route_serialize( _body_params: Optional[bytes] = None # process the path parameters - if instance_id is not None: - _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if receiver is not None: - _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_instance_payload is not None: + _body_params = create_instance_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", + method="POST", + resource_path="/v1/projects/{projectId}/instances", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3384,11 +3500,11 @@ def _delete_alert_config_route_serialize( ) @validate_call - def delete_alertgroup( + def create_logs_alertgroups( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3399,16 +3515,16 @@ def delete_alertgroup( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> AlertGroupsResponse: - """delete_alertgroup + """create_logs_alertgroups - Delete alert group config. + Create 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 create_logs_alertgroups_payload: (required) + :type create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload :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 @@ -3431,10 +3547,10 @@ def delete_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertgroup_serialize( - group_name=group_name, + _param = self._create_logs_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + create_logs_alertgroups_payload=create_logs_alertgroups_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3443,9 +3559,8 @@ def delete_alertgroup( _response_types_map: Dict[str, Optional[str]] = { "202": "AlertGroupsResponse", - "400": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3455,11 +3570,11 @@ def delete_alertgroup( ).data @validate_call - def delete_alertgroup_with_http_info( + def create_logs_alertgroups_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3470,16 +3585,16 @@ def delete_alertgroup_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[AlertGroupsResponse]: - """delete_alertgroup + """create_logs_alertgroups - Delete alert group config. + Create 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 create_logs_alertgroups_payload: (required) + :type create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload :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 @@ -3502,10 +3617,10 @@ def delete_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertgroup_serialize( - group_name=group_name, + _param = self._create_logs_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + create_logs_alertgroups_payload=create_logs_alertgroups_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3514,9 +3629,8 @@ def delete_alertgroup_with_http_info( _response_types_map: Dict[str, Optional[str]] = { "202": "AlertGroupsResponse", - "400": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3526,11 +3640,11 @@ def delete_alertgroup_with_http_info( ) @validate_call - def delete_alertgroup_without_preload_content( + def create_logs_alertgroups_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3541,16 +3655,16 @@ def delete_alertgroup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alertgroup + """create_logs_alertgroups - Delete alert group config. + Create 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 create_logs_alertgroups_payload: (required) + :type create_logs_alertgroups_payload: CreateLogsAlertgroupsPayload :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 @@ -3573,10 +3687,10 @@ def delete_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertgroup_serialize( - group_name=group_name, + _param = self._create_logs_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + create_logs_alertgroups_payload=create_logs_alertgroups_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3585,18 +3699,17 @@ def delete_alertgroup_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { "202": "AlertGroupsResponse", - "400": "Message", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alertgroup_serialize( + def _create_logs_alertgroups_serialize( self, - group_name, instance_id, project_id, + create_logs_alertgroups_payload, _request_auth, _content_type, _headers, @@ -3615,8 +3728,6 @@ def _delete_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: @@ -3625,17 +3736,27 @@ def _delete_alertgroup_serialize( # process the header parameters # process the form parameters # process the body parameter + if create_logs_alertgroups_payload is not None: + _body_params = create_logs_alertgroups_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3649,11 +3770,11 @@ def _delete_alertgroup_serialize( ) @validate_call - def delete_alertgroups( + def create_mongodb_check( self, instance_id: StrictStr, project_id: StrictStr, - group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], + create_mongodb_check_payload: CreateMongodbCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3663,17 +3784,17 @@ def delete_alertgroups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """delete_alertgroups + ) -> MongodbCheckResponse: + """create_mongodb_check - Delete alert groups. + Create mongodb check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param group_name: Name of the groups that should be deleted (required) - :type group_name: List[str] + :param create_mongodb_check_payload: (required) + :type create_mongodb_check_payload: CreateMongodbCheckPayload :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 @@ -3696,10 +3817,10 @@ def delete_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertgroups_serialize( + _param = self._create_mongodb_check_serialize( instance_id=instance_id, project_id=project_id, - group_name=group_name, + create_mongodb_check_payload=create_mongodb_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3707,7 +3828,8 @@ def delete_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "200": "MongodbCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3718,11 +3840,11 @@ def delete_alertgroups( ).data @validate_call - def delete_alertgroups_with_http_info( + def create_mongodb_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], + create_mongodb_check_payload: CreateMongodbCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3732,17 +3854,17 @@ def delete_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]: - """delete_alertgroups + ) -> ApiResponse[MongodbCheckResponse]: + """create_mongodb_check - Delete alert groups. + Create mongodb check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param group_name: Name of the groups that should be deleted (required) - :type group_name: List[str] + :param create_mongodb_check_payload: (required) + :type create_mongodb_check_payload: CreateMongodbCheckPayload :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 @@ -3765,10 +3887,10 @@ def delete_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertgroups_serialize( + _param = self._create_mongodb_check_serialize( instance_id=instance_id, project_id=project_id, - group_name=group_name, + create_mongodb_check_payload=create_mongodb_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3776,7 +3898,8 @@ def delete_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "200": "MongodbCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3787,11 +3910,11 @@ def delete_alertgroups_with_http_info( ) @validate_call - def delete_alertgroups_without_preload_content( + def create_mongodb_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], + create_mongodb_check_payload: CreateMongodbCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3802,16 +3925,16 @@ def delete_alertgroups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alertgroups + """create_mongodb_check - Delete alert groups. + Create mongodb check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param group_name: Name of the groups that should be deleted (required) - :type group_name: List[str] + :param create_mongodb_check_payload: (required) + :type create_mongodb_check_payload: CreateMongodbCheckPayload :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 @@ -3834,10 +3957,10 @@ def delete_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertgroups_serialize( + _param = self._create_mongodb_check_serialize( instance_id=instance_id, project_id=project_id, - group_name=group_name, + create_mongodb_check_payload=create_mongodb_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3845,17 +3968,18 @@ def delete_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "200": "MongodbCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alertgroups_serialize( + def _create_mongodb_check_serialize( self, instance_id, project_id, - group_name, + create_mongodb_check_payload, _request_auth, _content_type, _headers, @@ -3864,9 +3988,7 @@ def _delete_alertgroups_serialize( _host = None - _collection_formats: Dict[str, str] = { - "groupName": "csv", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -3881,24 +4003,30 @@ def _delete_alertgroups_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters - if group_name is not None: - - _query_params.append(("groupName", group_name)) - # process the header parameters # process the form parameters # process the body parameter + if create_mongodb_check_payload is not None: + _body_params = create_mongodb_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/mongodb-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3912,12 +4040,11 @@ def _delete_alertgroups_serialize( ) @validate_call - def delete_alertrules( + def create_mysql_check( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], + create_mysql_check_payload: CreateMysqlCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3927,19 +4054,17 @@ def delete_alertrules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertRulesResponse: - """delete_alertrules + ) -> MysqlCheckResponse: + """create_mysql_check - Delete alert rules. + Create mysql check. - :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 alert_name: Name of the alert rules that should be deleted (required) - :type alert_name: List[str] + :param create_mysql_check_payload: (required) + :type create_mysql_check_payload: CreateMysqlCheckPayload :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 @@ -3962,11 +4087,10 @@ def delete_alertrules( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertrules_serialize( - group_name=group_name, + _param = self._create_mysql_check_serialize( instance_id=instance_id, project_id=project_id, - alert_name=alert_name, + create_mysql_check_payload=create_mysql_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3974,7 +4098,8 @@ def delete_alertrules( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", + "200": "MysqlCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3985,12 +4110,11 @@ def delete_alertrules( ).data @validate_call - def delete_alertrules_with_http_info( + def create_mysql_check_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], + create_mysql_check_payload: CreateMysqlCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4000,19 +4124,17 @@ def delete_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]: - """delete_alertrules + ) -> ApiResponse[MysqlCheckResponse]: + """create_mysql_check - Delete alert rules. + Create mysql check. - :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 alert_name: Name of the alert rules that should be deleted (required) - :type alert_name: List[str] + :param create_mysql_check_payload: (required) + :type create_mysql_check_payload: CreateMysqlCheckPayload :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 @@ -4035,11 +4157,10 @@ def delete_alertrules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertrules_serialize( - group_name=group_name, + _param = self._create_mysql_check_serialize( instance_id=instance_id, project_id=project_id, - alert_name=alert_name, + create_mysql_check_payload=create_mysql_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4047,7 +4168,8 @@ def delete_alertrules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", + "200": "MysqlCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4058,12 +4180,11 @@ def delete_alertrules_with_http_info( ) @validate_call - def delete_alertrules_without_preload_content( + def create_mysql_check_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], + create_mysql_check_payload: CreateMysqlCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4074,18 +4195,16 @@ def delete_alertrules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alertrules + """create_mysql_check - Delete alert rules. + Create mysql check. - :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 alert_name: Name of the alert rules that should be deleted (required) - :type alert_name: List[str] + :param create_mysql_check_payload: (required) + :type create_mysql_check_payload: CreateMysqlCheckPayload :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 @@ -4108,11 +4227,10 @@ def delete_alertrules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alertrules_serialize( - group_name=group_name, + _param = self._create_mysql_check_serialize( instance_id=instance_id, project_id=project_id, - alert_name=alert_name, + create_mysql_check_payload=create_mysql_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4120,18 +4238,18 @@ def delete_alertrules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", + "200": "MysqlCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_alertrules_serialize( + def _create_mysql_check_serialize( self, - group_name, instance_id, project_id, - alert_name, + create_mysql_check_payload, _request_auth, _content_type, _headers, @@ -4140,9 +4258,7 @@ def _delete_alertrules_serialize( _host = None - _collection_formats: Dict[str, str] = { - "alertName": "csv", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -4152,31 +4268,35 @@ def _delete_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: _path_params["projectId"] = project_id # process the query parameters - if alert_name is not None: - - _query_params.append(("alertName", alert_name)) - # process the header parameters # process the form parameters # process the body parameter + if create_mysql_check_payload is not None: + _body_params = create_mysql_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/mysql-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4190,11 +4310,11 @@ def _delete_alertrules_serialize( ) @validate_call - def delete_cert_check( + def create_network_check( self, instance_id: StrictStr, project_id: StrictStr, - id: StrictStr, + create_network_check_payload: CreateNetworkCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4204,17 +4324,17 @@ def delete_cert_check( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CertCheckResponse: - """delete_cert_check + ) -> NetworkCheckResponse: + """create_network_check - Delete cert check. + Create network check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param id: (required) - :type id: str + :param create_network_check_payload: (required) + :type create_network_check_payload: CreateNetworkCheckPayload :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 @@ -4237,10 +4357,10 @@ def delete_cert_check( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_cert_check_serialize( + _param = self._create_network_check_serialize( instance_id=instance_id, project_id=project_id, - id=id, + create_network_check_payload=create_network_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4248,8 +4368,8 @@ def delete_cert_check( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", - "400": "List[str]", + "200": "NetworkCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4260,11 +4380,11 @@ def delete_cert_check( ).data @validate_call - def delete_cert_check_with_http_info( + def create_network_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - id: StrictStr, + create_network_check_payload: CreateNetworkCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4274,17 +4394,17 @@ def delete_cert_check_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[CertCheckResponse]: - """delete_cert_check + ) -> ApiResponse[NetworkCheckResponse]: + """create_network_check - Delete cert check. + Create network check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param id: (required) - :type id: str + :param create_network_check_payload: (required) + :type create_network_check_payload: CreateNetworkCheckPayload :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 @@ -4307,10 +4427,10 @@ def delete_cert_check_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_cert_check_serialize( + _param = self._create_network_check_serialize( instance_id=instance_id, project_id=project_id, - id=id, + create_network_check_payload=create_network_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4318,8 +4438,8 @@ def delete_cert_check_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", - "400": "List[str]", + "200": "NetworkCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -4330,11 +4450,11 @@ def delete_cert_check_with_http_info( ) @validate_call - def delete_cert_check_without_preload_content( + def create_network_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - id: StrictStr, + create_network_check_payload: CreateNetworkCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4345,16 +4465,16 @@ def delete_cert_check_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_cert_check + """create_network_check - Delete cert check. + Create network check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param id: (required) - :type id: str + :param create_network_check_payload: (required) + :type create_network_check_payload: CreateNetworkCheckPayload :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 @@ -4377,10 +4497,10 @@ def delete_cert_check_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_cert_check_serialize( + _param = self._create_network_check_serialize( instance_id=instance_id, project_id=project_id, - id=id, + create_network_check_payload=create_network_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4388,18 +4508,18 @@ def delete_cert_check_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", - "400": "List[str]", + "200": "NetworkCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_cert_check_serialize( + def _create_network_check_serialize( self, instance_id, project_id, - id, + create_network_check_payload, _request_auth, _content_type, _headers, @@ -4422,23 +4542,31 @@ def _delete_cert_check_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if id is not None: - _path_params["id"] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_network_check_payload is not None: + _body_params = create_network_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/cert-checks/{id}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/network-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4452,11 +4580,11 @@ def _delete_cert_check_serialize( ) @validate_call - def delete_credentials( + def create_ping_check( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + create_ping_check_payload: CreatePingCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4466,17 +4594,17 @@ def delete_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Message: - """delete_credentials + ) -> PingCheckResponse: + """create_ping_check - Delete technical credentials. + Create ping check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param create_ping_check_payload: (required) + :type create_ping_check_payload: CreatePingCheckPayload :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 @@ -4499,10 +4627,10 @@ def delete_credentials( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_serialize( + _param = self._create_ping_check_serialize( instance_id=instance_id, project_id=project_id, - username=username, + create_ping_check_payload=create_ping_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4510,10 +4638,9 @@ def delete_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Message", + "200": "PingCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", - "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4523,11 +4650,11 @@ def delete_credentials( ).data @validate_call - def delete_credentials_with_http_info( + def create_ping_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + create_ping_check_payload: CreatePingCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4537,17 +4664,17 @@ def delete_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Message]: - """delete_credentials + ) -> ApiResponse[PingCheckResponse]: + """create_ping_check - Delete technical credentials. + Create ping check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param create_ping_check_payload: (required) + :type create_ping_check_payload: CreatePingCheckPayload :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 @@ -4570,10 +4697,10 @@ def delete_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_serialize( + _param = self._create_ping_check_serialize( instance_id=instance_id, project_id=project_id, - username=username, + create_ping_check_payload=create_ping_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4581,10 +4708,9 @@ def delete_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Message", + "200": "PingCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", - "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4594,11 +4720,11 @@ def delete_credentials_with_http_info( ) @validate_call - def delete_credentials_without_preload_content( + def create_ping_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + create_ping_check_payload: CreatePingCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4609,16 +4735,16 @@ def delete_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_credentials + """create_ping_check - Delete technical credentials. + Create ping check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param create_ping_check_payload: (required) + :type create_ping_check_payload: CreatePingCheckPayload :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 @@ -4641,10 +4767,10 @@ def delete_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_serialize( + _param = self._create_ping_check_serialize( instance_id=instance_id, project_id=project_id, - username=username, + create_ping_check_payload=create_ping_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4652,19 +4778,18 @@ def delete_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Message", + "200": "PingCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", - "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_credentials_serialize( + def _create_ping_check_serialize( self, instance_id, project_id, - username, + create_ping_check_payload, _request_auth, _content_type, _headers, @@ -4687,23 +4812,31 @@ def _delete_credentials_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if username is not None: - _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_ping_check_payload is not None: + _body_params = create_ping_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/ping-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4717,11 +4850,11 @@ def _delete_credentials_serialize( ) @validate_call - def delete_credentials_remote_write_config( + def create_postgresql_check( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + create_postgresql_check_payload: CreatePostgresqlCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4731,17 +4864,17 @@ def delete_credentials_remote_write_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CredentialsRemoteWriteDeleteResponse: - """delete_credentials_remote_write_config + ) -> PostgresqlCheckResponse: + """create_postgresql_check - Delete remote write config for credentials. + Create postgresql check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param create_postgresql_check_payload: (required) + :type create_postgresql_check_payload: CreatePostgresqlCheckPayload :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 @@ -4764,10 +4897,10 @@ def delete_credentials_remote_write_config( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_remote_write_config_serialize( + _param = self._create_postgresql_check_serialize( instance_id=instance_id, project_id=project_id, - username=username, + create_postgresql_check_payload=create_postgresql_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4775,11 +4908,9 @@ def delete_credentials_remote_write_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteDeleteResponse", - "400": "Error", + "200": "PostgresqlCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4789,11 +4920,11 @@ def delete_credentials_remote_write_config( ).data @validate_call - def delete_credentials_remote_write_config_with_http_info( + def create_postgresql_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + create_postgresql_check_payload: CreatePostgresqlCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4803,17 +4934,17 @@ def delete_credentials_remote_write_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CredentialsRemoteWriteDeleteResponse]: - """delete_credentials_remote_write_config + ) -> ApiResponse[PostgresqlCheckResponse]: + """create_postgresql_check - Delete remote write config for credentials. + Create postgresql check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param create_postgresql_check_payload: (required) + :type create_postgresql_check_payload: CreatePostgresqlCheckPayload :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 @@ -4836,10 +4967,10 @@ def delete_credentials_remote_write_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_remote_write_config_serialize( + _param = self._create_postgresql_check_serialize( instance_id=instance_id, project_id=project_id, - username=username, + create_postgresql_check_payload=create_postgresql_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4847,11 +4978,9 @@ def delete_credentials_remote_write_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteDeleteResponse", - "400": "Error", + "200": "PostgresqlCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4861,11 +4990,11 @@ def delete_credentials_remote_write_config_with_http_info( ) @validate_call - def delete_credentials_remote_write_config_without_preload_content( + def create_postgresql_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + create_postgresql_check_payload: CreatePostgresqlCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4876,16 +5005,16 @@ def delete_credentials_remote_write_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_credentials_remote_write_config + """create_postgresql_check - Delete remote write config for credentials. + Create postgresql check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param username: (required) - :type username: str + :param create_postgresql_check_payload: (required) + :type create_postgresql_check_payload: CreatePostgresqlCheckPayload :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 @@ -4908,10 +5037,10 @@ def delete_credentials_remote_write_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_remote_write_config_serialize( + _param = self._create_postgresql_check_serialize( instance_id=instance_id, project_id=project_id, - username=username, + create_postgresql_check_payload=create_postgresql_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4919,20 +5048,18 @@ def delete_credentials_remote_write_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteDeleteResponse", - "400": "Error", + "200": "PostgresqlCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", - "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_credentials_remote_write_config_serialize( + def _create_postgresql_check_serialize( self, instance_id, project_id, - username, + create_postgresql_check_payload, _request_auth, _content_type, _headers, @@ -4955,23 +5082,31 @@ def _delete_credentials_remote_write_config_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if username is not None: - _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_postgresql_check_payload is not None: + _body_params = create_postgresql_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/postgresql-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4985,11 +5120,11 @@ def _delete_credentials_remote_write_config_serialize( ) @validate_call - def delete_http_check( + def create_rabbitmq_check( self, instance_id: StrictStr, project_id: StrictStr, - id: StrictStr, + create_rabbitmq_check_payload: CreateRabbitmqCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4999,17 +5134,17 @@ def delete_http_check( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> HttpCheckResponse: - """delete_http_check + ) -> RabbitmqCheckResponse: + """create_rabbitmq_check - Delete http check. + Create rabbitmq check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param id: (required) - :type id: str + :param create_rabbitmq_check_payload: (required) + :type create_rabbitmq_check_payload: CreateRabbitmqCheckPayload :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 @@ -5032,10 +5167,10 @@ def delete_http_check( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_http_check_serialize( + _param = self._create_rabbitmq_check_serialize( instance_id=instance_id, project_id=project_id, - id=id, + create_rabbitmq_check_payload=create_rabbitmq_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5043,8 +5178,8 @@ def delete_http_check( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", - "400": "List[str]", + "200": "RabbitmqCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5055,11 +5190,11 @@ def delete_http_check( ).data @validate_call - def delete_http_check_with_http_info( + def create_rabbitmq_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, - id: StrictStr, + create_rabbitmq_check_payload: CreateRabbitmqCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5069,17 +5204,17 @@ def delete_http_check_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[HttpCheckResponse]: - """delete_http_check + ) -> ApiResponse[RabbitmqCheckResponse]: + """create_rabbitmq_check - Delete http check. + Create rabbitmq check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param id: (required) - :type id: str + :param create_rabbitmq_check_payload: (required) + :type create_rabbitmq_check_payload: CreateRabbitmqCheckPayload :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 @@ -5102,10 +5237,10 @@ def delete_http_check_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_http_check_serialize( + _param = self._create_rabbitmq_check_serialize( instance_id=instance_id, project_id=project_id, - id=id, + create_rabbitmq_check_payload=create_rabbitmq_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5113,8 +5248,8 @@ def delete_http_check_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", - "400": "List[str]", + "200": "RabbitmqCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5125,11 +5260,11 @@ def delete_http_check_with_http_info( ) @validate_call - def delete_http_check_without_preload_content( + def create_rabbitmq_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, - id: StrictStr, + create_rabbitmq_check_payload: CreateRabbitmqCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5140,16 +5275,16 @@ def delete_http_check_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_http_check + """create_rabbitmq_check - Delete http check. + Create rabbitmq check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param id: (required) - :type id: str + :param create_rabbitmq_check_payload: (required) + :type create_rabbitmq_check_payload: CreateRabbitmqCheckPayload :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 @@ -5172,10 +5307,10 @@ def delete_http_check_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_http_check_serialize( + _param = self._create_rabbitmq_check_serialize( instance_id=instance_id, project_id=project_id, - id=id, + create_rabbitmq_check_payload=create_rabbitmq_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5183,18 +5318,18 @@ def delete_http_check_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", - "400": "List[str]", + "200": "RabbitmqCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_http_check_serialize( + def _create_rabbitmq_check_serialize( self, instance_id, project_id, - id, + create_rabbitmq_check_payload, _request_auth, _content_type, _headers, @@ -5217,23 +5352,31 @@ def _delete_http_check_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id - if id is not None: - _path_params["id"] = id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_rabbitmq_check_payload is not None: + _body_params = create_rabbitmq_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - # authentication setting - _auth_settings: List[str] = [] + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/http-checks/{id}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/rabbitmq-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5247,10 +5390,11 @@ def _delete_http_check_serialize( ) @validate_call - def delete_instance( + def create_redis_check( self, instance_id: StrictStr, project_id: StrictStr, + create_redis_check_payload: CreateRedisCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5260,15 +5404,17 @@ def delete_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> InstanceResponse: - """delete_instance + ) -> RedisCheckResponse: + """create_redis_check - Delete instance. + Create redis check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param create_redis_check_payload: (required) + :type create_redis_check_payload: CreateRedisCheckPayload :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 @@ -5291,9 +5437,10 @@ def delete_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._create_redis_check_serialize( instance_id=instance_id, project_id=project_id, + create_redis_check_payload=create_redis_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5301,7 +5448,8 @@ def delete_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "200": "RedisCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5312,10 +5460,11 @@ def delete_instance( ).data @validate_call - def delete_instance_with_http_info( + def create_redis_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + create_redis_check_payload: CreateRedisCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5325,15 +5474,17 @@ def delete_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[InstanceResponse]: - """delete_instance + ) -> ApiResponse[RedisCheckResponse]: + """create_redis_check - Delete instance. + Create redis check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param create_redis_check_payload: (required) + :type create_redis_check_payload: CreateRedisCheckPayload :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 @@ -5356,9 +5507,10 @@ def delete_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._create_redis_check_serialize( instance_id=instance_id, project_id=project_id, + create_redis_check_payload=create_redis_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5366,7 +5518,8 @@ def delete_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "200": "RedisCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -5377,10 +5530,11 @@ def delete_instance_with_http_info( ) @validate_call - def delete_instance_without_preload_content( + def create_redis_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + create_redis_check_payload: CreateRedisCheckPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5391,14 +5545,16 @@ def delete_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_instance + """create_redis_check - Delete instance. + Create redis check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param create_redis_check_payload: (required) + :type create_redis_check_payload: CreateRedisCheckPayload :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 @@ -5421,9 +5577,10 @@ def delete_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._create_redis_check_serialize( instance_id=instance_id, project_id=project_id, + create_redis_check_payload=create_redis_check_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5431,16 +5588,18 @@ def delete_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "InstanceResponse", + "200": "RedisCheckResponse", + "400": "CreateCertCheck400Response", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_instance_serialize( + def _create_redis_check_serialize( self, instance_id, project_id, + create_redis_check_payload, _request_auth, _content_type, _headers, @@ -5467,17 +5626,27 @@ def _delete_instance_serialize( # process the header parameters # process the form parameters # process the body parameter + if create_redis_check_payload is not None: + _body_params = create_redis_check_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/redis-checks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5491,11 +5660,11 @@ def _delete_instance_serialize( ) @validate_call - def delete_logs_alertgroup( + def create_scrape_config( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5505,17 +5674,17 @@ def delete_logs_alertgroup( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupsResponse: - """delete_logs_alertgroup + ) -> ScrapeConfigsResponse: + """create_scrape_config - Delete logs alert group config. + Create scrape 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 create_scrape_config_payload: (required) + :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5538,10 +5707,10 @@ def delete_logs_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_logs_alertgroup_serialize( - group_name=group_name, + _param = self._create_scrape_config_serialize( instance_id=instance_id, project_id=project_id, + create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5549,10 +5718,9 @@ def delete_logs_alertgroup( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "ScrapeConfigsResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5562,11 +5730,11 @@ def delete_logs_alertgroup( ).data @validate_call - def delete_logs_alertgroup_with_http_info( + def create_scrape_config_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5576,17 +5744,17 @@ def delete_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]: - """delete_logs_alertgroup + ) -> ApiResponse[ScrapeConfigsResponse]: + """create_scrape_config - Delete logs alert group config. + Create scrape 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 create_scrape_config_payload: (required) + :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5609,10 +5777,10 @@ def delete_logs_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_logs_alertgroup_serialize( - group_name=group_name, + _param = self._create_scrape_config_serialize( instance_id=instance_id, project_id=project_id, + create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5620,10 +5788,9 @@ def delete_logs_alertgroup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "ScrapeConfigsResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -5633,11 +5800,11 @@ def delete_logs_alertgroup_with_http_info( ) @validate_call - def delete_logs_alertgroup_without_preload_content( + def create_scrape_config_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + create_scrape_config_payload: CreateScrapeConfigPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5648,16 +5815,16 @@ def delete_logs_alertgroup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_logs_alertgroup + """create_scrape_config - Delete logs alert group config. + Create scrape 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 create_scrape_config_payload: (required) + :type create_scrape_config_payload: CreateScrapeConfigPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5680,10 +5847,10 @@ def delete_logs_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_logs_alertgroup_serialize( - group_name=group_name, + _param = self._create_scrape_config_serialize( instance_id=instance_id, project_id=project_id, + create_scrape_config_payload=create_scrape_config_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5691,19 +5858,18 @@ def delete_logs_alertgroup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "ScrapeConfigsResponse", + "400": "Error", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_logs_alertgroup_serialize( + def _create_scrape_config_serialize( self, - group_name, instance_id, project_id, + create_scrape_config_payload, _request_auth, _content_type, _headers, @@ -5722,8 +5888,6 @@ def _delete_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: @@ -5732,17 +5896,27 @@ def _delete_logs_alertgroup_serialize( # process the header parameters # process the form parameters # process the body parameter + if create_scrape_config_payload is not None: + _body_params = create_scrape_config_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}", + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5756,11 +5930,11 @@ def _delete_logs_alertgroup_serialize( ) @validate_call - def delete_scrape_config( + def delete_alert_config_receiver( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5770,17 +5944,17 @@ def delete_scrape_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeleteScrapeConfigResponse: - """delete_scrape_config + ) -> AlertConfigReceiversResponse: + """delete_alert_config_receiver - Delete scrape config. + Delete alert config receiver. :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 receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5803,10 +5977,10 @@ def delete_scrape_config( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_scrape_config_serialize( + _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5814,7 +5988,7 @@ def delete_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "DeleteScrapeConfigResponse", + "202": "AlertConfigReceiversResponse", "403": "PermissionDenied", "404": "Message", } @@ -5826,11 +6000,11 @@ def delete_scrape_config( ).data @validate_call - def delete_scrape_config_with_http_info( + def delete_alert_config_receiver_with_http_info( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5840,17 +6014,17 @@ def delete_scrape_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DeleteScrapeConfigResponse]: - """delete_scrape_config + ) -> ApiResponse[AlertConfigReceiversResponse]: + """delete_alert_config_receiver - Delete scrape config. + Delete alert config receiver. :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 receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5873,10 +6047,10 @@ def delete_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_scrape_config_serialize( + _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5884,7 +6058,7 @@ def delete_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "DeleteScrapeConfigResponse", + "202": "AlertConfigReceiversResponse", "403": "PermissionDenied", "404": "Message", } @@ -5896,11 +6070,11 @@ def delete_scrape_config_with_http_info( ) @validate_call - def delete_scrape_config_without_preload_content( + def delete_alert_config_receiver_without_preload_content( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5911,16 +6085,16 @@ def delete_scrape_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_scrape_config + """delete_alert_config_receiver - Delete scrape config. + Delete alert config receiver. :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 receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5943,10 +6117,10 @@ def delete_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_scrape_config_serialize( + _param = self._delete_alert_config_receiver_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5954,18 +6128,18 @@ def delete_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "DeleteScrapeConfigResponse", + "202": "AlertConfigReceiversResponse", "403": "PermissionDenied", "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_scrape_config_serialize( + def _delete_alert_config_receiver_serialize( self, instance_id, - job_name, project_id, + receiver, _request_auth, _content_type, _headers, @@ -5986,10 +6160,10 @@ def _delete_scrape_config_serialize( # process the path parameters if instance_id is not None: _path_params["instanceId"] = instance_id - if job_name is not None: - _path_params["jobName"] = job_name if project_id is not None: _path_params["projectId"] = project_id + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters @@ -6004,7 +6178,7 @@ def _delete_scrape_config_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6018,7 +6192,7 @@ def _delete_scrape_config_serialize( ) @validate_call - def get_alert_config_receiver( + def delete_alert_config_route( self, instance_id: StrictStr, project_id: StrictStr, @@ -6032,10 +6206,10 @@ def get_alert_config_receiver( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Receiver: - """get_alert_config_receiver + ) -> AlertConfigRouteResponse: + """delete_alert_config_route - Get alert config receivers. + Delete alert receiver for route. :param instance_id: (required) :type instance_id: str @@ -6065,7 +6239,7 @@ def get_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_config_receiver_serialize( + _param = self._delete_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, receiver=receiver, @@ -6076,7 +6250,7 @@ def get_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Receiver", + "202": "AlertConfigRouteResponse", "403": "PermissionDenied", "404": "Message", } @@ -6088,7 +6262,7 @@ def get_alert_config_receiver( ).data @validate_call - def get_alert_config_receiver_with_http_info( + def delete_alert_config_route_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -6102,10 +6276,10 @@ def get_alert_config_receiver_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Receiver]: - """get_alert_config_receiver + ) -> ApiResponse[AlertConfigRouteResponse]: + """delete_alert_config_route - Get alert config receivers. + Delete alert receiver for route. :param instance_id: (required) :type instance_id: str @@ -6135,7 +6309,7 @@ def get_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_config_receiver_serialize( + _param = self._delete_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, receiver=receiver, @@ -6146,7 +6320,7 @@ def get_alert_config_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Receiver", + "202": "AlertConfigRouteResponse", "403": "PermissionDenied", "404": "Message", } @@ -6158,7 +6332,7 @@ def get_alert_config_receiver_with_http_info( ) @validate_call - def get_alert_config_receiver_without_preload_content( + def delete_alert_config_route_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -6173,9 +6347,9 @@ def get_alert_config_receiver_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alert_config_receiver + """delete_alert_config_route - Get alert config receivers. + Delete alert receiver for route. :param instance_id: (required) :type instance_id: str @@ -6205,7 +6379,7 @@ def get_alert_config_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_config_receiver_serialize( + _param = self._delete_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, receiver=receiver, @@ -6216,14 +6390,14 @@ def get_alert_config_receiver_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Receiver", + "202": "AlertConfigRouteResponse", "403": "PermissionDenied", "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_alert_config_receiver_serialize( + def _delete_alert_config_route_serialize( self, instance_id, project_id, @@ -6265,8 +6439,8 @@ def _get_alert_config_receiver_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6280,11 +6454,11 @@ def _get_alert_config_receiver_serialize( ) @validate_call - def get_alert_config_route( + def delete_alertgroup( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6294,17 +6468,17 @@ def get_alert_config_route( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertConfigRouteResponse: - """get_alert_config_route + ) -> AlertGroupsResponse: + """delete_alertgroup - Get alert receiver for route. + Delete 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 _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 @@ -6327,10 +6501,10 @@ def get_alert_config_route( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_config_route_serialize( - instance_id=instance_id, + _param = self._delete_alertgroup_serialize( + group_name=group_name, + instance_id=instance_id, project_id=project_id, - receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6338,8 +6512,10 @@ def get_alert_config_route( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6349,11 +6525,11 @@ def get_alert_config_route( ).data @validate_call - def get_alert_config_route_with_http_info( + def delete_alertgroup_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6363,17 +6539,17 @@ def get_alert_config_route_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AlertConfigRouteResponse]: - """get_alert_config_route + ) -> ApiResponse[AlertGroupsResponse]: + """delete_alertgroup - Get alert receiver for route. + Delete 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 _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 @@ -6396,10 +6572,10 @@ def get_alert_config_route_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_config_route_serialize( + _param = self._delete_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6407,8 +6583,10 @@ def get_alert_config_route_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -6418,11 +6596,11 @@ def get_alert_config_route_with_http_info( ) @validate_call - def get_alert_config_route_without_preload_content( + def delete_alertgroup_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6433,16 +6611,16 @@ def get_alert_config_route_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alert_config_route + """delete_alertgroup - Get alert receiver for route. + Delete 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 _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 @@ -6465,10 +6643,10 @@ def get_alert_config_route_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_config_route_serialize( + _param = self._delete_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6476,17 +6654,19 @@ def get_alert_config_route_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "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 _get_alert_config_route_serialize( + def _delete_alertgroup_serialize( self, + group_name, instance_id, project_id, - receiver, _request_auth, _content_type, _headers, @@ -6505,12 +6685,12 @@ def _get_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 @@ -6524,8 +6704,8 @@ def _get_alert_config_route_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes/{receiver}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6539,10 +6719,11 @@ def _get_alert_config_route_serialize( ) @validate_call - def get_alert_configs( + def delete_alertgroups( self, instance_id: StrictStr, project_id: StrictStr, + group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6552,15 +6733,17 @@ def get_alert_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetAlertConfigsResponse: - """get_alert_configs + ) -> AlertGroupsResponse: + """delete_alertgroups - Get alert config. + Delete alert groups. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param group_name: Name of the groups that should be deleted (required) + :type group_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6583,9 +6766,10 @@ def get_alert_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_configs_serialize( + _param = self._delete_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + group_name=group_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6593,7 +6777,7 @@ def get_alert_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAlertConfigsResponse", + "202": "AlertGroupsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6604,10 +6788,11 @@ def get_alert_configs( ).data @validate_call - def get_alert_configs_with_http_info( + def delete_alertgroups_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6617,15 +6802,17 @@ def get_alert_configs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetAlertConfigsResponse]: - """get_alert_configs + ) -> ApiResponse[AlertGroupsResponse]: + """delete_alertgroups - Get alert config. + Delete alert groups. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param group_name: Name of the groups that should be deleted (required) + :type group_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6648,9 +6835,10 @@ def get_alert_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_configs_serialize( + _param = self._delete_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + group_name=group_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6658,7 +6846,7 @@ def get_alert_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAlertConfigsResponse", + "202": "AlertGroupsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -6669,10 +6857,11 @@ def get_alert_configs_with_http_info( ) @validate_call - def get_alert_configs_without_preload_content( + def delete_alertgroups_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + group_name: Annotated[List[StrictStr], Field(description="Name of the groups that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6683,14 +6872,16 @@ def get_alert_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alert_configs + """delete_alertgroups - Get alert config. + Delete alert groups. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param group_name: Name of the groups that should be deleted (required) + :type group_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6713,9 +6904,10 @@ def get_alert_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alert_configs_serialize( + _param = self._delete_alertgroups_serialize( instance_id=instance_id, project_id=project_id, + group_name=group_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6723,16 +6915,17 @@ def get_alert_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetAlertConfigsResponse", + "202": "AlertGroupsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_alert_configs_serialize( + def _delete_alertgroups_serialize( self, instance_id, project_id, + group_name, _request_auth, _content_type, _headers, @@ -6741,7 +6934,9 @@ def _get_alert_configs_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "groupName": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -6756,6 +6951,10 @@ def _get_alert_configs_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if group_name is not None: + + _query_params.append(("groupName", group_name)) + # process the header parameters # process the form parameters # process the body parameter @@ -6768,8 +6967,8 @@ def _get_alert_configs_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6783,8 +6982,9 @@ def _get_alert_configs_serialize( ) @validate_call - def get_alertgroup( + def delete_alertrecord( self, + alert_record: StrictStr, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, @@ -6797,11 +6997,13 @@ def get_alertgroup( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupResponse: - """get_alertgroup + ) -> AlertRecordsResponse: + """delete_alertrecord - Get alert group. + Delete alert record. + :param alert_record: (required) + :type alert_record: str :param group_name: (required) :type group_name: str :param instance_id: (required) @@ -6830,7 +7032,8 @@ def get_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alertgroup_serialize( + _param = self._delete_alertrecord_serialize( + alert_record=alert_record, group_name=group_name, instance_id=instance_id, project_id=project_id, @@ -6841,8 +7044,7 @@ def get_alertgroup( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupResponse", - "400": "Message", + "202": "AlertRecordsResponse", "403": "PermissionDenied", "404": "Message", } @@ -6854,8 +7056,9 @@ def get_alertgroup( ).data @validate_call - def get_alertgroup_with_http_info( + def delete_alertrecord_with_http_info( self, + alert_record: StrictStr, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, @@ -6868,11 +7071,13 @@ def get_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[AlertGroupResponse]: - """get_alertgroup + ) -> ApiResponse[AlertRecordsResponse]: + """delete_alertrecord - Get alert group. + Delete alert record. + :param alert_record: (required) + :type alert_record: str :param group_name: (required) :type group_name: str :param instance_id: (required) @@ -6901,7 +7106,8 @@ def get_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alertgroup_serialize( + _param = self._delete_alertrecord_serialize( + alert_record=alert_record, group_name=group_name, instance_id=instance_id, project_id=project_id, @@ -6912,8 +7118,7 @@ def get_alertgroup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupResponse", - "400": "Message", + "202": "AlertRecordsResponse", "403": "PermissionDenied", "404": "Message", } @@ -6925,8 +7130,9 @@ def get_alertgroup_with_http_info( ) @validate_call - def get_alertgroup_without_preload_content( + def delete_alertrecord_without_preload_content( self, + alert_record: StrictStr, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, @@ -6940,10 +7146,12 @@ def get_alertgroup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_alertgroup + """delete_alertrecord - Get alert group. + Delete alert record. + :param alert_record: (required) + :type alert_record: str :param group_name: (required) :type group_name: str :param instance_id: (required) @@ -6972,7 +7180,8 @@ def get_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_alertgroup_serialize( + _param = self._delete_alertrecord_serialize( + alert_record=alert_record, group_name=group_name, instance_id=instance_id, project_id=project_id, @@ -6983,16 +7192,16 @@ def get_alertgroup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupResponse", - "400": "Message", + "202": "AlertRecordsResponse", "403": "PermissionDenied", "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_alertgroup_serialize( + def _delete_alertrecord_serialize( self, + alert_record, group_name, instance_id, project_id, @@ -7014,6 +7223,8 @@ def _get_alertgroup_serialize( _body_params: Optional[bytes] = None # process the path parameters + if alert_record is not None: + _path_params["alertRecord"] = alert_record if group_name is not None: _path_params["groupName"] = group_name if instance_id is not None: @@ -7033,8 +7244,8 @@ def _get_alertgroup_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records/{alertRecord}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7048,11 +7259,12 @@ def _get_alertgroup_serialize( ) @validate_call - def get_credentials( + def delete_alertrecords( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + alert_record: Annotated[List[StrictStr], Field(description="Name of the records that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7062,17 +7274,19 @@ def get_credentials( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetCredentialsResponse: - """get_credentials + ) -> AlertRecordsResponse: + """delete_alertrecords - Get single technical credentials. + Delete alert records. + :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 username: (required) - :type username: str + :param alert_record: Name of the records that should be deleted (required) + :type alert_record: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7095,10 +7309,11 @@ def get_credentials( :return: Returns the result object. """ # noqa: E501 - _param = self._get_credentials_serialize( + _param = self._delete_alertrecords_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - username=username, + alert_record=alert_record, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7106,9 +7321,8 @@ def get_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialsResponse", + "202": "AlertRecordsResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7118,11 +7332,12 @@ def get_credentials( ).data @validate_call - def get_credentials_with_http_info( + def delete_alertrecords_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + alert_record: Annotated[List[StrictStr], Field(description="Name of the records that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7132,17 +7347,19 @@ def get_credentials_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetCredentialsResponse]: - """get_credentials + ) -> ApiResponse[AlertRecordsResponse]: + """delete_alertrecords - Get single technical credentials. + Delete alert records. + :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 username: (required) - :type username: str + :param alert_record: Name of the records that should be deleted (required) + :type alert_record: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7165,10 +7382,11 @@ def get_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_credentials_serialize( + _param = self._delete_alertrecords_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - username=username, + alert_record=alert_record, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7176,9 +7394,8 @@ def get_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialsResponse", + "202": "AlertRecordsResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7188,11 +7405,12 @@ def get_credentials_with_http_info( ) @validate_call - def get_credentials_without_preload_content( + def delete_alertrecords_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, + alert_record: Annotated[List[StrictStr], Field(description="Name of the records that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7203,16 +7421,18 @@ def get_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_credentials + """delete_alertrecords - Get single technical credentials. + Delete alert records. + :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 username: (required) - :type username: str + :param alert_record: Name of the records that should be deleted (required) + :type alert_record: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7235,10 +7455,11 @@ def get_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_credentials_serialize( + _param = self._delete_alertrecords_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, - username=username, + alert_record=alert_record, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7246,18 +7467,18 @@ def get_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetCredentialsResponse", + "202": "AlertRecordsResponse", "403": "PermissionDenied", - "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_credentials_serialize( + def _delete_alertrecords_serialize( self, + group_name, instance_id, project_id, - username, + alert_record, _request_auth, _content_type, _headers, @@ -7266,7 +7487,9 @@ def _get_credentials_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "alertRecord": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -7276,13 +7499,17 @@ def _get_credentials_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 + if alert_record is not None: + + _query_params.append(("alertRecord", alert_record)) + # process the header parameters # process the form parameters # process the body parameter @@ -7295,8 +7522,8 @@ def _get_credentials_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7310,11 +7537,12 @@ def _get_credentials_serialize( ) @validate_call - def get_credentials_remote_write_config( + def delete_alertrule( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7324,17 +7552,19 @@ def get_credentials_remote_write_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CredentialsRemoteWriteConfig: - """get_credentials_remote_write_config + ) -> AlertRulesResponse: + """delete_alertrule - Get remote write config. + Delete alert rule. + :param alert_name: (required) + :type alert_name: str + :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 username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7357,10 +7587,11 @@ def get_credentials_remote_write_config( :return: Returns the result object. """ # noqa: E501 - _param = self._get_credentials_remote_write_config_serialize( + _param = self._delete_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, instance_id=instance_id, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7368,10 +7599,10 @@ def get_credentials_remote_write_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "AlertRulesResponse", + "400": "Error", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7381,11 +7612,12 @@ def get_credentials_remote_write_config( ).data @validate_call - def get_credentials_remote_write_config_with_http_info( + def delete_alertrule_with_http_info( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7395,17 +7627,19 @@ def get_credentials_remote_write_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CredentialsRemoteWriteConfig]: - """get_credentials_remote_write_config + ) -> ApiResponse[AlertRulesResponse]: + """delete_alertrule - Get remote write config. + Delete alert rule. + :param alert_name: (required) + :type alert_name: str + :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 username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7428,10 +7662,11 @@ def get_credentials_remote_write_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_credentials_remote_write_config_serialize( + _param = self._delete_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, instance_id=instance_id, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7439,10 +7674,10 @@ def get_credentials_remote_write_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "AlertRulesResponse", + "400": "Error", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -7452,11 +7687,12 @@ def get_credentials_remote_write_config_with_http_info( ) @validate_call - def get_credentials_remote_write_config_without_preload_content( + def delete_alertrule_without_preload_content( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7467,16 +7703,18 @@ def get_credentials_remote_write_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_credentials_remote_write_config + """delete_alertrule - Get remote write config. + Delete alert rule. + :param alert_name: (required) + :type alert_name: str + :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 username: (required) - :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7499,10 +7737,11 @@ def get_credentials_remote_write_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_credentials_remote_write_config_serialize( + _param = self._delete_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, instance_id=instance_id, project_id=project_id, - username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7510,19 +7749,20 @@ def get_credentials_remote_write_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CredentialsRemoteWriteConfig", + "202": "AlertRulesResponse", + "400": "Error", "403": "PermissionDenied", "404": "Message", - "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_credentials_remote_write_config_serialize( + def _delete_alertrule_serialize( self, + alert_name, + group_name, instance_id, project_id, - username, _request_auth, _content_type, _headers, @@ -7541,12 +7781,14 @@ def _get_credentials_remote_write_config_serialize( _body_params: Optional[bytes] = None # process the path parameters + if alert_name is not None: + _path_params["alertName"] = alert_name + 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 @@ -7560,8 +7802,8 @@ def _get_credentials_remote_write_config_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules/{alertName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7575,10 +7817,12 @@ def _get_credentials_remote_write_config_serialize( ) @validate_call - def get_grafana_configs( + def delete_alertrules( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7588,15 +7832,19 @@ def get_grafana_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GrafanaConfigs: - """get_grafana_configs + ) -> AlertRulesResponse: + """delete_alertrules - Get grafana config. + Delete alert rules. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param alert_name: Name of the alert rules that should be deleted (required) + :type alert_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7619,9 +7867,11 @@ def get_grafana_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._get_grafana_configs_serialize( + _param = self._delete_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, + alert_name=alert_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7629,7 +7879,7 @@ def get_grafana_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GrafanaConfigs", + "202": "AlertRulesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7640,10 +7890,12 @@ def get_grafana_configs( ).data @validate_call - def get_grafana_configs_with_http_info( + def delete_alertrules_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7653,15 +7905,19 @@ def get_grafana_configs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GrafanaConfigs]: - """get_grafana_configs + ) -> ApiResponse[AlertRulesResponse]: + """delete_alertrules - Get grafana config. + Delete alert rules. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param alert_name: Name of the alert rules that should be deleted (required) + :type alert_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7684,9 +7940,11 @@ def get_grafana_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_grafana_configs_serialize( + _param = self._delete_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, + alert_name=alert_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7694,7 +7952,7 @@ def get_grafana_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GrafanaConfigs", + "202": "AlertRulesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7705,10 +7963,12 @@ def get_grafana_configs_with_http_info( ) @validate_call - def get_grafana_configs_without_preload_content( + def delete_alertrules_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + alert_name: Annotated[List[StrictStr], Field(description="Name of the alert rules that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7719,14 +7979,18 @@ def get_grafana_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_grafana_configs + """delete_alertrules - Get grafana config. + Delete alert rules. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param alert_name: Name of the alert rules that should be deleted (required) + :type alert_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7749,9 +8013,11 @@ def get_grafana_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_grafana_configs_serialize( + _param = self._delete_alertrules_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, + alert_name=alert_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7759,16 +8025,18 @@ def get_grafana_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GrafanaConfigs", + "202": "AlertRulesResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_grafana_configs_serialize( + def _delete_alertrules_serialize( self, + group_name, instance_id, project_id, + alert_name, _request_auth, _content_type, _headers, @@ -7777,7 +8045,9 @@ def _get_grafana_configs_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "alertName": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -7787,11 +8057,17 @@ def _get_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: _path_params["projectId"] = project_id # process the query parameters + if alert_name is not None: + + _query_params.append(("alertName", alert_name)) + # process the header parameters # process the form parameters # process the body parameter @@ -7804,8 +8080,8 @@ def _get_grafana_configs_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/grafana-configs", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7819,10 +8095,11 @@ def _get_grafana_configs_serialize( ) @validate_call - def get_instance( + def delete_cert_check( self, instance_id: StrictStr, project_id: StrictStr, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7832,15 +8109,17 @@ def get_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetInstanceResponse: - """get_instance + ) -> CertCheckResponse: + """delete_cert_check - Get instance information. + Delete cert check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param id: (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7863,9 +8142,10 @@ def get_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._delete_cert_check_serialize( instance_id=instance_id, project_id=project_id, + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7873,7 +8153,8 @@ def get_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceResponse", + "200": "CertCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7884,10 +8165,11 @@ def get_instance( ).data @validate_call - def get_instance_with_http_info( + def delete_cert_check_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7897,15 +8179,17 @@ def get_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetInstanceResponse]: - """get_instance + ) -> ApiResponse[CertCheckResponse]: + """delete_cert_check - Get instance information. + Delete cert check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param id: (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7928,9 +8212,10 @@ def get_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._delete_cert_check_serialize( instance_id=instance_id, project_id=project_id, + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7938,7 +8223,8 @@ def get_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceResponse", + "200": "CertCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -7949,10 +8235,11 @@ def get_instance_with_http_info( ) @validate_call - def get_instance_without_preload_content( + def delete_cert_check_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7963,14 +8250,16 @@ def get_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_instance + """delete_cert_check - Get instance information. + Delete cert check. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param id: (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7993,9 +8282,10 @@ def get_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._delete_cert_check_serialize( instance_id=instance_id, project_id=project_id, + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8003,16 +8293,18 @@ def get_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetInstanceResponse", + "200": "CertCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_instance_serialize( + def _delete_cert_check_serialize( self, instance_id, project_id, + id, _request_auth, _content_type, _headers, @@ -8035,6 +8327,8 @@ def _get_instance_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if id is not None: + _path_params["id"] = id # process the query parameters # process the header parameters # process the form parameters @@ -8048,8 +8342,8 @@ def _get_instance_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/cert-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8063,11 +8357,11 @@ def _get_instance_serialize( ) @validate_call - def get_logs_alertgroup( + def delete_credentials( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8077,17 +8371,17 @@ def get_logs_alertgroup( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AlertGroupResponse: - """get_logs_alertgroup + ) -> Message: + """delete_credentials - Get logs alert group config. + Delete technical 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 username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8110,10 +8404,10 @@ def get_logs_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_alertgroup_serialize( - group_name=group_name, + _param = self._delete_credentials_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8121,10 +8415,10 @@ def get_logs_alertgroup( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupResponse", - "400": "Message", + "200": "Message", "403": "PermissionDenied", "404": "Message", + "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -8134,11 +8428,11 @@ def get_logs_alertgroup( ).data @validate_call - def get_logs_alertgroup_with_http_info( + def delete_credentials_with_http_info( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8148,17 +8442,17 @@ def get_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[AlertGroupResponse]: - """get_logs_alertgroup + ) -> ApiResponse[Message]: + """delete_credentials - Get logs alert group config. + Delete technical 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 username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8181,10 +8475,10 @@ def get_logs_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_alertgroup_serialize( - group_name=group_name, + _param = self._delete_credentials_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8192,10 +8486,10 @@ def get_logs_alertgroup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupResponse", - "400": "Message", + "200": "Message", "403": "PermissionDenied", "404": "Message", + "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -8205,11 +8499,11 @@ def get_logs_alertgroup_with_http_info( ) @validate_call - def get_logs_alertgroup_without_preload_content( + def delete_credentials_without_preload_content( self, - group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8220,16 +8514,16 @@ def get_logs_alertgroup_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_logs_alertgroup + """delete_credentials - Get logs alert group config. + Delete technical 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 username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8252,10 +8546,10 @@ def get_logs_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_alertgroup_serialize( - group_name=group_name, + _param = self._delete_credentials_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8263,19 +8557,19 @@ def get_logs_alertgroup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupResponse", - "400": "Message", + "200": "Message", "403": "PermissionDenied", "404": "Message", + "500": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_logs_alertgroup_serialize( + def _delete_credentials_serialize( self, - group_name, instance_id, project_id, + username, _request_auth, _content_type, _headers, @@ -8294,12 +8588,12 @@ def _get_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: _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 @@ -8313,8 +8607,8 @@ def _get_logs_alertgroup_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8328,10 +8622,11 @@ def _get_logs_alertgroup_serialize( ) @validate_call - def get_logs_configs( + def delete_credentials_remote_write_config( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8341,15 +8636,17 @@ def get_logs_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LogsConfigResponse: - """get_logs_configs + ) -> CredentialsRemoteWriteDeleteResponse: + """delete_credentials_remote_write_config - Get logs configuration. + Delete remote write config for credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8372,9 +8669,10 @@ def get_logs_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_configs_serialize( + _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8382,8 +8680,11 @@ def get_logs_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsConfigResponse", + "200": "CredentialsRemoteWriteDeleteResponse", + "400": "Error", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -8393,10 +8694,11 @@ def get_logs_configs( ).data @validate_call - def get_logs_configs_with_http_info( + def delete_credentials_remote_write_config_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8406,16 +8708,18 @@ def get_logs_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[LogsConfigResponse]: - """get_logs_configs + ) -> ApiResponse[CredentialsRemoteWriteDeleteResponse]: + """delete_credentials_remote_write_config - Get logs configuration. + Delete remote write config for credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str - :param _request_timeout: timeout setting for this request. If one + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. @@ -8437,9 +8741,10 @@ def get_logs_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_configs_serialize( + _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8447,8 +8752,11 @@ def get_logs_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsConfigResponse", + "200": "CredentialsRemoteWriteDeleteResponse", + "400": "Error", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -8458,10 +8766,11 @@ def get_logs_configs_with_http_info( ) @validate_call - def get_logs_configs_without_preload_content( + def delete_credentials_remote_write_config_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + username: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8472,14 +8781,16 @@ def get_logs_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_logs_configs + """delete_credentials_remote_write_config - Get logs configuration. + Delete remote write config for credentials. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param username: (required) + :type username: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8502,9 +8813,10 @@ def get_logs_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_configs_serialize( + _param = self._delete_credentials_remote_write_config_serialize( instance_id=instance_id, project_id=project_id, + username=username, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8512,16 +8824,20 @@ def get_logs_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsConfigResponse", + "200": "CredentialsRemoteWriteDeleteResponse", + "400": "Error", "403": "PermissionDenied", + "404": "Message", + "502": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_logs_configs_serialize( + def _delete_credentials_remote_write_config_serialize( self, instance_id, project_id, + username, _request_auth, _content_type, _headers, @@ -8544,6 +8860,8 @@ def _get_logs_configs_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if username is not None: + _path_params["username"] = username # process the query parameters # process the header parameters # process the form parameters @@ -8557,8 +8875,8 @@ def _get_logs_configs_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-configs", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8572,8 +8890,9 @@ def _get_logs_configs_serialize( ) @validate_call - def get_metrics_storage_retention( + def delete_elasticsearch_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -8585,11 +8904,13 @@ 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 + ) -> ElasticsearchCheckResponse: + """delete_elasticsearch_check - Get metric storage retention time. + Delete elasticsearch check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -8616,7 +8937,8 @@ def get_metrics_storage_retention( :return: Returns the result object. """ # noqa: E501 - _param = self._get_metrics_storage_retention_serialize( + _param = self._delete_elasticsearch_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8626,7 +8948,8 @@ def get_metrics_storage_retention( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "ElasticsearchCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8637,8 +8960,9 @@ def get_metrics_storage_retention( ).data @validate_call - def get_metrics_storage_retention_with_http_info( + def delete_elasticsearch_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -8650,11 +8974,13 @@ 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[ElasticsearchCheckResponse]: + """delete_elasticsearch_check - Get metric storage retention time. + Delete elasticsearch check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -8681,7 +9007,8 @@ def get_metrics_storage_retention_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_metrics_storage_retention_serialize( + _param = self._delete_elasticsearch_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8691,7 +9018,8 @@ def get_metrics_storage_retention_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "ElasticsearchCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8702,8 +9030,9 @@ def get_metrics_storage_retention_with_http_info( ) @validate_call - def get_metrics_storage_retention_without_preload_content( + def delete_elasticsearch_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -8716,10 +9045,12 @@ 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 + """delete_elasticsearch_check - Get metric storage retention time. + Delete elasticsearch check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -8746,7 +9077,8 @@ def get_metrics_storage_retention_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_metrics_storage_retention_serialize( + _param = self._delete_elasticsearch_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -8756,14 +9088,16 @@ def get_metrics_storage_retention_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetMetricsStorageRetentionResponse", + "200": "ElasticsearchCheckResponse", + "400": "List[str]", "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 _delete_elasticsearch_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -8784,6 +9118,8 @@ def _get_metrics_storage_retention_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -8801,8 +9137,8 @@ def _get_metrics_storage_retention_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/elasticsearch-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8816,11 +9152,11 @@ def _get_metrics_storage_retention_serialize( ) @validate_call - def get_scrape_config( + def delete_http_check( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8830,17 +9166,17 @@ 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 + ) -> HttpCheckResponse: + """delete_http_check - Get scrape config. + Delete http check. :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 id: (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8863,10 +9199,10 @@ def get_scrape_config( :return: Returns the result object. """ # noqa: E501 - _param = self._get_scrape_config_serialize( + _param = self._delete_http_check_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8874,7 +9210,8 @@ def get_scrape_config( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "HttpCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8885,11 +9222,11 @@ def get_scrape_config( ).data @validate_call - def get_scrape_config_with_http_info( + def delete_http_check_with_http_info( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8899,17 +9236,17 @@ 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[HttpCheckResponse]: + """delete_http_check - Get scrape config. + Delete http check. :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 id: (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8932,10 +9269,10 @@ def get_scrape_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_scrape_config_serialize( + _param = self._delete_http_check_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8943,7 +9280,8 @@ def get_scrape_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "HttpCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -8954,11 +9292,11 @@ def get_scrape_config_with_http_info( ) @validate_call - def get_scrape_config_without_preload_content( + def delete_http_check_without_preload_content( self, instance_id: StrictStr, - job_name: StrictStr, project_id: StrictStr, + id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8969,16 +9307,16 @@ 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 + """delete_http_check - Get scrape config. + Delete http check. :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 id: (required) + :type id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -9001,10 +9339,10 @@ def get_scrape_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_scrape_config_serialize( + _param = self._delete_http_check_serialize( instance_id=instance_id, - job_name=job_name, project_id=project_id, + id=id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -9012,17 +9350,18 @@ def get_scrape_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetScrapeConfigResponse", + "200": "HttpCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_scrape_config_serialize( + def _delete_http_check_serialize( self, instance_id, - job_name, project_id, + id, _request_auth, _content_type, _headers, @@ -9043,10 +9382,10 @@ 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 + if id is not None: + _path_params["id"] = id # process the query parameters # process the header parameters # process the form parameters @@ -9060,8 +9399,8 @@ def _get_scrape_config_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/http-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9075,7 +9414,7 @@ def _get_scrape_config_serialize( ) @validate_call - def get_traces_configs( + def delete_instance( self, instance_id: StrictStr, project_id: StrictStr, @@ -9088,10 +9427,10 @@ def get_traces_configs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TracesConfigResponse: - """get_traces_configs + ) -> InstanceResponse: + """delete_instance - Get traces config. + Delete instance. :param instance_id: (required) :type instance_id: str @@ -9119,7 +9458,7 @@ def get_traces_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._get_traces_configs_serialize( + _param = self._delete_instance_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9129,7 +9468,7 @@ def get_traces_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TracesConfigResponse", + "202": "InstanceResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9140,7 +9479,7 @@ def get_traces_configs( ).data @validate_call - def get_traces_configs_with_http_info( + def delete_instance_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, @@ -9153,10 +9492,10 @@ def get_traces_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[TracesConfigResponse]: - """get_traces_configs + ) -> ApiResponse[InstanceResponse]: + """delete_instance - Get traces config. + Delete instance. :param instance_id: (required) :type instance_id: str @@ -9184,7 +9523,7 @@ def get_traces_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_traces_configs_serialize( + _param = self._delete_instance_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9194,7 +9533,7 @@ def get_traces_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TracesConfigResponse", + "202": "InstanceResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9205,7 +9544,7 @@ def get_traces_configs_with_http_info( ) @validate_call - def get_traces_configs_without_preload_content( + def delete_instance_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, @@ -9219,9 +9558,9 @@ def get_traces_configs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_traces_configs + """delete_instance - Get traces config. + Delete instance. :param instance_id: (required) :type instance_id: str @@ -9249,7 +9588,7 @@ def get_traces_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_traces_configs_serialize( + _param = self._delete_instance_serialize( instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9259,13 +9598,13 @@ def get_traces_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "TracesConfigResponse", + "202": "InstanceResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_traces_configs_serialize( + def _delete_instance_serialize( self, instance_id, project_id, @@ -9304,8 +9643,8 @@ def _get_traces_configs_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/traces-configs", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9319,8 +9658,9 @@ def _get_traces_configs_serialize( ) @validate_call - def list_acl( + def delete_logs_alertgroup( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9332,11 +9672,13 @@ 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 + ) -> AlertGroupsResponse: + """delete_logs_alertgroup - Get acl for instance. + Delete logs alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9363,7 +9705,8 @@ def list_acl( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acl_serialize( + _param = self._delete_logs_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9373,8 +9716,10 @@ def list_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -9384,8 +9729,9 @@ def list_acl( ).data @validate_call - def list_acl_with_http_info( + def delete_logs_alertgroup_with_http_info( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9397,11 +9743,13 @@ 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[AlertGroupsResponse]: + """delete_logs_alertgroup - Get acl for instance. + Delete logs alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9428,7 +9776,8 @@ def list_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acl_serialize( + _param = self._delete_logs_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9438,8 +9787,10 @@ def list_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "202": "AlertGroupsResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -9449,8 +9800,9 @@ def list_acl_with_http_info( ) @validate_call - def list_acl_without_preload_content( + def delete_logs_alertgroup_without_preload_content( self, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9463,10 +9815,12 @@ 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 + """delete_logs_alertgroup - Get acl for instance. + Delete logs alert group config. + :param group_name: (required) + :type group_name: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9493,7 +9847,8 @@ def list_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acl_serialize( + _param = self._delete_logs_alertgroup_serialize( + group_name=group_name, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9503,14 +9858,17 @@ def list_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLResponse", + "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 _list_acl_serialize( + def _delete_logs_alertgroup_serialize( self, + group_name, instance_id, project_id, _request_auth, @@ -9531,6 +9889,8 @@ def _list_acl_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: @@ -9548,8 +9908,8 @@ def _list_acl_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acl", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9563,8 +9923,9 @@ def _list_acl_serialize( ) @validate_call - def list_alert_config_receivers( + def delete_mongodb_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9576,12 +9937,14 @@ 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 + ) -> MongodbCheckResponse: + """delete_mongodb_check - Get alert config receivers. + Delete mongodb check. - :param instance_id: (required) + :param id: (required) + :type id: str + :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str @@ -9607,7 +9970,8 @@ def list_alert_config_receivers( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_receivers_serialize( + _param = self._delete_mongodb_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9617,7 +9981,8 @@ def list_alert_config_receivers( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "MongodbCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9628,8 +9993,9 @@ def list_alert_config_receivers( ).data @validate_call - def list_alert_config_receivers_with_http_info( + def delete_mongodb_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9641,11 +10007,13 @@ 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[MongodbCheckResponse]: + """delete_mongodb_check - Get alert config receivers. + Delete mongodb check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9672,7 +10040,8 @@ def list_alert_config_receivers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_receivers_serialize( + _param = self._delete_mongodb_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9682,7 +10051,8 @@ def list_alert_config_receivers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "MongodbCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9693,8 +10063,9 @@ def list_alert_config_receivers_with_http_info( ) @validate_call - def list_alert_config_receivers_without_preload_content( + def delete_mongodb_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9707,10 +10078,12 @@ 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 + """delete_mongodb_check - Get alert config receivers. + Delete mongodb check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9737,7 +10110,8 @@ def list_alert_config_receivers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_receivers_serialize( + _param = self._delete_mongodb_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9747,14 +10121,16 @@ def list_alert_config_receivers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigReceiversResponse", + "200": "MongodbCheckResponse", + "400": "List[str]", "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 _delete_mongodb_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -9775,6 +10151,8 @@ def _list_alert_config_receivers_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -9792,8 +10170,8 @@ def _list_alert_config_receivers_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/mongodb-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -9807,8 +10185,9 @@ def _list_alert_config_receivers_serialize( ) @validate_call - def list_alert_config_routes( + def delete_mysql_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9820,11 +10199,13 @@ 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 + ) -> MysqlCheckResponse: + """delete_mysql_check - Get alert config route. + Delete mysql check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9851,7 +10232,8 @@ def list_alert_config_routes( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_routes_serialize( + _param = self._delete_mysql_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9861,7 +10243,8 @@ def list_alert_config_routes( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "MysqlCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9872,8 +10255,9 @@ def list_alert_config_routes( ).data @validate_call - def list_alert_config_routes_with_http_info( + def delete_mysql_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9885,11 +10269,13 @@ 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[MysqlCheckResponse]: + """delete_mysql_check - Get alert config route. + Delete mysql check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9916,7 +10302,8 @@ def list_alert_config_routes_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_routes_serialize( + _param = self._delete_mysql_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9926,7 +10313,8 @@ def list_alert_config_routes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "MysqlCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -9937,8 +10325,9 @@ def list_alert_config_routes_with_http_info( ) @validate_call - def list_alert_config_routes_without_preload_content( + def delete_mysql_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -9951,10 +10340,12 @@ 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 + """delete_mysql_check - Get alert config route. + Delete mysql check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -9981,7 +10372,8 @@ def list_alert_config_routes_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_config_routes_serialize( + _param = self._delete_mysql_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -9991,14 +10383,16 @@ def list_alert_config_routes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertConfigRouteResponse", + "200": "MysqlCheckResponse", + "400": "List[str]", "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 _delete_mysql_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -10019,6 +10413,8 @@ def _list_alert_config_routes_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -10036,8 +10432,8 @@ def _list_alert_config_routes_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/mysql-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10051,8 +10447,9 @@ def _list_alert_config_routes_serialize( ) @validate_call - def list_alertgroups( + def delete_network_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10064,11 +10461,13 @@ 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 + ) -> NetworkCheckResponse: + """delete_network_check - Get alert groups. + Delete network check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10095,7 +10494,8 @@ def list_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertgroups_serialize( + _param = self._delete_network_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10105,8 +10505,8 @@ def list_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "200": "NetworkCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10117,8 +10517,9 @@ def list_alertgroups( ).data @validate_call - def list_alertgroups_with_http_info( + def delete_network_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10130,11 +10531,13 @@ 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[NetworkCheckResponse]: + """delete_network_check - Get alert groups. + Delete network check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10161,7 +10564,8 @@ def list_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertgroups_serialize( + _param = self._delete_network_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10171,8 +10575,8 @@ def list_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "200": "NetworkCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10183,8 +10587,9 @@ def list_alertgroups_with_http_info( ) @validate_call - def list_alertgroups_without_preload_content( + def delete_network_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10197,10 +10602,12 @@ 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 + """delete_network_check - Get alert groups. + Delete network check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10227,7 +10634,8 @@ def list_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertgroups_serialize( + _param = self._delete_network_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10237,15 +10645,16 @@ def list_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "200": "NetworkCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alertgroups_serialize( + def _delete_network_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -10266,6 +10675,8 @@ def _list_alertgroups_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -10283,8 +10694,8 @@ def _list_alertgroups_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/network-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10298,9 +10709,9 @@ def _list_alertgroups_serialize( ) @validate_call - def list_alertrules( + def delete_ping_check( self, - group_name: StrictStr, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10312,13 +10723,13 @@ 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 + ) -> PingCheckResponse: + """delete_ping_check - Get alert rules. + Delete ping check. - :param group_name: (required) - :type group_name: str + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10345,8 +10756,8 @@ def list_alertrules( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertrules_serialize( - group_name=group_name, + _param = self._delete_ping_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10356,7 +10767,8 @@ def list_alertrules( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertRulesResponse", + "200": "PingCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10367,9 +10779,9 @@ def list_alertrules( ).data @validate_call - def list_alertrules_with_http_info( + def delete_ping_check_with_http_info( self, - group_name: StrictStr, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10381,13 +10793,13 @@ 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[PingCheckResponse]: + """delete_ping_check - Get alert rules. + Delete ping check. - :param group_name: (required) - :type group_name: str + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10414,8 +10826,8 @@ def list_alertrules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertrules_serialize( - group_name=group_name, + _param = self._delete_ping_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10425,7 +10837,8 @@ def list_alertrules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertRulesResponse", + "200": "PingCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10436,9 +10849,9 @@ def list_alertrules_with_http_info( ) @validate_call - def list_alertrules_without_preload_content( + def delete_ping_check_without_preload_content( self, - group_name: StrictStr, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10451,12 +10864,12 @@ 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 + """delete_ping_check - Get alert rules. + Delete ping check. - :param group_name: (required) - :type group_name: str + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10483,8 +10896,8 @@ def list_alertrules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alertrules_serialize( - group_name=group_name, + _param = self._delete_ping_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10494,15 +10907,16 @@ def list_alertrules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertRulesResponse", + "200": "PingCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_alertrules_serialize( + def _delete_ping_check_serialize( self, - group_name, + id, instance_id, project_id, _request_auth, @@ -10523,8 +10937,8 @@ 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 id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -10542,8 +10956,8 @@ def _list_alertrules_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/ping-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10557,8 +10971,9 @@ def _list_alertrules_serialize( ) @validate_call - def list_cert_checks( + def delete_postgresql_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10570,11 +10985,13 @@ def list_cert_checks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CertCheckResponse: - """list_cert_checks + ) -> PostgresqlCheckResponse: + """delete_postgresql_check - Get all cert checks configured. + Delete postgresql check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10601,7 +11018,8 @@ def list_cert_checks( :return: Returns the result object. """ # noqa: E501 - _param = self._list_cert_checks_serialize( + _param = self._delete_postgresql_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10611,7 +11029,7 @@ def list_cert_checks( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", + "200": "PostgresqlCheckResponse", "400": "List[str]", "403": "PermissionDenied", } @@ -10623,8 +11041,9 @@ def list_cert_checks( ).data @validate_call - def list_cert_checks_with_http_info( + def delete_postgresql_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10636,11 +11055,13 @@ def list_cert_checks_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[CertCheckResponse]: - """list_cert_checks + ) -> ApiResponse[PostgresqlCheckResponse]: + """delete_postgresql_check - Get all cert checks configured. + Delete postgresql check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10667,7 +11088,8 @@ def list_cert_checks_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_cert_checks_serialize( + _param = self._delete_postgresql_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10677,7 +11099,7 @@ def list_cert_checks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", + "200": "PostgresqlCheckResponse", "400": "List[str]", "403": "PermissionDenied", } @@ -10689,8 +11111,9 @@ def list_cert_checks_with_http_info( ) @validate_call - def list_cert_checks_without_preload_content( + def delete_postgresql_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10703,10 +11126,12 @@ def list_cert_checks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_cert_checks + """delete_postgresql_check - Get all cert checks configured. + Delete postgresql check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10733,7 +11158,8 @@ def list_cert_checks_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_cert_checks_serialize( + _param = self._delete_postgresql_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10743,15 +11169,16 @@ def list_cert_checks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "CertCheckResponse", + "200": "PostgresqlCheckResponse", "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_cert_checks_serialize( + def _delete_postgresql_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -10772,6 +11199,8 @@ def _list_cert_checks_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -10789,8 +11218,8 @@ def _list_cert_checks_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/cert-checks", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/postgresql-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -10804,8 +11233,9 @@ def _list_cert_checks_serialize( ) @validate_call - def list_credentials( + def delete_rabbitmq_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10817,11 +11247,13 @@ 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 + ) -> RabbitmqCheckResponse: + """delete_rabbitmq_check - Get all technical user credentials. + Delete rabbitmq check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10848,7 +11280,8 @@ def list_credentials( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_serialize( + _param = self._delete_rabbitmq_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10858,7 +11291,8 @@ def list_credentials( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "RabbitmqCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10869,8 +11303,9 @@ def list_credentials( ).data @validate_call - def list_credentials_with_http_info( + def delete_rabbitmq_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10882,11 +11317,13 @@ 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[RabbitmqCheckResponse]: + """delete_rabbitmq_check - Get all technical user credentials. + Delete rabbitmq check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10913,7 +11350,8 @@ def list_credentials_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_serialize( + _param = self._delete_rabbitmq_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10923,7 +11361,8 @@ def list_credentials_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "RabbitmqCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -10934,8 +11373,9 @@ def list_credentials_with_http_info( ) @validate_call - def list_credentials_without_preload_content( + def delete_rabbitmq_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -10948,10 +11388,12 @@ 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 + """delete_rabbitmq_check - Get all technical user credentials. + Delete rabbitmq check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -10978,7 +11420,8 @@ def list_credentials_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_serialize( + _param = self._delete_rabbitmq_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -10988,14 +11431,16 @@ def list_credentials_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "ListCredentialsResponse", + "200": "RabbitmqCheckResponse", + "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_credentials_serialize( + def _delete_rabbitmq_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -11016,6 +11461,8 @@ def _list_credentials_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -11033,8 +11480,8 @@ def _list_credentials_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/rabbitmq-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11048,8 +11495,9 @@ def _list_credentials_serialize( ) @validate_call - def list_http_checks( + def delete_redis_check( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -11061,11 +11509,13 @@ def list_http_checks( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> HttpCheckResponse: - """list_http_checks + ) -> RedisCheckResponse: + """delete_redis_check - Get all http checks configured. + Delete redis check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -11092,7 +11542,8 @@ def list_http_checks( :return: Returns the result object. """ # noqa: E501 - _param = self._list_http_checks_serialize( + _param = self._delete_redis_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -11102,7 +11553,7 @@ def list_http_checks( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", + "200": "RedisCheckResponse", "400": "List[str]", "403": "PermissionDenied", } @@ -11114,8 +11565,9 @@ def list_http_checks( ).data @validate_call - def list_http_checks_with_http_info( + def delete_redis_check_with_http_info( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -11127,11 +11579,13 @@ def list_http_checks_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[HttpCheckResponse]: - """list_http_checks + ) -> ApiResponse[RedisCheckResponse]: + """delete_redis_check - Get all http checks configured. + Delete redis check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -11158,7 +11612,8 @@ def list_http_checks_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_http_checks_serialize( + _param = self._delete_redis_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -11168,7 +11623,7 @@ def list_http_checks_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", + "200": "RedisCheckResponse", "400": "List[str]", "403": "PermissionDenied", } @@ -11180,8 +11635,9 @@ def list_http_checks_with_http_info( ) @validate_call - def list_http_checks_without_preload_content( + def delete_redis_check_without_preload_content( self, + id: StrictStr, instance_id: StrictStr, project_id: StrictStr, _request_timeout: Union[ @@ -11194,10 +11650,12 @@ def list_http_checks_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_http_checks + """delete_redis_check - Get all http checks configured. + Delete redis check. + :param id: (required) + :type id: str :param instance_id: (required) :type instance_id: str :param project_id: (required) @@ -11224,7 +11682,8 @@ def list_http_checks_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_http_checks_serialize( + _param = self._delete_redis_check_serialize( + id=id, instance_id=instance_id, project_id=project_id, _request_auth=_request_auth, @@ -11234,15 +11693,16 @@ def list_http_checks_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "HttpCheckResponse", + "200": "RedisCheckResponse", "400": "List[str]", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_http_checks_serialize( + def _delete_redis_check_serialize( self, + id, instance_id, project_id, _request_auth, @@ -11263,6 +11723,8 @@ def _list_http_checks_serialize( _body_params: Optional[bytes] = None # process the path parameters + if id is not None: + _path_params["id"] = id if instance_id is not None: _path_params["instanceId"] = instance_id if project_id is not None: @@ -11280,8 +11742,8 @@ def _list_http_checks_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/http-checks", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/redis-checks/{id}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11295,8 +11757,10 @@ def _list_http_checks_serialize( ) @validate_call - def list_instances( + def delete_scrape_config( self, + instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -11307,11 +11771,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 + ) -> DeleteScrapeConfigResponse: + """delete_scrape_config - Get all instances for a project. + Delete scrape config. + :param instance_id: (required) + :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -11336,7 +11804,9 @@ def list_instances( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _param = self._delete_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -11345,8 +11815,9 @@ def list_instances( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "202": "DeleteScrapeConfigResponse", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -11356,8 +11827,10 @@ def list_instances( ).data @validate_call - def list_instances_with_http_info( + def delete_scrape_config_with_http_info( self, + instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -11368,11 +11841,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[DeleteScrapeConfigResponse]: + """delete_scrape_config - Get all instances for a project. + Delete scrape config. + :param instance_id: (required) + :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -11397,7 +11874,9 @@ def list_instances_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _param = self._delete_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -11406,8 +11885,9 @@ def list_instances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "202": "DeleteScrapeConfigResponse", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -11417,8 +11897,10 @@ def list_instances_with_http_info( ) @validate_call - def list_instances_without_preload_content( + def delete_scrape_config_without_preload_content( self, + instance_id: StrictStr, + job_name: StrictStr, project_id: StrictStr, _request_timeout: Union[ None, @@ -11430,10 +11912,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 + """delete_scrape_config - Get all instances for a project. + Delete scrape config. + :param instance_id: (required) + :type instance_id: str + :param job_name: (required) + :type job_name: str :param project_id: (required) :type project_id: str :param _request_timeout: timeout setting for this request. If one @@ -11458,7 +11944,9 @@ def list_instances_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_instances_serialize( + _param = self._delete_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, @@ -11467,14 +11955,17 @@ def list_instances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListInstancesResponse", + "202": "DeleteScrapeConfigResponse", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_instances_serialize( + def _delete_scrape_config_serialize( self, + instance_id, + job_name, project_id, _request_auth, _content_type, @@ -11494,6 +11985,10 @@ def _list_instances_serialize( _body_params: Optional[bytes] = None # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id + if 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 @@ -11509,8 +12004,8 @@ def _list_instances_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11524,10 +12019,11 @@ def _list_instances_serialize( ) @validate_call - def list_logs_alertgroups( + def delete_scrape_configs( self, instance_id: StrictStr, project_id: StrictStr, + job_name: Annotated[List[StrictStr], Field(description="Name of the jobs that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11537,15 +12033,17 @@ 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 + ) -> ScrapeConfigsResponse: + """delete_scrape_configs - Get logs alert groups config. + Delete scrape configs. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param job_name: Name of the jobs that should be deleted (required) + :type job_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11568,9 +12066,10 @@ def list_logs_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_alertgroups_serialize( + _param = self._delete_scrape_configs_serialize( instance_id=instance_id, project_id=project_id, + job_name=job_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11578,8 +12077,7 @@ def list_logs_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "202": "ScrapeConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -11590,10 +12088,11 @@ def list_logs_alertgroups( ).data @validate_call - def list_logs_alertgroups_with_http_info( + def delete_scrape_configs_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + job_name: Annotated[List[StrictStr], Field(description="Name of the jobs that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11603,15 +12102,17 @@ 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[ScrapeConfigsResponse]: + """delete_scrape_configs - Get logs alert groups config. + Delete scrape configs. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param job_name: Name of the jobs that should be deleted (required) + :type job_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11634,9 +12135,10 @@ def list_logs_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_alertgroups_serialize( + _param = self._delete_scrape_configs_serialize( instance_id=instance_id, project_id=project_id, + job_name=job_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11644,8 +12146,7 @@ def list_logs_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "202": "ScrapeConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -11656,10 +12157,11 @@ def list_logs_alertgroups_with_http_info( ) @validate_call - def list_logs_alertgroups_without_preload_content( + def delete_scrape_configs_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + job_name: Annotated[List[StrictStr], Field(description="Name of the jobs that should be deleted")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11670,14 +12172,16 @@ 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 + """delete_scrape_configs - Get logs alert groups config. + Delete scrape configs. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param job_name: Name of the jobs that should be deleted (required) + :type job_name: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11700,9 +12204,10 @@ def list_logs_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_alertgroups_serialize( + _param = self._delete_scrape_configs_serialize( instance_id=instance_id, project_id=project_id, + job_name=job_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11710,17 +12215,17 @@ def list_logs_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AlertGroupsResponse", - "400": "Error", + "202": "ScrapeConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_logs_alertgroups_serialize( + def _delete_scrape_configs_serialize( self, instance_id, project_id, + job_name, _request_auth, _content_type, _headers, @@ -11729,7 +12234,9 @@ def _list_logs_alertgroups_serialize( _host = None - _collection_formats: Dict[str, str] = {} + _collection_formats: Dict[str, str] = { + "jobName": "csv", + } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -11744,6 +12251,10 @@ def _list_logs_alertgroups_serialize( if project_id is not None: _path_params["projectId"] = project_id # process the query parameters + if job_name is not None: + + _query_params.append(("jobName", job_name)) + # process the header parameters # process the form parameters # process the body parameter @@ -11756,8 +12267,8 @@ def _list_logs_alertgroups_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups", + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -11771,9 +12282,11 @@ def _list_logs_alertgroups_serialize( ) @validate_call - def list_plans( + def get_alert_config_receiver( self, + instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11783,13 +12296,17 @@ 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 + ) -> Receiver: + """get_alert_config_receiver - Get all plans. + Get alert config receivers. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11812,8 +12329,10 @@ def list_plans( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._get_alert_config_receiver_serialize( + instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11821,8 +12340,9 @@ def list_plans( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "Receiver", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -11832,9 +12352,11 @@ def list_plans( ).data @validate_call - def list_plans_with_http_info( + def get_alert_config_receiver_with_http_info( self, + instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11844,13 +12366,17 @@ 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[Receiver]: + """get_alert_config_receiver - Get all plans. + Get alert config receivers. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11873,8 +12399,10 @@ def list_plans_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._get_alert_config_receiver_serialize( + instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11882,8 +12410,9 @@ def list_plans_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "Receiver", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -11893,9 +12422,11 @@ def list_plans_with_http_info( ) @validate_call - def list_plans_without_preload_content( + def get_alert_config_receiver_without_preload_content( self, + instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -11906,12 +12437,16 @@ def list_plans_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_plans + """get_alert_config_receiver - Get all plans. + Get alert config receivers. + :param instance_id: (required) + :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -11934,8 +12469,10 @@ def list_plans_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_plans_serialize( + _param = self._get_alert_config_receiver_serialize( + instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -11943,15 +12480,18 @@ def list_plans_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "PlansResponse", + "200": "Receiver", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_plans_serialize( + def _get_alert_config_receiver_serialize( self, + instance_id, project_id, + receiver, _request_auth, _content_type, _headers, @@ -11970,8 +12510,12 @@ def _list_plans_serialize( _body_params: Optional[bytes] = None # process the path parameters + if instance_id is not None: + _path_params["instanceId"] = instance_id if 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 @@ -11986,7 +12530,7 @@ def _list_plans_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/plans", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12000,10 +12544,11 @@ def _list_plans_serialize( ) @validate_call - def list_scrape_configs( + def get_alert_config_route( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12013,15 +12558,17 @@ 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 + ) -> AlertConfigRouteResponse: + """get_alert_config_route - Get scrape configs. + Get alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12044,9 +12591,10 @@ def list_scrape_configs( :return: Returns the result object. """ # noqa: E501 - _param = self._list_scrape_configs_serialize( + _param = self._get_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12054,7 +12602,7 @@ def list_scrape_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -12065,10 +12613,11 @@ def list_scrape_configs( ).data @validate_call - def list_scrape_configs_with_http_info( + def get_alert_config_route_with_http_info( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12078,15 +12627,17 @@ 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[AlertConfigRouteResponse]: + """get_alert_config_route - Get scrape configs. + Get alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12109,9 +12660,10 @@ def list_scrape_configs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_scrape_configs_serialize( + _param = self._get_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12119,7 +12671,7 @@ def list_scrape_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -12130,10 +12682,11 @@ def list_scrape_configs_with_http_info( ) @validate_call - def list_scrape_configs_without_preload_content( + def get_alert_config_route_without_preload_content( self, instance_id: StrictStr, project_id: StrictStr, + receiver: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12144,14 +12697,16 @@ 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 + """get_alert_config_route - Get scrape configs. + Get alert receiver for route. :param instance_id: (required) :type instance_id: str :param project_id: (required) :type project_id: str + :param receiver: (required) + :type receiver: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -12174,9 +12729,10 @@ def list_scrape_configs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_scrape_configs_serialize( + _param = self._get_alert_config_route_serialize( instance_id=instance_id, project_id=project_id, + receiver=receiver, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12184,16 +12740,17 @@ def list_scrape_configs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListScrapeConfigsResponse", + "200": "AlertConfigRouteResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_scrape_configs_serialize( + def _get_alert_config_route_serialize( self, instance_id, project_id, + receiver, _request_auth, _content_type, _headers, @@ -12216,6 +12773,8 @@ def _list_scrape_configs_serialize( _path_params["instanceId"] = instance_id if project_id is not None: _path_params["projectId"] = project_id + if receiver is not None: + _path_params["receiver"] = receiver # process the query parameters # process the header parameters # process the form parameters @@ -12230,7 +12789,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}/alertconfigs/routes/{receiver}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12244,11 +12803,10 @@ def _list_scrape_configs_serialize( ) @validate_call - def partial_update_alertgroups( + def get_alert_configs( self, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12258,17 +12816,15 @@ 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 + ) -> GetAlertConfigsResponse: + """get_alert_configs - Patch alert groups. + Get alert 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 _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 @@ -12291,10 +12847,9 @@ def partial_update_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertgroups_serialize( + _param = self._get_alert_configs_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12302,8 +12857,7 @@ def partial_update_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Error", + "200": "GetAlertConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -12314,11 +12868,10 @@ def partial_update_alertgroups( ).data @validate_call - def partial_update_alertgroups_with_http_info( + def get_alert_configs_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)], @@ -12328,17 +12881,15 @@ 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[GetAlertConfigsResponse]: + """get_alert_configs - Patch alert groups. + Get alert 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 _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 @@ -12361,10 +12912,9 @@ def partial_update_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertgroups_serialize( + _param = self._get_alert_configs_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12372,8 +12922,7 @@ def partial_update_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Error", + "200": "GetAlertConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -12384,11 +12933,10 @@ def partial_update_alertgroups_with_http_info( ) @validate_call - def partial_update_alertgroups_without_preload_content( + def get_alert_configs_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)], @@ -12399,16 +12947,14 @@ 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 + """get_alert_configs - Patch alert groups. + Get alert 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 _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 @@ -12431,10 +12977,9 @@ def partial_update_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertgroups_serialize( + _param = self._get_alert_configs_serialize( instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12442,18 +12987,16 @@ def partial_update_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Error", + "200": "GetAlertConfigsResponse", "403": "PermissionDenied", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _partial_update_alertgroups_serialize( + def _get_alert_configs_serialize( self, instance_id, project_id, - update_alertgroups_request_inner, _request_auth, _content_type, _headers, @@ -12462,9 +13005,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]] = [] @@ -12482,27 +13023,17 @@ def _partial_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 # 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}/instances/{instanceId}/alertconfigs", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12516,12 +13047,11 @@ def _partial_update_alertgroups_serialize( ) @validate_call - def partial_update_alertrules( + def get_alertgroup( self, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12531,10 +13061,10 @@ 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 + ) -> AlertGroupResponse: + """get_alertgroup - Patch alert rules. + Get alert group. :param group_name: (required) :type group_name: str @@ -12542,8 +13072,6 @@ def partial_update_alertrules( :type instance_id: str :param project_id: (required) :type project_id: str - :param partial_update_alertrules_request_inner: (required) - :type partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner] :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 @@ -12566,11 +13094,10 @@ def partial_update_alertrules( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertrules_serialize( + _param = self._get_alertgroup_serialize( group_name=group_name, instance_id=instance_id, project_id=project_id, - partial_update_alertrules_request_inner=partial_update_alertrules_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12578,9 +13105,10 @@ def partial_update_alertrules( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", - "400": "Error", + "200": "AlertGroupResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12590,12 +13118,11 @@ def partial_update_alertrules( ).data @validate_call - def partial_update_alertrules_with_http_info( + def get_alertgroup_with_http_info( self, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12605,10 +13132,10 @@ 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[AlertGroupResponse]: + """get_alertgroup - Patch alert rules. + Get alert group. :param group_name: (required) :type group_name: str @@ -12616,8 +13143,6 @@ def partial_update_alertrules_with_http_info( :type instance_id: str :param project_id: (required) :type project_id: str - :param partial_update_alertrules_request_inner: (required) - :type partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner] :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 @@ -12640,11 +13165,10 @@ def partial_update_alertrules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertrules_serialize( + _param = self._get_alertgroup_serialize( group_name=group_name, instance_id=instance_id, project_id=project_id, - partial_update_alertrules_request_inner=partial_update_alertrules_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12652,9 +13176,10 @@ def partial_update_alertrules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", - "400": "Error", + "200": "AlertGroupResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12664,12 +13189,11 @@ def partial_update_alertrules_with_http_info( ) @validate_call - def partial_update_alertrules_without_preload_content( + def get_alertgroup_without_preload_content( self, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12680,9 +13204,9 @@ 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 + """get_alertgroup - Patch alert rules. + Get alert group. :param group_name: (required) :type group_name: str @@ -12690,8 +13214,6 @@ def partial_update_alertrules_without_preload_content( :type instance_id: str :param project_id: (required) :type project_id: str - :param partial_update_alertrules_request_inner: (required) - :type partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner] :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 @@ -12714,11 +13236,10 @@ def partial_update_alertrules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._partial_update_alertrules_serialize( + _param = self._get_alertgroup_serialize( group_name=group_name, instance_id=instance_id, project_id=project_id, - partial_update_alertrules_request_inner=partial_update_alertrules_request_inner, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12726,19 +13247,19 @@ def partial_update_alertrules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertRulesResponse", - "400": "Error", + "200": "AlertGroupResponse", + "400": "Message", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _partial_update_alertrules_serialize( + def _get_alertgroup_serialize( self, group_name, instance_id, project_id, - partial_update_alertrules_request_inner, _request_auth, _content_type, _headers, @@ -12747,9 +13268,7 @@ def _partial_update_alertrules_serialize( _host = None - _collection_formats: Dict[str, str] = { - "PartialUpdateAlertrulesRequestInner": "", - } + _collection_formats: Dict[str, str] = {} _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] @@ -12769,27 +13288,17 @@ def _partial_update_alertrules_serialize( # process the header parameters # process the form parameters # process the body parameter - if partial_update_alertrules_request_inner is not None: - _body_params = partial_update_alertrules_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/{groupName}/alertrules", + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -12803,11 +13312,12 @@ def _partial_update_alertrules_serialize( ) @validate_call - def update_acl( + def get_alertrecord( self, + alert_record: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12817,17 +13327,19 @@ 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 + ) -> AlertRecordResponse: + """get_alertrecord - Update acl config. + Get alert record. + :param alert_record: (required) + :type alert_record: str + :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_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 @@ -12850,10 +13362,11 @@ def update_acl( :return: Returns the result object. """ # noqa: E501 - _param = self._update_acl_serialize( + _param = self._get_alertrecord_serialize( + alert_record=alert_record, + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12861,9 +13374,10 @@ def update_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "200": "AlertRecordResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12873,11 +13387,12 @@ def update_acl( ).data @validate_call - def update_acl_with_http_info( + def get_alertrecord_with_http_info( self, + alert_record: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12887,17 +13402,19 @@ def update_acl_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Message]: - """update_acl + ) -> ApiResponse[AlertRecordResponse]: + """get_alertrecord - Update acl config. + Get alert record. + :param alert_record: (required) + :type alert_record: str + :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_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 @@ -12920,10 +13437,11 @@ def update_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_acl_serialize( + _param = self._get_alertrecord_serialize( + alert_record=alert_record, + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -12931,9 +13449,10 @@ def update_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "200": "AlertRecordResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -12943,11 +13462,12 @@ def update_acl_with_http_info( ) @validate_call - def update_acl_without_preload_content( + def get_alertrecord_without_preload_content( self, + alert_record: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_acl_payload: Optional[UpdateACLPayload] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -12958,16 +13478,18 @@ def update_acl_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_acl + """get_alertrecord - Update acl config. + Get alert record. + :param alert_record: (required) + :type alert_record: str + :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_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 @@ -12990,10 +13512,11 @@ def update_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_acl_serialize( + _param = self._get_alertrecord_serialize( + alert_record=alert_record, + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_acl_payload=update_acl_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13001,18 +13524,20 @@ def update_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "Message", + "200": "AlertRecordResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_acl_serialize( + def _get_alertrecord_serialize( self, + alert_record, + group_name, instance_id, project_id, - update_acl_payload, _request_auth, _content_type, _headers, @@ -13031,6 +13556,10 @@ def _update_acl_serialize( _body_params: Optional[bytes] = None # process the path parameters + if alert_record is not None: + _path_params["alertRecord"] = alert_record + 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: @@ -13039,27 +13568,17 @@ 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 # 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", + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records/{alertRecord}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -13073,12 +13592,12 @@ def _update_acl_serialize( ) @validate_call - def update_alert_config_receiver( + def get_alertrule( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13088,19 +13607,19 @@ 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 + ) -> AlertRuleResponse: + """get_alertrule - Update alert config receiver. + Get alert rule. + :param alert_name: (required) + :type alert_name: str + :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) - :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 @@ -13123,11 +13642,11 @@ def update_alert_config_receiver( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_config_receiver_serialize( + _param = self._get_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, 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, @@ -13135,8 +13654,7 @@ def update_alert_config_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", - "400": "Error", + "200": "AlertRuleResponse", "403": "PermissionDenied", "404": "Message", } @@ -13148,12 +13666,12 @@ def update_alert_config_receiver( ).data @validate_call - def update_alert_config_receiver_with_http_info( + def get_alertrule_with_http_info( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - receiver: StrictStr, - update_alert_config_receiver_payload: UpdateAlertConfigReceiverPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13163,19 +13681,19 @@ 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[AlertRuleResponse]: + """get_alertrule - Update alert config receiver. + Get alert rule. + :param alert_name: (required) + :type alert_name: str + :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) - :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 @@ -13198,11 +13716,11 @@ def update_alert_config_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_config_receiver_serialize( + _param = self._get_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, 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, @@ -13210,8 +13728,7 @@ def update_alert_config_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertConfigReceiversResponse", - "400": "Error", + "200": "AlertRuleResponse", "403": "PermissionDenied", "404": "Message", } @@ -13223,12 +13740,10956 @@ def update_alert_config_receiver_with_http_info( ) @validate_call - def update_alert_config_receiver_without_preload_content( + def get_alertrule_without_preload_content( + self, + alert_name: StrictStr, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_alertrule + + Get alert rule. + + :param alert_name: (required) + :type alert_name: str + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRuleResponse", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_alertrule_serialize( + self, + alert_name, + group_name, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if alert_name is not None: + _path_params["alertName"] = alert_name + if group_name is not None: + _path_params["groupName"] = group_name + if instance_id is not None: + _path_params["instanceId"] = instance_id + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules/{alertName}", + 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 get_credentials( + self, + instance_id: StrictStr, + project_id: StrictStr, + username: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetCredentialsResponse: + """get_credentials + + Get single technical credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._get_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetCredentialsResponse", + "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 get_credentials_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + username: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetCredentialsResponse]: + """get_credentials + + Get single technical credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._get_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetCredentialsResponse", + "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 get_credentials_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + username: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_credentials + + Get single technical credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._get_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetCredentialsResponse", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_credentials_serialize( + self, + instance_id, + project_id, + username, + _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 username is not None: + _path_params["username"] = username + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}", + 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 get_credentials_remote_write_config( + self, + instance_id: StrictStr, + project_id: StrictStr, + username: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CredentialsRemoteWriteConfig: + """get_credentials_remote_write_config + + Get remote write config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._get_credentials_remote_write_config_serialize( + instance_id=instance_id, + project_id=project_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CredentialsRemoteWriteConfig", + "403": "PermissionDenied", + "404": "Message", + "502": "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 get_credentials_remote_write_config_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + username: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + 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[CredentialsRemoteWriteConfig]: + """get_credentials_remote_write_config + + Get remote write config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._get_credentials_remote_write_config_serialize( + instance_id=instance_id, + project_id=project_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CredentialsRemoteWriteConfig", + "403": "PermissionDenied", + "404": "Message", + "502": "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 get_credentials_remote_write_config_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + username: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + 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: + """get_credentials_remote_write_config + + Get remote write config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param username: (required) + :type username: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._get_credentials_remote_write_config_serialize( + instance_id=instance_id, + project_id=project_id, + username=username, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CredentialsRemoteWriteConfig", + "403": "PermissionDenied", + "404": "Message", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_credentials_remote_write_config_serialize( + self, + instance_id, + project_id, + username, + _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 username is not None: + _path_params["username"] = username + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials/{username}/remote-write-limits", + 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 get_grafana_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GrafanaConfigs: + """get_grafana_configs + + Get grafana config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_grafana_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GrafanaConfigs", + "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 get_grafana_configs_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GrafanaConfigs]: + """get_grafana_configs + + Get grafana config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_grafana_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GrafanaConfigs", + "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 get_grafana_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_grafana_configs + + Get grafana config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_grafana_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GrafanaConfigs", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_grafana_configs_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/grafana-configs", + 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 get_instance( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetInstanceResponse: + """get_instance + + Get instance information. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetInstanceResponse", + "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 get_instance_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetInstanceResponse]: + """get_instance + + Get instance information. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetInstanceResponse", + "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 get_instance_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_instance + + Get instance information. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_instance_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetInstanceResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_instance_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", + 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 get_logs_alertgroup( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertGroupResponse: + """get_logs_alertgroup + + Get 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 _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._get_logs_alertgroup_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupResponse", + "400": "Message", + "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 get_logs_alertgroup_with_http_info( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertGroupResponse]: + """get_logs_alertgroup + + Get 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 _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._get_logs_alertgroup_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupResponse", + "400": "Message", + "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 get_logs_alertgroup_without_preload_content( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_logs_alertgroup + + Get 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 _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._get_logs_alertgroup_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupResponse", + "400": "Message", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_logs_alertgroup_serialize( + self, + group_name, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups/{groupName}", + 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 get_logs_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LogsConfigResponse: + """get_logs_configs + + Get logs configuration. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_logs_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "LogsConfigResponse", + "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 get_logs_configs_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LogsConfigResponse]: + """get_logs_configs + + Get logs configuration. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_logs_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "LogsConfigResponse", + "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 get_logs_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_logs_configs + + Get logs configuration. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_logs_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "LogsConfigResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_logs_configs_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-configs", + 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 get_metrics_storage_retention( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetMetricsStorageRetentionResponse: + """get_metrics_storage_retention + + Get metric storage retention time. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + 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._get_metrics_storage_retention_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetMetricsStorageRetentionResponse", + "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 get_metrics_storage_retention_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetMetricsStorageRetentionResponse]: + """get_metrics_storage_retention + + Get metric storage retention time. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + 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._get_metrics_storage_retention_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetMetricsStorageRetentionResponse", + "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 get_metrics_storage_retention_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_metrics_storage_retention + + Get metric storage retention time. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + 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._get_metrics_storage_retention_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetMetricsStorageRetentionResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_metrics_storage_retention_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/metrics-storage-retentions", + 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 get_scrape_config( + self, + instance_id: StrictStr, + job_name: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetScrapeConfigResponse: + """get_scrape_config + + 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 + 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._get_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetScrapeConfigResponse", + "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 get_scrape_config_with_http_info( + self, + instance_id: StrictStr, + job_name: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetScrapeConfigResponse]: + """get_scrape_config + + 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 + 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._get_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetScrapeConfigResponse", + "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 get_scrape_config_without_preload_content( + self, + instance_id: StrictStr, + job_name: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_scrape_config + + 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 + 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._get_scrape_config_serialize( + instance_id=instance_id, + job_name=job_name, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetScrapeConfigResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_scrape_config_serialize( + self, + instance_id, + job_name, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs/{jobName}", + 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 get_traces_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TracesConfigResponse: + """get_traces_configs + + Get traces config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_traces_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TracesConfigResponse", + "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 get_traces_configs_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TracesConfigResponse]: + """get_traces_configs + + Get traces config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_traces_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TracesConfigResponse", + "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 get_traces_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_traces_configs + + Get traces config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_traces_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TracesConfigResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_traces_configs_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/traces-configs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_acl( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListACLResponse: + """list_acl + + Get acl for instance. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_acl_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListACLResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_acl_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListACLResponse]: + """list_acl + + Get acl for instance. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_acl_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListACLResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_acl_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_acl + + Get acl for instance. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_acl_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListACLResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_acl_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/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 list_alert_config_receivers( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertConfigReceiversResponse: + """list_alert_config_receivers + + Get alert config receivers. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alert_config_receivers_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigReceiversResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alert_config_receivers_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertConfigReceiversResponse]: + """list_alert_config_receivers + + Get alert config receivers. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alert_config_receivers_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigReceiversResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alert_config_receivers_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alert_config_receivers + + Get alert config receivers. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alert_config_receivers_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigReceiversResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alert_config_receivers_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/receivers", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alert_config_routes( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertConfigRouteResponse: + """list_alert_config_routes + + Get alert config route. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alert_config_routes_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigRouteResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alert_config_routes_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertConfigRouteResponse]: + """list_alert_config_routes + + Get alert config route. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alert_config_routes_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigRouteResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alert_config_routes_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alert_config_routes + + Get alert config route. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alert_config_routes_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertConfigRouteResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alert_config_routes_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertconfigs/routes", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alertgroups( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertGroupsResponse: + """list_alertgroups + + Get alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alertgroups_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertGroupsResponse]: + """list_alertgroups + + Get alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alertgroups_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alertgroups + + Get alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alertgroups_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alertrecords( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertRecordsResponse: + """list_alertrecords + + Get alert records. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertrecords_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRecordsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alertrecords_with_http_info( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertRecordsResponse]: + """list_alertrecords + + Get alert records. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertrecords_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRecordsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alertrecords_without_preload_content( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alertrecords + + Get alert records. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertrecords_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRecordsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alertrecords_serialize( + self, + group_name, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/records", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_alertrules( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertRulesResponse: + """list_alertrules + + Get alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRulesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_alertrules_with_http_info( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertRulesResponse]: + """list_alertrules + + Get alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRulesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_alertrules_without_preload_content( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_alertrules + + Get alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_alertrules_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertRulesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_alertrules_serialize( + self, + group_name, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups/{groupName}/alertrules", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_backup_retentions( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BackupRetentionResponse: + """list_backup_retentions + + Get backup retention. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_backup_retentions_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupRetentionResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_backup_retentions_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BackupRetentionResponse]: + """list_backup_retentions + + Get backup retention. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_backup_retentions_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupRetentionResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_backup_retentions_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_backup_retentions + + Get backup retention. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_backup_retentions_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupRetentionResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_backup_retentions_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/backup-retentions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_backup_schedules( + self, + instance_id: StrictStr, + project_id: StrictStr, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = 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, + ) -> BackupScheduleResponse: + """list_backup_schedules + + Get backup schedules. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param backup_target: List of backup targets + :type backup_target: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._list_backup_schedules_serialize( + instance_id=instance_id, + project_id=project_id, + backup_target=backup_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupScheduleResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_backup_schedules_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = 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[BackupScheduleResponse]: + """list_backup_schedules + + Get backup schedules. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param backup_target: List of backup targets + :type backup_target: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._list_backup_schedules_serialize( + instance_id=instance_id, + project_id=project_id, + backup_target=backup_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupScheduleResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_backup_schedules_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = 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: + """list_backup_schedules + + Get backup schedules. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param backup_target: List of backup targets + :type backup_target: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._list_backup_schedules_serialize( + instance_id=instance_id, + project_id=project_id, + backup_target=backup_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupScheduleResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_backup_schedules_serialize( + self, + instance_id, + project_id, + backup_target, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "backupTarget": "csv", + } + + _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 + if backup_target is not None: + + _query_params.append(("backupTarget", backup_target)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/backup-schedules", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_backups( + self, + instance_id: StrictStr, + project_id: StrictStr, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = 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, + ) -> BackupResponse: + """list_backups + + Get backups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param backup_target: List of backup targets + :type backup_target: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._list_backups_serialize( + instance_id=instance_id, + project_id=project_id, + backup_target=backup_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupResponse", + "403": "PermissionDenied", + "502": "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 list_backups_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = 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[BackupResponse]: + """list_backups + + Get backups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param backup_target: List of backup targets + :type backup_target: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._list_backups_serialize( + instance_id=instance_id, + project_id=project_id, + backup_target=backup_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupResponse", + "403": "PermissionDenied", + "502": "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 list_backups_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + backup_target: Annotated[Optional[List[StrictStr]], Field(description="List of backup targets")] = 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: + """list_backups + + Get backups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param backup_target: List of backup targets + :type backup_target: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (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._list_backups_serialize( + instance_id=instance_id, + project_id=project_id, + backup_target=backup_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "BackupResponse", + "403": "PermissionDenied", + "502": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_backups_serialize( + self, + instance_id, + project_id, + backup_target, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "backupTarget": "csv", + } + + _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 + if backup_target is not None: + + _query_params.append(("backupTarget", backup_target)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/backups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_cert_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CertCheckResponse: + """list_cert_checks + + Get all cert checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cert_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CertCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_cert_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CertCheckResponse]: + """list_cert_checks + + Get all cert checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cert_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CertCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_cert_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_cert_checks + + Get all cert checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cert_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "CertCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_cert_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/cert-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_credentials( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListCredentialsResponse: + """list_credentials + + Get all technical user credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ListCredentialsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_credentials_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListCredentialsResponse]: + """list_credentials + + Get all technical user credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ListCredentialsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_credentials_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_credentials + + Get all technical user credentials. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_credentials_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ListCredentialsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_credentials_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/credentials", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_elasticsearch_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ElasticsearchCheckResponse: + """list_elasticsearch_checks + + Get all elasticsearch checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_elasticsearch_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ElasticsearchCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_elasticsearch_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ElasticsearchCheckResponse]: + """list_elasticsearch_checks + + Get all elasticsearch checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_elasticsearch_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ElasticsearchCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_elasticsearch_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_elasticsearch_checks + + Get all elasticsearch checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_elasticsearch_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ElasticsearchCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_elasticsearch_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/elasticsearch-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_http_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> HttpCheckResponse: + """list_http_checks + + Get all http checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_http_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HttpCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_http_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[HttpCheckResponse]: + """list_http_checks + + Get all http checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_http_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HttpCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_http_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_http_checks + + Get all http checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_http_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "HttpCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_http_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/http-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_instances( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListInstancesResponse: + """list_instances + + Get all instances for a project. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstancesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_instances_with_http_info( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListInstancesResponse]: + """list_instances + + Get all instances for a project. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstancesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_instances_without_preload_content( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_instances + + Get all instances for a project. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_instances_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListInstancesResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_instances_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_logs_alertgroups( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertGroupsResponse: + """list_logs_alertgroups + + Get logs alert groups config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_logs_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_logs_alertgroups_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertGroupsResponse]: + """list_logs_alertgroups + + Get logs alert groups config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_logs_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_logs_alertgroups_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_logs_alertgroups + + Get logs alert groups config. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_logs_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_logs_alertgroups_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/logs-alertgroups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_mongodb_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MongodbCheckResponse: + """list_mongodb_checks + + Get all mongodb checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_mongodb_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MongodbCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_mongodb_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MongodbCheckResponse]: + """list_mongodb_checks + + Get all mongodb checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_mongodb_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MongodbCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_mongodb_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_mongodb_checks + + Get all mongodb checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_mongodb_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MongodbCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_mongodb_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/mongodb-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_mysql_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> MysqlCheckResponse: + """list_mysql_checks + + Get all mysql checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_mysql_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MysqlCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_mysql_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[MysqlCheckResponse]: + """list_mysql_checks + + Get all mysql checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_mysql_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MysqlCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_mysql_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_mysql_checks + + Get all mysql checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_mysql_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "MysqlCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_mysql_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/mysql-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_network_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> NetworkCheckResponse: + """list_network_checks + + Get all network checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_network_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_network_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[NetworkCheckResponse]: + """list_network_checks + + Get all network checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_network_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_network_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_network_checks + + Get all network checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_network_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "NetworkCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_network_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/network-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_offerings( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Offerings: + """list_offerings + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_offerings_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Offerings", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_offerings_with_http_info( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Offerings]: + """list_offerings + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_offerings_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Offerings", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_offerings_without_preload_content( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_offerings + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_offerings_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Offerings", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_offerings_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/offerings", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_ping_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PingCheckResponse: + """list_ping_checks + + Get all ping checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_ping_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PingCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_ping_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PingCheckResponse]: + """list_ping_checks + + Get all ping checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_ping_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PingCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_ping_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_ping_checks + + Get all ping checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_ping_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PingCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_ping_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/ping-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_plans( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlansResponse: + """list_plans + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_plans_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlansResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_plans_with_http_info( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlansResponse]: + """list_plans + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_plans_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlansResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_plans_without_preload_content( + self, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_plans + + Get all plans. + + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_plans_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PlansResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_plans_serialize( + self, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/plans", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_postgresql_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PostgresqlCheckResponse: + """list_postgresql_checks + + Get all postgresql checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_postgresql_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PostgresqlCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_postgresql_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PostgresqlCheckResponse]: + """list_postgresql_checks + + Get all postgresql checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_postgresql_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PostgresqlCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_postgresql_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_postgresql_checks + + Get all postgresql checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_postgresql_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "PostgresqlCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_postgresql_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/postgresql-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_rabbitmq_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RabbitmqCheckResponse: + """list_rabbitmq_checks + + Get all rabbitmq checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_rabbitmq_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RabbitmqCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_rabbitmq_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RabbitmqCheckResponse]: + """list_rabbitmq_checks + + Get all rabbitmq checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_rabbitmq_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RabbitmqCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_rabbitmq_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_rabbitmq_checks + + Get all rabbitmq checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_rabbitmq_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RabbitmqCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_rabbitmq_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/rabbitmq-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_redis_checks( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RedisCheckResponse: + """list_redis_checks + + Get all redis checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_redis_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RedisCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_redis_checks_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RedisCheckResponse]: + """list_redis_checks + + Get all redis checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_redis_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RedisCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_redis_checks_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_redis_checks + + Get all redis checks configured. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_redis_checks_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "RedisCheckResponse", + "400": "List[str]", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_redis_checks_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/redis-checks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_scrape_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListScrapeConfigsResponse: + """list_scrape_configs + + Get scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListScrapeConfigsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_scrape_configs_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListScrapeConfigsResponse]: + """list_scrape_configs + + Get scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListScrapeConfigsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_scrape_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_scrape_configs + + Get scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListScrapeConfigsResponse", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_scrape_configs_serialize( + self, + instance_id, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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 + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/scrapeconfigs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def partial_update_alertgroups( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertGroupsResponse: + """partial_update_alertgroups + + Patch alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._partial_update_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner=update_alertgroups_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def partial_update_alertgroups_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AlertGroupsResponse]: + """partial_update_alertgroups + + Patch alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._partial_update_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner=update_alertgroups_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def partial_update_alertgroups_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """partial_update_alertgroups + + Patch alert groups. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param update_alertgroups_request_inner: (required) + :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._partial_update_alertgroups_serialize( + instance_id=instance_id, + project_id=project_id, + update_alertgroups_request_inner=update_alertgroups_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertGroupsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _partial_update_alertgroups_serialize( + self, + instance_id, + project_id, + update_alertgroups_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "UpdateAlertgroupsRequestInner": "", + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, 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_alertgroups_request_inner is not None: + _body_params = update_alertgroups_request_inner + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/alertgroups", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def partial_update_alertrecords( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_alertrecords_request_inner: List[PartialUpdateAlertrecordsRequestInner], + _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, + ) -> AlertRecordsResponse: + """partial_update_alertrecords + + Patch alert records. + + :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 partial_update_alertrecords_request_inner: (required) + :type partial_update_alertrecords_request_inner: List[PartialUpdateAlertrecordsRequestInner] + :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_alertrecords_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + partial_update_alertrecords_request_inner=partial_update_alertrecords_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertRecordsResponse", + "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_alertrecords_with_http_info( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_alertrecords_request_inner: List[PartialUpdateAlertrecordsRequestInner], + _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[AlertRecordsResponse]: + """partial_update_alertrecords + + Patch alert records. + + :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 partial_update_alertrecords_request_inner: (required) + :type partial_update_alertrecords_request_inner: List[PartialUpdateAlertrecordsRequestInner] + :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_alertrecords_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + partial_update_alertrecords_request_inner=partial_update_alertrecords_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertRecordsResponse", + "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_alertrecords_without_preload_content( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_alertrecords_request_inner: List[PartialUpdateAlertrecordsRequestInner], + _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_alertrecords + + Patch alert records. + + :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 partial_update_alertrecords_request_inner: (required) + :type partial_update_alertrecords_request_inner: List[PartialUpdateAlertrecordsRequestInner] + :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_alertrecords_serialize( + group_name=group_name, + instance_id=instance_id, + project_id=project_id, + partial_update_alertrecords_request_inner=partial_update_alertrecords_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "AlertRecordsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _partial_update_alertrecords_serialize( + self, + group_name, + instance_id, + project_id, + partial_update_alertrecords_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "PartialUpdateAlertrecordsRequestInner": "", + } + + _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 partial_update_alertrecords_request_inner is not None: + _body_params = partial_update_alertrecords_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/{groupName}/records", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def partial_update_alertrules( + self, + group_name: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AlertRulesResponse: + """partial_update_alertrules + + Patch alert rules. + + :param group_name: (required) + :type group_name: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param partial_update_alertrules_request_inner: (required) + :type partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner] + :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, + partial_update_alertrules_request_inner=partial_update_alertrules_request_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, + partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner], + _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 partial_update_alertrules_request_inner: (required) + :type partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner] + :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, + partial_update_alertrules_request_inner=partial_update_alertrules_request_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, + partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner], + _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 partial_update_alertrules_request_inner: (required) + :type partial_update_alertrules_request_inner: List[PartialUpdateAlertrulesRequestInner] + :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, + partial_update_alertrules_request_inner=partial_update_alertrules_request_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, + partial_update_alertrules_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "PartialUpdateAlertrulesRequestInner": "", + } + + _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 partial_update_alertrules_request_inner is not None: + _body_params = partial_update_alertrules_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/{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 partial_update_scrape_configs( + self, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_scrape_configs_request_inner: List[PartialUpdateScrapeConfigsRequestInner], + _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, + ) -> ScrapeConfigsResponse: + """partial_update_scrape_configs + + Update scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param partial_update_scrape_configs_request_inner: (required) + :type partial_update_scrape_configs_request_inner: List[PartialUpdateScrapeConfigsRequestInner] + :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_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + partial_update_scrape_configs_request_inner=partial_update_scrape_configs_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "ScrapeConfigsResponse", + "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_scrape_configs_with_http_info( + self, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_scrape_configs_request_inner: List[PartialUpdateScrapeConfigsRequestInner], + _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[ScrapeConfigsResponse]: + """partial_update_scrape_configs + + Update scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param partial_update_scrape_configs_request_inner: (required) + :type partial_update_scrape_configs_request_inner: List[PartialUpdateScrapeConfigsRequestInner] + :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_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + partial_update_scrape_configs_request_inner=partial_update_scrape_configs_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "ScrapeConfigsResponse", + "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_scrape_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + partial_update_scrape_configs_request_inner: List[PartialUpdateScrapeConfigsRequestInner], + _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_scrape_configs + + Update scrape configs. + + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param partial_update_scrape_configs_request_inner: (required) + :type partial_update_scrape_configs_request_inner: List[PartialUpdateScrapeConfigsRequestInner] + :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_scrape_configs_serialize( + instance_id=instance_id, + project_id=project_id, + partial_update_scrape_configs_request_inner=partial_update_scrape_configs_request_inner, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "ScrapeConfigsResponse", + "400": "Error", + "403": "PermissionDenied", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _partial_update_scrape_configs_serialize( + self, + instance_id, + project_id, + partial_update_scrape_configs_request_inner, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + "PartialUpdateScrapeConfigsRequestInner": "", + } + + _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 partial_update_scrape_configs_request_inner is not None: + _body_params = partial_update_scrape_configs_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}/scrapeconfigs", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def restore_backup( + self, + backup_date: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + restore_target: Annotated[StrictStr, Field(description="List of restore targets")], + _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: + """restore_backup + + Restore backup. + + :param backup_date: (required) + :type backup_date: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param restore_target: List of restore targets (required) + :type restore_target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restore_backup_serialize( + backup_date=backup_date, + instance_id=instance_id, + project_id=project_id, + restore_target=restore_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Message", + "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 restore_backup_with_http_info( + self, + backup_date: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + restore_target: Annotated[StrictStr, Field(description="List of restore targets")], + _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]: + """restore_backup + + Restore backup. + + :param backup_date: (required) + :type backup_date: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param restore_target: List of restore targets (required) + :type restore_target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restore_backup_serialize( + backup_date=backup_date, + instance_id=instance_id, + project_id=project_id, + restore_target=restore_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Message", + "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 restore_backup_without_preload_content( + self, + backup_date: StrictStr, + instance_id: StrictStr, + project_id: StrictStr, + restore_target: Annotated[StrictStr, Field(description="List of restore targets")], + _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: + """restore_backup + + Restore backup. + + :param backup_date: (required) + :type backup_date: str + :param instance_id: (required) + :type instance_id: str + :param project_id: (required) + :type project_id: str + :param restore_target: List of restore targets (required) + :type restore_target: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._restore_backup_serialize( + backup_date=backup_date, + instance_id=instance_id, + project_id=project_id, + restore_target=restore_target, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "202": "Message", + "403": "PermissionDenied", + "404": "Message", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _restore_backup_serialize( + self, + backup_date, + instance_id, + project_id, + restore_target, + _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 backup_date is not None: + _path_params["backupDate"] = backup_date + 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 + if restore_target is not None: + + _query_params.append(("restoreTarget", restore_target)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/backup-restores/{backupDate}", + 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 + 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) + 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_receiver_payload: UpdateAlertConfigReceiverPayload, + 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_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) + 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, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_alert_configs_with_http_info( + 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, + ) -> ApiResponse[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, + response_types_map=_response_types_map, + ) + + @validate_call + def update_alert_configs_without_preload_content( + self, + instance_id: StrictStr, + project_id: StrictStr, + update_alert_configs_payload: UpdateAlertConfigsPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13239,18 +24700,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 @@ -13273,11 +24732,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, @@ -13285,20 +24743,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, @@ -13321,14 +24777,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: @@ -13347,7 +24801,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, @@ -13361,12 +24815,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)], @@ -13376,19 +24830,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 @@ -13411,11 +24865,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, @@ -13423,8 +24877,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", } @@ -13436,12 +24890,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)], @@ -13451,19 +24905,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 @@ -13486,11 +24940,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, + update_alertgroup_payload=update_alertgroup_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13498,8 +24952,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", } @@ -13511,12 +24965,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)], @@ -13527,18 +24981,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 @@ -13561,11 +25015,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, @@ -13573,20 +25027,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, @@ -13605,18 +25059,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: @@ -13635,7 +25089,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, @@ -13649,11 +25103,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)], @@ -13663,17 +25117,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 @@ -13696,10 +25150,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, @@ -13707,7 +25161,7 @@ def update_alert_configs( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -13719,11 +25173,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)], @@ -13733,17 +25187,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 @@ -13766,10 +25220,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, @@ -13777,7 +25231,7 @@ def update_alert_configs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "UpdateAlertConfigsResponse", + "202": "AlertGroupsResponse", "400": "Error", "403": "PermissionDenied", } @@ -13789,11 +25243,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)], @@ -13804,16 +25258,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 @@ -13836,10 +25290,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, @@ -13847,18 +25301,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, @@ -13867,7 +25321,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]] = [] @@ -13885,8 +25341,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: @@ -13905,7 +25361,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, @@ -13919,12 +25375,13 @@ def _update_alert_configs_serialize( ) @validate_call - def update_alertgroup( + def update_alertrecord( self, + alert_record: StrictStr, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroup_payload: UpdateAlertgroupPayload, + update_alertrecord_payload: UpdateAlertrecordPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13934,19 +25391,21 @@ 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 + ) -> AlertRecordsResponse: + """update_alertrecord - Update alert group config. + Update alert record. + :param alert_record: (required) + :type alert_record: str :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 update_alertrecord_payload: (required) + :type update_alertrecord_payload: UpdateAlertrecordPayload :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 @@ -13969,11 +25428,12 @@ def update_alertgroup( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroup_serialize( + _param = self._update_alertrecord_serialize( + alert_record=alert_record, group_name=group_name, instance_id=instance_id, project_id=project_id, - update_alertgroup_payload=update_alertgroup_payload, + update_alertrecord_payload=update_alertrecord_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -13981,8 +25441,8 @@ def update_alertgroup( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "AlertRecordsResponse", + "400": "Error", "403": "PermissionDenied", "404": "Message", } @@ -13994,12 +25454,13 @@ def update_alertgroup( ).data @validate_call - def update_alertgroup_with_http_info( + def update_alertrecord_with_http_info( self, + alert_record: StrictStr, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroup_payload: UpdateAlertgroupPayload, + update_alertrecord_payload: UpdateAlertrecordPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14009,19 +25470,21 @@ 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[AlertRecordsResponse]: + """update_alertrecord - Update alert group config. + Update alert record. + :param alert_record: (required) + :type alert_record: str :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 update_alertrecord_payload: (required) + :type update_alertrecord_payload: UpdateAlertrecordPayload :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 @@ -14044,11 +25507,12 @@ def update_alertgroup_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroup_serialize( + _param = self._update_alertrecord_serialize( + alert_record=alert_record, group_name=group_name, instance_id=instance_id, project_id=project_id, - update_alertgroup_payload=update_alertgroup_payload, + update_alertrecord_payload=update_alertrecord_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14056,8 +25520,8 @@ def update_alertgroup_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "AlertRecordsResponse", + "400": "Error", "403": "PermissionDenied", "404": "Message", } @@ -14069,12 +25533,13 @@ def update_alertgroup_with_http_info( ) @validate_call - def update_alertgroup_without_preload_content( + def update_alertrecord_without_preload_content( self, + alert_record: StrictStr, group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroup_payload: UpdateAlertgroupPayload, + update_alertrecord_payload: UpdateAlertrecordPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14085,18 +25550,20 @@ 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_alertrecord - Update alert group config. + Update alert record. + :param alert_record: (required) + :type alert_record: str :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 update_alertrecord_payload: (required) + :type update_alertrecord_payload: UpdateAlertrecordPayload :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 @@ -14119,11 +25586,12 @@ def update_alertgroup_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroup_serialize( + _param = self._update_alertrecord_serialize( + alert_record=alert_record, group_name=group_name, instance_id=instance_id, project_id=project_id, - update_alertgroup_payload=update_alertgroup_payload, + update_alertrecord_payload=update_alertrecord_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14131,20 +25599,21 @@ def update_alertgroup_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", - "400": "Message", + "202": "AlertRecordsResponse", + "400": "Error", "403": "PermissionDenied", "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_alertgroup_serialize( + def _update_alertrecord_serialize( self, + alert_record, group_name, instance_id, project_id, - update_alertgroup_payload, + update_alertrecord_payload, _request_auth, _content_type, _headers, @@ -14163,6 +25632,8 @@ def _update_alertgroup_serialize( _body_params: Optional[bytes] = None # process the path parameters + if alert_record is not None: + _path_params["alertRecord"] = alert_record if group_name is not None: _path_params["groupName"] = group_name if instance_id is not None: @@ -14173,8 +25644,8 @@ def _update_alertgroup_serialize( # 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_alertrecord_payload is not None: + _body_params = update_alertrecord_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -14193,7 +25664,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}/alertgroups/{groupName}/records/{alertRecord}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -14207,11 +25678,13 @@ def _update_alertgroup_serialize( ) @validate_call - def update_alertgroups( + def update_alertrule( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + update_alertrule_payload: UpdateAlertrulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14221,17 +25694,21 @@ 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 + ) -> AlertRulesResponse: + """update_alertrule - Update alert groups. + Update alert rule. + :param alert_name: (required) + :type alert_name: str + :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: (required) - :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param update_alertrule_payload: (required) + :type update_alertrule_payload: UpdateAlertrulePayload :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 @@ -14254,10 +25731,12 @@ def update_alertgroups( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroups_serialize( + _param = self._update_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, + update_alertrule_payload=update_alertrule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14265,9 +25744,10 @@ def update_alertgroups( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "202": "AlertRulesResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -14277,11 +25757,13 @@ def update_alertgroups( ).data @validate_call - def update_alertgroups_with_http_info( + def update_alertrule_with_http_info( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + update_alertrule_payload: UpdateAlertrulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14291,17 +25773,21 @@ 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[AlertRulesResponse]: + """update_alertrule - Update alert groups. + Update alert rule. + :param alert_name: (required) + :type alert_name: str + :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: (required) - :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param update_alertrule_payload: (required) + :type update_alertrule_payload: UpdateAlertrulePayload :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 @@ -14324,10 +25810,12 @@ def update_alertgroups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroups_serialize( + _param = self._update_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, + update_alertrule_payload=update_alertrule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14335,9 +25823,10 @@ def update_alertgroups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "202": "AlertRulesResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -14347,11 +25836,13 @@ def update_alertgroups_with_http_info( ) @validate_call - def update_alertgroups_without_preload_content( + def update_alertrule_without_preload_content( self, + alert_name: StrictStr, + group_name: StrictStr, instance_id: StrictStr, project_id: StrictStr, - update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner], + update_alertrule_payload: UpdateAlertrulePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14362,16 +25853,20 @@ 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_alertrule - Update alert groups. + Update alert rule. + :param alert_name: (required) + :type alert_name: str + :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: (required) - :type update_alertgroups_request_inner: List[UpdateAlertgroupsRequestInner] + :param update_alertrule_payload: (required) + :type update_alertrule_payload: UpdateAlertrulePayload :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 @@ -14394,10 +25889,12 @@ def update_alertgroups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alertgroups_serialize( + _param = self._update_alertrule_serialize( + alert_name=alert_name, + group_name=group_name, instance_id=instance_id, project_id=project_id, - update_alertgroups_request_inner=update_alertgroups_request_inner, + update_alertrule_payload=update_alertrule_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -14405,18 +25902,21 @@ def update_alertgroups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "202": "AlertGroupsResponse", + "202": "AlertRulesResponse", "400": "Error", "403": "PermissionDenied", + "404": "Message", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_alertgroups_serialize( + def _update_alertrule_serialize( self, + alert_name, + group_name, instance_id, project_id, - update_alertgroups_request_inner, + update_alertrule_payload, _request_auth, _content_type, _headers, @@ -14425,9 +25925,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]] = [] @@ -14437,6 +25935,10 @@ def _update_alertgroups_serialize( _body_params: Optional[bytes] = None # process the path parameters + if alert_name is not None: + _path_params["alertName"] = alert_name + 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: @@ -14445,8 +25947,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_alertrule_payload is not None: + _body_params = update_alertrule_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -14465,7 +25967,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}/alertgroups/{groupName}/alertrules/{alertName}", 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 b2938298d..061e09ce1 100644 --- a/services/observability/src/stackit/observability/models/__init__.py +++ b/services/observability/src/stackit/observability/models/__init__.py @@ -25,9 +25,22 @@ from stackit.observability.models.alert_group import AlertGroup from stackit.observability.models.alert_group_response import AlertGroupResponse from stackit.observability.models.alert_groups_response import AlertGroupsResponse -from stackit.observability.models.alert_rule import AlertRule +from stackit.observability.models.alert_record_response import AlertRecordResponse +from stackit.observability.models.alert_records_response import AlertRecordsResponse from stackit.observability.models.alert_rule_record import AlertRuleRecord +from stackit.observability.models.alert_rule_response import AlertRuleResponse from stackit.observability.models.alert_rules_response import AlertRulesResponse +from stackit.observability.models.alertrecord_response import AlertrecordResponse +from stackit.observability.models.alertrule_response import AlertruleResponse +from stackit.observability.models.backup_response import BackupResponse +from stackit.observability.models.backup_retention_response import ( + BackupRetentionResponse, +) +from stackit.observability.models.backup_schedule import BackupSchedule +from stackit.observability.models.backup_schedule_post_response import ( + BackupSchedulePostResponse, +) +from stackit.observability.models.backup_schedule_response import BackupScheduleResponse from stackit.observability.models.basic_auth import BasicAuth from stackit.observability.models.cert_check_child_response import ( CertCheckChildResponse, @@ -54,9 +67,15 @@ from stackit.observability.models.create_alertgroups_payload import ( CreateAlertgroupsPayload, ) +from stackit.observability.models.create_alertrecord_payload import ( + CreateAlertrecordPayload, +) from stackit.observability.models.create_alertrules_payload import ( CreateAlertrulesPayload, ) +from stackit.observability.models.create_backup_schedule_payload import ( + CreateBackupSchedulePayload, +) from stackit.observability.models.create_cert_check400_response import ( CreateCertCheck400Response, ) @@ -69,6 +88,9 @@ from stackit.observability.models.create_credentials_response import ( CreateCredentialsResponse, ) +from stackit.observability.models.create_elasticsearch_check_payload import ( + CreateElasticsearchCheckPayload, +) from stackit.observability.models.create_http_check_payload import ( CreateHttpCheckPayload, ) @@ -80,26 +102,29 @@ from stackit.observability.models.create_logs_alertgroups_payload_rules_inner import ( CreateLogsAlertgroupsPayloadRulesInner, ) -from stackit.observability.models.create_scrape_config_payload import ( - CreateScrapeConfigPayload, +from stackit.observability.models.create_mongodb_check_payload import ( + CreateMongodbCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_basic_auth import ( - CreateScrapeConfigPayloadBasicAuth, +from stackit.observability.models.create_mysql_check_payload import ( + CreateMysqlCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner import ( - CreateScrapeConfigPayloadHttpSdConfigsInner, +from stackit.observability.models.create_network_check_payload import ( + CreateNetworkCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2 import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2, +from stackit.observability.models.create_ping_check_payload import ( + CreatePingCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, +from stackit.observability.models.create_postgresql_check_payload import ( + CreatePostgresqlCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_metrics_relabel_configs_inner import ( - CreateScrapeConfigPayloadMetricsRelabelConfigsInner, +from stackit.observability.models.create_rabbitmq_check_payload import ( + CreateRabbitmqCheckPayload, ) -from stackit.observability.models.create_scrape_config_payload_static_configs_inner import ( - CreateScrapeConfigPayloadStaticConfigsInner, +from stackit.observability.models.create_redis_check_payload import ( + CreateRedisCheckPayload, +) +from stackit.observability.models.create_scrape_config_payload import ( + CreateScrapeConfigPayload, ) from stackit.observability.models.credentials import Credentials from stackit.observability.models.credentials_remote_write_config import ( @@ -111,6 +136,12 @@ from stackit.observability.models.delete_scrape_config_response import ( DeleteScrapeConfigResponse, ) +from stackit.observability.models.elasticsearch_check_child_response import ( + ElasticsearchCheckChildResponse, +) +from stackit.observability.models.elasticsearch_check_response import ( + ElasticsearchCheckResponse, +) from stackit.observability.models.email_config import EmailConfig from stackit.observability.models.error import Error from stackit.observability.models.get_alert_configs_response import ( @@ -149,18 +180,73 @@ from stackit.observability.models.message import Message from stackit.observability.models.metrics_relabel_config import MetricsRelabelConfig from stackit.observability.models.model_global import ModelGlobal +from stackit.observability.models.mongodb_check_child_response import ( + MongodbCheckChildResponse, +) +from stackit.observability.models.mongodb_check_response import MongodbCheckResponse +from stackit.observability.models.mysql_check_child_response import ( + MysqlCheckChildResponse, +) +from stackit.observability.models.mysql_check_response import MysqlCheckResponse +from stackit.observability.models.network_check_child_response import ( + NetworkCheckChildResponse, +) +from stackit.observability.models.network_check_response import NetworkCheckResponse from stackit.observability.models.o_auth2 import OAuth2 +from stackit.observability.models.offerings import Offerings from stackit.observability.models.opsgenie_config import OpsgenieConfig +from stackit.observability.models.partial_update_alertrecords_request_inner import ( + PartialUpdateAlertrecordsRequestInner, +) from stackit.observability.models.partial_update_alertrules_request_inner import ( PartialUpdateAlertrulesRequestInner, ) +from stackit.observability.models.partial_update_scrape_configs_request_inner import ( + PartialUpdateScrapeConfigsRequestInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_basic_auth import ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2 import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_static_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner, +) from stackit.observability.models.permission_denied import PermissionDenied +from stackit.observability.models.ping_check_child_response import ( + PingCheckChildResponse, +) +from stackit.observability.models.ping_check_response import PingCheckResponse from stackit.observability.models.plan import Plan from stackit.observability.models.plan_model import PlanModel from stackit.observability.models.plans_response import PlansResponse +from stackit.observability.models.postgresql_check_child_response import ( + PostgresqlCheckChildResponse, +) +from stackit.observability.models.postgresql_check_response import ( + PostgresqlCheckResponse, +) from stackit.observability.models.project_instance_full import ProjectInstanceFull +from stackit.observability.models.rabbit_mq_check_child_response import ( + RabbitMQCheckChildResponse, +) +from stackit.observability.models.rabbitmq_check_response import RabbitmqCheckResponse from stackit.observability.models.receiver import Receiver from stackit.observability.models.receivers import Receivers +from stackit.observability.models.redis_check_child_response import ( + RedisCheckChildResponse, +) +from stackit.observability.models.redis_check_response import RedisCheckResponse from stackit.observability.models.route import Route from stackit.observability.models.route_serializer import RouteSerializer from stackit.observability.models.scrape_configs_response import ScrapeConfigsResponse @@ -206,6 +292,10 @@ from stackit.observability.models.update_alertgroups_request_inner_rules_inner import ( UpdateAlertgroupsRequestInnerRulesInner, ) +from stackit.observability.models.update_alertrecord_payload import ( + UpdateAlertrecordPayload, +) +from stackit.observability.models.update_alertrule_payload import UpdateAlertrulePayload from stackit.observability.models.update_credentials_remote_write_config_payload import ( UpdateCredentialsRemoteWriteConfigPayload, ) diff --git a/services/observability/src/stackit/observability/models/alert_record_response.py b/services/observability/src/stackit/observability/models/alert_record_response.py new file mode 100644 index 000000000..93db52eaa --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_record_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.alertrecord_response import AlertrecordResponse + + +class AlertRecordResponse(BaseModel): + """ + AlertRecordResponse + """ # noqa: E501 + + data: AlertrecordResponse + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["data", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertRecordResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict["data"] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertRecordResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": AlertrecordResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_records_response.py b/services/observability/src/stackit/observability/models/alert_records_response.py new file mode 100644 index 000000000..3a29e4391 --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_records_response.py @@ -0,0 +1,101 @@ +# 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.alertrecord_response import AlertrecordResponse + + +class AlertRecordsResponse(BaseModel): + """ + AlertRecordsResponse + """ # noqa: E501 + + data: List[AlertrecordResponse] + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["data", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertRecordsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict["data"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertRecordsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": ( + [AlertrecordResponse.from_dict(_item) for _item in obj["data"]] + if obj.get("data") is not None + else None + ), + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_rule_response.py b/services/observability/src/stackit/observability/models/alert_rule_response.py new file mode 100644 index 000000000..74d3cf617 --- /dev/null +++ b/services/observability/src/stackit/observability/models/alert_rule_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.alertrule_response import AlertruleResponse + + +class AlertRuleResponse(BaseModel): + """ + AlertRuleResponse + """ # noqa: E501 + + data: AlertruleResponse + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["data", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertRuleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict["data"] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AlertRuleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "data": AlertruleResponse.from_dict(obj["data"]) if obj.get("data") is not None else None, + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_rules_response.py b/services/observability/src/stackit/observability/models/alert_rules_response.py index ab300a817..a50b01629 100644 --- a/services/observability/src/stackit/observability/models/alert_rules_response.py +++ b/services/observability/src/stackit/observability/models/alert_rules_response.py @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated, Self -from stackit.observability.models.alert_rule import AlertRule +from stackit.observability.models.alertrule_response import AlertruleResponse class AlertRulesResponse(BaseModel): @@ -29,7 +29,7 @@ class AlertRulesResponse(BaseModel): AlertRulesResponse """ # noqa: E501 - data: List[AlertRule] + data: List[AlertruleResponse] message: Annotated[str, Field(min_length=1, strict=True)] __properties: ClassVar[List[str]] = ["data", "message"] @@ -90,7 +90,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { - "data": [AlertRule.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "data": ( + [AlertruleResponse.from_dict(_item) for _item in obj["data"]] + if obj.get("data") is not None + else None + ), "message": obj.get("message"), } ) diff --git a/services/observability/src/stackit/observability/models/alertrecord_response0.py b/services/observability/src/stackit/observability/models/alertrecord_response0.py new file mode 100644 index 000000000..bc8f63184 --- /dev/null +++ b/services/observability/src/stackit/observability/models/alertrecord_response0.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 AlertrecordResponse(BaseModel): + """ + AlertrecordResponse + """ # noqa: E501 + + expr: Annotated[str, Field(min_length=1, strict=True, max_length=2000)] + labels: Optional[Dict[str, Annotated[str, Field(min_length=1, strict=True)]]] = None + record: Annotated[str, Field(min_length=1, strict=True, max_length=300)] + __properties: ClassVar[List[str]] = ["expr", "labels", "record"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AlertrecordResponse 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 AlertrecordResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"expr": obj.get("expr"), "labels": obj.get("labels"), "record": obj.get("record")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/alert_rule.py b/services/observability/src/stackit/observability/models/alertrule_response0.py similarity index 93% rename from services/observability/src/stackit/observability/models/alert_rule.py rename to services/observability/src/stackit/observability/models/alertrule_response0.py index 257aeed93..3cd5964dd 100644 --- a/services/observability/src/stackit/observability/models/alert_rule.py +++ b/services/observability/src/stackit/observability/models/alertrule_response0.py @@ -22,9 +22,9 @@ from typing_extensions import Annotated, Self -class AlertRule(BaseModel): +class AlertruleResponse(BaseModel): """ - AlertRule + AlertruleResponse """ # noqa: E501 alert: Annotated[str, Field(min_length=1, strict=True, max_length=200)] @@ -51,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AlertRule from a JSON string""" + """Create an instance of AlertruleResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AlertRule from a dict""" + """Create an instance of AlertruleResponse from a dict""" if obj is None: return None diff --git a/services/observability/src/stackit/observability/models/backup_response.py b/services/observability/src/stackit/observability/models/backup_response.py new file mode 100644 index 000000000..a82cc4a07 --- /dev/null +++ b/services/observability/src/stackit/observability/models/backup_response.py @@ -0,0 +1,100 @@ +# 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, StrictStr +from typing_extensions import Annotated, Self + + +class BackupResponse(BaseModel): + """ + BackupResponse + """ # noqa: E501 + + alert_config_backups: List[StrictStr] = Field(alias="alertConfigBackups") + alert_rules_backups: List[StrictStr] = Field(alias="alertRulesBackups") + grafana_backups: List[StrictStr] = Field(alias="grafanaBackups") + message: Annotated[str, Field(min_length=1, strict=True)] + scrape_config_backups: List[StrictStr] = Field(alias="scrapeConfigBackups") + __properties: ClassVar[List[str]] = [ + "alertConfigBackups", + "alertRulesBackups", + "grafanaBackups", + "message", + "scrapeConfigBackups", + ] + + 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 BackupResponse 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 BackupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alertConfigBackups": obj.get("alertConfigBackups"), + "alertRulesBackups": obj.get("alertRulesBackups"), + "grafanaBackups": obj.get("grafanaBackups"), + "message": obj.get("message"), + "scrapeConfigBackups": obj.get("scrapeConfigBackups"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/backup_retention_response.py b/services/observability/src/stackit/observability/models/backup_retention_response.py new file mode 100644 index 000000000..2366d1d76 --- /dev/null +++ b/services/observability/src/stackit/observability/models/backup_retention_response.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +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 BackupRetentionResponse(BaseModel): + """ + BackupRetentionResponse + """ # noqa: E501 + + alert_config_backup_retention: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + alias="alertConfigBackupRetention" + ) + alert_rules_backup_retention: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + alias="alertRulesBackupRetention" + ) + grafana_backup_retention: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + alias="grafanaBackupRetention" + ) + message: Annotated[str, Field(min_length=1, strict=True)] + scrape_config_backup_retention: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + alias="scrapeConfigBackupRetention" + ) + __properties: ClassVar[List[str]] = [ + "alertConfigBackupRetention", + "alertRulesBackupRetention", + "grafanaBackupRetention", + "message", + "scrapeConfigBackupRetention", + ] + + 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 BackupRetentionResponse 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 BackupRetentionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alertConfigBackupRetention": obj.get("alertConfigBackupRetention"), + "alertRulesBackupRetention": obj.get("alertRulesBackupRetention"), + "grafanaBackupRetention": obj.get("grafanaBackupRetention"), + "message": obj.get("message"), + "scrapeConfigBackupRetention": obj.get("scrapeConfigBackupRetention"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/backup_schedule.py b/services/observability/src/stackit/observability/models/backup_schedule.py new file mode 100644 index 000000000..f389b5165 --- /dev/null +++ b/services/observability/src/stackit/observability/models/backup_schedule.py @@ -0,0 +1,83 @@ +# 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, StrictStr +from typing_extensions import Annotated, Self + + +class BackupSchedule(BaseModel): + """ + BackupSchedule + """ # noqa: E501 + + schedule: Annotated[str, Field(min_length=1, strict=True, max_length=100)] + schedule_id: StrictStr = Field(alias="scheduleId") + __properties: ClassVar[List[str]] = ["schedule", "scheduleId"] + + 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 BackupSchedule 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 BackupSchedule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"schedule": obj.get("schedule"), "scheduleId": obj.get("scheduleId")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/backup_schedule_post_response.py b/services/observability/src/stackit/observability/models/backup_schedule_post_response.py new file mode 100644 index 000000000..537b01001 --- /dev/null +++ b/services/observability/src/stackit/observability/models/backup_schedule_post_response.py @@ -0,0 +1,83 @@ +# 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 BackupSchedulePostResponse(BaseModel): + """ + BackupSchedulePostResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + schedule: Annotated[str, Field(min_length=1, strict=True, max_length=100)] + __properties: ClassVar[List[str]] = ["message", "schedule"] + + 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 BackupSchedulePostResponse 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 BackupSchedulePostResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"message": obj.get("message"), "schedule": obj.get("schedule")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/backup_schedule_response.py b/services/observability/src/stackit/observability/models/backup_schedule_response.py new file mode 100644 index 000000000..d03b64945 --- /dev/null +++ b/services/observability/src/stackit/observability/models/backup_schedule_response.py @@ -0,0 +1,152 @@ +# 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.backup_schedule import BackupSchedule + + +class BackupScheduleResponse(BaseModel): + """ + BackupScheduleResponse + """ # noqa: E501 + + alert_config_backup_schedules: Optional[List[BackupSchedule]] = Field( + default=None, alias="alertConfigBackupSchedules" + ) + alert_rules_backup_schedules: Optional[List[BackupSchedule]] = Field( + default=None, alias="alertRulesBackupSchedules" + ) + grafana_backup_schedules: Optional[List[BackupSchedule]] = Field(default=None, alias="grafanaBackupSchedules") + message: Annotated[str, Field(min_length=1, strict=True)] + scrape_config_backup_schedules: Optional[List[BackupSchedule]] = Field( + default=None, alias="scrapeConfigBackupSchedules" + ) + __properties: ClassVar[List[str]] = [ + "alertConfigBackupSchedules", + "alertRulesBackupSchedules", + "grafanaBackupSchedules", + "message", + "scrapeConfigBackupSchedules", + ] + + 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 BackupScheduleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in alert_config_backup_schedules (list) + _items = [] + if self.alert_config_backup_schedules: + for _item in self.alert_config_backup_schedules: + if _item: + _items.append(_item.to_dict()) + _dict["alertConfigBackupSchedules"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in alert_rules_backup_schedules (list) + _items = [] + if self.alert_rules_backup_schedules: + for _item in self.alert_rules_backup_schedules: + if _item: + _items.append(_item.to_dict()) + _dict["alertRulesBackupSchedules"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in grafana_backup_schedules (list) + _items = [] + if self.grafana_backup_schedules: + for _item in self.grafana_backup_schedules: + if _item: + _items.append(_item.to_dict()) + _dict["grafanaBackupSchedules"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in scrape_config_backup_schedules (list) + _items = [] + if self.scrape_config_backup_schedules: + for _item in self.scrape_config_backup_schedules: + if _item: + _items.append(_item.to_dict()) + _dict["scrapeConfigBackupSchedules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BackupScheduleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "alertConfigBackupSchedules": ( + [BackupSchedule.from_dict(_item) for _item in obj["alertConfigBackupSchedules"]] + if obj.get("alertConfigBackupSchedules") is not None + else None + ), + "alertRulesBackupSchedules": ( + [BackupSchedule.from_dict(_item) for _item in obj["alertRulesBackupSchedules"]] + if obj.get("alertRulesBackupSchedules") is not None + else None + ), + "grafanaBackupSchedules": ( + [BackupSchedule.from_dict(_item) for _item in obj["grafanaBackupSchedules"]] + if obj.get("grafanaBackupSchedules") is not None + else None + ), + "message": obj.get("message"), + "scrapeConfigBackupSchedules": ( + [BackupSchedule.from_dict(_item) for _item in obj["scrapeConfigBackupSchedules"]] + if obj.get("scrapeConfigBackupSchedules") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_alertrecord_payload.py b/services/observability/src/stackit/observability/models/create_alertrecord_payload.py new file mode 100644 index 000000000..f6f84f07a --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_alertrecord_payload.py @@ -0,0 +1,91 @@ +# 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 CreateAlertrecordPayload(BaseModel): + """ + Record. `Additional Validators:` * total config (all alert groups/rules/records) should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ # noqa: E501 + + expr: Annotated[str, Field(min_length=1, strict=True, max_length=2000)] = Field( + description="The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts." + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters ", + ) + record: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The name of the record. `Additional Validators:` * is the identifier and so unique in the group " + ) + __properties: ClassVar[List[str]] = ["expr", "labels", "record"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateAlertrecordPayload 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 CreateAlertrecordPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"expr": obj.get("expr"), "labels": obj.get("labels"), "record": obj.get("record")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_backup_schedule_payload.py b/services/observability/src/stackit/observability/models/create_backup_schedule_payload.py new file mode 100644 index 000000000..f9722b949 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_backup_schedule_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 CreateBackupSchedulePayload(BaseModel): + """ + CreateBackupSchedulePayload + """ # noqa: E501 + + schedule: Annotated[str, Field(strict=True, max_length=100)] = Field( + description="The schedule for how often to create a backup. `Additional Validators:` * must be a valid cronjob format * must run less than hourly" + ) + __properties: ClassVar[List[str]] = ["schedule"] + + 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 CreateBackupSchedulePayload 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 CreateBackupSchedulePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"schedule": obj.get("schedule")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_elasticsearch_check_payload.py b/services/observability/src/stackit/observability/models/create_elasticsearch_check_payload.py new file mode 100644 index 000000000..4745f5875 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_elasticsearch_check_payload.py @@ -0,0 +1,86 @@ +# 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 CreateElasticsearchCheckPayload(BaseModel): + """ + Elasticsearch check body. + """ # noqa: E501 + + password: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="password") + server: Annotated[str, Field(strict=True, max_length=200)] = Field(description="url to check") + username: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="username") + __properties: ClassVar[List[str]] = ["password", "server", "username"] + + 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 CreateElasticsearchCheckPayload 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 CreateElasticsearchCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"password": obj.get("password"), "server": obj.get("server"), "username": obj.get("username")} + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_mongodb_check_payload.py b/services/observability/src/stackit/observability/models/create_mongodb_check_payload.py new file mode 100644 index 000000000..a3258aaaf --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_mongodb_check_payload.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 CreateMongodbCheckPayload(BaseModel): + """ + Mongodb check body. + """ # noqa: E501 + + server: Annotated[str, Field(strict=True, max_length=200)] = Field(description="url to check") + __properties: ClassVar[List[str]] = ["server"] + + 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 CreateMongodbCheckPayload 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 CreateMongodbCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"server": obj.get("server")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_mysql_check_payload.py b/services/observability/src/stackit/observability/models/create_mysql_check_payload.py new file mode 100644 index 000000000..aacdd4a05 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_mysql_check_payload.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 CreateMysqlCheckPayload(BaseModel): + """ + MySQL check body. + """ # noqa: E501 + + server: Annotated[str, Field(strict=True, max_length=200)] = Field(description="url to check") + __properties: ClassVar[List[str]] = ["server"] + + 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 CreateMysqlCheckPayload 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 CreateMysqlCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"server": obj.get("server")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_network_check_payload.py b/services/observability/src/stackit/observability/models/create_network_check_payload.py new file mode 100644 index 000000000..749c54da5 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_network_check_payload.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 CreateNetworkCheckPayload(BaseModel): + """ + Network check body. + """ # noqa: E501 + + address: Annotated[str, Field(strict=True, max_length=400)] = Field(description="network to check") + __properties: ClassVar[List[str]] = ["address"] + + 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 CreateNetworkCheckPayload 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 CreateNetworkCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"address": obj.get("address")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_ping_check_payload.py b/services/observability/src/stackit/observability/models/create_ping_check_payload.py new file mode 100644 index 000000000..4d94985a8 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_ping_check_payload.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 CreatePingCheckPayload(BaseModel): + """ + Ping check body. + """ # noqa: E501 + + url: Annotated[str, Field(strict=True, max_length=400)] = Field(description="domain to check") + __properties: ClassVar[List[str]] = ["url"] + + 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 CreatePingCheckPayload 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 CreatePingCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"url": obj.get("url")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_postgresql_check_payload.py b/services/observability/src/stackit/observability/models/create_postgresql_check_payload.py new file mode 100644 index 000000000..3ba27f306 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_postgresql_check_payload.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 CreatePostgresqlCheckPayload(BaseModel): + """ + Postgresql check body. + """ # noqa: E501 + + address: Annotated[str, Field(strict=True, max_length=200)] = Field(description="url to check") + __properties: ClassVar[List[str]] = ["address"] + + 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 CreatePostgresqlCheckPayload 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 CreatePostgresqlCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"address": obj.get("address")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_rabbitmq_check_payload.py b/services/observability/src/stackit/observability/models/create_rabbitmq_check_payload.py new file mode 100644 index 000000000..8bbbea7c0 --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_rabbitmq_check_payload.py @@ -0,0 +1,86 @@ +# 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 CreateRabbitmqCheckPayload(BaseModel): + """ + RabbitMQ check body. + """ # noqa: E501 + + password: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="password") + url: Annotated[str, Field(strict=True, max_length=200)] = Field(description="url to check") + username: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="username") + __properties: ClassVar[List[str]] = ["password", "url", "username"] + + 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 CreateRabbitmqCheckPayload 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 CreateRabbitmqCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"password": obj.get("password"), "url": obj.get("url"), "username": obj.get("username")} + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_redis_check_payload.py b/services/observability/src/stackit/observability/models/create_redis_check_payload.py new file mode 100644 index 000000000..f8530b6ce --- /dev/null +++ b/services/observability/src/stackit/observability/models/create_redis_check_payload.py @@ -0,0 +1,86 @@ +# 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 CreateRedisCheckPayload(BaseModel): + """ + Redis check body. + """ # noqa: E501 + + password: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="password") + server: Annotated[str, Field(strict=True, max_length=200)] = Field(description="url to check") + username: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="username") + __properties: ClassVar[List[str]] = ["password", "server", "username"] + + 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 CreateRedisCheckPayload 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 CreateRedisCheckPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"password": obj.get("password"), "server": obj.get("server"), "username": obj.get("username")} + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload.py b/services/observability/src/stackit/observability/models/create_scrape_config_payload.py index 1c6529809..8d64ab0cc 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload.py +++ b/services/observability/src/stackit/observability/models/create_scrape_config_payload.py @@ -30,23 +30,23 @@ ) from typing_extensions import Annotated, Self -from stackit.observability.models.create_scrape_config_payload_basic_auth import ( - CreateScrapeConfigPayloadBasicAuth, +from stackit.observability.models.partial_update_scrape_configs_request_inner_basic_auth import ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner import ( - CreateScrapeConfigPayloadHttpSdConfigsInner, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2 import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2 import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, ) -from stackit.observability.models.create_scrape_config_payload_metrics_relabel_configs_inner import ( - CreateScrapeConfigPayloadMetricsRelabelConfigsInner, +from stackit.observability.models.partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner, ) -from stackit.observability.models.create_scrape_config_payload_static_configs_inner import ( - CreateScrapeConfigPayloadStaticConfigsInner, +from stackit.observability.models.partial_update_scrape_configs_request_inner_static_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner, ) @@ -55,7 +55,7 @@ class CreateScrapeConfigPayload(BaseModel): CreateScrapeConfigPayload """ # noqa: E501 - basic_auth: Optional[CreateScrapeConfigPayloadBasicAuth] = Field(default=None, alias="basicAuth") + basic_auth: Optional[PartialUpdateScrapeConfigsRequestInnerBasicAuth] = Field(default=None, alias="basicAuth") bearer_token: Optional[StrictStr] = Field( default=None, description="Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'. `Additional Validators:` * needs to be a valid bearer token * if bearerToken is in the body no other authentication method should be in the body", @@ -71,7 +71,7 @@ class CreateScrapeConfigPayload(BaseModel): description="honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used.", alias="honorTimeStamps", ) - http_sd_configs: Optional[List[CreateScrapeConfigPayloadHttpSdConfigsInner]] = Field( + http_sd_configs: Optional[List[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner]] = Field( default=None, description="HTTP-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms.", alias="httpSdConfigs", @@ -85,10 +85,10 @@ class CreateScrapeConfigPayload(BaseModel): description="The HTTP resource path on which to fetch metrics from targets. E.g. /metrics", alias="metricsPath", ) - metrics_relabel_configs: Optional[List[CreateScrapeConfigPayloadMetricsRelabelConfigsInner]] = Field( + metrics_relabel_configs: Optional[List[PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner]] = Field( default=None, description="List of metric relabel configurations", alias="metricsRelabelConfigs" ) - oauth2: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2] = None + oauth2: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2] = None params: Optional[Dict[str, Any]] = Field( default=None, description="Optional http params `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters", @@ -107,10 +107,10 @@ class CreateScrapeConfigPayload(BaseModel): description="Per-scrape timeout when scraping this job. `Additional Validators:` * must be a valid time format* must be smaller than scrapeInterval", alias="scrapeTimeout", ) - static_configs: List[CreateScrapeConfigPayloadStaticConfigsInner] = Field( + static_configs: List[PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner] = Field( description="A list of scrape configurations.", alias="staticConfigs" ) - tls_config: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig] = Field( + tls_config: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig] = Field( default=None, alias="tlsConfig" ) __properties: ClassVar[List[str]] = [ @@ -220,7 +220,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "basicAuth": ( - CreateScrapeConfigPayloadBasicAuth.from_dict(obj["basicAuth"]) + PartialUpdateScrapeConfigsRequestInnerBasicAuth.from_dict(obj["basicAuth"]) if obj.get("basicAuth") is not None else None ), @@ -228,7 +228,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "honorLabels": obj.get("honorLabels") if obj.get("honorLabels") is not None else False, "honorTimeStamps": obj.get("honorTimeStamps") if obj.get("honorTimeStamps") is not None else False, "httpSdConfigs": ( - [CreateScrapeConfigPayloadHttpSdConfigsInner.from_dict(_item) for _item in obj["httpSdConfigs"]] + [ + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner.from_dict(_item) + for _item in obj["httpSdConfigs"] + ] if obj.get("httpSdConfigs") is not None else None ), @@ -236,14 +239,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "metricsPath": obj.get("metricsPath") if obj.get("metricsPath") is not None else "/metrics", "metricsRelabelConfigs": ( [ - CreateScrapeConfigPayloadMetricsRelabelConfigsInner.from_dict(_item) + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner.from_dict(_item) for _item in obj["metricsRelabelConfigs"] ] if obj.get("metricsRelabelConfigs") is not None else None ), "oauth2": ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2.from_dict(obj["oauth2"]) + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2.from_dict(obj["oauth2"]) if obj.get("oauth2") is not None else None ), @@ -253,12 +256,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "scrapeInterval": obj.get("scrapeInterval"), "scrapeTimeout": obj.get("scrapeTimeout"), "staticConfigs": ( - [CreateScrapeConfigPayloadStaticConfigsInner.from_dict(_item) for _item in obj["staticConfigs"]] + [ + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner.from_dict(_item) + for _item in obj["staticConfigs"] + ] if obj.get("staticConfigs") is not None else None ), "tlsConfig": ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) if obj.get("tlsConfig") is not None else None ), diff --git a/services/observability/src/stackit/observability/models/elasticsearch_check_child_response.py b/services/observability/src/stackit/observability/models/elasticsearch_check_child_response.py new file mode 100644 index 000000000..647c689d7 --- /dev/null +++ b/services/observability/src/stackit/observability/models/elasticsearch_check_child_response.py @@ -0,0 +1,92 @@ +# 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 ElasticsearchCheckChildResponse(BaseModel): + """ + ElasticsearchCheckChildResponse + """ # noqa: E501 + + id: Annotated[str, Field(min_length=1, strict=True)] + password: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + server: Annotated[str, Field(min_length=1, strict=True)] + username: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + __properties: ClassVar[List[str]] = ["id", "password", "server", "username"] + + 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 ElasticsearchCheckChildResponse 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 ElasticsearchCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "password": obj.get("password"), + "server": obj.get("server"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/elasticsearch_check_response.py b/services/observability/src/stackit/observability/models/elasticsearch_check_response.py new file mode 100644 index 000000000..4d55f45a8 --- /dev/null +++ b/services/observability/src/stackit/observability/models/elasticsearch_check_response.py @@ -0,0 +1,114 @@ +# 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.elasticsearch_check_child_response import ( + ElasticsearchCheckChildResponse, +) + + +class ElasticsearchCheckResponse(BaseModel): + """ + ElasticsearchCheckResponse + """ # noqa: E501 + + elasticsearch_check: Optional[ElasticsearchCheckChildResponse] = Field(default=None, alias="elasticsearchCheck") + elasticsearch_checks: Annotated[List[ElasticsearchCheckChildResponse], Field(max_length=100)] = Field( + alias="elasticsearchChecks" + ) + message: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["elasticsearchCheck", "elasticsearchChecks", "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 ElasticsearchCheckResponse 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 elasticsearch_check + if self.elasticsearch_check: + _dict["elasticsearchCheck"] = self.elasticsearch_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in elasticsearch_checks (list) + _items = [] + if self.elasticsearch_checks: + for _item in self.elasticsearch_checks: + if _item: + _items.append(_item.to_dict()) + _dict["elasticsearchChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ElasticsearchCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "elasticsearchCheck": ( + ElasticsearchCheckChildResponse.from_dict(obj["elasticsearchCheck"]) + if obj.get("elasticsearchCheck") is not None + else None + ), + "elasticsearchChecks": ( + [ElasticsearchCheckChildResponse.from_dict(_item) for _item in obj["elasticsearchChecks"]] + if obj.get("elasticsearchChecks") is not None + else None + ), + "message": obj.get("message"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/mongodb_check_child_response.py b/services/observability/src/stackit/observability/models/mongodb_check_child_response.py new file mode 100644 index 000000000..a209cf2e6 --- /dev/null +++ b/services/observability/src/stackit/observability/models/mongodb_check_child_response.py @@ -0,0 +1,83 @@ +# 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 MongodbCheckChildResponse(BaseModel): + """ + MongodbCheckChildResponse + """ # noqa: E501 + + id: Annotated[str, Field(min_length=1, strict=True)] + server: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["id", "server"] + + 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 MongodbCheckChildResponse 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 MongodbCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "server": obj.get("server")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/mongodb_check_response.py b/services/observability/src/stackit/observability/models/mongodb_check_response.py new file mode 100644 index 000000000..80f4422b4 --- /dev/null +++ b/services/observability/src/stackit/observability/models/mongodb_check_response.py @@ -0,0 +1,112 @@ +# 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.mongodb_check_child_response import ( + MongodbCheckChildResponse, +) + + +class MongodbCheckResponse(BaseModel): + """ + MongodbCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + mongodb_check: Optional[MongodbCheckChildResponse] = Field(default=None, alias="mongodbCheck") + mongodb_checks: Annotated[List[MongodbCheckChildResponse], Field(max_length=100)] = Field(alias="mongodbChecks") + __properties: ClassVar[List[str]] = ["message", "mongodbCheck", "mongodbChecks"] + + 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 MongodbCheckResponse 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 mongodb_check + if self.mongodb_check: + _dict["mongodbCheck"] = self.mongodb_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in mongodb_checks (list) + _items = [] + if self.mongodb_checks: + for _item in self.mongodb_checks: + if _item: + _items.append(_item.to_dict()) + _dict["mongodbChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MongodbCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "mongodbCheck": ( + MongodbCheckChildResponse.from_dict(obj["mongodbCheck"]) + if obj.get("mongodbCheck") is not None + else None + ), + "mongodbChecks": ( + [MongodbCheckChildResponse.from_dict(_item) for _item in obj["mongodbChecks"]] + if obj.get("mongodbChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/mysql_check_child_response.py b/services/observability/src/stackit/observability/models/mysql_check_child_response.py new file mode 100644 index 000000000..99e3a5bb2 --- /dev/null +++ b/services/observability/src/stackit/observability/models/mysql_check_child_response.py @@ -0,0 +1,83 @@ +# 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 MysqlCheckChildResponse(BaseModel): + """ + MysqlCheckChildResponse + """ # noqa: E501 + + id: Annotated[str, Field(min_length=1, strict=True)] + server: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["id", "server"] + + 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 MysqlCheckChildResponse 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 MysqlCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "server": obj.get("server")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/mysql_check_response.py b/services/observability/src/stackit/observability/models/mysql_check_response.py new file mode 100644 index 000000000..3c6d17840 --- /dev/null +++ b/services/observability/src/stackit/observability/models/mysql_check_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +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.mysql_check_child_response import ( + MysqlCheckChildResponse, +) + + +class MysqlCheckResponse(BaseModel): + """ + MysqlCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + mysql_check: Optional[MysqlCheckChildResponse] = Field(default=None, alias="mysqlCheck") + mysql_checks: Annotated[List[MysqlCheckChildResponse], Field(max_length=100)] = Field(alias="mysqlChecks") + __properties: ClassVar[List[str]] = ["message", "mysqlCheck", "mysqlChecks"] + + 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 MysqlCheckResponse 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 mysql_check + if self.mysql_check: + _dict["mysqlCheck"] = self.mysql_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in mysql_checks (list) + _items = [] + if self.mysql_checks: + for _item in self.mysql_checks: + if _item: + _items.append(_item.to_dict()) + _dict["mysqlChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MysqlCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "mysqlCheck": ( + MysqlCheckChildResponse.from_dict(obj["mysqlCheck"]) if obj.get("mysqlCheck") is not None else None + ), + "mysqlChecks": ( + [MysqlCheckChildResponse.from_dict(_item) for _item in obj["mysqlChecks"]] + if obj.get("mysqlChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/network_check_child_response.py b/services/observability/src/stackit/observability/models/network_check_child_response.py new file mode 100644 index 000000000..f0eed108f --- /dev/null +++ b/services/observability/src/stackit/observability/models/network_check_child_response.py @@ -0,0 +1,83 @@ +# 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 NetworkCheckChildResponse(BaseModel): + """ + NetworkCheckChildResponse + """ # noqa: E501 + + address: Annotated[str, Field(min_length=1, strict=True)] + id: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["address", "id"] + + 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 NetworkCheckChildResponse 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 NetworkCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"address": obj.get("address"), "id": obj.get("id")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/network_check_response.py b/services/observability/src/stackit/observability/models/network_check_response.py new file mode 100644 index 000000000..c3df22bb9 --- /dev/null +++ b/services/observability/src/stackit/observability/models/network_check_response.py @@ -0,0 +1,112 @@ +# 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.network_check_child_response import ( + NetworkCheckChildResponse, +) + + +class NetworkCheckResponse(BaseModel): + """ + NetworkCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + network_check: Optional[NetworkCheckChildResponse] = Field(default=None, alias="networkCheck") + network_checks: Annotated[List[NetworkCheckChildResponse], Field(max_length=100)] = Field(alias="networkChecks") + __properties: ClassVar[List[str]] = ["message", "networkCheck", "networkChecks"] + + 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 NetworkCheckResponse 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 network_check + if self.network_check: + _dict["networkCheck"] = self.network_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in network_checks (list) + _items = [] + if self.network_checks: + for _item in self.network_checks: + if _item: + _items.append(_item.to_dict()) + _dict["networkChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "networkCheck": ( + NetworkCheckChildResponse.from_dict(obj["networkCheck"]) + if obj.get("networkCheck") is not None + else None + ), + "networkChecks": ( + [NetworkCheckChildResponse.from_dict(_item) for _item in obj["networkChecks"]] + if obj.get("networkChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/offerings.py b/services/observability/src/stackit/observability/models/offerings.py new file mode 100644 index 000000000..305e40f23 --- /dev/null +++ b/services/observability/src/stackit/observability/models/offerings.py @@ -0,0 +1,107 @@ +# 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.plan import Plan + + +class Offerings(BaseModel): + """ + Offerings + """ # noqa: E501 + + description: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] + documentation_url: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field( + alias="documentationUrl" + ) + image_url: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(alias="imageUrl") + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] + plans: List[Plan] + tags: Annotated[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]], Field(max_length=10)] + __properties: ClassVar[List[str]] = ["description", "documentationUrl", "imageUrl", "name", "plans", "tags"] + + 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 Offerings from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in plans (list) + _items = [] + if self.plans: + for _item in self.plans: + if _item: + _items.append(_item.to_dict()) + _dict["plans"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Offerings from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "documentationUrl": obj.get("documentationUrl"), + "imageUrl": obj.get("imageUrl"), + "name": obj.get("name"), + "plans": [Plan.from_dict(_item) for _item in obj["plans"]] if obj.get("plans") is not None else None, + "tags": obj.get("tags"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/partial_update_alertrecords_request_inner.py b/services/observability/src/stackit/observability/models/partial_update_alertrecords_request_inner.py new file mode 100644 index 000000000..f06b114ce --- /dev/null +++ b/services/observability/src/stackit/observability/models/partial_update_alertrecords_request_inner.py @@ -0,0 +1,91 @@ +# 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 PartialUpdateAlertrecordsRequestInner(BaseModel): + """ + Record. `Additional Validators:` * total config (all alert groups/rules/records) should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ # noqa: E501 + + expr: Annotated[str, Field(min_length=1, strict=True, max_length=2000)] = Field( + description="The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts." + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 10 keys * each key and value should not be longer than 200 characters ", + ) + record: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The name of the record. `Additional Validators:` * is the identifier and so unique in the group " + ) + __properties: ClassVar[List[str]] = ["expr", "labels", "record"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PartialUpdateAlertrecordsRequestInner 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 PartialUpdateAlertrecordsRequestInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"expr": obj.get("expr"), "labels": obj.get("labels"), "record": obj.get("record")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner.py new file mode 100644 index 000000000..9e865ffd1 --- /dev/null +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner.py @@ -0,0 +1,273 @@ +# 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, Union + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictFloat, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + +from stackit.observability.models.partial_update_scrape_configs_request_inner_basic_auth import ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2 import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner, +) +from stackit.observability.models.partial_update_scrape_configs_request_inner_static_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner, +) + + +class PartialUpdateScrapeConfigsRequestInner(BaseModel): + """ + PartialUpdateScrapeConfigsRequestInner + """ # noqa: E501 + + basic_auth: Optional[PartialUpdateScrapeConfigsRequestInnerBasicAuth] = Field(default=None, alias="basicAuth") + bearer_token: Optional[StrictStr] = Field( + default=None, + description="Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'. `Additional Validators:` * needs to be a valid bearer token * if bearerToken is in the body no other authentication method should be in the body", + alias="bearerToken", + ) + honor_labels: Optional[StrictBool] = Field( + default=False, + description="Note that any globally configured 'external_labels' are unaffected by this setting. In communication with external systems, they are always applied only when a time series does not have a given label yet and are ignored otherwise.", + alias="honorLabels", + ) + honor_time_stamps: Optional[StrictBool] = Field( + default=False, + description="honor_timestamps controls whether Prometheus respects the timestamps present in scraped data. If honor_timestamps is set to 'true', the timestamps of the metrics exposed by the target will be used.", + alias="honorTimeStamps", + ) + http_sd_configs: Optional[List[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner]] = Field( + default=None, + description="HTTP-based service discovery provides a more generic way to configure static targets and serves as an interface to plug in custom service discovery mechanisms.", + alias="httpSdConfigs", + ) + job_name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="The job name assigned to scraped metrics by default. `Additional Validators:` * must be unique * key and values should only include the characters: a-zA-Z0-9-", + alias="jobName", + ) + metrics_path: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field( + default="/metrics", + description="The HTTP resource path on which to fetch metrics from targets. E.g. /metrics", + alias="metricsPath", + ) + metrics_relabel_configs: Optional[List[PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner]] = Field( + default=None, description="List of metric relabel configurations", alias="metricsRelabelConfigs" + ) + oauth2: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2] = None + params: Optional[Dict[str, Any]] = Field( + default=None, + description="Optional http params `Additional Validators:` * should not contain more than 5 keys * each key and value should not have more than 200 characters", + ) + sample_limit: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, + description="Per-scrape limit on number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. The total limit depends on the service plan target limits * samples", + alias="sampleLimit", + ) + scheme: StrictStr = Field(description="Configures the protocol scheme used for requests. https or http") + scrape_interval: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + description="How frequently to scrape targets from this job. E.g. 5m `Additional Validators:` * must be a valid time format* must be >= 60s", + alias="scrapeInterval", + ) + scrape_timeout: Annotated[str, Field(min_length=2, strict=True, max_length=8)] = Field( + description="Per-scrape timeout when scraping this job. `Additional Validators:` * must be a valid time format* must be smaller than scrapeInterval", + alias="scrapeTimeout", + ) + static_configs: List[PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner] = Field( + description="A list of scrape configurations.", alias="staticConfigs" + ) + tls_config: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig] = Field( + default=None, alias="tlsConfig" + ) + __properties: ClassVar[List[str]] = [ + "basicAuth", + "bearerToken", + "honorLabels", + "honorTimeStamps", + "httpSdConfigs", + "jobName", + "metricsPath", + "metricsRelabelConfigs", + "oauth2", + "params", + "sampleLimit", + "scheme", + "scrapeInterval", + "scrapeTimeout", + "staticConfigs", + "tlsConfig", + ] + + @field_validator("scheme") + def scheme_validate_enum(cls, value): + """Validates the enum""" + if value not in set(["http", "https"]): + raise ValueError("must be one of enum values ('http', 'https')") + return value + + 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 PartialUpdateScrapeConfigsRequestInner 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 basic_auth + if self.basic_auth: + _dict["basicAuth"] = self.basic_auth.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in http_sd_configs (list) + _items = [] + if self.http_sd_configs: + for _item in self.http_sd_configs: + if _item: + _items.append(_item.to_dict()) + _dict["httpSdConfigs"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in metrics_relabel_configs (list) + _items = [] + if self.metrics_relabel_configs: + for _item in self.metrics_relabel_configs: + if _item: + _items.append(_item.to_dict()) + _dict["metricsRelabelConfigs"] = _items + # override the default output from pydantic by calling `to_dict()` of oauth2 + if self.oauth2: + _dict["oauth2"] = self.oauth2.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in static_configs (list) + _items = [] + if self.static_configs: + for _item in self.static_configs: + if _item: + _items.append(_item.to_dict()) + _dict["staticConfigs"] = _items + # override the default output from pydantic by calling `to_dict()` of tls_config + if self.tls_config: + _dict["tlsConfig"] = self.tls_config.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PartialUpdateScrapeConfigsRequestInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "basicAuth": ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth.from_dict(obj["basicAuth"]) + if obj.get("basicAuth") is not None + else None + ), + "bearerToken": obj.get("bearerToken"), + "honorLabels": obj.get("honorLabels") if obj.get("honorLabels") is not None else False, + "honorTimeStamps": obj.get("honorTimeStamps") if obj.get("honorTimeStamps") is not None else False, + "httpSdConfigs": ( + [ + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner.from_dict(_item) + for _item in obj["httpSdConfigs"] + ] + if obj.get("httpSdConfigs") is not None + else None + ), + "jobName": obj.get("jobName"), + "metricsPath": obj.get("metricsPath") if obj.get("metricsPath") is not None else "/metrics", + "metricsRelabelConfigs": ( + [ + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner.from_dict(_item) + for _item in obj["metricsRelabelConfigs"] + ] + if obj.get("metricsRelabelConfigs") is not None + else None + ), + "oauth2": ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2.from_dict(obj["oauth2"]) + if obj.get("oauth2") is not None + else None + ), + "params": obj.get("params"), + "sampleLimit": obj.get("sampleLimit"), + "scheme": obj.get("scheme"), + "scrapeInterval": obj.get("scrapeInterval"), + "scrapeTimeout": obj.get("scrapeTimeout"), + "staticConfigs": ( + [ + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner.from_dict(_item) + for _item in obj["staticConfigs"] + ] + if obj.get("staticConfigs") is not None + else None + ), + "tlsConfig": ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) + if obj.get("tlsConfig") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_basic_auth.py similarity index 91% rename from services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py rename to services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_basic_auth.py index 0bbeb8b4a..0429be2fb 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_basic_auth.py +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_basic_auth.py @@ -22,7 +22,7 @@ from typing_extensions import Annotated, Self -class CreateScrapeConfigPayloadBasicAuth(BaseModel): +class PartialUpdateScrapeConfigsRequestInnerBasicAuth(BaseModel): """ Sets the 'Authorization' header on every scrape request with the configured username and password. `Additional Validators:` * if basicAuth is in the body no other authentication method should be in the body """ # noqa: E501 @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadBasicAuth from a JSON string""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerBasicAuth from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -76,7 +76,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadBasicAuth from a dict""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerBasicAuth from a dict""" if obj is None: return None diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner.py similarity index 71% rename from services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py rename to services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner.py index 191d74918..5c918b608 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner.py +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner.py @@ -21,30 +21,30 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated, Self -from stackit.observability.models.create_scrape_config_payload_basic_auth import ( - CreateScrapeConfigPayloadBasicAuth, +from stackit.observability.models.partial_update_scrape_configs_request_inner_basic_auth import ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2 import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2 import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, ) -class CreateScrapeConfigPayloadHttpSdConfigsInner(BaseModel): +class PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner(BaseModel): """ - CreateScrapeConfigPayloadHttpSdConfigsInner + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner """ # noqa: E501 - basic_auth: Optional[CreateScrapeConfigPayloadBasicAuth] = Field(default=None, alias="basicAuth") - oauth2: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2] = None + basic_auth: Optional[PartialUpdateScrapeConfigsRequestInnerBasicAuth] = Field(default=None, alias="basicAuth") + oauth2: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2] = None refresh_interval: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( default="60s", description="Refresh interval to re-query the endpoint. E.g. 60s `Additional Validators:` * must be a valid time format* must be >= 60s", alias="refreshInterval", ) - tls_config: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig] = Field( + tls_config: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig] = Field( default=None, alias="tlsConfig" ) url: Annotated[str, Field(strict=True, max_length=400)] = Field( @@ -69,7 +69,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadHttpSdConfigsInner from a JSON string""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -102,7 +102,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadHttpSdConfigsInner from a dict""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInner from a dict""" if obj is None: return None @@ -112,18 +112,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "basicAuth": ( - CreateScrapeConfigPayloadBasicAuth.from_dict(obj["basicAuth"]) + PartialUpdateScrapeConfigsRequestInnerBasicAuth.from_dict(obj["basicAuth"]) if obj.get("basicAuth") is not None else None ), "oauth2": ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2.from_dict(obj["oauth2"]) + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2.from_dict(obj["oauth2"]) if obj.get("oauth2") is not None else None ), "refreshInterval": obj.get("refreshInterval") if obj.get("refreshInterval") is not None else "60s", "tlsConfig": ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) if obj.get("tlsConfig") is not None else None ), diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2.py similarity index 83% rename from services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py rename to services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2.py index c1270e5cf..e4897e699 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2.py +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2.py @@ -21,12 +21,12 @@ from pydantic import BaseModel, ConfigDict, Field from typing_extensions import Annotated, Self -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, ) -class CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2(BaseModel): +class PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2(BaseModel): """ OAuth 2.0 authentication using the client credentials grant type. Prometheus fetches an access token from the specified endpoint with the given client access and secret keys. `Additional Validators:` * if oauth2 is in the body no other authentication method should be in the body """ # noqa: E501 @@ -40,7 +40,7 @@ class CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2(BaseModel): scopes: Optional[List[Annotated[str, Field(min_length=1, strict=True, max_length=200)]]] = Field( default=None, description="The URL to fetch the token from." ) - tls_config: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig] = Field( + tls_config: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig] = Field( default=None, alias="tlsConfig" ) token_url: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( @@ -65,7 +65,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 from a JSON string""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -92,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2 from a dict""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2 from a dict""" if obj is None: return None @@ -105,7 +105,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "clientSecret": obj.get("clientSecret"), "scopes": obj.get("scopes"), "tlsConfig": ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) if obj.get("tlsConfig") is not None else None ), diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config.py similarity index 88% rename from services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py rename to services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config.py index 9b62fd40b..1fc2e9d9a 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config.py +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config.py @@ -22,7 +22,7 @@ from typing_extensions import Self -class CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig(BaseModel): +class PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig(BaseModel): """ Configures the scrape request's TLS settings. """ # noqa: E501 @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig from a JSON string""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig from a dict""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig from a dict""" if obj is None: return None diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.py similarity index 93% rename from services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py rename to services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.py index fda5b94f5..b2b90fdbb 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_metrics_relabel_configs_inner.py +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner.py @@ -30,9 +30,9 @@ from typing_extensions import Annotated, Self -class CreateScrapeConfigPayloadMetricsRelabelConfigsInner(BaseModel): +class PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner(BaseModel): """ - CreateScrapeConfigPayloadMetricsRelabelConfigsInner + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner """ # noqa: E501 action: Optional[StrictStr] = Field( @@ -101,7 +101,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadMetricsRelabelConfigsInner from a JSON string""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -125,7 +125,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadMetricsRelabelConfigsInner from a dict""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner from a dict""" if obj is None: return None diff --git a/services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_static_configs_inner.py similarity index 88% rename from services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py rename to services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_static_configs_inner.py index d99dbddb6..b05b8000c 100644 --- a/services/observability/src/stackit/observability/models/create_scrape_config_payload_static_configs_inner.py +++ b/services/observability/src/stackit/observability/models/partial_update_scrape_configs_request_inner_static_configs_inner.py @@ -22,9 +22,9 @@ from typing_extensions import Annotated, Self -class CreateScrapeConfigPayloadStaticConfigsInner(BaseModel): +class PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner(BaseModel): """ - CreateScrapeConfigPayloadStaticConfigsInner + PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner """ # noqa: E501 labels: Optional[Dict[str, Any]] = Field( @@ -53,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadStaticConfigsInner from a JSON string""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,7 +77,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateScrapeConfigPayloadStaticConfigsInner from a dict""" + """Create an instance of PartialUpdateScrapeConfigsRequestInnerStaticConfigsInner from a dict""" if obj is None: return None diff --git a/services/observability/src/stackit/observability/models/ping_check_child_response.py b/services/observability/src/stackit/observability/models/ping_check_child_response.py new file mode 100644 index 000000000..c72136783 --- /dev/null +++ b/services/observability/src/stackit/observability/models/ping_check_child_response.py @@ -0,0 +1,83 @@ +# 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 PingCheckChildResponse(BaseModel): + """ + PingCheckChildResponse + """ # noqa: E501 + + id: Annotated[str, Field(min_length=1, strict=True)] + url: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["id", "url"] + + 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 PingCheckChildResponse 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 PingCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "url": obj.get("url")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/ping_check_response.py b/services/observability/src/stackit/observability/models/ping_check_response.py new file mode 100644 index 000000000..d772f80d0 --- /dev/null +++ b/services/observability/src/stackit/observability/models/ping_check_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +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.ping_check_child_response import ( + PingCheckChildResponse, +) + + +class PingCheckResponse(BaseModel): + """ + PingCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + ping_check: Optional[PingCheckChildResponse] = Field(default=None, alias="pingCheck") + ping_checks: Annotated[List[PingCheckChildResponse], Field(max_length=100)] = Field(alias="pingChecks") + __properties: ClassVar[List[str]] = ["message", "pingCheck", "pingChecks"] + + 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 PingCheckResponse 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 ping_check + if self.ping_check: + _dict["pingCheck"] = self.ping_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in ping_checks (list) + _items = [] + if self.ping_checks: + for _item in self.ping_checks: + if _item: + _items.append(_item.to_dict()) + _dict["pingChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PingCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "pingCheck": ( + PingCheckChildResponse.from_dict(obj["pingCheck"]) if obj.get("pingCheck") is not None else None + ), + "pingChecks": ( + [PingCheckChildResponse.from_dict(_item) for _item in obj["pingChecks"]] + if obj.get("pingChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/postgresql_check_child_response.py b/services/observability/src/stackit/observability/models/postgresql_check_child_response.py new file mode 100644 index 000000000..43425d33c --- /dev/null +++ b/services/observability/src/stackit/observability/models/postgresql_check_child_response.py @@ -0,0 +1,83 @@ +# 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 PostgresqlCheckChildResponse(BaseModel): + """ + PostgresqlCheckChildResponse + """ # noqa: E501 + + address: Annotated[str, Field(min_length=1, strict=True)] + id: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["address", "id"] + + 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 PostgresqlCheckChildResponse 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 PostgresqlCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"address": obj.get("address"), "id": obj.get("id")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/postgresql_check_response.py b/services/observability/src/stackit/observability/models/postgresql_check_response.py new file mode 100644 index 000000000..39ea44cfa --- /dev/null +++ b/services/observability/src/stackit/observability/models/postgresql_check_response.py @@ -0,0 +1,114 @@ +# 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.postgresql_check_child_response import ( + PostgresqlCheckChildResponse, +) + + +class PostgresqlCheckResponse(BaseModel): + """ + PostgresqlCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + postgresql_check: Optional[PostgresqlCheckChildResponse] = Field(default=None, alias="postgresqlCheck") + postgresql_checks: Annotated[List[PostgresqlCheckChildResponse], Field(max_length=100)] = Field( + alias="postgresqlChecks" + ) + __properties: ClassVar[List[str]] = ["message", "postgresqlCheck", "postgresqlChecks"] + + 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 PostgresqlCheckResponse 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 postgresql_check + if self.postgresql_check: + _dict["postgresqlCheck"] = self.postgresql_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in postgresql_checks (list) + _items = [] + if self.postgresql_checks: + for _item in self.postgresql_checks: + if _item: + _items.append(_item.to_dict()) + _dict["postgresqlChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PostgresqlCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "postgresqlCheck": ( + PostgresqlCheckChildResponse.from_dict(obj["postgresqlCheck"]) + if obj.get("postgresqlCheck") is not None + else None + ), + "postgresqlChecks": ( + [PostgresqlCheckChildResponse.from_dict(_item) for _item in obj["postgresqlChecks"]] + if obj.get("postgresqlChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/rabbit_mq_check_child_response.py b/services/observability/src/stackit/observability/models/rabbit_mq_check_child_response.py new file mode 100644 index 000000000..d6f75956a --- /dev/null +++ b/services/observability/src/stackit/observability/models/rabbit_mq_check_child_response.py @@ -0,0 +1,92 @@ +# 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 RabbitMQCheckChildResponse(BaseModel): + """ + RabbitMQCheckChildResponse + """ # noqa: E501 + + id: Annotated[str, Field(min_length=1, strict=True)] + password: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + url: Annotated[str, Field(min_length=1, strict=True)] + username: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + __properties: ClassVar[List[str]] = ["id", "password", "url", "username"] + + 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 RabbitMQCheckChildResponse 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 RabbitMQCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "password": obj.get("password"), + "url": obj.get("url"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/rabbitmq_check_response.py b/services/observability/src/stackit/observability/models/rabbitmq_check_response.py new file mode 100644 index 000000000..bc20d85b2 --- /dev/null +++ b/services/observability/src/stackit/observability/models/rabbitmq_check_response.py @@ -0,0 +1,112 @@ +# 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.rabbit_mq_check_child_response import ( + RabbitMQCheckChildResponse, +) + + +class RabbitmqCheckResponse(BaseModel): + """ + RabbitmqCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + rabbitmq_check: Optional[RabbitMQCheckChildResponse] = Field(default=None, alias="rabbitmqCheck") + rabbitmq_checks: Annotated[List[RabbitMQCheckChildResponse], Field(max_length=100)] = Field(alias="rabbitmqChecks") + __properties: ClassVar[List[str]] = ["message", "rabbitmqCheck", "rabbitmqChecks"] + + 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 RabbitmqCheckResponse 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 rabbitmq_check + if self.rabbitmq_check: + _dict["rabbitmqCheck"] = self.rabbitmq_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in rabbitmq_checks (list) + _items = [] + if self.rabbitmq_checks: + for _item in self.rabbitmq_checks: + if _item: + _items.append(_item.to_dict()) + _dict["rabbitmqChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RabbitmqCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "rabbitmqCheck": ( + RabbitMQCheckChildResponse.from_dict(obj["rabbitmqCheck"]) + if obj.get("rabbitmqCheck") is not None + else None + ), + "rabbitmqChecks": ( + [RabbitMQCheckChildResponse.from_dict(_item) for _item in obj["rabbitmqChecks"]] + if obj.get("rabbitmqChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/redis_check_child_response.py b/services/observability/src/stackit/observability/models/redis_check_child_response.py new file mode 100644 index 000000000..18e1b71fc --- /dev/null +++ b/services/observability/src/stackit/observability/models/redis_check_child_response.py @@ -0,0 +1,92 @@ +# 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 RedisCheckChildResponse(BaseModel): + """ + RedisCheckChildResponse + """ # noqa: E501 + + id: Annotated[str, Field(min_length=1, strict=True)] + password: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + server: Annotated[str, Field(min_length=1, strict=True)] + username: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + __properties: ClassVar[List[str]] = ["id", "password", "server", "username"] + + 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 RedisCheckChildResponse 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 RedisCheckChildResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "id": obj.get("id"), + "password": obj.get("password"), + "server": obj.get("server"), + "username": obj.get("username"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/redis_check_response.py b/services/observability/src/stackit/observability/models/redis_check_response.py new file mode 100644 index 000000000..33f523c13 --- /dev/null +++ b/services/observability/src/stackit/observability/models/redis_check_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + STACKIT Observability API + + API endpoints for Observability on STACKIT + + The version of the OpenAPI document: 1.1.1 + Contact: stackit-argus@mail.schwarz + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +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.redis_check_child_response import ( + RedisCheckChildResponse, +) + + +class RedisCheckResponse(BaseModel): + """ + RedisCheckResponse + """ # noqa: E501 + + message: Annotated[str, Field(min_length=1, strict=True)] + redis_check: Optional[RedisCheckChildResponse] = Field(default=None, alias="redisCheck") + redis_checks: Annotated[List[RedisCheckChildResponse], Field(max_length=100)] = Field(alias="redisChecks") + __properties: ClassVar[List[str]] = ["message", "redisCheck", "redisChecks"] + + 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 RedisCheckResponse 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 redis_check + if self.redis_check: + _dict["redisCheck"] = self.redis_check.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in redis_checks (list) + _items = [] + if self.redis_checks: + for _item in self.redis_checks: + if _item: + _items.append(_item.to_dict()) + _dict["redisChecks"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RedisCheckResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "message": obj.get("message"), + "redisCheck": ( + RedisCheckChildResponse.from_dict(obj["redisCheck"]) if obj.get("redisCheck") is not None else None + ), + "redisChecks": ( + [RedisCheckChildResponse.from_dict(_item) for _item in obj["redisChecks"]] + if obj.get("redisChecks") is not None + else None + ), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_alertrecord_payload.py b/services/observability/src/stackit/observability/models/update_alertrecord_payload.py new file mode 100644 index 000000000..e3e24a470 --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_alertrecord_payload.py @@ -0,0 +1,88 @@ +# 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 UpdateAlertrecordPayload(BaseModel): + """ + Record. `Additional Validators:` * total config (all alert groups/rules/records) should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ # noqa: E501 + + expr: Annotated[str, Field(min_length=1, strict=True, max_length=2000)] = Field( + description="The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts." + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters ", + ) + __properties: ClassVar[List[str]] = ["expr", "labels"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateAlertrecordPayload 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 UpdateAlertrecordPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"expr": obj.get("expr"), "labels": obj.get("labels")}) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_alertrule_payload.py b/services/observability/src/stackit/observability/models/update_alertrule_payload.py new file mode 100644 index 000000000..7aedf57a3 --- /dev/null +++ b/services/observability/src/stackit/observability/models/update_alertrule_payload.py @@ -0,0 +1,104 @@ +# 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 UpdateAlertrulePayload(BaseModel): + """ + Alert rule. `Additional Validators:` * total config (all alert groups/rules) should not be bigger than 500000 characters as string since this the limitation of prometheus. + """ # noqa: E501 + + annotations: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Annotations to add to each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters", + ) + expr: Annotated[str, Field(min_length=1, strict=True, max_length=2000)] = Field( + description="The PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts." + ) + var_for: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=8)]] = Field( + default="0s", + description="Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. `Additional Validators:` * must be a valid time string", + alias="for", + ) + labels: Optional[Dict[str, Any]] = Field( + default=None, + description="map of key:value. Labels to add or overwrite for each alert. `Additional Validators:` * should not contain more than 5 keys * each key and value should not be longer than 200 characters", + ) + __properties: ClassVar[List[str]] = ["annotations", "expr", "for", "labels"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateAlertrulePayload 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 UpdateAlertrulePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "annotations": obj.get("annotations"), + "expr": obj.get("expr"), + "for": obj.get("for") if obj.get("for") is not None else "0s", + "labels": obj.get("labels"), + } + ) + return _obj diff --git a/services/observability/src/stackit/observability/models/update_scrape_config_payload.py b/services/observability/src/stackit/observability/models/update_scrape_config_payload.py index 7ef271f4e..1b80da1d7 100644 --- a/services/observability/src/stackit/observability/models/update_scrape_config_payload.py +++ b/services/observability/src/stackit/observability/models/update_scrape_config_payload.py @@ -30,14 +30,14 @@ ) from typing_extensions import Annotated, Self -from stackit.observability.models.create_scrape_config_payload_basic_auth import ( - CreateScrapeConfigPayloadBasicAuth, +from stackit.observability.models.partial_update_scrape_configs_request_inner_basic_auth import ( + PartialUpdateScrapeConfigsRequestInnerBasicAuth, ) -from stackit.observability.models.create_scrape_config_payload_http_sd_configs_inner_oauth2_tls_config import ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig, +from stackit.observability.models.partial_update_scrape_configs_request_inner_http_sd_configs_inner_oauth2_tls_config import ( + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig, ) -from stackit.observability.models.create_scrape_config_payload_metrics_relabel_configs_inner import ( - CreateScrapeConfigPayloadMetricsRelabelConfigsInner, +from stackit.observability.models.partial_update_scrape_configs_request_inner_metrics_relabel_configs_inner import ( + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner, ) from stackit.observability.models.update_scrape_config_payload_static_configs_inner import ( UpdateScrapeConfigPayloadStaticConfigsInner, @@ -49,7 +49,7 @@ class UpdateScrapeConfigPayload(BaseModel): UpdateScrapeConfigPayload """ # noqa: E501 - basic_auth: Optional[CreateScrapeConfigPayloadBasicAuth] = Field(default=None, alias="basicAuth") + basic_auth: Optional[PartialUpdateScrapeConfigsRequestInnerBasicAuth] = Field(default=None, alias="basicAuth") bearer_token: Optional[StrictStr] = Field( default=None, description="Sets the 'Authorization' header on every scrape request with the configured bearer token. It is mutually exclusive with 'bearer_token_file'. `Additional Validators:` * needs to be a valid bearer token * if bearerToken is in the body no other authentication method should be in the body", @@ -68,7 +68,7 @@ class UpdateScrapeConfigPayload(BaseModel): metrics_path: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( description="The HTTP resource path on which to fetch metrics from targets. E.g. /metrics", alias="metricsPath" ) - metrics_relabel_configs: Optional[List[CreateScrapeConfigPayloadMetricsRelabelConfigsInner]] = Field( + metrics_relabel_configs: Optional[List[PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner]] = Field( default=None, description="List of metric relabel configurations", alias="metricsRelabelConfigs" ) params: Optional[Dict[str, Any]] = Field( @@ -92,7 +92,7 @@ class UpdateScrapeConfigPayload(BaseModel): static_configs: List[UpdateScrapeConfigPayloadStaticConfigsInner] = Field( description="A list of scrape configurations.", alias="staticConfigs" ) - tls_config: Optional[CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig] = Field( + tls_config: Optional[PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig] = Field( default=None, alias="tlsConfig" ) __properties: ClassVar[List[str]] = [ @@ -189,7 +189,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "basicAuth": ( - CreateScrapeConfigPayloadBasicAuth.from_dict(obj["basicAuth"]) + PartialUpdateScrapeConfigsRequestInnerBasicAuth.from_dict(obj["basicAuth"]) if obj.get("basicAuth") is not None else None ), @@ -199,7 +199,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "metricsPath": obj.get("metricsPath") if obj.get("metricsPath") is not None else "/metrics", "metricsRelabelConfigs": ( [ - CreateScrapeConfigPayloadMetricsRelabelConfigsInner.from_dict(_item) + PartialUpdateScrapeConfigsRequestInnerMetricsRelabelConfigsInner.from_dict(_item) for _item in obj["metricsRelabelConfigs"] ] if obj.get("metricsRelabelConfigs") is not None @@ -216,7 +216,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: else None ), "tlsConfig": ( - CreateScrapeConfigPayloadHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) + PartialUpdateScrapeConfigsRequestInnerHttpSdConfigsInnerOauth2TlsConfig.from_dict(obj["tlsConfig"]) if obj.get("tlsConfig") is not None else None ),