diff --git a/services/sfs/oas_commit b/services/sfs/oas_commit index e3713dde3..1bb3c5531 100644 --- a/services/sfs/oas_commit +++ b/services/sfs/oas_commit @@ -1 +1 @@ -0e64886dd0847341800d7191ed193b75413be998 +09d270eaf70fdaf9baa80d725cca3fdec9653ba3 diff --git a/services/sfs/src/stackit/sfs/__init__.py b/services/sfs/src/stackit/sfs/__init__.py index 01434e11b..932467703 100644 --- a/services/sfs/src/stackit/sfs/__init__.py +++ b/services/sfs/src/stackit/sfs/__init__.py @@ -38,27 +38,38 @@ "CreateSharePayload", "CreateShareResponse", "Error", + "GetLockResponse", "GetResourcePoolResponse", "GetResourcePoolSnapshotResponse", + "GetScheduleResponse", "GetShareExportPolicyResponse", "GetShareResponse", + "GetSnapshotPolicyResponse", "GoogleProtobufAny", "ListPerformanceClassesResponse", "ListResourcePoolSnapshotsResponse", "ListResourcePoolsResponse", + "ListSchedulesResponse", "ListShareExportPoliciesResponse", "ListSharesResponse", + "ListSnapshotPoliciesResponse", "PerformanceClass", "ResourcePool", "ResourcePoolPerformanceClass", "ResourcePoolSnapshot", + "ResourcePoolSnapshotPolicy", "ResourcePoolSpace", + "Schedule", "Share", "ShareExportPolicy", "ShareExportPolicyRule", + "SnapshotPolicy", + "SnapshotPolicySchedule", "Status", "UpdateResourcePoolPayload", "UpdateResourcePoolResponse", + "UpdateResourcePoolSnapshotPayload", + "UpdateResourcePoolSnapshotResponse", "UpdateShareExportPolicyBodyRule", "UpdateShareExportPolicyPayload", "UpdateShareExportPolicyResponse", @@ -111,16 +122,23 @@ CreateShareResponse as CreateShareResponse, ) from stackit.sfs.models.error import Error as Error +from stackit.sfs.models.get_lock_response import GetLockResponse as GetLockResponse from stackit.sfs.models.get_resource_pool_response import ( GetResourcePoolResponse as GetResourcePoolResponse, ) from stackit.sfs.models.get_resource_pool_snapshot_response import ( GetResourcePoolSnapshotResponse as GetResourcePoolSnapshotResponse, ) +from stackit.sfs.models.get_schedule_response import ( + GetScheduleResponse as GetScheduleResponse, +) from stackit.sfs.models.get_share_export_policy_response import ( GetShareExportPolicyResponse as GetShareExportPolicyResponse, ) from stackit.sfs.models.get_share_response import GetShareResponse as GetShareResponse +from stackit.sfs.models.get_snapshot_policy_response import ( + GetSnapshotPolicyResponse as GetSnapshotPolicyResponse, +) from stackit.sfs.models.google_protobuf_any import ( GoogleProtobufAny as GoogleProtobufAny, ) @@ -133,12 +151,18 @@ from stackit.sfs.models.list_resource_pools_response import ( ListResourcePoolsResponse as ListResourcePoolsResponse, ) +from stackit.sfs.models.list_schedules_response import ( + ListSchedulesResponse as ListSchedulesResponse, +) from stackit.sfs.models.list_share_export_policies_response import ( ListShareExportPoliciesResponse as ListShareExportPoliciesResponse, ) from stackit.sfs.models.list_shares_response import ( ListSharesResponse as ListSharesResponse, ) +from stackit.sfs.models.list_snapshot_policies_response import ( + ListSnapshotPoliciesResponse as ListSnapshotPoliciesResponse, +) from stackit.sfs.models.performance_class import PerformanceClass as PerformanceClass from stackit.sfs.models.resource_pool import ResourcePool as ResourcePool from stackit.sfs.models.resource_pool_performance_class import ( @@ -147,9 +171,13 @@ from stackit.sfs.models.resource_pool_snapshot import ( ResourcePoolSnapshot as ResourcePoolSnapshot, ) +from stackit.sfs.models.resource_pool_snapshot_policy import ( + ResourcePoolSnapshotPolicy as ResourcePoolSnapshotPolicy, +) from stackit.sfs.models.resource_pool_space import ( ResourcePoolSpace as ResourcePoolSpace, ) +from stackit.sfs.models.schedule import Schedule as Schedule from stackit.sfs.models.share import Share as Share from stackit.sfs.models.share_export_policy import ( ShareExportPolicy as ShareExportPolicy, @@ -157,6 +185,10 @@ from stackit.sfs.models.share_export_policy_rule import ( ShareExportPolicyRule as ShareExportPolicyRule, ) +from stackit.sfs.models.snapshot_policy import SnapshotPolicy as SnapshotPolicy +from stackit.sfs.models.snapshot_policy_schedule import ( + SnapshotPolicySchedule as SnapshotPolicySchedule, +) from stackit.sfs.models.status import Status as Status from stackit.sfs.models.update_resource_pool_payload import ( UpdateResourcePoolPayload as UpdateResourcePoolPayload, @@ -164,6 +196,12 @@ from stackit.sfs.models.update_resource_pool_response import ( UpdateResourcePoolResponse as UpdateResourcePoolResponse, ) +from stackit.sfs.models.update_resource_pool_snapshot_payload import ( + UpdateResourcePoolSnapshotPayload as UpdateResourcePoolSnapshotPayload, +) +from stackit.sfs.models.update_resource_pool_snapshot_response import ( + UpdateResourcePoolSnapshotResponse as UpdateResourcePoolSnapshotResponse, +) from stackit.sfs.models.update_share_export_policy_body_rule import ( UpdateShareExportPolicyBodyRule as UpdateShareExportPolicyBodyRule, ) diff --git a/services/sfs/src/stackit/sfs/api/default_api.py b/services/sfs/src/stackit/sfs/api/default_api.py index 5544d4eec..d1726fdcc 100644 --- a/services/sfs/src/stackit/sfs/api/default_api.py +++ b/services/sfs/src/stackit/sfs/api/default_api.py @@ -13,7 +13,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call from stackit.core.configuration import Configuration from typing_extensions import Annotated @@ -35,14 +35,17 @@ ) from stackit.sfs.models.create_share_payload import CreateSharePayload from stackit.sfs.models.create_share_response import CreateShareResponse +from stackit.sfs.models.get_lock_response import GetLockResponse from stackit.sfs.models.get_resource_pool_response import GetResourcePoolResponse from stackit.sfs.models.get_resource_pool_snapshot_response import ( GetResourcePoolSnapshotResponse, ) +from stackit.sfs.models.get_schedule_response import GetScheduleResponse from stackit.sfs.models.get_share_export_policy_response import ( GetShareExportPolicyResponse, ) from stackit.sfs.models.get_share_response import GetShareResponse +from stackit.sfs.models.get_snapshot_policy_response import GetSnapshotPolicyResponse from stackit.sfs.models.list_performance_classes_response import ( ListPerformanceClassesResponse, ) @@ -50,12 +53,22 @@ ListResourcePoolSnapshotsResponse, ) from stackit.sfs.models.list_resource_pools_response import ListResourcePoolsResponse +from stackit.sfs.models.list_schedules_response import ListSchedulesResponse from stackit.sfs.models.list_share_export_policies_response import ( ListShareExportPoliciesResponse, ) from stackit.sfs.models.list_shares_response import ListSharesResponse +from stackit.sfs.models.list_snapshot_policies_response import ( + ListSnapshotPoliciesResponse, +) from stackit.sfs.models.update_resource_pool_payload import UpdateResourcePoolPayload from stackit.sfs.models.update_resource_pool_response import UpdateResourcePoolResponse +from stackit.sfs.models.update_resource_pool_snapshot_payload import ( + UpdateResourcePoolSnapshotPayload, +) +from stackit.sfs.models.update_resource_pool_snapshot_response import ( + UpdateResourcePoolSnapshotResponse, +) from stackit.sfs.models.update_share_export_policy_payload import ( UpdateShareExportPolicyPayload, ) @@ -2309,11 +2322,10 @@ def _delete_share_export_policy_serialize( ) @validate_call - def get_resource_pool( + def disable_lock( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2323,17 +2335,15 @@ def get_resource_pool( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetResourcePoolResponse: - """Get Resource Pool + ) -> object: + """disable_lock - Retrieves a Resource Pool in a project. + Clean up locks for a project so that it can be deleted successfully. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2356,10 +2366,9 @@ def get_resource_pool( :return: Returns the result object. """ # noqa: E501 - _param = self._get_resource_pool_serialize( - project_id=project_id, + _param = self._disable_lock_serialize( region=region, - resource_pool_id=resource_pool_id, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2367,10 +2376,7 @@ def get_resource_pool( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetResourcePoolResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2380,11 +2386,10 @@ def get_resource_pool( ).data @validate_call - def get_resource_pool_with_http_info( + def disable_lock_with_http_info( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2394,17 +2399,15 @@ def get_resource_pool_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetResourcePoolResponse]: - """Get Resource Pool + ) -> ApiResponse[object]: + """disable_lock - Retrieves a Resource Pool in a project. + Clean up locks for a project so that it can be deleted successfully. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2427,10 +2430,9 @@ def get_resource_pool_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_resource_pool_serialize( - project_id=project_id, + _param = self._disable_lock_serialize( region=region, - resource_pool_id=resource_pool_id, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2438,10 +2440,7 @@ def get_resource_pool_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetResourcePoolResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2451,11 +2450,10 @@ def get_resource_pool_with_http_info( ) @validate_call - def get_resource_pool_without_preload_content( + def disable_lock_without_preload_content( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2466,16 +2464,14 @@ def get_resource_pool_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Resource Pool + """disable_lock - Retrieves a Resource Pool in a project. + Clean up locks for a project so that it can be deleted successfully. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2498,10 +2494,9 @@ def get_resource_pool_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_resource_pool_serialize( - project_id=project_id, + _param = self._disable_lock_serialize( region=region, - resource_pool_id=resource_pool_id, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2509,19 +2504,15 @@ def get_resource_pool_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetResourcePoolResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_resource_pool_serialize( + def _disable_lock_serialize( self, - project_id, region, - resource_pool_id, + project_id, _request_auth, _content_type, _headers, @@ -2540,12 +2531,10 @@ def _get_resource_pool_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if resource_pool_id is not None: - _path_params["resourcePoolId"] = resource_pool_id + if project_id is not None: + _path_params["projectId"] = project_id # process the query parameters # process the header parameters # process the form parameters @@ -2553,16 +2542,14 @@ def _get_resource_pool_serialize( # set the HTTP header `Accept` if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json", "application/problem+json", "text/plain"] - ) + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}", + method="DELETE", + resource_path="/v1/regions/{region}/project/{projectId}/locks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2576,12 +2563,10 @@ def _get_resource_pool_serialize( ) @validate_call - def get_resource_pool_snapshot( + def enable_lock( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, - snapshot_name: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2591,19 +2576,15 @@ def get_resource_pool_snapshot( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetResourcePoolSnapshotResponse: - """Get Resource Pool Snapshot + ) -> object: + """enable_lock - Retrieves a Snapshot from a Resource Pool in a project. + Enable Lock for a project. Necessary for immutable snapshots and to prevent accidental deletion of resources. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str - :param snapshot_name: (required) - :type snapshot_name: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2626,11 +2607,9 @@ def get_resource_pool_snapshot( :return: Returns the result object. """ # noqa: E501 - _param = self._get_resource_pool_snapshot_serialize( - project_id=project_id, + _param = self._enable_lock_serialize( region=region, - resource_pool_id=resource_pool_id, - snapshot_name=snapshot_name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2638,10 +2617,7 @@ def get_resource_pool_snapshot( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetResourcePoolSnapshotResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2651,12 +2627,10 @@ def get_resource_pool_snapshot( ).data @validate_call - def get_resource_pool_snapshot_with_http_info( + def enable_lock_with_http_info( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, - snapshot_name: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2666,19 +2640,15 @@ def get_resource_pool_snapshot_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetResourcePoolSnapshotResponse]: - """Get Resource Pool Snapshot + ) -> ApiResponse[object]: + """enable_lock - Retrieves a Snapshot from a Resource Pool in a project. + Enable Lock for a project. Necessary for immutable snapshots and to prevent accidental deletion of resources. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str - :param snapshot_name: (required) - :type snapshot_name: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2701,11 +2671,9 @@ def get_resource_pool_snapshot_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_resource_pool_snapshot_serialize( - project_id=project_id, + _param = self._enable_lock_serialize( region=region, - resource_pool_id=resource_pool_id, - snapshot_name=snapshot_name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2713,10 +2681,7 @@ def get_resource_pool_snapshot_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetResourcePoolSnapshotResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2726,12 +2691,10 @@ def get_resource_pool_snapshot_with_http_info( ) @validate_call - def get_resource_pool_snapshot_without_preload_content( + def enable_lock_without_preload_content( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, - snapshot_name: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2742,18 +2705,14 @@ def get_resource_pool_snapshot_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Resource Pool Snapshot + """enable_lock - Retrieves a Snapshot from a Resource Pool in a project. + Enable Lock for a project. Necessary for immutable snapshots and to prevent accidental deletion of resources. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str - :param snapshot_name: (required) - :type snapshot_name: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2776,11 +2735,9 @@ def get_resource_pool_snapshot_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_resource_pool_snapshot_serialize( - project_id=project_id, + _param = self._enable_lock_serialize( region=region, - resource_pool_id=resource_pool_id, - snapshot_name=snapshot_name, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2788,20 +2745,15 @@ def get_resource_pool_snapshot_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetResourcePoolSnapshotResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "object", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_resource_pool_snapshot_serialize( + def _enable_lock_serialize( self, - project_id, region, - resource_pool_id, - snapshot_name, + project_id, _request_auth, _content_type, _headers, @@ -2820,14 +2772,10 @@ def _get_resource_pool_snapshot_serialize( _body_params: Optional[bytes] = None # process the path parameters - if project_id is not None: - _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if resource_pool_id is not None: - _path_params["resourcePoolId"] = resource_pool_id - if snapshot_name is not None: - _path_params["snapshotName"] = snapshot_name + if project_id is not None: + _path_params["projectId"] = project_id # process the query parameters # process the header parameters # process the form parameters @@ -2835,16 +2783,14 @@ def _get_resource_pool_snapshot_serialize( # set the HTTP header `Accept` if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json", "application/problem+json", "text/plain"] - ) + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}", + method="POST", + resource_path="/v1/regions/{region}/project/{projectId}/locks", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2858,12 +2804,10 @@ def _get_resource_pool_snapshot_serialize( ) @validate_call - def get_share( + def get_lock( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, - share_id: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2873,19 +2817,15 @@ def get_share( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetShareResponse: - """Get Share + ) -> GetLockResponse: + """get_lock - Retrieves a Shares in a Resource Pool in a project. + Get lock status for a project. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str - :param share_id: (required) - :type share_id: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2908,11 +2848,9 @@ def get_share( :return: Returns the result object. """ # noqa: E501 - _param = self._get_share_serialize( - project_id=project_id, + _param = self._get_lock_serialize( region=region, - resource_pool_id=resource_pool_id, - share_id=share_id, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2920,10 +2858,7 @@ def get_share( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetShareResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "GetLockResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -2933,12 +2868,10 @@ def get_share( ).data @validate_call - def get_share_with_http_info( + def get_lock_with_http_info( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, - share_id: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2948,19 +2881,15 @@ def get_share_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetShareResponse]: - """Get Share + ) -> ApiResponse[GetLockResponse]: + """get_lock - Retrieves a Shares in a Resource Pool in a project. + Get lock status for a project. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str - :param share_id: (required) - :type share_id: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2983,11 +2912,9 @@ def get_share_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_share_serialize( - project_id=project_id, + _param = self._get_lock_serialize( region=region, - resource_pool_id=resource_pool_id, - share_id=share_id, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2995,10 +2922,7 @@ def get_share_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetShareResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "GetLockResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3008,12 +2932,10 @@ def get_share_with_http_info( ) @validate_call - def get_share_without_preload_content( + def get_lock_without_preload_content( self, - project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, - share_id: StrictStr, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3024,18 +2946,14 @@ def get_share_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Share + """get_lock - Retrieves a Shares in a Resource Pool in a project. + Get lock status for a project. - :param project_id: (required) - :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str - :param share_id: (required) - :type share_id: str + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3058,11 +2976,9 @@ def get_share_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_share_serialize( - project_id=project_id, + _param = self._get_lock_serialize( region=region, - resource_pool_id=resource_pool_id, - share_id=share_id, + project_id=project_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3070,20 +2986,2071 @@ def get_share_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetShareResponse", - "400": "ValidationError", + "200": "GetLockResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_lock_serialize( + self, + region, + project_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if region is not None: + _path_params["region"] = region + if project_id is not None: + _path_params["projectId"] = project_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/regions/{region}/project/{projectId}/locks", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_resource_pool( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetResourcePoolResponse: + """Get Resource Pool + + Retrieves a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_pool_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetResourcePoolResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_resource_pool_with_http_info( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetResourcePoolResponse]: + """Get Resource Pool + + Retrieves a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_pool_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetResourcePoolResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_resource_pool_without_preload_content( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Resource Pool + + Retrieves a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_pool_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetResourcePoolResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_resource_pool_serialize( + self, + project_id, + region, + resource_pool_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region + if resource_pool_id is not None: + _path_params["resourcePoolId"] = resource_pool_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json", "application/problem+json", "text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_resource_pool_snapshot( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + snapshot_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetResourcePoolSnapshotResponse: + """Get Resource Pool Snapshot + + Retrieves a Snapshot from a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param snapshot_name: (required) + :type snapshot_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_pool_snapshot_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + snapshot_name=snapshot_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetResourcePoolSnapshotResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_resource_pool_snapshot_with_http_info( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + snapshot_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetResourcePoolSnapshotResponse]: + """Get Resource Pool Snapshot + + Retrieves a Snapshot from a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param snapshot_name: (required) + :type snapshot_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_pool_snapshot_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + snapshot_name=snapshot_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetResourcePoolSnapshotResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_resource_pool_snapshot_without_preload_content( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + snapshot_name: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Resource Pool Snapshot + + Retrieves a Snapshot from a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param snapshot_name: (required) + :type snapshot_name: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_resource_pool_snapshot_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + snapshot_name=snapshot_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetResourcePoolSnapshotResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_resource_pool_snapshot_serialize( + self, + project_id, + region, + resource_pool_id, + snapshot_name, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region + if resource_pool_id is not None: + _path_params["resourcePoolId"] = resource_pool_id + if snapshot_name is not None: + _path_params["snapshotName"] = snapshot_name + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json", "application/problem+json", "text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_schedule( + self, + project_id: StrictStr, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetScheduleResponse: + """get_schedule + + Get Schedule + + :param project_id: (required) + :type project_id: str + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_schedule_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetScheduleResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_schedule_with_http_info( + self, + project_id: StrictStr, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetScheduleResponse]: + """get_schedule + + Get Schedule + + :param project_id: (required) + :type project_id: str + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_schedule_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetScheduleResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_schedule_without_preload_content( + self, + project_id: StrictStr, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_schedule + + Get Schedule + + :param project_id: (required) + :type project_id: str + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_schedule_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetScheduleResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_schedule_serialize( + self, + project_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/schedules/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_share( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + share_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetShareResponse: + """Get Share + + Retrieves a Shares in a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param share_id: (required) + :type share_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_share_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + share_id=share_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetShareResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_share_with_http_info( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + share_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetShareResponse]: + """Get Share + + Retrieves a Shares in a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param share_id: (required) + :type share_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_share_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + share_id=share_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetShareResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_share_without_preload_content( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + share_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Share + + Retrieves a Shares in a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param share_id: (required) + :type share_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_share_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + share_id=share_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetShareResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_share_serialize( + self, + project_id, + region, + resource_pool_id, + share_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region + if resource_pool_id is not None: + _path_params["resourcePoolId"] = resource_pool_id + if share_id is not None: + _path_params["shareId"] = share_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json", "application/problem+json", "text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_share_export_policy( + self, + project_id: StrictStr, + region: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetShareExportPolicyResponse: + """Get Share Export Policy + + Retrieves a ShareExportPolicies in a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_share_export_policy_serialize( + project_id=project_id, + region=region, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetShareExportPolicyResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_share_export_policy_with_http_info( + self, + project_id: StrictStr, + region: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetShareExportPolicyResponse]: + """Get Share Export Policy + + Retrieves a ShareExportPolicies in a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_share_export_policy_serialize( + project_id=project_id, + region=region, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetShareExportPolicyResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_share_export_policy_without_preload_content( + self, + project_id: StrictStr, + region: StrictStr, + policy_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get Share Export Policy + + Retrieves a ShareExportPolicies in a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param policy_id: (required) + :type policy_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_share_export_policy_serialize( + project_id=project_id, + region=region, + policy_id=policy_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetShareExportPolicyResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_share_export_policy_serialize( + self, + project_id, + region, + policy_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region is not None: + _path_params["region"] = region + if policy_id is not None: + _path_params["policyId"] = policy_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json", "application/problem+json", "text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_snapshot_policy( + self, + project_id: StrictStr, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetSnapshotPolicyResponse: + """get_snapshot_policy + + Get Snapshot Policy + + :param project_id: (required) + :type project_id: str + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_snapshot_policy_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetSnapshotPolicyResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_snapshot_policy_with_http_info( + self, + project_id: StrictStr, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetSnapshotPolicyResponse]: + """get_snapshot_policy + + Get Snapshot Policy + + :param project_id: (required) + :type project_id: str + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_snapshot_policy_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetSnapshotPolicyResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_snapshot_policy_without_preload_content( + self, + project_id: StrictStr, + id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_snapshot_policy + + Get Snapshot Policy + + :param project_id: (required) + :type project_id: str + :param id: (required) + :type id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_snapshot_policy_serialize( + project_id=project_id, + id=id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetSnapshotPolicyResponse", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_snapshot_policy_serialize( + self, + project_id, + id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if id is not None: + _path_params["id"] = id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/snapshotPolicies/{id}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_performance_classes( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListPerformanceClassesResponse: + """List Resource Performance Classes + + Lists all performances classes available + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_performance_classes_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListPerformanceClassesResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_performance_classes_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListPerformanceClassesResponse]: + """List Resource Performance Classes + + Lists all performances classes available + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_performance_classes_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListPerformanceClassesResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_performance_classes_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Resource Performance Classes + + Lists all performances classes available + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_performance_classes_serialize( + _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListPerformanceClassesResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _list_performance_classes_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json", "application/problem+json", "text/plain"] + ) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/resourcePoolPerformanceClasses", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def list_resource_pool_snapshots( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListResourcePoolSnapshotsResponse: + """List Resource Pool Snapshots + + Lists the Snapshots of a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_resource_pool_snapshots_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListResourcePoolSnapshotsResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_resource_pool_snapshots_with_http_info( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListResourcePoolSnapshotsResponse]: + """List Resource Pool Snapshots + + Lists the Snapshots of a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_resource_pool_snapshots_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListResourcePoolSnapshotsResponse", + "400": "ValidationError", + "401": "str", + "500": "Error", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_resource_pool_snapshots_without_preload_content( + self, + project_id: StrictStr, + region: StrictStr, + resource_pool_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List Resource Pool Snapshots + + Lists the Snapshots of a Resource Pool in a project. + + :param project_id: (required) + :type project_id: str + :param region: (required) + :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_resource_pool_snapshots_serialize( + project_id=project_id, + region=region, + resource_pool_id=resource_pool_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ListResourcePoolSnapshotsResponse", + "400": "ValidationError", "401": "str", "500": "Error", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_share_serialize( + def _list_resource_pool_snapshots_serialize( self, project_id, region, resource_pool_id, - share_id, _request_auth, _content_type, _headers, @@ -3108,8 +5075,6 @@ def _get_share_serialize( _path_params["region"] = region if resource_pool_id is not None: _path_params["resourcePoolId"] = resource_pool_id - if share_id is not None: - _path_params["shareId"] = share_id # process the query parameters # process the header parameters # process the form parameters @@ -3126,7 +5091,7 @@ def _get_share_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares/{shareId}", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3140,11 +5105,10 @@ def _get_share_serialize( ) @validate_call - def get_share_export_policy( + def list_resource_pools( self, project_id: StrictStr, region: StrictStr, - policy_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3154,17 +5118,15 @@ def get_share_export_policy( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetShareExportPolicyResponse: - """Get Share Export Policy + ) -> ListResourcePoolsResponse: + """List Resource Pools - Retrieves a ShareExportPolicies in a Resource Pool in a project. + Lists Resource Pools in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str - :param policy_id: (required) - :type policy_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3187,10 +5149,9 @@ def get_share_export_policy( :return: Returns the result object. """ # noqa: E501 - _param = self._get_share_export_policy_serialize( + _param = self._list_resource_pools_serialize( project_id=project_id, region=region, - policy_id=policy_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3198,7 +5159,7 @@ def get_share_export_policy( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetShareExportPolicyResponse", + "200": "ListResourcePoolsResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3211,11 +5172,10 @@ def get_share_export_policy( ).data @validate_call - def get_share_export_policy_with_http_info( + def list_resource_pools_with_http_info( self, project_id: StrictStr, region: StrictStr, - policy_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3225,17 +5185,15 @@ def get_share_export_policy_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetShareExportPolicyResponse]: - """Get Share Export Policy + ) -> ApiResponse[ListResourcePoolsResponse]: + """List Resource Pools - Retrieves a ShareExportPolicies in a Resource Pool in a project. + Lists Resource Pools in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str - :param policy_id: (required) - :type policy_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3258,10 +5216,9 @@ def get_share_export_policy_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_share_export_policy_serialize( + _param = self._list_resource_pools_serialize( project_id=project_id, region=region, - policy_id=policy_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3269,7 +5226,7 @@ def get_share_export_policy_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetShareExportPolicyResponse", + "200": "ListResourcePoolsResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3282,11 +5239,10 @@ def get_share_export_policy_with_http_info( ) @validate_call - def get_share_export_policy_without_preload_content( + def list_resource_pools_without_preload_content( self, project_id: StrictStr, region: StrictStr, - policy_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3297,16 +5253,14 @@ def get_share_export_policy_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Share Export Policy + """List Resource Pools - Retrieves a ShareExportPolicies in a Resource Pool in a project. + Lists Resource Pools in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str - :param policy_id: (required) - :type policy_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3329,10 +5283,9 @@ def get_share_export_policy_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_share_export_policy_serialize( + _param = self._list_resource_pools_serialize( project_id=project_id, region=region, - policy_id=policy_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3340,7 +5293,7 @@ def get_share_export_policy_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetShareExportPolicyResponse", + "200": "ListResourcePoolsResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3348,11 +5301,10 @@ def get_share_export_policy_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_share_export_policy_serialize( + def _list_resource_pools_serialize( self, project_id, region, - policy_id, _request_auth, _content_type, _headers, @@ -3375,8 +5327,6 @@ def _get_share_export_policy_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if policy_id is not None: - _path_params["policyId"] = policy_id # process the query parameters # process the header parameters # process the form parameters @@ -3393,7 +5343,7 @@ def _get_share_export_policy_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3407,8 +5357,9 @@ def _get_share_export_policy_serialize( ) @validate_call - def list_performance_classes( + def list_schedules( self, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3418,11 +5369,13 @@ def list_performance_classes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListPerformanceClassesResponse: - """List Resource Pool Performance Classes + ) -> ListSchedulesResponse: + """list_schedules - Lists all performances classes available + List Schedules + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3445,15 +5398,16 @@ def list_performance_classes( :return: Returns the result object. """ # noqa: E501 - _param = self._list_performance_classes_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + _param = self._list_schedules_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPerformanceClassesResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "ListSchedulesResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3463,8 +5417,9 @@ def list_performance_classes( ).data @validate_call - def list_performance_classes_with_http_info( + def list_schedules_with_http_info( self, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3474,11 +5429,13 @@ def list_performance_classes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListPerformanceClassesResponse]: - """List Resource Pool Performance Classes + ) -> ApiResponse[ListSchedulesResponse]: + """list_schedules - Lists all performances classes available + List Schedules + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3501,15 +5458,16 @@ def list_performance_classes_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_performance_classes_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + _param = self._list_schedules_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPerformanceClassesResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "ListSchedulesResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -3519,8 +5477,9 @@ def list_performance_classes_with_http_info( ) @validate_call - def list_performance_classes_without_preload_content( + def list_schedules_without_preload_content( self, + project_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3531,10 +5490,12 @@ def list_performance_classes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Resource Pool Performance Classes + """list_schedules - Lists all performances classes available + List Schedules + :param project_id: (required) + :type project_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3557,21 +5518,23 @@ def list_performance_classes_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_performance_classes_serialize( - _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, _host_index=_host_index + _param = self._list_schedules_serialize( + project_id=project_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListPerformanceClassesResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "ListSchedulesResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_performance_classes_serialize( + def _list_schedules_serialize( self, + project_id, _request_auth, _content_type, _headers, @@ -3590,6 +5553,8 @@ def _list_performance_classes_serialize( _body_params: Optional[bytes] = None # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id # process the query parameters # process the header parameters # process the form parameters @@ -3597,16 +5562,14 @@ def _list_performance_classes_serialize( # set the HTTP header `Accept` if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json", "application/problem+json", "text/plain"] - ) + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", - resource_path="/v1/resourcePoolPerformanceClasses", + resource_path="/v1/projects/{projectId}/schedules", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3620,11 +5583,10 @@ def _list_performance_classes_serialize( ) @validate_call - def list_resource_pool_snapshots( + def list_share_export_policies( self, project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3634,17 +5596,15 @@ def list_resource_pool_snapshots( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListResourcePoolSnapshotsResponse: - """List Resource Pool Snapshots + ) -> ListShareExportPoliciesResponse: + """List Share Export Policies - Lists the Snapshots of a Resource Pool in a project. + Lists ShareExportPolicies in a Resource Pool in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3667,10 +5627,9 @@ def list_resource_pool_snapshots( :return: Returns the result object. """ # noqa: E501 - _param = self._list_resource_pool_snapshots_serialize( + _param = self._list_share_export_policies_serialize( project_id=project_id, region=region, - resource_pool_id=resource_pool_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3678,7 +5637,7 @@ def list_resource_pool_snapshots( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListResourcePoolSnapshotsResponse", + "200": "ListShareExportPoliciesResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3691,11 +5650,10 @@ def list_resource_pool_snapshots( ).data @validate_call - def list_resource_pool_snapshots_with_http_info( + def list_share_export_policies_with_http_info( self, project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3705,17 +5663,15 @@ def list_resource_pool_snapshots_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListResourcePoolSnapshotsResponse]: - """List Resource Pool Snapshots + ) -> ApiResponse[ListShareExportPoliciesResponse]: + """List Share Export Policies - Lists the Snapshots of a Resource Pool in a project. + Lists ShareExportPolicies in a Resource Pool in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3738,10 +5694,9 @@ def list_resource_pool_snapshots_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_resource_pool_snapshots_serialize( + _param = self._list_share_export_policies_serialize( project_id=project_id, region=region, - resource_pool_id=resource_pool_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3749,7 +5704,7 @@ def list_resource_pool_snapshots_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListResourcePoolSnapshotsResponse", + "200": "ListShareExportPoliciesResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3762,11 +5717,10 @@ def list_resource_pool_snapshots_with_http_info( ) @validate_call - def list_resource_pool_snapshots_without_preload_content( + def list_share_export_policies_without_preload_content( self, project_id: StrictStr, region: StrictStr, - resource_pool_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3777,16 +5731,14 @@ def list_resource_pool_snapshots_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Resource Pool Snapshots + """List Share Export Policies - Lists the Snapshots of a Resource Pool in a project. + Lists ShareExportPolicies in a Resource Pool in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str - :param resource_pool_id: (required) - :type resource_pool_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3809,10 +5761,9 @@ def list_resource_pool_snapshots_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_resource_pool_snapshots_serialize( + _param = self._list_share_export_policies_serialize( project_id=project_id, region=region, - resource_pool_id=resource_pool_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3820,7 +5771,7 @@ def list_resource_pool_snapshots_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListResourcePoolSnapshotsResponse", + "200": "ListShareExportPoliciesResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3828,11 +5779,10 @@ def list_resource_pool_snapshots_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_resource_pool_snapshots_serialize( + def _list_share_export_policies_serialize( self, project_id, region, - resource_pool_id, _request_auth, _content_type, _headers, @@ -3855,8 +5805,6 @@ def _list_resource_pool_snapshots_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if resource_pool_id is not None: - _path_params["resourcePoolId"] = resource_pool_id # process the query parameters # process the header parameters # process the form parameters @@ -3873,7 +5821,7 @@ def _list_resource_pool_snapshots_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots", + resource_path="/v1/projects/{projectId}/regions/{region}/shareExportPolicies", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3887,10 +5835,11 @@ def _list_resource_pool_snapshots_serialize( ) @validate_call - def list_resource_pools( + def list_shares( self, project_id: StrictStr, region: StrictStr, + resource_pool_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3900,15 +5849,17 @@ def list_resource_pools( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListResourcePoolsResponse: - """List Resource Pools + ) -> ListSharesResponse: + """List Shares - Lists Resource Pools in a project. + Lists Shares in a Resource Pool in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3931,9 +5882,10 @@ def list_resource_pools( :return: Returns the result object. """ # noqa: E501 - _param = self._list_resource_pools_serialize( + _param = self._list_shares_serialize( project_id=project_id, region=region, + resource_pool_id=resource_pool_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3941,7 +5893,7 @@ def list_resource_pools( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListResourcePoolsResponse", + "200": "ListSharesResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -3954,10 +5906,11 @@ def list_resource_pools( ).data @validate_call - def list_resource_pools_with_http_info( + def list_shares_with_http_info( self, project_id: StrictStr, region: StrictStr, + resource_pool_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3967,15 +5920,17 @@ def list_resource_pools_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListResourcePoolsResponse]: - """List Resource Pools + ) -> ApiResponse[ListSharesResponse]: + """List Shares - Lists Resource Pools in a project. + Lists Shares in a Resource Pool in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3998,9 +5953,10 @@ def list_resource_pools_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_resource_pools_serialize( + _param = self._list_shares_serialize( project_id=project_id, region=region, + resource_pool_id=resource_pool_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4008,7 +5964,7 @@ def list_resource_pools_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListResourcePoolsResponse", + "200": "ListSharesResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4021,10 +5977,11 @@ def list_resource_pools_with_http_info( ) @validate_call - def list_resource_pools_without_preload_content( + def list_shares_without_preload_content( self, project_id: StrictStr, region: StrictStr, + resource_pool_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4035,14 +5992,16 @@ def list_resource_pools_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Resource Pools + """List Shares - Lists Resource Pools in a project. + Lists Shares in a Resource Pool in a project. :param project_id: (required) :type project_id: str :param region: (required) :type region: str + :param resource_pool_id: (required) + :type resource_pool_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4065,9 +6024,10 @@ def list_resource_pools_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_resource_pools_serialize( + _param = self._list_shares_serialize( project_id=project_id, region=region, + resource_pool_id=resource_pool_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4075,7 +6035,7 @@ def list_resource_pools_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListResourcePoolsResponse", + "200": "ListSharesResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4083,10 +6043,11 @@ def list_resource_pools_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_resource_pools_serialize( + def _list_shares_serialize( self, project_id, region, + resource_pool_id, _request_auth, _content_type, _headers, @@ -4109,6 +6070,8 @@ def _list_resource_pools_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region + if resource_pool_id is not None: + _path_params["resourcePoolId"] = resource_pool_id # process the query parameters # process the header parameters # process the form parameters @@ -4125,7 +6088,7 @@ def _list_resource_pools_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4139,10 +6102,10 @@ def _list_resource_pools_serialize( ) @validate_call - def list_share_export_policies( + def list_snapshot_policies( self, project_id: StrictStr, - region: StrictStr, + immutable: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4152,15 +6115,15 @@ def list_share_export_policies( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListShareExportPoliciesResponse: - """List Share Export Policies + ) -> ListSnapshotPoliciesResponse: + """list_snapshot_policies - Lists ShareExportPolicies in a Resource Pool in a project. + List Snapshot Policies :param project_id: (required) :type project_id: str - :param region: (required) - :type region: str + :param immutable: + :type immutable: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4183,9 +6146,9 @@ def list_share_export_policies( :return: Returns the result object. """ # noqa: E501 - _param = self._list_share_export_policies_serialize( + _param = self._list_snapshot_policies_serialize( project_id=project_id, - region=region, + immutable=immutable, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4193,10 +6156,7 @@ def list_share_export_policies( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListShareExportPoliciesResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "ListSnapshotPoliciesResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4206,10 +6166,10 @@ def list_share_export_policies( ).data @validate_call - def list_share_export_policies_with_http_info( + def list_snapshot_policies_with_http_info( self, project_id: StrictStr, - region: StrictStr, + immutable: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4219,15 +6179,15 @@ def list_share_export_policies_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListShareExportPoliciesResponse]: - """List Share Export Policies + ) -> ApiResponse[ListSnapshotPoliciesResponse]: + """list_snapshot_policies - Lists ShareExportPolicies in a Resource Pool in a project. + List Snapshot Policies :param project_id: (required) :type project_id: str - :param region: (required) - :type region: str + :param immutable: + :type immutable: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4250,9 +6210,9 @@ def list_share_export_policies_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_share_export_policies_serialize( + _param = self._list_snapshot_policies_serialize( project_id=project_id, - region=region, + immutable=immutable, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4260,10 +6220,7 @@ def list_share_export_policies_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListShareExportPoliciesResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "ListSnapshotPoliciesResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) response_data.read() @@ -4273,10 +6230,10 @@ def list_share_export_policies_with_http_info( ) @validate_call - def list_share_export_policies_without_preload_content( + def list_snapshot_policies_without_preload_content( self, project_id: StrictStr, - region: StrictStr, + immutable: Optional[StrictBool] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4287,14 +6244,14 @@ def list_share_export_policies_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Share Export Policies + """list_snapshot_policies - Lists ShareExportPolicies in a Resource Pool in a project. + List Snapshot Policies :param project_id: (required) :type project_id: str - :param region: (required) - :type region: str + :param immutable: + :type immutable: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4317,9 +6274,9 @@ def list_share_export_policies_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_share_export_policies_serialize( + _param = self._list_snapshot_policies_serialize( project_id=project_id, - region=region, + immutable=immutable, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4327,18 +6284,15 @@ def list_share_export_policies_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListShareExportPoliciesResponse", - "400": "ValidationError", - "401": "str", - "500": "Error", + "200": "ListSnapshotPoliciesResponse", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_share_export_policies_serialize( + def _list_snapshot_policies_serialize( self, project_id, - region, + immutable, _request_auth, _content_type, _headers, @@ -4359,25 +6313,25 @@ def _list_share_export_policies_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if region is not None: - _path_params["region"] = region # process the query parameters + if immutable is not None: + + _query_params.append(("immutable", immutable)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json", "application/problem+json", "text/plain"] - ) + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/shareExportPolicies", + resource_path="/v1/projects/{projectId}/snapshotPolicies", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4391,11 +6345,12 @@ def _list_share_export_policies_serialize( ) @validate_call - def list_shares( + def update_resource_pool( self, project_id: StrictStr, region: StrictStr, resource_pool_id: StrictStr, + update_resource_pool_payload: UpdateResourcePoolPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4405,10 +6360,10 @@ def list_shares( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListSharesResponse: - """List Shares + ) -> UpdateResourcePoolResponse: + """Update Resource Pool - Lists Shares in a Resource Pool in a project. + Updates a Resource Pool in a project. :param project_id: (required) :type project_id: str @@ -4416,6 +6371,8 @@ def list_shares( :type region: str :param resource_pool_id: (required) :type resource_pool_id: str + :param update_resource_pool_payload: (required) + :type update_resource_pool_payload: UpdateResourcePoolPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4438,10 +6395,11 @@ def list_shares( :return: Returns the result object. """ # noqa: E501 - _param = self._list_shares_serialize( + _param = self._update_resource_pool_serialize( project_id=project_id, region=region, resource_pool_id=resource_pool_id, + update_resource_pool_payload=update_resource_pool_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4449,7 +6407,7 @@ def list_shares( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSharesResponse", + "200": "UpdateResourcePoolResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4462,11 +6420,12 @@ def list_shares( ).data @validate_call - def list_shares_with_http_info( + def update_resource_pool_with_http_info( self, project_id: StrictStr, region: StrictStr, resource_pool_id: StrictStr, + update_resource_pool_payload: UpdateResourcePoolPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4476,10 +6435,10 @@ def list_shares_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListSharesResponse]: - """List Shares + ) -> ApiResponse[UpdateResourcePoolResponse]: + """Update Resource Pool - Lists Shares in a Resource Pool in a project. + Updates a Resource Pool in a project. :param project_id: (required) :type project_id: str @@ -4487,6 +6446,8 @@ def list_shares_with_http_info( :type region: str :param resource_pool_id: (required) :type resource_pool_id: str + :param update_resource_pool_payload: (required) + :type update_resource_pool_payload: UpdateResourcePoolPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4509,10 +6470,11 @@ def list_shares_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_shares_serialize( + _param = self._update_resource_pool_serialize( project_id=project_id, region=region, resource_pool_id=resource_pool_id, + update_resource_pool_payload=update_resource_pool_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4520,7 +6482,7 @@ def list_shares_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSharesResponse", + "200": "UpdateResourcePoolResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4533,11 +6495,12 @@ def list_shares_with_http_info( ) @validate_call - def list_shares_without_preload_content( + def update_resource_pool_without_preload_content( self, project_id: StrictStr, region: StrictStr, resource_pool_id: StrictStr, + update_resource_pool_payload: UpdateResourcePoolPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4548,9 +6511,9 @@ def list_shares_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Shares + """Update Resource Pool - Lists Shares in a Resource Pool in a project. + Updates a Resource Pool in a project. :param project_id: (required) :type project_id: str @@ -4558,6 +6521,8 @@ def list_shares_without_preload_content( :type region: str :param resource_pool_id: (required) :type resource_pool_id: str + :param update_resource_pool_payload: (required) + :type update_resource_pool_payload: UpdateResourcePoolPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4580,10 +6545,11 @@ def list_shares_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_shares_serialize( + _param = self._update_resource_pool_serialize( project_id=project_id, region=region, resource_pool_id=resource_pool_id, + update_resource_pool_payload=update_resource_pool_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4591,7 +6557,7 @@ def list_shares_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListSharesResponse", + "200": "UpdateResourcePoolResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4599,11 +6565,12 @@ def list_shares_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_shares_serialize( + def _update_resource_pool_serialize( self, project_id, region, resource_pool_id, + update_resource_pool_payload, _request_auth, _content_type, _headers, @@ -4632,6 +6599,8 @@ def _list_shares_serialize( # process the header parameters # process the form parameters # process the body parameter + if update_resource_pool_payload is not None: + _body_params = update_resource_pool_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -4639,12 +6608,20 @@ def _list_shares_serialize( ["application/json", "application/problem+json", "text/plain"] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/shares", + method="PATCH", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4658,12 +6635,13 @@ def _list_shares_serialize( ) @validate_call - def update_resource_pool( + def update_resource_pool_snapshot( self, project_id: StrictStr, region: StrictStr, resource_pool_id: StrictStr, - update_resource_pool_payload: UpdateResourcePoolPayload, + snapshot_name: StrictStr, + update_resource_pool_snapshot_payload: UpdateResourcePoolSnapshotPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4673,10 +6651,10 @@ def update_resource_pool( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> UpdateResourcePoolResponse: - """Update Resource Pool + ) -> UpdateResourcePoolSnapshotResponse: + """Update Resource Pool Snapshot - Updates a Resource Pool in a project. + Updates a Snapshot from a Resource Pool in a project. :param project_id: (required) :type project_id: str @@ -4684,8 +6662,10 @@ def update_resource_pool( :type region: str :param resource_pool_id: (required) :type resource_pool_id: str - :param update_resource_pool_payload: (required) - :type update_resource_pool_payload: UpdateResourcePoolPayload + :param snapshot_name: (required) + :type snapshot_name: str + :param update_resource_pool_snapshot_payload: (required) + :type update_resource_pool_snapshot_payload: UpdateResourcePoolSnapshotPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4708,11 +6688,12 @@ def update_resource_pool( :return: Returns the result object. """ # noqa: E501 - _param = self._update_resource_pool_serialize( + _param = self._update_resource_pool_snapshot_serialize( project_id=project_id, region=region, resource_pool_id=resource_pool_id, - update_resource_pool_payload=update_resource_pool_payload, + snapshot_name=snapshot_name, + update_resource_pool_snapshot_payload=update_resource_pool_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4720,7 +6701,7 @@ def update_resource_pool( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateResourcePoolResponse", + "200": "UpdateResourcePoolSnapshotResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4733,12 +6714,13 @@ def update_resource_pool( ).data @validate_call - def update_resource_pool_with_http_info( + def update_resource_pool_snapshot_with_http_info( self, project_id: StrictStr, region: StrictStr, resource_pool_id: StrictStr, - update_resource_pool_payload: UpdateResourcePoolPayload, + snapshot_name: StrictStr, + update_resource_pool_snapshot_payload: UpdateResourcePoolSnapshotPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4748,10 +6730,10 @@ def update_resource_pool_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[UpdateResourcePoolResponse]: - """Update Resource Pool + ) -> ApiResponse[UpdateResourcePoolSnapshotResponse]: + """Update Resource Pool Snapshot - Updates a Resource Pool in a project. + Updates a Snapshot from a Resource Pool in a project. :param project_id: (required) :type project_id: str @@ -4759,8 +6741,10 @@ def update_resource_pool_with_http_info( :type region: str :param resource_pool_id: (required) :type resource_pool_id: str - :param update_resource_pool_payload: (required) - :type update_resource_pool_payload: UpdateResourcePoolPayload + :param snapshot_name: (required) + :type snapshot_name: str + :param update_resource_pool_snapshot_payload: (required) + :type update_resource_pool_snapshot_payload: UpdateResourcePoolSnapshotPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4783,11 +6767,12 @@ def update_resource_pool_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_resource_pool_serialize( + _param = self._update_resource_pool_snapshot_serialize( project_id=project_id, region=region, resource_pool_id=resource_pool_id, - update_resource_pool_payload=update_resource_pool_payload, + snapshot_name=snapshot_name, + update_resource_pool_snapshot_payload=update_resource_pool_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4795,7 +6780,7 @@ def update_resource_pool_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateResourcePoolResponse", + "200": "UpdateResourcePoolSnapshotResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4808,12 +6793,13 @@ def update_resource_pool_with_http_info( ) @validate_call - def update_resource_pool_without_preload_content( + def update_resource_pool_snapshot_without_preload_content( self, project_id: StrictStr, region: StrictStr, resource_pool_id: StrictStr, - update_resource_pool_payload: UpdateResourcePoolPayload, + snapshot_name: StrictStr, + update_resource_pool_snapshot_payload: UpdateResourcePoolSnapshotPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4824,9 +6810,9 @@ def update_resource_pool_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update Resource Pool + """Update Resource Pool Snapshot - Updates a Resource Pool in a project. + Updates a Snapshot from a Resource Pool in a project. :param project_id: (required) :type project_id: str @@ -4834,8 +6820,10 @@ def update_resource_pool_without_preload_content( :type region: str :param resource_pool_id: (required) :type resource_pool_id: str - :param update_resource_pool_payload: (required) - :type update_resource_pool_payload: UpdateResourcePoolPayload + :param snapshot_name: (required) + :type snapshot_name: str + :param update_resource_pool_snapshot_payload: (required) + :type update_resource_pool_snapshot_payload: UpdateResourcePoolSnapshotPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4858,11 +6846,12 @@ def update_resource_pool_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_resource_pool_serialize( + _param = self._update_resource_pool_snapshot_serialize( project_id=project_id, region=region, resource_pool_id=resource_pool_id, - update_resource_pool_payload=update_resource_pool_payload, + snapshot_name=snapshot_name, + update_resource_pool_snapshot_payload=update_resource_pool_snapshot_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4870,7 +6859,7 @@ def update_resource_pool_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "UpdateResourcePoolResponse", + "200": "UpdateResourcePoolSnapshotResponse", "400": "ValidationError", "401": "str", "500": "Error", @@ -4878,12 +6867,13 @@ def update_resource_pool_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _update_resource_pool_serialize( + def _update_resource_pool_snapshot_serialize( self, project_id, region, resource_pool_id, - update_resource_pool_payload, + snapshot_name, + update_resource_pool_snapshot_payload, _request_auth, _content_type, _headers, @@ -4908,12 +6898,14 @@ def _update_resource_pool_serialize( _path_params["region"] = region if resource_pool_id is not None: _path_params["resourcePoolId"] = resource_pool_id + if snapshot_name is not None: + _path_params["snapshotName"] = snapshot_name # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_resource_pool_payload is not None: - _body_params = update_resource_pool_payload + if update_resource_pool_snapshot_payload is not None: + _body_params = update_resource_pool_snapshot_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -4934,7 +6926,7 @@ def _update_resource_pool_serialize( return self.api_client.param_serialize( method="PATCH", - resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}", + resource_path="/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/sfs/src/stackit/sfs/models/__init__.py b/services/sfs/src/stackit/sfs/models/__init__.py index 444e6fdef..0206356f6 100644 --- a/services/sfs/src/stackit/sfs/models/__init__.py +++ b/services/sfs/src/stackit/sfs/models/__init__.py @@ -33,14 +33,17 @@ from stackit.sfs.models.create_share_payload import CreateSharePayload from stackit.sfs.models.create_share_response import CreateShareResponse from stackit.sfs.models.error import Error +from stackit.sfs.models.get_lock_response import GetLockResponse from stackit.sfs.models.get_resource_pool_response import GetResourcePoolResponse from stackit.sfs.models.get_resource_pool_snapshot_response import ( GetResourcePoolSnapshotResponse, ) +from stackit.sfs.models.get_schedule_response import GetScheduleResponse from stackit.sfs.models.get_share_export_policy_response import ( GetShareExportPolicyResponse, ) from stackit.sfs.models.get_share_response import GetShareResponse +from stackit.sfs.models.get_snapshot_policy_response import GetSnapshotPolicyResponse from stackit.sfs.models.google_protobuf_any import GoogleProtobufAny from stackit.sfs.models.list_performance_classes_response import ( ListPerformanceClassesResponse, @@ -49,23 +52,37 @@ ListResourcePoolSnapshotsResponse, ) from stackit.sfs.models.list_resource_pools_response import ListResourcePoolsResponse +from stackit.sfs.models.list_schedules_response import ListSchedulesResponse from stackit.sfs.models.list_share_export_policies_response import ( ListShareExportPoliciesResponse, ) from stackit.sfs.models.list_shares_response import ListSharesResponse +from stackit.sfs.models.list_snapshot_policies_response import ( + ListSnapshotPoliciesResponse, +) from stackit.sfs.models.performance_class import PerformanceClass from stackit.sfs.models.resource_pool import ResourcePool from stackit.sfs.models.resource_pool_performance_class import ( ResourcePoolPerformanceClass, ) from stackit.sfs.models.resource_pool_snapshot import ResourcePoolSnapshot +from stackit.sfs.models.resource_pool_snapshot_policy import ResourcePoolSnapshotPolicy from stackit.sfs.models.resource_pool_space import ResourcePoolSpace +from stackit.sfs.models.schedule import Schedule from stackit.sfs.models.share import Share from stackit.sfs.models.share_export_policy import ShareExportPolicy from stackit.sfs.models.share_export_policy_rule import ShareExportPolicyRule +from stackit.sfs.models.snapshot_policy import SnapshotPolicy +from stackit.sfs.models.snapshot_policy_schedule import SnapshotPolicySchedule from stackit.sfs.models.status import Status from stackit.sfs.models.update_resource_pool_payload import UpdateResourcePoolPayload from stackit.sfs.models.update_resource_pool_response import UpdateResourcePoolResponse +from stackit.sfs.models.update_resource_pool_snapshot_payload import ( + UpdateResourcePoolSnapshotPayload, +) +from stackit.sfs.models.update_resource_pool_snapshot_response import ( + UpdateResourcePoolSnapshotResponse, +) from stackit.sfs.models.update_share_export_policy_body_rule import ( UpdateShareExportPolicyBodyRule, ) diff --git a/services/sfs/src/stackit/sfs/models/create_resource_pool_payload.py b/services/sfs/src/stackit/sfs/models/create_resource_pool_payload.py index 6ed2010f8..138038474 100644 --- a/services/sfs/src/stackit/sfs/models/create_resource_pool_payload.py +++ b/services/sfs/src/stackit/sfs/models/create_resource_pool_payload.py @@ -47,6 +47,9 @@ class CreateResourcePoolPayload(BaseModel): size_gigabytes: StrictInt = Field( description="Size of the Resource Pool (unit: gibibytes)", alias="sizeGigabytes" ) + snapshot_policy_id: Optional[StrictStr] = Field( + default=None, description="(optional) Id of the Snapshot Policy to use", alias="snapshotPolicyId" + ) snapshots_are_visible: Optional[StrictBool] = Field( default=None, description="Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares.", @@ -59,6 +62,7 @@ class CreateResourcePoolPayload(BaseModel): "name", "performanceClass", "sizeGigabytes", + "snapshotPolicyId", "snapshotsAreVisible", ] @@ -118,6 +122,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "performanceClass": obj.get("performanceClass"), "sizeGigabytes": obj.get("sizeGigabytes"), + "snapshotPolicyId": obj.get("snapshotPolicyId"), "snapshotsAreVisible": obj.get("snapshotsAreVisible"), } ) diff --git a/services/sfs/src/stackit/sfs/models/create_resource_pool_snapshot_payload.py b/services/sfs/src/stackit/sfs/models/create_resource_pool_snapshot_payload.py index 71f34a940..6acfd64a1 100644 --- a/services/sfs/src/stackit/sfs/models/create_resource_pool_snapshot_payload.py +++ b/services/sfs/src/stackit/sfs/models/create_resource_pool_snapshot_payload.py @@ -17,7 +17,7 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing_extensions import Self @@ -30,7 +30,12 @@ class CreateResourcePoolSnapshotPayload(BaseModel): default=None, description="(optional) A comment to add more information about a snapshot" ) name: Optional[StrictStr] = Field(default=None, description="Name of the Resource Pool Snapshot") - __properties: ClassVar[List[str]] = ["comment", "name"] + snaplock_retention_hours: Optional[StrictInt] = Field( + default=None, + description="(optional) Time in hours after which snaplock on the snapshot expires", + alias="snaplockRetentionHours", + ) + __properties: ClassVar[List[str]] = ["comment", "name", "snaplockRetentionHours"] model_config = ConfigDict( populate_by_name=True, @@ -74,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: if self.comment is None and "comment" in self.model_fields_set: _dict["comment"] = None + # set to None if snaplock_retention_hours (nullable) is None + # and model_fields_set contains the field + if self.snaplock_retention_hours is None and "snaplock_retention_hours" in self.model_fields_set: + _dict["snaplockRetentionHours"] = None + return _dict @classmethod @@ -85,5 +95,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"comment": obj.get("comment"), "name": obj.get("name")}) + _obj = cls.model_validate( + { + "comment": obj.get("comment"), + "name": obj.get("name"), + "snaplockRetentionHours": obj.get("snaplockRetentionHours"), + } + ) return _obj diff --git a/services/sfs/src/stackit/sfs/models/get_lock_response.py b/services/sfs/src/stackit/sfs/models/get_lock_response.py new file mode 100644 index 000000000..e8a0583d6 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/get_lock_response.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class GetLockResponse(BaseModel): + """ + GetLockResponse + """ # noqa: E501 + + lock_id: Optional[StrictStr] = Field( + default=None, description="Whether the lock is enabled for the project", alias="lockId" + ) + __properties: ClassVar[List[str]] = ["lockId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetLockResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetLockResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"lockId": obj.get("lockId")}) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/get_schedule_response.py b/services/sfs/src/stackit/sfs/models/get_schedule_response.py new file mode 100644 index 000000000..5e4d8f157 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/get_schedule_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.sfs.models.schedule import Schedule + + +class GetScheduleResponse(BaseModel): + """ + GetScheduleResponse + """ # noqa: E501 + + schedule: Optional[Schedule] = Field(default=None, description="Schedule") + __properties: ClassVar[List[str]] = ["schedule"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetScheduleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of schedule + if self.schedule: + _dict["schedule"] = self.schedule.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetScheduleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"schedule": Schedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None} + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/get_snapshot_policy_response.py b/services/sfs/src/stackit/sfs/models/get_snapshot_policy_response.py new file mode 100644 index 000000000..3bc9d30a3 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/get_snapshot_policy_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.sfs.models.snapshot_policy import SnapshotPolicy + + +class GetSnapshotPolicyResponse(BaseModel): + """ + GetSnapshotPolicyResponse + """ # noqa: E501 + + snapshot_policy: Optional[SnapshotPolicy] = Field( + default=None, description="Snapshot Policy", alias="snapshotPolicy" + ) + __properties: ClassVar[List[str]] = ["snapshotPolicy"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetSnapshotPolicyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of snapshot_policy + if self.snapshot_policy: + _dict["snapshotPolicy"] = self.snapshot_policy.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetSnapshotPolicyResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "snapshotPolicy": ( + SnapshotPolicy.from_dict(obj["snapshotPolicy"]) if obj.get("snapshotPolicy") is not None else None + ) + } + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/list_schedules_response.py b/services/sfs/src/stackit/sfs/models/list_schedules_response.py new file mode 100644 index 000000000..595a22ace --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/list_schedules_response.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.sfs.models.schedule import Schedule + + +class ListSchedulesResponse(BaseModel): + """ + ListSchedulesResponse + """ # noqa: E501 + + schedules: Optional[List[Schedule]] = Field(default=None, description="List of Schedules") + __properties: ClassVar[List[str]] = ["schedules"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListSchedulesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in schedules (list) + _items = [] + if self.schedules: + for _item_schedules in self.schedules: + if _item_schedules: + _items.append(_item_schedules.to_dict()) + _dict["schedules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSchedulesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "schedules": ( + [Schedule.from_dict(_item) for _item in obj["schedules"]] + if obj.get("schedules") is not None + else None + ) + } + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/list_snapshot_policies_response.py b/services/sfs/src/stackit/sfs/models/list_snapshot_policies_response.py new file mode 100644 index 000000000..ef09717e9 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/list_snapshot_policies_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.sfs.models.snapshot_policy import SnapshotPolicy + + +class ListSnapshotPoliciesResponse(BaseModel): + """ + ListSnapshotPoliciesResponse + """ # noqa: E501 + + snapshot_policies: Optional[List[SnapshotPolicy]] = Field( + default=None, description="List of Snapshot Policies", alias="snapshotPolicies" + ) + __properties: ClassVar[List[str]] = ["snapshotPolicies"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListSnapshotPoliciesResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in snapshot_policies (list) + _items = [] + if self.snapshot_policies: + for _item_snapshot_policies in self.snapshot_policies: + if _item_snapshot_policies: + _items.append(_item_snapshot_policies.to_dict()) + _dict["snapshotPolicies"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSnapshotPoliciesResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "snapshotPolicies": ( + [SnapshotPolicy.from_dict(_item) for _item in obj["snapshotPolicies"]] + if obj.get("snapshotPolicies") is not None + else None + ) + } + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/resource_pool.py b/services/sfs/src/stackit/sfs/models/resource_pool.py index 18bbeaaf9..8c1b2f3cc 100644 --- a/services/sfs/src/stackit/sfs/models/resource_pool.py +++ b/services/sfs/src/stackit/sfs/models/resource_pool.py @@ -33,6 +33,7 @@ from stackit.sfs.models.resource_pool_performance_class import ( ResourcePoolPerformanceClass, ) +from stackit.sfs.models.resource_pool_snapshot_policy import ResourcePoolSnapshotPolicy from stackit.sfs.models.resource_pool_space import ResourcePoolSpace @@ -72,6 +73,9 @@ class ResourcePool(BaseModel): size_reducible_at: Optional[datetime] = Field( default=None, description="Time when the size can be reduced again.", alias="sizeReducibleAt" ) + snapshot_policy: Optional[ResourcePoolSnapshotPolicy] = Field( + default=None, description="(optional) Snapshot Policy", alias="snapshotPolicy" + ) snapshots_are_visible: Optional[StrictBool] = Field( default=False, description="Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares.", @@ -94,6 +98,7 @@ class ResourcePool(BaseModel): "performanceClass", "performanceClassDowngradableAt", "sizeReducibleAt", + "snapshotPolicy", "snapshotsAreVisible", "space", "state", @@ -178,9 +183,17 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of performance_class if self.performance_class: _dict["performanceClass"] = self.performance_class.to_dict() + # override the default output from pydantic by calling `to_dict()` of snapshot_policy + if self.snapshot_policy: + _dict["snapshotPolicy"] = self.snapshot_policy.to_dict() # override the default output from pydantic by calling `to_dict()` of space if self.space: _dict["space"] = self.space.to_dict() + # set to None if snapshot_policy (nullable) is None + # and model_fields_set contains the field + if self.snapshot_policy is None and "snapshot_policy" in self.model_fields_set: + _dict["snapshotPolicy"] = None + return _dict @classmethod @@ -209,6 +222,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: ), "performanceClassDowngradableAt": obj.get("performanceClassDowngradableAt"), "sizeReducibleAt": obj.get("sizeReducibleAt"), + "snapshotPolicy": ( + ResourcePoolSnapshotPolicy.from_dict(obj["snapshotPolicy"]) + if obj.get("snapshotPolicy") is not None + else None + ), "snapshotsAreVisible": ( obj.get("snapshotsAreVisible") if obj.get("snapshotsAreVisible") is not None else False ), diff --git a/services/sfs/src/stackit/sfs/models/resource_pool_snapshot.py b/services/sfs/src/stackit/sfs/models/resource_pool_snapshot.py index 32920e169..e395a6488 100644 --- a/services/sfs/src/stackit/sfs/models/resource_pool_snapshot.py +++ b/services/sfs/src/stackit/sfs/models/resource_pool_snapshot.py @@ -45,6 +45,11 @@ class ResourcePoolSnapshot(BaseModel): description="Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use).", alias="sizeGigabytes", ) + snaplock_expiry_time: Optional[datetime] = Field( + default=None, + description="Represents the snaplock expiry time if snaplock is enabled for the resource pool", + alias="snaplockExpiryTime", + ) snapshot_name: Optional[StrictStr] = Field( default=None, description="Name of the Resource Pool Snapshot", alias="snapshotName" ) @@ -54,6 +59,7 @@ class ResourcePoolSnapshot(BaseModel): "logicalSizeGigabytes", "resourcePoolId", "sizeGigabytes", + "snaplockExpiryTime", "snapshotName", ] @@ -70,6 +76,19 @@ def created_at_change_year_zero_to_one(cls, value): return "0001" + value[4:] # Take "0001" and append the rest of the string return value + @field_validator("snaplock_expiry_time", mode="before") + def snaplock_expiry_time_change_year_zero_to_one(cls, value): + """Workaround which prevents year 0 issue""" + if isinstance(value, str): + # Check for year "0000" at the beginning of the string + # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ + if value.startswith("0000-01-01T") and re.match( + r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value + ): + # Workaround: Replace "0000" with "0001" + return "0001" + value[4:] # Take "0001" and append the rest of the string + return value + model_config = ConfigDict( populate_by_name=True, validate_assignment=True, @@ -112,6 +131,11 @@ def to_dict(self) -> Dict[str, Any]: if self.comment is None and "comment" in self.model_fields_set: _dict["comment"] = None + # set to None if snaplock_expiry_time (nullable) is None + # and model_fields_set contains the field + if self.snaplock_expiry_time is None and "snaplock_expiry_time" in self.model_fields_set: + _dict["snaplockExpiryTime"] = None + return _dict @classmethod @@ -130,6 +154,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "logicalSizeGigabytes": obj.get("logicalSizeGigabytes"), "resourcePoolId": obj.get("resourcePoolId"), "sizeGigabytes": obj.get("sizeGigabytes"), + "snaplockExpiryTime": obj.get("snaplockExpiryTime"), "snapshotName": obj.get("snapshotName"), } ) diff --git a/services/sfs/src/stackit/sfs/models/resource_pool_snapshot_policy.py b/services/sfs/src/stackit/sfs/models/resource_pool_snapshot_policy.py new file mode 100644 index 000000000..33aab6217 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/resource_pool_snapshot_policy.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class ResourcePoolSnapshotPolicy(BaseModel): + """ + ResourcePoolSnapshotPolicy + """ # noqa: E501 + + id: Optional[StrictStr] = Field(default=None, description="ID of the Snapshot Policy") + name: Optional[StrictStr] = Field(default=None, description="Name of the Snapshot Policy") + __properties: ClassVar[List[str]] = ["id", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourcePoolSnapshotPolicy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourcePoolSnapshotPolicy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"id": obj.get("id"), "name": obj.get("name")}) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/resource_pool_space.py b/services/sfs/src/stackit/sfs/models/resource_pool_space.py index ad5e757c3..85b67770e 100644 --- a/services/sfs/src/stackit/sfs/models/resource_pool_space.py +++ b/services/sfs/src/stackit/sfs/models/resource_pool_space.py @@ -40,12 +40,22 @@ class ResourcePoolSpace(BaseModel): size_gigabytes: Optional[StrictInt] = Field( default=None, description="Size of the Resource Pool in Gibibytes.", alias="sizeGigabytes" ) + used_by_snapshots_gigabytes: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, + description="Used space by snapshots (only available when retrieving a single Resource Pool by ID)", + alias="usedBySnapshotsGigabytes", + ) used_gigabytes: Optional[Union[StrictFloat, StrictInt]] = Field( default=None, description="Used space of the Resource Pool (only available when retrieving a single Resource Pool by ID)", alias="usedGigabytes", ) - __properties: ClassVar[List[str]] = ["availableGigabytes", "sizeGigabytes", "usedGigabytes"] + __properties: ClassVar[List[str]] = [ + "availableGigabytes", + "sizeGigabytes", + "usedBySnapshotsGigabytes", + "usedGigabytes", + ] model_config = ConfigDict( populate_by_name=True, @@ -89,6 +99,11 @@ def to_dict(self) -> Dict[str, Any]: if self.available_gigabytes is None and "available_gigabytes" in self.model_fields_set: _dict["availableGigabytes"] = None + # set to None if used_by_snapshots_gigabytes (nullable) is None + # and model_fields_set contains the field + if self.used_by_snapshots_gigabytes is None and "used_by_snapshots_gigabytes" in self.model_fields_set: + _dict["usedBySnapshotsGigabytes"] = None + # set to None if used_gigabytes (nullable) is None # and model_fields_set contains the field if self.used_gigabytes is None and "used_gigabytes" in self.model_fields_set: @@ -109,6 +124,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: { "availableGigabytes": obj.get("availableGigabytes"), "sizeGigabytes": obj.get("sizeGigabytes"), + "usedBySnapshotsGigabytes": obj.get("usedBySnapshotsGigabytes"), "usedGigabytes": obj.get("usedGigabytes"), } ) diff --git a/services/sfs/src/stackit/sfs/models/schedule.py b/services/sfs/src/stackit/sfs/models/schedule.py new file mode 100644 index 000000000..3c7e08d64 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/schedule.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing_extensions import Self + + +class Schedule(BaseModel): + """ + Schedule + """ # noqa: E501 + + created_at: Optional[datetime] = Field(default=None, description="created at timestamp", alias="createdAt") + id: Optional[StrictStr] = Field(default=None, description="ID of the Schedule") + interval: Optional[StrictStr] = Field( + default=None, description="Interval of the Schedule (follows the cron schedule expression in Unix-like systems)" + ) + name: Optional[StrictStr] = Field(default=None, description="Name of the Schedule") + __properties: ClassVar[List[str]] = ["createdAt", "id", "interval", "name"] + + @field_validator("created_at", mode="before") + def created_at_change_year_zero_to_one(cls, value): + """Workaround which prevents year 0 issue""" + if isinstance(value, str): + # Check for year "0000" at the beginning of the string + # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ + if value.startswith("0000-01-01T") and re.match( + r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value + ): + # Workaround: Replace "0000" with "0001" + return "0001" + value[4:] # Take "0001" and append the rest of the string + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Schedule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Schedule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "createdAt": obj.get("createdAt"), + "id": obj.get("id"), + "interval": obj.get("interval"), + "name": obj.get("name"), + } + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/snapshot_policy.py b/services/sfs/src/stackit/sfs/models/snapshot_policy.py new file mode 100644 index 000000000..a73a9061e --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/snapshot_policy.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, + field_validator, +) +from typing_extensions import Self + +from stackit.sfs.models.snapshot_policy_schedule import SnapshotPolicySchedule + + +class SnapshotPolicy(BaseModel): + """ + SnapshotPolicy + """ # noqa: E501 + + comment: Optional[StrictStr] = Field(default=None, description="Comment of the Snapshot Policy") + created_at: Optional[datetime] = Field(default=None, description="created at timestamp", alias="createdAt") + enabled: Optional[StrictBool] = Field(default=None, description="Wether the Snapshot Policy is enabled") + id: Optional[StrictStr] = Field(default=None, description="ID of the Snapshot Policy") + name: Optional[StrictStr] = Field(default=None, description="Name of the Snapshot Policy") + schedules: Optional[List[SnapshotPolicySchedule]] = Field(default=None, description="associated schedules") + __properties: ClassVar[List[str]] = ["comment", "createdAt", "enabled", "id", "name", "schedules"] + + @field_validator("created_at", mode="before") + def created_at_change_year_zero_to_one(cls, value): + """Workaround which prevents year 0 issue""" + if isinstance(value, str): + # Check for year "0000" at the beginning of the string + # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ + if value.startswith("0000-01-01T") and re.match( + r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value + ): + # Workaround: Replace "0000" with "0001" + return "0001" + value[4:] # Take "0001" and append the rest of the string + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SnapshotPolicy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in schedules (list) + _items = [] + if self.schedules: + for _item_schedules in self.schedules: + if _item_schedules: + _items.append(_item_schedules.to_dict()) + _dict["schedules"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SnapshotPolicy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "comment": obj.get("comment"), + "createdAt": obj.get("createdAt"), + "enabled": obj.get("enabled"), + "id": obj.get("id"), + "name": obj.get("name"), + "schedules": ( + [SnapshotPolicySchedule.from_dict(_item) for _item in obj["schedules"]] + if obj.get("schedules") is not None + else None + ), + } + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/snapshot_policy_schedule.py b/services/sfs/src/stackit/sfs/models/snapshot_policy_schedule.py new file mode 100644 index 000000000..675f2a6e8 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/snapshot_policy_schedule.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + + +class SnapshotPolicySchedule(BaseModel): + """ + SnapshotPolicySchedule + """ # noqa: E501 + + count: Optional[StrictInt] = None + prefix: Optional[StrictStr] = None + retention_period: Optional[StrictStr] = Field(default=None, alias="retentionPeriod") + schedule_id: Optional[StrictStr] = Field(default=None, alias="scheduleId") + __properties: ClassVar[List[str]] = ["count", "prefix", "retentionPeriod", "scheduleId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SnapshotPolicySchedule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SnapshotPolicySchedule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "count": obj.get("count"), + "prefix": obj.get("prefix"), + "retentionPeriod": obj.get("retentionPeriod"), + "scheduleId": obj.get("scheduleId"), + } + ) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/update_resource_pool_payload.py b/services/sfs/src/stackit/sfs/models/update_resource_pool_payload.py index 93531d73e..54ccbc930 100644 --- a/services/sfs/src/stackit/sfs/models/update_resource_pool_payload.py +++ b/services/sfs/src/stackit/sfs/models/update_resource_pool_payload.py @@ -48,12 +48,24 @@ class UpdateResourcePoolPayload(BaseModel): size_gigabytes: Optional[StrictInt] = Field( default=None, description="(optional) Size of the Resource Pool (unit: gigabytes)", alias="sizeGigabytes" ) + snapshot_policy_id: Optional[StrictStr] = Field( + default=None, + description="(optional) Id of the Snapshot Policy to use If not set, the Snapshot Policy is not updated If set to an empty string, the Snapshot Policy is removed", + alias="snapshotPolicyId", + ) snapshots_are_visible: Optional[StrictBool] = Field( default=None, description="Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares.", alias="snapshotsAreVisible", ) - __properties: ClassVar[List[str]] = ["ipAcl", "labels", "performanceClass", "sizeGigabytes", "snapshotsAreVisible"] + __properties: ClassVar[List[str]] = [ + "ipAcl", + "labels", + "performanceClass", + "sizeGigabytes", + "snapshotPolicyId", + "snapshotsAreVisible", + ] model_config = ConfigDict( populate_by_name=True, @@ -114,6 +126,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "labels": obj.get("labels"), "performanceClass": obj.get("performanceClass"), "sizeGigabytes": obj.get("sizeGigabytes"), + "snapshotPolicyId": obj.get("snapshotPolicyId"), "snapshotsAreVisible": obj.get("snapshotsAreVisible"), } ) diff --git a/services/sfs/src/stackit/sfs/models/update_resource_pool_snapshot_payload.py b/services/sfs/src/stackit/sfs/models/update_resource_pool_snapshot_payload.py new file mode 100644 index 000000000..bd7f1e583 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/update_resource_pool_snapshot_payload.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class UpdateResourcePoolSnapshotPayload(BaseModel): + """ + UpdateResourcePoolSnapshotPayload + """ # noqa: E501 + + comment: Optional[StrictStr] = Field( + default=None, description="(optional) A comment to add more information about a snapshot" + ) + name: Optional[StrictStr] = Field(default=None, description="(optional) name of the Resource Pool Snapshot") + __properties: ClassVar[List[str]] = ["comment", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateResourcePoolSnapshotPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if comment (nullable) is None + # and model_fields_set contains the field + if self.comment is None and "comment" in self.model_fields_set: + _dict["comment"] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict["name"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateResourcePoolSnapshotPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"comment": obj.get("comment"), "name": obj.get("name")}) + return _obj diff --git a/services/sfs/src/stackit/sfs/models/update_resource_pool_snapshot_response.py b/services/sfs/src/stackit/sfs/models/update_resource_pool_snapshot_response.py new file mode 100644 index 000000000..1120d7543 --- /dev/null +++ b/services/sfs/src/stackit/sfs/models/update_resource_pool_snapshot_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + STACKIT File Storage (SFS) + + API used to create and manage NFS Shares. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Self + +from stackit.sfs.models.resource_pool_snapshot import ResourcePoolSnapshot + + +class UpdateResourcePoolSnapshotResponse(BaseModel): + """ + UpdateResourcePoolSnapshotResponse + """ # noqa: E501 + + resource_pool_snapshot: Optional[ResourcePoolSnapshot] = Field( + default=None, description="Updated Resource Pool Snapshot", alias="resourcePoolSnapshot" + ) + __properties: ClassVar[List[str]] = ["resourcePoolSnapshot"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateResourcePoolSnapshotResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resource_pool_snapshot + if self.resource_pool_snapshot: + _dict["resourcePoolSnapshot"] = self.resource_pool_snapshot.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateResourcePoolSnapshotResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "resourcePoolSnapshot": ( + ResourcePoolSnapshot.from_dict(obj["resourcePoolSnapshot"]) + if obj.get("resourcePoolSnapshot") is not None + else None + ) + } + ) + return _obj