stackit-serverupdate 0.2.0__tar.gz → 0.3.0__tar.gz

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.
Files changed (28) hide show
  1. stackit_serverupdate-0.3.0/LICENSE.md +201 -0
  2. stackit_serverupdate-0.3.0/NOTICE.txt +2 -0
  3. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/PKG-INFO +1 -1
  4. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/pyproject.toml +1 -1
  5. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/__init__.py +6 -1
  6. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/api/default_api.py +250 -0
  7. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/__init__.py +6 -1
  8. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/create_update_payload.py +2 -16
  9. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/create_update_schedule_payload.py +2 -4
  10. stackit_serverupdate-0.2.0/src/stackit/serverupdate/models/backup_properties.py → stackit_serverupdate-0.3.0/src/stackit/serverupdate/models/get_update_service_response.py +9 -15
  11. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/update_schedule.py +3 -3
  12. stackit_serverupdate-0.3.0/src/stackit/serverupdate/models/update_schedule_create_request.py +92 -0
  13. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/update_update_schedule_payload.py +2 -4
  14. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/README.md +0 -0
  15. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/api/__init__.py +0 -0
  16. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/api_client.py +0 -0
  17. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/api_response.py +0 -0
  18. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/configuration.py +0 -0
  19. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/exceptions.py +0 -0
  20. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/enable_service_payload.py +0 -0
  21. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/enable_service_resource_payload.py +0 -0
  22. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/get_update_policies_response.py +0 -0
  23. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/get_update_schedules_response.py +0 -0
  24. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/get_updates_list_response.py +0 -0
  25. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/update.py +0 -0
  26. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/models/update_policy.py +0 -0
  27. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/py.typed +0 -0
  28. {stackit_serverupdate-0.2.0 → stackit_serverupdate-0.3.0}/src/stackit/serverupdate/rest.py +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2025 Schwarz IT KG
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ STACKIT Server Update SDK for Python
2
+ Copyright 2025 Schwarz IT KG
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stackit-serverupdate
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: STACKIT Server Update Management API
5
5
  Author: STACKIT Developer Tools
6
6
  Author-email: developer-tools@stackit.cloud
@@ -3,7 +3,7 @@ name = "stackit-serverupdate"
3
3
 
4
4
  [tool.poetry]
5
5
  name = "stackit-serverupdate"
6
- version = "v0.2.0"
6
+ version = "v0.3.0"
7
7
  authors = [
8
8
  "STACKIT Developer Tools <developer-tools@stackit.cloud>",
9
9
  ]
@@ -34,7 +34,6 @@ from stackit.serverupdate.exceptions import (
34
34
  )
35
35
 
36
36
  # import models into sdk package
37
- from stackit.serverupdate.models.backup_properties import BackupProperties
38
37
  from stackit.serverupdate.models.create_update_payload import CreateUpdatePayload
