stackit-sqlserverflex 1.0.0__py3-none-any.whl → 1.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,6 +45,7 @@ from stackit.sqlserverflex.models.create_instance_payload import CreateInstanceP
45
45
  from stackit.sqlserverflex.models.create_instance_response import CreateInstanceResponse
46
46
  from stackit.sqlserverflex.models.create_user_payload import CreateUserPayload
47
47
  from stackit.sqlserverflex.models.create_user_response import CreateUserResponse
48
+ from stackit.sqlserverflex.models.data_point import DataPoint
48
49
  from stackit.sqlserverflex.models.database import Database
49
50
  from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
50
51
  DatabaseDocumentationCreateDatabaseRequestOptions,
@@ -55,6 +56,8 @@ from stackit.sqlserverflex.models.get_backup_response import GetBackupResponse
55
56
  from stackit.sqlserverflex.models.get_database_response import GetDatabaseResponse
56
57
  from stackit.sqlserverflex.models.get_instance_response import GetInstanceResponse
57
58
  from stackit.sqlserverflex.models.get_user_response import GetUserResponse
59
+ from stackit.sqlserverflex.models.host import Host
60
+ from stackit.sqlserverflex.models.host_metric import HostMetric
58
61
  from stackit.sqlserverflex.models.instance import Instance
