|
38 | 38 | from stackit.serverbackup.models.get_backup_schedules_response import (
|
39 | 39 | GetBackupSchedulesResponse,
|
40 | 40 | )
|
| 41 | +from stackit.serverbackup.models.get_backup_service_response import ( |
| 42 | + GetBackupServiceResponse, |
| 43 | +) |
41 | 44 | from stackit.serverbackup.models.get_backups_list_response import GetBackupsListResponse
|
42 | 45 | from stackit.serverbackup.models.restore_backup_payload import RestoreBackupPayload
|
43 | 46 | from stackit.serverbackup.models.restore_volume_backup_payload import (
|
@@ -2891,6 +2894,250 @@ def _get_backup_schedule_serialize(
|
2891 | 2894 | _request_auth=_request_auth,
|
2892 | 2895 | )
|
2893 | 2896 |
|
| 2897 | + @validate_call |
| 2898 | + def get_service_resource( |
| 2899 | + self, |
| 2900 | + project_id: Annotated[StrictStr, Field(description="project id")], |
| 2901 | + server_id: Annotated[StrictStr, Field(description="server id")], |
| 2902 | + _request_timeout: Union[ |
| 2903 | + None, |
| 2904 | + Annotated[StrictFloat, Field(gt=0)], |
| 2905 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 2906 | + ] = None, |
| 2907 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2908 | + _content_type: Optional[StrictStr] = None, |
| 2909 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2910 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2911 | + ) -> GetBackupServiceResponse: |
| 2912 | + """get backup service details |
| 2913 | +
|
| 2914 | +
|
| 2915 | + :param project_id: project id (required) |
| 2916 | + :type project_id: str |
| 2917 | + :param server_id: server id (required) |
| 2918 | + :type server_id: str |
| 2919 | + :param _request_timeout: timeout setting for this request. If one |
| 2920 | + number provided, it will be total request |
| 2921 | + timeout. It can also be a pair (tuple) of |
| 2922 | + (connection, read) timeouts. |
| 2923 | + :type _request_timeout: int, tuple(int, int), optional |
| 2924 | + :param _request_auth: set to override the auth_settings for an a single |
| 2925 | + request; this effectively ignores the |
| 2926 | + authentication in the spec for a single request. |
| 2927 | + :type _request_auth: dict, optional |
| 2928 | + :param _content_type: force content-type for the request. |
| 2929 | + :type _content_type: str, Optional |
| 2930 | + :param _headers: set to override the headers for a single |
| 2931 | + request; this effectively ignores the headers |
| 2932 | + in the spec for a single request. |
| 2933 | + :type _headers: dict, optional |
| 2934 | + :param _host_index: set to override the host_index for a single |
| 2935 | + request; this effectively ignores the host_index |
| 2936 | + in the spec for a single request. |
| 2937 | + :type _host_index: int, optional |
| 2938 | + :return: Returns the result object. |
| 2939 | + """ # noqa: E501 docstring might be too long |
| 2940 | + |
| 2941 | + _param = self._get_service_resource_serialize( |
| 2942 | + project_id=project_id, |
| 2943 | + server_id=server_id, |
| 2944 | + _request_auth=_request_auth, |
| 2945 | + _content_type=_content_type, |
| 2946 | + _headers=_headers, |
| 2947 | + _host_index=_host_index, |
| 2948 | + ) |
| 2949 | + |
| 2950 | + _response_types_map: Dict[str, Optional[str]] = { |
| 2951 | + "200": "GetBackupServiceResponse", |
| 2952 | + "400": None, |
| 2953 | + "404": None, |
| 2954 | + } |
| 2955 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 2956 | + response_data.read() |
| 2957 | + return self.api_client.response_deserialize( |
| 2958 | + response_data=response_data, |
| 2959 | + response_types_map=_response_types_map, |
| 2960 | + ).data |
| 2961 | + |
| 2962 | + @validate_call |
| 2963 | + def get_service_resource_with_http_info( |
| 2964 | + self, |
| 2965 | + project_id: Annotated[StrictStr, Field(description="project id")], |
| 2966 | + server_id: Annotated[StrictStr, Field(description="server id")], |
| 2967 | + _request_timeout: Union[ |
| 2968 | + None, |
| 2969 | + Annotated[StrictFloat, Field(gt=0)], |
| 2970 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 2971 | + ] = None, |
| 2972 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 2973 | + _content_type: Optional[StrictStr] = None, |
| 2974 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 2975 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 2976 | + ) -> ApiResponse[GetBackupServiceResponse]: |
| 2977 | + """get backup service details |
| 2978 | +
|
| 2979 | +
|
| 2980 | + :param project_id: project id (required) |
| 2981 | + :type project_id: str |
| 2982 | + :param server_id: server id (required) |
| 2983 | + :type server_id: str |
| 2984 | + :param _request_timeout: timeout setting for this request. If one |
| 2985 | + number provided, it will be total request |
| 2986 | + timeout. It can also be a pair (tuple) of |
| 2987 | + (connection, read) timeouts. |
| 2988 | + :type _request_timeout: int, tuple(int, int), optional |
| 2989 | + :param _request_auth: set to override the auth_settings for an a single |
| 2990 | + request; this effectively ignores the |
| 2991 | + authentication in the spec for a single request. |
| 2992 | + :type _request_auth: dict, optional |
| 2993 | + :param _content_type: force content-type for the request. |
| 2994 | + :type _content_type: str, Optional |
| 2995 | + :param _headers: set to override the headers for a single |
| 2996 | + request; this effectively ignores the headers |
| 2997 | + in the spec for a single request. |
| 2998 | + :type _headers: dict, optional |
| 2999 | + :param _host_index: set to override the host_index for a single |
| 3000 | + request; this effectively ignores the host_index |
| 3001 | + in the spec for a single request. |
| 3002 | + :type _host_index: int, optional |
| 3003 | + :return: Returns the result object. |
| 3004 | + """ # noqa: E501 docstring might be too long |
| 3005 | + |
| 3006 | + _param = self._get_service_resource_serialize( |
| 3007 | + project_id=project_id, |
| 3008 | + server_id=server_id, |
| 3009 | + _request_auth=_request_auth, |
| 3010 | + _content_type=_content_type, |
| 3011 | + _headers=_headers, |
| 3012 | + _host_index=_host_index, |
| 3013 | + ) |
| 3014 | + |
| 3015 | + _response_types_map: Dict[str, Optional[str]] = { |
| 3016 | + "200": "GetBackupServiceResponse", |
| 3017 | + "400": None, |
| 3018 | + "404": None, |
| 3019 | + } |
| 3020 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 3021 | + response_data.read() |
| 3022 | + return self.api_client.response_deserialize( |
| 3023 | + response_data=response_data, |
| 3024 | + response_types_map=_response_types_map, |
| 3025 | + ) |
| 3026 | + |
| 3027 | + @validate_call |
| 3028 | + def get_service_resource_without_preload_content( |
| 3029 | + self, |
| 3030 | + project_id: Annotated[StrictStr, Field(description="project id")], |
| 3031 | + server_id: Annotated[StrictStr, Field(description="server id")], |
| 3032 | + _request_timeout: Union[ |
| 3033 | + None, |
| 3034 | + Annotated[StrictFloat, Field(gt=0)], |
| 3035 | + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], |
| 3036 | + ] = None, |
| 3037 | + _request_auth: Optional[Dict[StrictStr, Any]] = None, |
| 3038 | + _content_type: Optional[StrictStr] = None, |
| 3039 | + _headers: Optional[Dict[StrictStr, Any]] = None, |
| 3040 | + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, |
| 3041 | + ) -> RESTResponseType: |
| 3042 | + """get backup service details |
| 3043 | +
|
| 3044 | +
|
| 3045 | + :param project_id: project id (required) |
| 3046 | + :type project_id: str |
| 3047 | + :param server_id: server id (required) |
| 3048 | + :type server_id: str |
| 3049 | + :param _request_timeout: timeout setting for this request. If one |
| 3050 | + number provided, it will be total request |
| 3051 | + timeout. It can also be a pair (tuple) of |
| 3052 | + (connection, read) timeouts. |
| 3053 | + :type _request_timeout: int, tuple(int, int), optional |
| 3054 | + :param _request_auth: set to override the auth_settings for an a single |
| 3055 | + request; this effectively ignores the |
| 3056 | + authentication in the spec for a single request. |
| 3057 | + :type _request_auth: dict, optional |
| 3058 | + :param _content_type: force content-type for the request. |
| 3059 | + :type _content_type: str, Optional |
| 3060 | + :param _headers: set to override the headers for a single |
| 3061 | + request; this effectively ignores the headers |
| 3062 | + in the spec for a single request. |
| 3063 | + :type _headers: dict, optional |
| 3064 | + :param _host_index: set to override the host_index for a single |
| 3065 | + request; this effectively ignores the host_index |
| 3066 | + in the spec for a single request. |
| 3067 | + :type _host_index: int, optional |
| 3068 | + :return: Returns the result object. |
| 3069 | + """ # noqa: E501 docstring might be too long |
| 3070 | + |
| 3071 | + _param = self._get_service_resource_serialize( |
| 3072 | + project_id=project_id, |
| 3073 | + server_id=server_id, |
| 3074 | + _request_auth=_request_auth, |
| 3075 | + _content_type=_content_type, |
| 3076 | + _headers=_headers, |
| 3077 | + _host_index=_host_index, |
| 3078 | + ) |
| 3079 | + |
| 3080 | + _response_types_map: Dict[str, Optional[str]] = { |
| 3081 | + "200": "GetBackupServiceResponse", |
| 3082 | + "400": None, |
| 3083 | + "404": None, |
| 3084 | + } |
| 3085 | + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) |
| 3086 | + return response_data.response |
| 3087 | + |
| 3088 | + def _get_service_resource_serialize( |
| 3089 | + self, |
| 3090 | + project_id, |
| 3091 | + server_id, |
| 3092 | + _request_auth, |
| 3093 | + _content_type, |
| 3094 | + _headers, |
| 3095 | + _host_index, |
| 3096 | + ) -> RequestSerialized: |
| 3097 | + |
| 3098 | + _host = None |
| 3099 | + |
| 3100 | + _collection_formats: Dict[str, str] = {} |
| 3101 | + |
| 3102 | + _path_params: Dict[str, str] = {} |
| 3103 | + _query_params: List[Tuple[str, str]] = [] |
| 3104 | + _header_params: Dict[str, Optional[str]] = _headers or {} |
| 3105 | + _form_params: List[Tuple[str, str]] = [] |
| 3106 | + _files: Dict[str, Union[str, bytes]] = {} |
| 3107 | + _body_params: Optional[bytes] = None |
| 3108 | + |
| 3109 | + # process the path parameters |
| 3110 | + if project_id is not None: |
| 3111 | + _path_params["projectId"] = project_id |
| 3112 | + if server_id is not None: |
| 3113 | + _path_params["serverId"] = server_id |
| 3114 | + # process the query parameters |
| 3115 | + # process the header parameters |
| 3116 | + # process the form parameters |
| 3117 | + # process the body parameter |
| 3118 | + |
| 3119 | + # set the HTTP header `Accept` |
| 3120 | + if "Accept" not in _header_params: |
| 3121 | + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) |
| 3122 | + |
| 3123 | + # authentication setting |
| 3124 | + _auth_settings: List[str] = [] |
| 3125 | + |
| 3126 | + return self.api_client.param_serialize( |
| 3127 | + method="GET", |
| 3128 | + resource_path="/v1/projects/{projectId}/servers/{serverId}/service", |
| 3129 | + path_params=_path_params, |
| 3130 | + query_params=_query_params, |
| 3131 | + header_params=_header_params, |
| 3132 | + body=_body_params, |
| 3133 | + post_params=_form_params, |
| 3134 | + files=_files, |
| 3135 | + auth_settings=_auth_settings, |
| 3136 | + collection_formats=_collection_formats, |
| 3137 | + _host=_host, |
| 3138 | + _request_auth=_request_auth, |
| 3139 | + ) |
| 3140 | + |
2894 | 3141 | @validate_call
|
2895 | 3142 | def list_backup_policies(
|
2896 | 3143 | self,
|
|
0 commit comments