39
38
  from stackit.serverupdate.models.create_update_schedule_payload import (
40
39
  CreateUpdateSchedulePayload,
@@ -49,10 +48,16 @@ from stackit.serverupdate.models.get_update_policies_response import (
49
48
  from stackit.serverupdate.models.get_update_schedules_response import (
50
49
  GetUpdateSchedulesResponse,
51
50
  )
51
+ from stackit.serverupdate.models.get_update_service_response import (
52
+ GetUpdateServiceResponse,
53
+ )
52
54
  from stackit.serverupdate.models.get_updates_list_response import GetUpdatesListResponse
53
55
  from stackit.serverupdate.models.update import Update
54
56
  from stackit.serverupdate.models.update_policy import UpdatePolicy
55
57
  from stackit.serverupdate.models.update_schedule import UpdateSchedule
58
+ from stackit.serverupdate.models.update_schedule_create_request import (
59
+ UpdateScheduleCreateRequest,
60
+ )
56
61
  from stackit.serverupdate.models.update_update_schedule_payload import (
57
62
  UpdateUpdateSchedulePayload,
58
63
  )
@@ -35,6 +35,9 @@ from stackit.serverupdate.models.get_update_policies_response import (
35
35
  from stackit.serverupdate.models.get_update_schedules_response import (
36
36
  GetUpdateSchedulesResponse,
37
37
  )
38
+ from stackit.serverupdate.models.get_update_service_response import (
39
+ GetUpdateServiceResponse,
40
+ )
38
41
  from stackit.serverupdate.models.get_updates_list_response import GetUpdatesListResponse
39
42
  from stackit.serverupdate.models.update import Update
40
43
  from stackit.serverupdate.models.update_schedule import UpdateSchedule
@@ -1879,6 +1882,253 @@ class DefaultApi:
1879
1882
  _request_auth=_request_auth,
1880
1883
  )
1881
1884
 
1885
+ @validate_call
1886
+ def get_service_resource(
1887
+ self,
1888
+ project_id: Annotated[StrictStr, Field(description="project id")],
1889
+ server_id: Annotated[StrictStr, Field(description="server id")],
1890
+ _request_timeout: Union[
1891
+ None,
1892
+ Annotated[StrictFloat, Field(gt=0)],
1893
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1894
+ ] = None,
1895
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1896
+ _content_type: Optional[StrictStr] = None,
1897
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1898
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1899
+ ) -> GetUpdateServiceResponse:
1900
+ """get update service details
1901
+
1902
+
1903
+ :param project_id: project id (required)
1904
+ :type project_id: str
1905
+ :param server_id: server id (required)
1906
+ :type server_id: str
1907
+ :param _request_timeout: timeout setting for this request. If one
1908
+ number provided, it will be total request
1909
+ timeout. It can also be a pair (tuple) of
1910
+ (connection, read) timeouts.
1911
+ :type _request_timeout: int, tuple(int, int), optional
1912
+ :param _request_auth: set to override the auth_settings for an a single
1913
+ request; this effectively ignores the
1914
+ authentication in the spec for a single request.
1915
+ :type _request_auth: dict, optional
1916
+ :param _content_type: force content-type for the request.
1917
+ :type _content_type: str, Optional
1918
+ :param _headers: set to override the headers for a single
1919
+ request; this effectively ignores the headers
1920
+ in the spec for a single request.
1921
+ :type _headers: dict, optional
1922
+ :param _host_index: set to override the host_index for a single
1923
+ request; this effectively ignores the host_index
1924
+ in the spec for a single request.
1925
+ :type _host_index: int, optional
1926
+ :return: Returns the result object.
1927
+ """ # noqa: E501 docstring might be too long
1928
+
1929
+ _param = self._get_service_resource_serialize(
1930
+ project_id=project_id,
1931
+ server_id=server_id,
1932
+ _request_auth=_request_auth,
1933
+ _content_type=_content_type,
1934
+ _headers=_headers,
1935
+ _host_index=_host_index,
1936
+ )
1937
+
1938
+ _response_types_map: Dict[str, Optional[str]] = {
1939
+ "200": "GetUpdateServiceResponse",
1940
+ "400": None,
1941
+ "401": None,
1942
+ "404": None,
1943
+ }
1944
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1945
+ response_data.read()
1946
+ return self.api_client.response_deserialize(
1947
+ response_data=response_data,
1948
+ response_types_map=_response_types_map,
1949
+ ).data
1950
+
1951
+ @validate_call
1952
+ def get_service_resource_with_http_info(
1953
+ self,
1954
+ project_id: Annotated[StrictStr, Field(description="project id")],
1955
+ server_id: Annotated[StrictStr, Field(description="server id")],
1956
+ _request_timeout: Union[
1957
+ None,
1958
+ Annotated[StrictFloat, Field(gt=0)],
1959
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1960
+ ] = None,
1961
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1962
+ _content_type: Optional[StrictStr] = None,
1963
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1964
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1965
+ ) -> ApiResponse[GetUpdateServiceResponse]:
1966
+ """get update service details
1967
+
1968
+
1969
+ :param project_id: project id (required)
1970
+ :type project_id: str
1971
+ :param server_id: server id (required)
1972
+ :type server_id: str
1973
+ :param _request_timeout: timeout setting for this request. If one
1974
+ number provided, it will be total request
1975
+ timeout. It can also be a pair (tuple) of
1976
+ (connection, read) timeouts.
1977
+ :type _request_timeout: int, tuple(int, int), optional
1978
+ :param _request_auth: set to override the auth_settings for an a single
1979
+ request; this effectively ignores the
1980
+ authentication in the spec for a single request.
1981
+ :type _request_auth: dict, optional
1982
+ :param _content_type: force content-type for the request.
1983
+ :type _content_type: str, Optional
1984
+ :param _headers: set to override the headers for a single
1985
+ request; this effectively ignores the headers
1986
+ in the spec for a single request.
1987
+ :type _headers: dict, optional
1988
+ :param _host_index: set to override the host_index for a single
1989
+ request; this effectively ignores the host_index
1990
+ in the spec for a single request.
1991
+ :type _host_index: int, optional
1992
+ :return: Returns the result object.
1993
+ """ # noqa: E501 docstring might be too long
1994
+
1995
+ _param = self._get_service_resource_serialize(
1996
+ project_id=project_id,
1997
+ server_id=server_id,
1998
+ _request_auth=_request_auth,
1999
+ _content_type=_content_type,
2000
+ _headers=_headers,
2001
+ _host_index=_host_index,
2002
+ )
2003
+
2004
+ _response_types_map: Dict[str, Optional[str]] = {
2005
+ "200": "GetUpdateServiceResponse",
2006
+ "400": None,
2007
+ "401": None,
2008
+ "404": None,
2009
+ }
2010
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2011
+ response_data.read()
2012
+ return self.api_client.response_deserialize(
2013
+ response_data=response_data,
2014
+ response_types_map=_response_types_map,
2015
+ )
2016
+
2017
+ @validate_call
2018
+ def get_service_resource_without_preload_content(
2019
+ self,
2020
+ project_id: Annotated[StrictStr, Field(description="project id")],
2021
+ server_id: Annotated[StrictStr, Field(description="server id")],
2022
+ _request_timeout: Union[
2023
+ None,
2024
+ Annotated[StrictFloat, Field(gt=0)],
2025
+ Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2026
+ ] = None,
2027
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2028
+ _content_type: Optional[StrictStr] = None,
2029
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2030
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2031
+ ) -> RESTResponseType:
2032
+ """get update service details
2033
+
2034
+
2035
+ :param project_id: project id (required)
2036
+ :type project_id: str
2037
+ :param server_id: server id (required)
2038
+ :type server_id: str
2039
+ :param _request_timeout: timeout setting for this request. If one
2040
+ number provided, it will be total request
2041
+ timeout. It can also be a pair (tuple) of
2042
+ (connection, read) timeouts.
2043
+ :type _request_timeout: int, tuple(int, int), optional
2044
+ :param _request_auth: set to override the auth_settings for an a single
2045
+ request; this effectively ignores the
2046
+ authentication in the spec for a single request.
2047
+ :type _request_auth: dict, optional
2048
+ :param _content_type: force content-type for the request.
2049
+ :type _content_type: str, Optional
2050
+ :param _headers: set to override the headers for a single
2051
+ request; this effectively ignores the headers
2052
+ in the spec for a single request.
2053
+ :type _headers: dict, optional
2054
+ :param _host_index: set to override the host_index for a single
2055
+ request; this effectively ignores the host_index
2056
+ in the spec for a single request.
2057
+ :type _host_index: int, optional
2058
+ :return: Returns the result object.
2059
+ """ # noqa: E501 docstring might be too long
2060
+
2061
+ _param = self._get_service_resource_serialize(
2062
+ project_id=project_id,
2063
+ server_id=server_id,
2064
+ _request_auth=_request_auth,
2065
+ _content_type=_content_type,
2066
+ _headers=_headers,
2067
+ _host_index=_host_index,
2068
+ )
2069
+
2070
+ _response_types_map: Dict[str, Optional[str]] = {
2071
+ "200": "GetUpdateServiceResponse",
2072
+ "400": None,
2073
+ "401": None,
2074
+ "404": None,
2075
+ }
2076
+ response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2077
+ return response_data.response
2078
+
2079
+ def _get_service_resource_serialize(
2080
+ self,
2081
+ project_id,
2082
+ server_id,
2083
+ _request_auth,
2084
+ _content_type,
2085
+ _headers,
2086
+ _host_index,
2087
+ ) -> RequestSerialized:
2088
+
2089
+ _host = None
2090
+
2091
+ _collection_formats: Dict[str, str] = {}
2092
+
2093
+ _path_params: Dict[str, str] = {}
2094
+ _query_params: List[Tuple[str, str]] = []
2095
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2096
+ _form_params: List[Tuple[str, str]] = []
2097
+ _files: Dict[str, Union[str, bytes]] = {}
2098
+ _body_params: Optional[bytes] = None
2099
+
2100
+ # process the path parameters
2101
+ if project_id is not None:
2102
+ _path_params["projectId"] = project_id
2103
+ if server_id is not None:
2104
+ _path_params["serverId"] = server_id
2105
+ # process the query parameters
2106
+ # process the header parameters
2107
+ # process the form parameters
2108
+ # process the body parameter
2109
+
2110
+ # set the HTTP header `Accept`
2111
+ if "Accept" not in _header_params:
2112
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
2113
+
2114
+ # authentication setting
2115
+ _auth_settings: List[str] = []
2116
+
2117
+ return self.api_client.param_serialize(
2118
+ method="GET",
2119
+ resource_path="/v1/projects/{projectId}/servers/{serverId}/service",
2120
+ path_params=_path_params,
2121
+ query_params=_query_params,
2122
+ header_params=_header_params,
2123
+ body=_body_params,
2124
+ post_params=_form_params,
2125
+ files=_files,
2126
+ auth_settings=_auth_settings,
2127
+ collection_formats=_collection_formats,
2128
+ _host=_host,
2129
+ _request_auth=_request_auth,
2130
+ )
2131
+
1882
2132
  @validate_call
1883
2133
  def get_update(
1884
2134
  self,
@@ -15,7 +15,6 @@
15
15
 
16
16
 
17
17
  # import models into model package
18
- from stackit.serverupdate.models.backup_properties import BackupProperties
19
18
  from stackit.serverupdate.models.create_update_payload import CreateUpdatePayload
20
19
  from stackit.serverupdate.models.create_update_schedule_payload import (
21
20
  CreateUpdateSchedulePayload,
@@ -30,10 +29,16 @@ from stackit.serverupdate.models.get_update_policies_response import (
30
29
  from stackit.serverupdate.models.get_update_schedules_response import (
31
30
  GetUpdateSchedulesResponse,
32
31
  )
32
+ from stackit.serverupdate.models.get_update_service_response import (
33
+ GetUpdateServiceResponse,
34
+ )
33
35
  from stackit.serverupdate.models.get_updates_list_response import GetUpdatesListResponse
34
36
  from stackit.serverupdate.models.update import Update
35
37
  from stackit.serverupdate.models.update_policy import UpdatePolicy
36
38
  from stackit.serverupdate.models.update_schedule import UpdateSchedule
39
+ from stackit.serverupdate.models.update_schedule_create_request import (
40
+ UpdateScheduleCreateRequest,
41
+ )
37
42
  from stackit.serverupdate.models.update_update_schedule_payload import (
38
43
  UpdateUpdateSchedulePayload,
39
44
  )
@@ -21,8 +21,6 @@ from typing import Any, ClassVar, Dict, List, Optional, Set
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool
22
22
  from typing_extensions import Annotated, Self
23
23
 
24
- from stackit.serverupdate.models.backup_properties import BackupProperties
25
-
26
24
 
27
25
  class CreateUpdatePayload(BaseModel):
28
26
  """
@@ -30,9 +28,8 @@ class CreateUpdatePayload(BaseModel):
30
28
  """
31
29
 
32
30
  backup_before_update: Optional[StrictBool] = Field(default=None, alias="backupBeforeUpdate")
33
- backup_properties: Optional[BackupProperties] = Field(default=None, alias="backupProperties")
34
31
  maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow")
35
- __properties: ClassVar[List[str]] = ["backupBeforeUpdate", "backupProperties", "maintenanceWindow"]
32
+ __properties: ClassVar[List[str]] = ["backupBeforeUpdate", "maintenanceWindow"]
36
33
 
37
34
  model_config = ConfigDict(
38
35
  populate_by_name=True,
@@ -71,9 +68,6 @@ class CreateUpdatePayload(BaseModel):
71
68
  exclude=excluded_fields,
72
69
  exclude_none=True,
73
70
  )
74
- # override the default output from pydantic by calling `to_dict()` of backup_properties
75
- if self.backup_properties:
76
- _dict["backupProperties"] = self.backup_properties.to_dict()
77
71
  return _dict
78
72
 
79
73
  @classmethod
@@ -86,14 +80,6 @@ class CreateUpdatePayload(BaseModel):
86
80
  return cls.model_validate(obj)
87
81
 
88
82
  _obj = cls.model_validate(
89
- {
90
- "backupBeforeUpdate": obj.get("backupBeforeUpdate"),
91
- "backupProperties": (
92
- BackupProperties.from_dict(obj["backupProperties"])
93
- if obj.get("backupProperties") is not None
94
- else None
95
- ),
96
- "maintenanceWindow": obj.get("maintenanceWindow"),
97
- }
83
+ {"backupBeforeUpdate": obj.get("backupBeforeUpdate"), "maintenanceWindow": obj.get("maintenanceWindow")}
98
84
  )
99
85
  return _obj
@@ -18,7 +18,7 @@ import json
18
18
  import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
22
  from typing_extensions import Annotated, Self
23
23
 
24
24
 
@@ -28,11 +28,10 @@ class CreateUpdateSchedulePayload(BaseModel):
28
28
  """
29
29
 
30
30
  enabled: StrictBool
31
- id: Optional[StrictInt] = None
32
31
  maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow")
33
32
  name: StrictStr
34
33
  rrule: StrictStr
35
- __properties: ClassVar[List[str]] = ["enabled", "id", "maintenanceWindow", "name", "rrule"]
34
+ __properties: ClassVar[List[str]] = ["enabled", "maintenanceWindow", "name", "rrule"]
36
35
 
37
36
  model_config = ConfigDict(
38
37
  populate_by_name=True,
@@ -85,7 +84,6 @@ class CreateUpdateSchedulePayload(BaseModel):
85
84
  _obj = cls.model_validate(
86
85
  {
87
86
  "enabled": obj.get("enabled"),
88
- "id": obj.get("id"),
89
87
  "maintenanceWindow": obj.get("maintenanceWindow"),
90
88
  "name": obj.get("name"),
91
89
  "rrule": obj.get("rrule"),
@@ -18,21 +18,17 @@ import json
18
18
  import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
- from typing_extensions import Annotated, Self
21
+ from pydantic import BaseModel, ConfigDict, StrictBool
22
+ from typing_extensions import Self
23
23
 
24
24
 
25
- class BackupProperties(BaseModel):
25
+ class GetUpdateServiceResponse(BaseModel):
26
26
  """
27
- BackupProperties
27
+ GetUpdateServiceResponse
28
28
  """
29
29
 
30
- name: StrictStr = Field(description="Max 255 characters")
31
- retention_period: Annotated[int, Field(le=36500, strict=True, ge=1)] = Field(
32
- description="Values are set in days (1-36500)", alias="retentionPeriod"
33
- )
34
- volume_ids: Optional[List[StrictStr]] = Field(default=None, alias="volumeIds")
35
- __properties: ClassVar[List[str]] = ["name", "retentionPeriod", "volumeIds"]
30
+ enabled: Optional[StrictBool] = None
31
+ __properties: ClassVar[List[str]] = ["enabled"]
36
32
 
37
33
  model_config = ConfigDict(
38
34
  populate_by_name=True,
@@ -51,7 +47,7 @@ class BackupProperties(BaseModel):
51
47
 
52
48
  @classmethod
53
49
  def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of BackupProperties from a JSON string"""
50
+ """Create an instance of GetUpdateServiceResponse from a JSON string"""
55
51
  return cls.from_dict(json.loads(json_str))
56
52
 
57
53
  def to_dict(self) -> Dict[str, Any]:
@@ -75,14 +71,12 @@ class BackupProperties(BaseModel):
75
71
 
76
72
  @classmethod
77
73
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
- """Create an instance of BackupProperties from a dict"""
74
+ """Create an instance of GetUpdateServiceResponse from a dict"""
79
75
  if obj is None:
80
76
  return None
81
77
 
82
78
  if not isinstance(obj, dict):
83
79
  return cls.model_validate(obj)
84
80
 
85
- _obj = cls.model_validate(
86
- {"name": obj.get("name"), "retentionPeriod": obj.get("retentionPeriod"), "volumeIds": obj.get("volumeIds")}
87
- )
81
+ _obj = cls.model_validate({"enabled": obj.get("enabled")})
88
82
  return _obj
@@ -28,11 +28,11 @@ class UpdateSchedule(BaseModel):
28
28
  """
29
29
 
30
30
  enabled: StrictBool
31
- id: Optional[StrictInt] = None
32
31
  maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow")
33
32
  name: StrictStr
34
33
  rrule: StrictStr
35
- __properties: ClassVar[List[str]] = ["enabled", "id", "maintenanceWindow", "name", "rrule"]
34
+ id: StrictInt
35
+ __properties: ClassVar[List[str]] = ["enabled", "maintenanceWindow", "name", "rrule", "id"]
36
36
 
37
37
  model_config = ConfigDict(
38
38
  populate_by_name=True,
@@ -85,10 +85,10 @@ class UpdateSchedule(BaseModel):
85
85
  _obj = cls.model_validate(
86
86
  {
87
87
  "enabled": obj.get("enabled"),
88
- "id": obj.get("id"),
89
88
  "maintenanceWindow": obj.get("maintenanceWindow"),
90
89
  "name": obj.get("name"),
91
90
  "rrule": obj.get("rrule"),
91
+ "id": obj.get("id"),
92
92
  }
93
93
  )
94
94
  return _obj
@@ -0,0 +1,92 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT Server Update Management API
5
+
6
+ API endpoints for Server Update Operations on STACKIT Servers.
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Contact: support@stackit.de
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, StrictBool, StrictStr
22
+ from typing_extensions import Annotated, Self
23
+
24
+
25
+ class UpdateScheduleCreateRequest(BaseModel):
26
+ """
27
+ UpdateScheduleCreateRequest
28
+ """
29
+
30
+ enabled: StrictBool
31
+ maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow")
32
+ name: StrictStr
33
+ rrule: StrictStr
34
+ __properties: ClassVar[List[str]] = ["enabled", "maintenanceWindow", "name", "rrule"]
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 UpdateScheduleCreateRequest 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
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of UpdateScheduleCreateRequest from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate(
85
+ {
86
+ "enabled": obj.get("enabled"),
87
+ "maintenanceWindow": obj.get("maintenanceWindow"),
88
+ "name": obj.get("name"),
89
+ "rrule": obj.get("rrule"),
90
+ }
91
+ )
92
+ return _obj
@@ -18,7 +18,7 @@ import json
18
18
  import pprint
19
19
  from typing import Any, ClassVar, Dict, List, Optional, Set
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
22
  from typing_extensions import Annotated, Self
23
23
 
24
24
 
@@ -28,11 +28,10 @@ class UpdateUpdateSchedulePayload(BaseModel):
28
28
  """
29
29
 
30
30
  enabled: StrictBool
31
- id: Optional[StrictInt] = None
32
31
  maintenance_window: Annotated[int, Field(le=24, strict=True, ge=1)] = Field(alias="maintenanceWindow")
33
32
  name: StrictStr
34
33
  rrule: StrictStr
35
- __properties: ClassVar[List[str]] = ["enabled", "id", "maintenanceWindow", "name", "rrule"]
34
+ __properties: ClassVar[List[str]] = ["enabled", "maintenanceWindow", "name", "rrule"]
36
35
 
37
36
  model_config = ConfigDict(
38
37
  populate_by_name=True,
@@ -85,7 +84,6 @@ class UpdateUpdateSchedulePayload(BaseModel):
85
84
  _obj = cls.model_validate(
86
85
  {
87
86
  "enabled": obj.get("enabled"),
88
- "id": obj.get("id"),
89
87
  "maintenanceWindow": obj.get("maintenanceWindow"),
90
88
  "name": obj.get("name"),
91
89
  "rrule": obj.get("rrule"),