59
62
  from stackit.sqlserverflex.models.instance_documentation_acl import (
60
63
  InstanceDocumentationACL,
@@ -77,6 +80,7 @@ from stackit.sqlserverflex.models.list_compatibility_response import (
77
80
  from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
78
81
  from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
79
82
  from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
83
+ from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
80
84
  from stackit.sqlserverflex.models.list_restore_jobs_response import (
81
85
  ListRestoreJobsResponse,
82
86
  )
@@ -44,6 +44,7 @@ from stackit.sqlserverflex.models.list_compatibility_response import (
44
44
  from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
45
45
  from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
46
46
  from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
47
+ from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
47
48
  from stackit.sqlserverflex.models.list_restore_jobs_response import (
48
49
  ListRestoreJobsResponse,
49
50
  )
@@ -4481,6 +4482,399 @@ class DefaultApi:
4481
4482
  _request_auth=_request_auth,
4482
4483
  )
4483
4484
 
4485
+ @validate_call
4486
+ def list_metrics(
4487
+ self,
4488
+ project_id: Annotated[StrictStr, Field(description="The UUID of the project.")],
4489
+ instance_id: Annotated[StrictStr, Field(description="The UUID of the instance.")],
4490
+ metric: Annotated[
4491
+ StrictStr,
4492
+ Field(
4493
+ description="The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'."
4494
+ ),
4495
+ ],
4496
+ granularity: Annotated[StrictStr, Field(description="The granularity in ISO8601 e.g. 5 minutes are 'PT5M'.")],
4497
+ period: Annotated[
4498
+ Optional[StrictStr],
4499
+ Field(
4500
+ description="The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used."
4501
+ ),
4502
+ ] = None,
4503
+ start: Annotated[
4504
+ Optional[StrictStr],
4505
+ Field(
4506
+ description="The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used."
4507
+ ),
4508
+ ] = None,
4509
+ end: Annotated[
4510
+ Optional[StrictStr],
4511
+ Field(
4512
+ description="The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'."
4513
+ ),
4514
+ ] = None,
4515
+ _request_timeout: Union[
4516
+ None,
4517
+ Annotated[StrictFloat, Field(gt=0)],
4518
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
4519
+ ] = None,
4520
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4521
+ _content_type: Optional[StrictStr] = None,
4522
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4523
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4524
+ ) -> ListMetricsResponse:
4525
+ """Get Metric
4526
+
4527
+ Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa.
4528
+
4529
+ :param project_id: The UUID of the project. (required)
4530
+ :type project_id: str
4531
+ :param instance_id: The UUID of the instance. (required)
4532
+ :type instance_id: str
4533
+ :param metric: The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. (required)
4534
+ :type metric: str
4535
+ :param granularity: The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. (required)
4536
+ :type granularity: str
4537
+ :param period: The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used.
4538
+ :type period: str
4539
+ :param start: The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used.
4540
+ :type start: str
4541
+ :param end: The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'.
4542
+ :type end: str
4543
+ :param _request_timeout: timeout setting for this request. If one
4544
+ number provided, it will be total request
4545
+ timeout. It can also be a pair (tuple) of
4546
+ (connection, read) timeouts.
4547
+ :type _request_timeout: int, tuple(int, int), optional
4548
+ :param _request_auth: set to override the auth_settings for an a single
4549
+ request; this effectively ignores the
4550
+ authentication in the spec for a single request.
4551
+ :type _request_auth: dict, optional
4552
+ :param _content_type: force content-type for the request.
4553
+ :type _content_type: str, Optional
4554
+ :param _headers: set to override the headers for a single
4555
+ request; this effectively ignores the headers
4556
+ in the spec for a single request.
4557
+ :type _headers: dict, optional
4558
+ :param _host_index: set to override the host_index for a single
4559
+ request; this effectively ignores the host_index
4560
+ in the spec for a single request.
4561
+ :type _host_index: int, optional
4562
+ :return: Returns the result object.
4563
+ """ # noqa: E501 docstring might be too long
4564
+
4565
+ _param = self._list_metrics_serialize(
4566
+ project_id=project_id,
4567
+ instance_id=instance_id,
4568
+ metric=metric,
4569
+ granularity=granularity,
4570
+ period=period,
4571
+ start=start,
4572
+ end=end,
4573
+ _request_auth=_request_auth,
4574
+ _content_type=_content_type,
4575
+ _headers=_headers,
4576
+ _host_index=_host_index,
4577
+ )
4578
+
4579
+ _response_types_map: Dict[str, Optional[str]] = {
4580
+ "200": "ListMetricsResponse",
4581
+ "400": "InstanceError",
4582
+ "405": "InstanceError",
4583
+ "500": "InstanceError",
4584
+ }
4585
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
4586
+ response_data.read()
4587
+ return self.api_client.response_deserialize(
4588
+ response_data=response_data,
4589
+ response_types_map=_response_types_map,
4590
+ ).data
4591
+
4592
+ @validate_call
4593
+ def list_metrics_with_http_info(
4594
+ self,
4595
+ project_id: Annotated[StrictStr, Field(description="The UUID of the project.")],
4596
+ instance_id: Annotated[StrictStr, Field(description="The UUID of the instance.")],
4597
+ metric: Annotated[
4598
+ StrictStr,
4599
+ Field(
4600
+ description="The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'."
4601
+ ),
4602
+ ],
4603
+ granularity: Annotated[StrictStr, Field(description="The granularity in ISO8601 e.g. 5 minutes are 'PT5M'.")],
4604
+ period: Annotated[
4605
+ Optional[StrictStr],
4606
+ Field(
4607
+ description="The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used."
4608
+ ),
4609
+ ] = None,
4610
+ start: Annotated[
4611
+ Optional[StrictStr],
4612
+ Field(
4613
+ description="The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used."
4614
+ ),
4615
+ ] = None,
4616
+ end: Annotated[
4617
+ Optional[StrictStr],
4618
+ Field(
4619
+ description="The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'."
4620
+ ),
4621
+ ] = None,
4622
+ _request_timeout: Union[
4623
+ None,
4624
+ Annotated[StrictFloat, Field(gt=0)],
4625
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
4626
+ ] = None,
4627
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4628
+ _content_type: Optional[StrictStr] = None,
4629
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4630
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4631
+ ) -> ApiResponse[ListMetricsResponse]:
4632
+ """Get Metric
4633
+
4634
+ Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa.
4635
+
4636
+ :param project_id: The UUID of the project. (required)
4637
+ :type project_id: str
4638
+ :param instance_id: The UUID of the instance. (required)
4639
+ :type instance_id: str
4640
+ :param metric: The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. (required)
4641
+ :type metric: str
4642
+ :param granularity: The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. (required)
4643
+ :type granularity: str
4644
+ :param period: The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used.
4645
+ :type period: str
4646
+ :param start: The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used.
4647
+ :type start: str
4648
+ :param end: The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'.
4649
+ :type end: str
4650
+ :param _request_timeout: timeout setting for this request. If one
4651
+ number provided, it will be total request
4652
+ timeout. It can also be a pair (tuple) of
4653
+ (connection, read) timeouts.
4654
+ :type _request_timeout: int, tuple(int, int), optional
4655
+ :param _request_auth: set to override the auth_settings for an a single
4656
+ request; this effectively ignores the
4657
+ authentication in the spec for a single request.
4658
+ :type _request_auth: dict, optional
4659
+ :param _content_type: force content-type for the request.
4660
+ :type _content_type: str, Optional
4661
+ :param _headers: set to override the headers for a single
4662
+ request; this effectively ignores the headers
4663
+ in the spec for a single request.
4664
+ :type _headers: dict, optional
4665
+ :param _host_index: set to override the host_index for a single
4666
+ request; this effectively ignores the host_index
4667
+ in the spec for a single request.
4668
+ :type _host_index: int, optional
4669
+ :return: Returns the result object.
4670
+ """ # noqa: E501 docstring might be too long
4671
+
4672
+ _param = self._list_metrics_serialize(
4673
+ project_id=project_id,
4674
+ instance_id=instance_id,
4675
+ metric=metric,
4676
+ granularity=granularity,
4677
+ period=period,
4678
+ start=start,
4679
+ end=end,
4680
+ _request_auth=_request_auth,
4681
+ _content_type=_content_type,
4682
+ _headers=_headers,
4683
+ _host_index=_host_index,
4684
+ )
4685
+
4686
+ _response_types_map: Dict[str, Optional[str]] = {
4687
+ "200": "ListMetricsResponse",
4688
+ "400": "InstanceError",
4689
+ "405": "InstanceError",
4690
+ "500": "InstanceError",
4691
+ }
4692
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
4693
+ response_data.read()
4694
+ return self.api_client.response_deserialize(
4695
+ response_data=response_data,
4696
+ response_types_map=_response_types_map,
4697
+ )
4698
+
4699
+ @validate_call
4700
+ def list_metrics_without_preload_content(
4701
+ self,
4702
+ project_id: Annotated[StrictStr, Field(description="The UUID of the project.")],
4703
+ instance_id: Annotated[StrictStr, Field(description="The UUID of the instance.")],
4704
+ metric: Annotated[
4705
+ StrictStr,
4706
+ Field(
4707
+ description="The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'."
4708
+ ),
4709
+ ],
4710
+ granularity: Annotated[StrictStr, Field(description="The granularity in ISO8601 e.g. 5 minutes are 'PT5M'.")],
4711
+ period: Annotated[
4712
+ Optional[StrictStr],
4713
+ Field(
4714
+ description="The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used."
4715
+ ),
4716
+ ] = None,
4717
+ start: Annotated[
4718
+ Optional[StrictStr],
4719
+ Field(
4720
+ description="The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used."
4721
+ ),
4722
+ ] = None,
4723
+ end: Annotated[
4724
+ Optional[StrictStr],
4725
+ Field(
4726
+ description="The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'."
4727
+ ),
4728
+ ] = None,
4729
+ _request_timeout: Union[
4730
+ None,
4731
+ Annotated[StrictFloat, Field(gt=0)],
4732
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
4733
+ ] = None,
4734
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4735
+ _content_type: Optional[StrictStr] = None,
4736
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4737
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4738
+ ) -> RESTResponseType:
4739
+ """Get Metric
4740
+
4741
+ Returns a metric for an instance. The metric will only be for the master pod if needed. Granularity parameter is always needed. If start and end time is provided, period is not considered in max-connections and disk-use. If you provide start time, you have to provide end time as well and vice versa.
4742
+
4743
+ :param project_id: The UUID of the project. (required)
4744
+ :type project_id: str
4745
+ :param instance_id: The UUID of the instance. (required)
4746
+ :type instance_id: str
4747
+ :param metric: The name of the metric. Valid metrics are 'cpu', 'memory', 'data-disk-size', 'data-disk-use','log-disk-size', 'log-disk-use', 'life-expectancy' and 'connections'. (required)
4748
+ :type metric: str
4749
+ :param granularity: The granularity in ISO8601 e.g. 5 minutes are 'PT5M'. (required)
4750
+ :type granularity: str
4751
+ :param period: The period in ISO8601 format e.g. 5 minutes are 'PT5M'. If no period is provided, the standard value of 5 minutes is used.
4752
+ :type period: str
4753
+ :param start: The start of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'. If no start time is provided, current server time as UTC is used.
4754
+ :type start: str
4755
+ :param end: The end of the timeframe as timestamp in ISO8601 (RFC3339) e.g. '2023-08-28T07:10:52.536Z'.
4756
+ :type end: str
4757
+ :param _request_timeout: timeout setting for this request. If one
4758
+ number provided, it will be total request
4759
+ timeout. It can also be a pair (tuple) of
4760
+ (connection, read) timeouts.
4761
+ :type _request_timeout: int, tuple(int, int), optional
4762
+ :param _request_auth: set to override the auth_settings for an a single
4763
+ request; this effectively ignores the
4764
+ authentication in the spec for a single request.
4765
+ :type _request_auth: dict, optional
4766
+ :param _content_type: force content-type for the request.
4767
+ :type _content_type: str, Optional
4768
+ :param _headers: set to override the headers for a single
4769
+ request; this effectively ignores the headers
4770
+ in the spec for a single request.
4771
+ :type _headers: dict, optional
4772
+ :param _host_index: set to override the host_index for a single
4773
+ request; this effectively ignores the host_index
4774
+ in the spec for a single request.
4775
+ :type _host_index: int, optional
4776
+ :return: Returns the result object.
4777
+ """ # noqa: E501 docstring might be too long
4778
+
4779
+ _param = self._list_metrics_serialize(
4780
+ project_id=project_id,
4781
+ instance_id=instance_id,
4782
+ metric=metric,
4783
+ granularity=granularity,
4784
+ period=period,
4785
+ start=start,
4786
+ end=end,
4787
+ _request_auth=_request_auth,
4788
+ _content_type=_content_type,
4789
+ _headers=_headers,
4790
+ _host_index=_host_index,
4791
+ )
4792
+
4793
+ _response_types_map: Dict[str, Optional[str]] = {
4794
+ "200": "ListMetricsResponse",
4795
+ "400": "InstanceError",
4796
+ "405": "InstanceError",
4797
+ "500": "InstanceError",
4798
+ }
4799
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
4800
+ return response_data.response
4801
+
4802
+ def _list_metrics_serialize(
4803
+ self,
4804
+ project_id,
4805
+ instance_id,
4806
+ metric,
4807
+ granularity,
4808
+ period,
4809
+ start,
4810
+ end,
4811
+ _request_auth,
4812
+ _content_type,
4813
+ _headers,
4814
+ _host_index,
4815
+ ) -> RequestSerialized:
4816
+
4817
+ _host = None
4818
+
4819
+ _collection_formats: Dict[str, str] = {}
4820
+
4821
+ _path_params: Dict[str, str] = {}
4822
+ _query_params: List[Tuple[str, str]] = []
4823
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4824
+ _form_params: List[Tuple[str, str]] = []
4825
+ _files: Dict[str, Union[str, bytes]] = {}
4826
+ _body_params: Optional[bytes] = None
4827
+
4828
+ # process the path parameters
4829
+ if project_id is not None:
4830
+ _path_params["projectId"] = project_id
4831
+ if instance_id is not None:
4832
+ _path_params["instanceId"] = instance_id
4833
+ if metric is not None:
4834
+ _path_params["metric"] = metric
4835
+ # process the query parameters
4836
+ if granularity is not None:
4837
+
4838
+ _query_params.append(("granularity", granularity))
4839
+
4840
+ if period is not None:
4841
+
4842
+ _query_params.append(("period", period))
4843
+
4844
+ if start is not None:
4845
+
4846
+ _query_params.append(("start", start))
4847
+
4848
+ if end is not None:
4849
+
4850
+ _query_params.append(("end", end))
4851
+
4852
+ # process the header parameters
4853
+ # process the form parameters
4854
+ # process the body parameter
4855
+
4856
+ # set the HTTP header `Accept`
4857
+ if "Accept" not in _header_params:
4858
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
4859
+
4860
+ # authentication setting
4861
+ _auth_settings: List[str] = []
4862
+
4863
+ return self.api_client.param_serialize(
4864
+ method="GET",
4865
+ resource_path="/v2/projects/{projectId}/instances/{instanceId}/metrics/{metric}",
4866
+ path_params=_path_params,
4867
+ query_params=_query_params,
4868
+ header_params=_header_params,
4869
+ body=_body_params,
4870
+ post_params=_form_params,
4871
+ files=_files,
4872
+ auth_settings=_auth_settings,
4873
+ collection_formats=_collection_formats,
4874
+ _host=_host,
4875
+ _request_auth=_request_auth,
4876
+ )
4877
+
4484
4878
  @validate_call
4485
4879
  def list_restore_jobs(
4486
4880
  self,
@@ -82,7 +82,7 @@ class ApiClient:
82
82
  self.default_headers[header_name] = header_value
83
83
  self.cookie = cookie
84
84
  # Set default User-Agent.
85
- self.user_agent = "OpenAPI-Generator/1.0.0/python"
85
+ self.user_agent = "stackit-sdk-python/sqlserverflex"
86
86
 
87
87
  def __enter__(self):
88
88
  return self
@@ -1,5 +1,10 @@
1
1
  # coding: utf-8
2
2
 
3
+ import sys
4
+
5
+ import os
6
+
7
+
3
8
  """
4
9
  STACKIT MSSQL Service API
5
10
 
@@ -12,8 +17,6 @@
12
17
  Do not edit the class manually.
13
18
  """ # noqa: E501 docstring might be too long
14
19
 
15
- import os
16
-
17
20
 
18
21
  class HostConfiguration:
19
22
  def __init__(
@@ -30,6 +33,7 @@ class HostConfiguration:
30
33
  "as a function argument instead of being set in the client configuration.\n"
31
34
  "Once all services have migrated, the methods to specify the region in the client configuration "
32
35
  "will be removed.",
36
+ file=sys.stderr,
33
37
  )
34
38
  """Constructor
35
39
  """
@@ -26,6 +26,7 @@ from stackit.sqlserverflex.models.create_instance_payload import CreateInstanceP
26
26
  from stackit.sqlserverflex.models.create_instance_response import CreateInstanceResponse
27
27
  from stackit.sqlserverflex.models.create_user_payload import CreateUserPayload
28
28
  from stackit.sqlserverflex.models.create_user_response import CreateUserResponse
29
+ from stackit.sqlserverflex.models.data_point import DataPoint
29
30
  from stackit.sqlserverflex.models.database import Database
30
31
  from stackit.sqlserverflex.models.database_documentation_create_database_request_options import (
31
32
  DatabaseDocumentationCreateDatabaseRequestOptions,
@@ -36,6 +37,8 @@ from stackit.sqlserverflex.models.get_backup_response import GetBackupResponse
36
37
  from stackit.sqlserverflex.models.get_database_response import GetDatabaseResponse
37
38
  from stackit.sqlserverflex.models.get_instance_response import GetInstanceResponse
38
39
  from stackit.sqlserverflex.models.get_user_response import GetUserResponse
40
+ from stackit.sqlserverflex.models.host import Host
41
+ from stackit.sqlserverflex.models.host_metric import HostMetric
39
42
  from stackit.sqlserverflex.models.instance import Instance
40
43
  from stackit.sqlserverflex.models.instance_documentation_acl import (
41
44
  InstanceDocumentationACL,
@@ -58,6 +61,7 @@ from stackit.sqlserverflex.models.list_compatibility_response import (
58
61
  from stackit.sqlserverflex.models.list_databases_response import ListDatabasesResponse
59
62
  from stackit.sqlserverflex.models.list_flavors_response import ListFlavorsResponse
60
63
  from stackit.sqlserverflex.models.list_instances_response import ListInstancesResponse
64
+ from stackit.sqlserverflex.models.list_metrics_response import ListMetricsResponse
61
65
  from stackit.sqlserverflex.models.list_restore_jobs_response import (
62
66
  ListRestoreJobsResponse,
63
67
  )
@@ -0,0 +1,83 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: support@stackit.cloud
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set, Union
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
22
+ from typing_extensions import Self
23
+
24
+
25
+ class DataPoint(BaseModel):
26
+ """
27
+ DataPoint
28
+ """
29
+
30
+ timestamp: Optional[StrictStr] = None
31
+ value: Optional[Union[StrictFloat, StrictInt]] = None
32
+ __properties: ClassVar[List[str]] = ["timestamp", "value"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of DataPoint from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of DataPoint from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({"timestamp": obj.get("timestamp"), "value": obj.get("value")})
83
+ return _obj
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: support@stackit.cloud
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
+ from typing_extensions import Self
23
+
24
+ from stackit.sqlserverflex.models.host_metric import HostMetric
25
+
26
+
27
+ class Host(BaseModel):
28
+ """
29
+ Host
30
+ """
31
+
32
+ host_metrics: Optional[List[HostMetric]] = Field(default=None, alias="hostMetrics")
33
+ id: Optional[StrictStr] = None
34
+ __properties: ClassVar[List[str]] = ["hostMetrics", "id"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of Host from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in host_metrics (list)
74
+ _items = []
75
+ if self.host_metrics:
76
+ for _item in self.host_metrics:
77
+ if _item:
78
+ _items.append(_item.to_dict())
79
+ _dict["hostMetrics"] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of Host from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate(
92
+ {
93
+ "hostMetrics": (
94
+ [HostMetric.from_dict(_item) for _item in obj["hostMetrics"]]
95
+ if obj.get("hostMetrics") is not None
96
+ else None
97
+ ),
98
+ "id": obj.get("id"),
99
+ }
100
+ )
101
+ return _obj
@@ -0,0 +1,103 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: support@stackit.cloud
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing_extensions import Self
23
+
24
+ from stackit.sqlserverflex.models.data_point import DataPoint
25
+
26
+
27
+ class HostMetric(BaseModel):
28
+ """
29
+ HostMetric
30
+ """
31
+
32
+ datapoints: Optional[List[DataPoint]] = None
33
+ name: Optional[StrictStr] = None
34
+ units: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = ["datapoints", "name", "units"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of HostMetric from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in datapoints (list)
75
+ _items = []
76
+ if self.datapoints:
77
+ for _item in self.datapoints:
78
+ if _item:
79
+ _items.append(_item.to_dict())
80
+ _dict["datapoints"] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of HostMetric from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate(
93
+ {
94
+ "datapoints": (
95
+ [DataPoint.from_dict(_item) for _item in obj["datapoints"]]
96
+ if obj.get("datapoints") is not None
97
+ else None
98
+ ),
99
+ "name": obj.get("name"),
100
+ "units": obj.get("units"),
101
+ }
102
+ )
103
+ return _obj
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT MSSQL Service API
5
+
6
+ This is the documentation for the STACKIT MSSQL service
7
+
8
+ The version of the OpenAPI document: 2.0.0
9
+ Contact: support@stackit.cloud
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501 docstring might be too long
14
+
15
+ from __future__ import annotations
16
+
17
+ import json
18
+ import pprint
19
+ from typing import Any, ClassVar, Dict, List, Optional, Set
20
+
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing_extensions import Self
23
+
24
+ from stackit.sqlserverflex.models.host import Host
25
+
26
+
27
+ class ListMetricsResponse(BaseModel):
28
+ """
29
+ ListMetricsResponse
30
+ """
31
+
32
+ hosts: Optional[List[Host]] = None
33
+ __properties: ClassVar[List[str]] = ["hosts"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of ListMetricsResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in hosts (list)
73
+ _items = []
74
+ if self.hosts:
75
+ for _item in self.hosts:
76
+ if _item:
77
+ _items.append(_item.to_dict())
78
+ _dict["hosts"] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListMetricsResponse from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate(
91
+ {"hosts": [Host.from_dict(_item) for _item in obj["hosts"]] if obj.get("hosts") is not None else None}
92
+ )
93
+ return _obj
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stackit-sqlserverflex
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: STACKIT MSSQL Service API
5
5
  Author: STACKIT Developer Tools
6
6
  Author-email: developer-tools@stackit.cloud
@@ -1,11 +1,11 @@
1
- stackit/sqlserverflex/__init__.py,sha256=gntwK_obY8PZiLWgGbaAkztVP3oJOfT-9TaEUIbFlE8,5137
1
+ stackit/sqlserverflex/__init__.py,sha256=vhP7RtxECtqhMG0ntC35cVt_oKfvSsKHiCPzvKT--Hk,5397
2
2
  stackit/sqlserverflex/api/__init__.py,sha256=vnWx4mPu8WNw9lyJ-_R5PHyz_KTKRlPdAPCAl72jpnQ,108
3
- stackit/sqlserverflex/api/default_api.py,sha256=oShlJNIln5NDZZfPoNPhXRy8Otxm1pIYd6biOgSBGBg,327916
4
- stackit/sqlserverflex/api_client.py,sha256=_UP2wfYv35IyMaOr5Vxhud5bUgWM4l96ucrWuN8UtJY,22749
3
+ stackit/sqlserverflex/api/default_api.py,sha256=xgv_saHwJkyMpgbOnQgKkniHrMn1eisC1fl6Uc31jI4,346746
4
+ stackit/sqlserverflex/api_client.py,sha256=VFS-1rxgtMqXp8Wchq15-6JBz-mVHidqJVAr-MSi7SI,22751
5
5
  stackit/sqlserverflex/api_response.py,sha256=HRYkVqMNIlfODacTQPTbiVj2YdcnutpQrKJdeAoCSpM,642
6
- stackit/sqlserverflex/configuration.py,sha256=0leRFU1YFVtsng_yyzLYKi-bUdWdLIXa3dqYUcIEe_c,5178
6
+ stackit/sqlserverflex/configuration.py,sha256=RA3KIX4mHt0odh07NCuIx3FYW0AhP21fCoAberEhSeA,5220
7
7
  stackit/sqlserverflex/exceptions.py,sha256=VFbkUi6-H3yCij0qY-T5C6ZZ1tYliu0vZU_y3CAZWZc,5951
8
- stackit/sqlserverflex/models/__init__.py,sha256=hxb7vDRfYa7deVaKY6CSzWhGER2ss_uET2nAE12VbNU,4656
8
+ stackit/sqlserverflex/models/__init__.py,sha256=TQ8G1ShdLVdft-FZBp2dnLpyYmIWucfTzR8ztlkzYx4,4916
9
9
  stackit/sqlserverflex/models/acl.py,sha256=OIOp4ene23d7WxPelBtz-CUMjgPqzMTegx1QXqKmILw,2398
10
10
  stackit/sqlserverflex/models/backup.py,sha256=ZDx2ejgRRuaBW5_nBwHxC3m5Hgj6G2Fy5S7mwjbh3P4,3206
11
11
  stackit/sqlserverflex/models/backup_list_backups_response_grouped.py,sha256=ktVdCTmQSAJyESTQdlUWkjYj5KoqjzAVdNgtbNTNGe0,3138
@@ -15,6 +15,7 @@ stackit/sqlserverflex/models/create_instance_payload.py,sha256=LjJI9a5BiEY44j_Z-
15
15
  stackit/sqlserverflex/models/create_instance_response.py,sha256=aM0sWkMHS8dUR7aVJjLKp4c4WLMA7fQnyKIv65EMBws,2456
16
16
  stackit/sqlserverflex/models/create_user_payload.py,sha256=uwt4b7gk7Id3o-XortUHoGNKhvztXmTXmFVzn6UQOGY,2709
17
17
  stackit/sqlserverflex/models/create_user_response.py,sha256=wMi6VnuSfTXX_gaMBgljKd1SwgZA1OTP5h2VBkfeDcc,2715
18
+ stackit/sqlserverflex/models/data_point.py,sha256=w9ct-4W9BXxc-UqzOAlg8EcQY1w3i3JUZLdXM0rhfdE,2557
18
19
  stackit/sqlserverflex/models/database.py,sha256=IiCavxHlBcGPkgEJ2qwE9BcIQsXBudKyFUMtFm-WG-o,2620
19
20
  stackit/sqlserverflex/models/database_documentation_create_database_request_options.py,sha256=JMp1IPaeDMq0FNFWD2YO3LGUoHim9v91harK9X7SXk4,3090
20
21
  stackit/sqlserverflex/models/database_options.py,sha256=WiKnibkpXDnEpnpsg_yyVu24g_QtipEwhsL9H373OBg,3055
@@ -23,6 +24,8 @@ stackit/sqlserverflex/models/get_backup_response.py,sha256=I8D0O7ezpuUKPnQMoJL3u
23
24
  stackit/sqlserverflex/models/get_database_response.py,sha256=M7bbUyZhv0ciLJSFnO253ZaP88WPGmcp8eEjP5JlYDM,2793
24
25
  stackit/sqlserverflex/models/get_instance_response.py,sha256=RLc6ebQ9WFc6EXPIifo-eOpX2jJo0B9f08l6KCsAlv0,2710
25
26
  stackit/sqlserverflex/models/get_user_response.py,sha256=DXDJpCTMtv12g-uFQJ8CgffcLHr2LZF3CV_BNpEaaz0,2750
27
+ stackit/sqlserverflex/models/host.py,sha256=jZAYNRX6iQIK7OZn3ixTtd-c4H1CPdXwEX6KtNp4kkk,3158
28
+ stackit/sqlserverflex/models/host_metric.py,sha256=VPCLoQKr0UxS7ZWddQpfc2c_mJFpYpVJ-VQVsNgxO5k,3220
26
29
  stackit/sqlserverflex/models/instance.py,sha256=25inJKdMX12PzofaWOiDsh1maKcYE5A6y9nC6JBrBdg,4280
27
30
  stackit/sqlserverflex/models/instance_documentation_acl.py,sha256=yMDOgYNPdo8NcrzO9XY4q4dYbmjK08vcsJRsciMlQ3U,2562
28
31
  stackit/sqlserverflex/models/instance_documentation_options.py,sha256=Kr2nreiXUBnwhnfvQnIXQ24n2FXMdbpO0rJzxtlwdlw,3027
@@ -37,6 +40,7 @@ stackit/sqlserverflex/models/list_compatibility_response.py,sha256=ZHCwkgNyPD_R7
37
40
  stackit/sqlserverflex/models/list_databases_response.py,sha256=HS8Clu8gRc5NhDM04aqWJMOiiE6GstUGy8alYR-UC4g,3062
38
41
  stackit/sqlserverflex/models/list_flavors_response.py,sha256=rQNLeN12H_nTYvLdsSxIDeFmmAeUu91O0Cxbt62h_Fg,3082
39
42
  stackit/sqlserverflex/models/list_instances_response.py,sha256=Aw5_ZywAzw8mMO1HpsCTBVkKSmZtfcmq-1bNuK66bp8,3178
43
+ stackit/sqlserverflex/models/list_metrics_response.py,sha256=mibJi73R2Fsvb6mPUoaEwUsbC_YPWQpVybr3bkXX0N4,2892
40
44
  stackit/sqlserverflex/models/list_restore_jobs_response.py,sha256=HmE_L4FzvIxZGbccYS_RlF1LY6jSPYE50TipGfiUiPU,3229
41
45
  stackit/sqlserverflex/models/list_roles_response.py,sha256=WATXIXNSZnR1quERHQvowmPBFNInZhs_hvQxJEiUJsY,2454
42
46
  stackit/sqlserverflex/models/list_storages_response.py,sha256=-u43gaQvhvpwb6TDdVmGOWdThKcAu0YcrAJP7QoVng8,3127
@@ -59,8 +63,8 @@ stackit/sqlserverflex/models/user.py,sha256=Wzdg6328cJyHnO7LgaJ0DLCeNWGaFeFk4e_m
59
63
  stackit/sqlserverflex/models/user_response_user.py,sha256=yzewtfcBtyPXS-PNl9zfT97rHXKi0OQLWyrTK5XPQ5g,3000
60
64
  stackit/sqlserverflex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
65
  stackit/sqlserverflex/rest.py,sha256=2JQidSroYQ4Ca_5wmVmm-W8lO6O_bIGXGZLdq8rRtVc,5837
62
- stackit_sqlserverflex-1.0.0.dist-info/LICENSE.md,sha256=3dF8Tb7yZn2tS4zyNa-yNe-68pH8qyWdGz4ioMd3MgE,10933
63
- stackit_sqlserverflex-1.0.0.dist-info/METADATA,sha256=cE7yLMkIx-YuXn9H4wVJ_cgm54lICNfG2RGgfyVDs5A,1619
64
- stackit_sqlserverflex-1.0.0.dist-info/NOTICE.txt,sha256=2NmOBbrveYxoc1q3Ttg2Py99H_uUiZtuzui5BSyh0qQ,66
65
- stackit_sqlserverflex-1.0.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
66
- stackit_sqlserverflex-1.0.0.dist-info/RECORD,,
66
+ stackit_sqlserverflex-1.0.2.dist-info/LICENSE.md,sha256=3dF8Tb7yZn2tS4zyNa-yNe-68pH8qyWdGz4ioMd3MgE,10933
67
+ stackit_sqlserverflex-1.0.2.dist-info/METADATA,sha256=CgdTs0GrlmD5r8R1YYOInBjhm7C18M7RL7R4sihJwyc,1619
68
+ stackit_sqlserverflex-1.0.2.dist-info/NOTICE.txt,sha256=2NmOBbrveYxoc1q3Ttg2Py99H_uUiZtuzui5BSyh0qQ,66
69
+ stackit_sqlserverflex-1.0.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
70
+ stackit_sqlserverflex-1.0.2.dist-info/RECORD,,