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