|
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 @@ def _enable_service_resource_serialize(
|
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,
|
|
0 commit comments