huaweicloudsdkgaussdbforopengauss 3.1.95__py2.py3-none-any.whl → 3.1.97__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -209,6 +209,8 @@ from huaweicloudsdkgaussdbforopengauss.v3.model.param_group_copy_request_body im
209
209
  from huaweicloudsdkgaussdbforopengauss.v3.model.param_group_diff_request_body import ParamGroupDiffRequestBody
210
210
  from huaweicloudsdkgaussdbforopengauss.v3.model.project_quotas_result import ProjectQuotasResult
211
211
  from huaweicloudsdkgaussdbforopengauss.v3.model.pwd_reset_request import PwdResetRequest
212
+ from huaweicloudsdkgaussdbforopengauss.v3.model.recovery_backup_source import RecoveryBackupSource
213
+ from huaweicloudsdkgaussdbforopengauss.v3.model.recovery_backup_target import RecoveryBackupTarget
212
214
  from huaweicloudsdkgaussdbforopengauss.v3.model.recycle_instances_detail_result import RecycleInstancesDetailResult
213
215
  from huaweicloudsdkgaussdbforopengauss.v3.model.recycle_policy import RecyclePolicy
214
216
  from huaweicloudsdkgaussdbforopengauss.v3.model.recycle_policy_request_body import RecyclePolicyRequestBody
@@ -222,7 +224,11 @@ from huaweicloudsdkgaussdbforopengauss.v3.model.resource_error_response import R
222
224
  from huaweicloudsdkgaussdbforopengauss.v3.model.resource_result import ResourceResult
223
225
  from huaweicloudsdkgaussdbforopengauss.v3.model.restart_instance_request import RestartInstanceRequest
224
226
  from huaweicloudsdkgaussdbforopengauss.v3.model.restart_instance_response import RestartInstanceResponse
227
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_instance_request import RestoreInstanceRequest
228
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_instance_request_body import RestoreInstanceRequestBody
229
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_instance_response import RestoreInstanceResponse
225
230
  from huaweicloudsdkgaussdbforopengauss.v3.model.restore_point import RestorePoint
231
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_table_list_detail import RestoreTableListDetail
226
232
  from huaweicloudsdkgaussdbforopengauss.v3.model.roll_upgrade_progress import RollUpgradeProgress
227
233
  from huaweicloudsdkgaussdbforopengauss.v3.model.run_instance_action_request import RunInstanceActionRequest
228
234
  from huaweicloudsdkgaussdbforopengauss.v3.model.run_instance_action_response import RunInstanceActionResponse
@@ -4038,6 +4038,73 @@ class GaussDBforopenGaussAsyncClient(Client):
4038
4038
 
4039
4039
  return http_info
4040
4040
 
4041
+ def restore_instance_async(self, request):
4042
+ """备份恢复到当前实例
4043
+
4044
+ 备份恢复到当前实例
4045
+
4046
+ Please refer to HUAWEI cloud API Explorer for details.
4047
+
4048
+
4049
+ :param request: Request instance for RestoreInstance
4050
+ :type request: :class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreInstanceRequest`
4051
+ :rtype: :class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreInstanceResponse`
4052
+ """
4053
+ http_info = self._restore_instance_http_info(request)
4054
+ return self._call_api(**http_info)
4055
+
4056
+ def restore_instance_async_invoker(self, request):
4057
+ http_info = self._restore_instance_http_info(request)
4058
+ return AsyncInvoker(self, http_info)
4059
+
4060
+ def _restore_instance_http_info(self, request):
4061
+ http_info = {
4062
+ "method": "POST",
4063
+ "resource_path": "/v3/{project_id}/instances/recovery",
4064
+ "request_type": request.__class__.__name__,
4065
+ "response_type": "RestoreInstanceResponse"
4066
+ }
4067
+
4068
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
4069
+
4070
+ cname = None
4071
+
4072
+ collection_formats = {}
4073
+
4074
+ path_params = {}
4075
+
4076
+ query_params = []
4077
+
4078
+ header_params = {}
4079
+ if 'x_language' in local_var_params:
4080
+ header_params['X-Language'] = local_var_params['x_language']
4081
+
4082
+ form_params = {}
4083
+
4084
+ body = None
4085
+ if 'body' in local_var_params:
4086
+ body = local_var_params['body']
4087
+ if isinstance(request, SdkStreamRequest):
4088
+ body = request.get_file_stream()
4089
+
4090
+ response_headers = []
4091
+
4092
+ header_params['Content-Type'] = http_utils.select_header_content_type(
4093
+ ['application/json;charset=UTF-8'])
4094
+
4095
+ auth_settings = []
4096
+
4097
+ http_info["cname"] = cname
4098
+ http_info["collection_formats"] = collection_formats
4099
+ http_info["path_params"] = path_params
4100
+ http_info["query_params"] = query_params
4101
+ http_info["header_params"] = header_params
4102
+ http_info["post_params"] = form_params
4103
+ http_info["body"] = body
4104
+ http_info["response_headers"] = response_headers
4105
+
4106
+ return http_info
4107
+
4041
4108
  def run_instance_action_async(self, request):
4042
4109
  """CN横向扩容/DN分片扩容/磁盘扩容
4043
4110
 
@@ -4038,6 +4038,73 @@ class GaussDBforopenGaussClient(Client):
4038
4038
 
4039
4039
  return http_info
4040
4040
 
4041
+ def restore_instance(self, request):
4042
+ """备份恢复到当前实例
4043
+
4044
+ 备份恢复到当前实例
4045
+
4046
+ Please refer to HUAWEI cloud API Explorer for details.
4047
+
4048
+ :param request: Request instance for RestoreInstance
4049
+ :type request: :class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreInstanceRequest`
4050
+ :rtype: :class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreInstanceResponse`
4051
+ """
4052
+ http_info = self._restore_instance_http_info(request)
4053
+ return self._call_api(**http_info)
4054
+
4055
+ def restore_instance_invoker(self, request):
4056
+ http_info = self._restore_instance_http_info(request)
4057
+ return SyncInvoker(self, http_info)
4058
+
4059
+ @classmethod
4060
+ def _restore_instance_http_info(cls, request):
4061
+ http_info = {
4062
+ "method": "POST",
4063
+ "resource_path": "/v3/{project_id}/instances/recovery",
4064
+ "request_type": request.__class__.__name__,
4065
+ "response_type": "RestoreInstanceResponse"
4066
+ }
4067
+
4068
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
4069
+
4070
+ cname = None
4071
+
4072
+ collection_formats = {}
4073
+
4074
+ path_params = {}
4075
+
4076
+ query_params = []
4077
+
4078
+ header_params = {}
4079
+ if 'x_language' in local_var_params:
4080
+ header_params['X-Language'] = local_var_params['x_language']
4081
+
4082
+ form_params = {}
4083
+
4084
+ body = None
4085
+ if 'body' in local_var_params:
4086
+ body = local_var_params['body']
4087
+ if isinstance(request, SdkStreamRequest):
4088
+ body = request.get_file_stream()
4089
+
4090
+ response_headers = []
4091
+
4092
+ header_params['Content-Type'] = http_utils.select_header_content_type(
4093
+ ['application/json;charset=UTF-8'])
4094
+
4095
+ auth_settings = []
4096
+
4097
+ http_info["cname"] = cname
4098
+ http_info["collection_formats"] = collection_formats
4099
+ http_info["path_params"] = path_params
4100
+ http_info["query_params"] = query_params
4101
+ http_info["header_params"] = header_params
4102
+ http_info["post_params"] = form_params
4103
+ http_info["body"] = body
4104
+ http_info["response_headers"] = response_headers
4105
+
4106
+ return http_info
4107
+
4041
4108
  def run_instance_action(self, request):
4042
4109
  """CN横向扩容/DN分片扩容/磁盘扩容
4043
4110
 
@@ -207,6 +207,8 @@ from huaweicloudsdkgaussdbforopengauss.v3.model.param_group_copy_request_body im
207
207
  from huaweicloudsdkgaussdbforopengauss.v3.model.param_group_diff_request_body import ParamGroupDiffRequestBody
208
208
  from huaweicloudsdkgaussdbforopengauss.v3.model.project_quotas_result import ProjectQuotasResult
209
209
  from huaweicloudsdkgaussdbforopengauss.v3.model.pwd_reset_request import PwdResetRequest
210
+ from huaweicloudsdkgaussdbforopengauss.v3.model.recovery_backup_source import RecoveryBackupSource
211
+ from huaweicloudsdkgaussdbforopengauss.v3.model.recovery_backup_target import RecoveryBackupTarget
210
212
  from huaweicloudsdkgaussdbforopengauss.v3.model.recycle_instances_detail_result import RecycleInstancesDetailResult
211
213
  from huaweicloudsdkgaussdbforopengauss.v3.model.recycle_policy import RecyclePolicy
212
214
  from huaweicloudsdkgaussdbforopengauss.v3.model.recycle_policy_request_body import RecyclePolicyRequestBody
@@ -220,7 +222,11 @@ from huaweicloudsdkgaussdbforopengauss.v3.model.resource_error_response import R
220
222
  from huaweicloudsdkgaussdbforopengauss.v3.model.resource_result import ResourceResult
221
223
  from huaweicloudsdkgaussdbforopengauss.v3.model.restart_instance_request import RestartInstanceRequest
222
224
  from huaweicloudsdkgaussdbforopengauss.v3.model.restart_instance_response import RestartInstanceResponse
225
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_instance_request import RestoreInstanceRequest
226
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_instance_request_body import RestoreInstanceRequestBody
227
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_instance_response import RestoreInstanceResponse
223
228
  from huaweicloudsdkgaussdbforopengauss.v3.model.restore_point import RestorePoint
229
+ from huaweicloudsdkgaussdbforopengauss.v3.model.restore_table_list_detail import RestoreTableListDetail
224
230
  from huaweicloudsdkgaussdbforopengauss.v3.model.roll_upgrade_progress import RollUpgradeProgress
225
231
  from huaweicloudsdkgaussdbforopengauss.v3.model.run_instance_action_request import RunInstanceActionRequest
226
232
  from huaweicloudsdkgaussdbforopengauss.v3.model.run_instance_action_response import RunInstanceActionResponse
@@ -38,7 +38,8 @@ class OpenGaussInstanceRequestBody:
38
38
  'sharding_num': 'int',
39
39
  'coordinator_num': 'int',
40
40
  'replica_num': 'int',
41
- 'enable_force_switch': 'bool'
41
+ 'enable_force_switch': 'bool',
42
+ 'enable_single_float_ip': 'bool'
42
43
  }
43
44
 
44
45
  attribute_map = {
@@ -63,10 +64,11 @@ class OpenGaussInstanceRequestBody:
63
64
  'sharding_num': 'sharding_num',
64
65
  'coordinator_num': 'coordinator_num',
65
66
  'replica_num': 'replica_num',
66
- 'enable_force_switch': 'enable_force_switch'
67
+ 'enable_force_switch': 'enable_force_switch',
68
+ 'enable_single_float_ip': 'enable_single_float_ip'
67
69
  }
68
70
 
69
- def __init__(self, name=None, datastore=None, ha=None, configuration_id=None, port=None, password=None, backup_strategy=None, enterprise_project_id=None, disk_encryption_id=None, flavor_ref=None, volume=None, region=None, availability_zone=None, vpc_id=None, subnet_id=None, security_group_id=None, charge_info=None, time_zone=None, sharding_num=None, coordinator_num=None, replica_num=None, enable_force_switch=None):
71
+ def __init__(self, name=None, datastore=None, ha=None, configuration_id=None, port=None, password=None, backup_strategy=None, enterprise_project_id=None, disk_encryption_id=None, flavor_ref=None, volume=None, region=None, availability_zone=None, vpc_id=None, subnet_id=None, security_group_id=None, charge_info=None, time_zone=None, sharding_num=None, coordinator_num=None, replica_num=None, enable_force_switch=None, enable_single_float_ip=None):
70
72
  """OpenGaussInstanceRequestBody
71
73
 
72
74
  The model defined in huaweicloud sdk
@@ -115,6 +117,8 @@ class OpenGaussInstanceRequestBody:
115
117
  :type replica_num: int
116
118
  :param enable_force_switch: enable_force_switch表示是否开启备机强升主功能,enable_force_switch=true表示开启备机强升主功能,enable_force_switch=false表示关闭,默认关闭。仅支持1.2.2及以上版本。 说明: 备机强升主功能适用场景:在主机发生故障后,为了保障集群的可用性,强制拉起备机作为新主机对外提供服务的场景。 本功能在集群故障状态下,以丢失部分数据为代价换取集群尽可能快的恢复服务。本功能是集群状态为不可用时的一个逃生方法,如果操作者不清楚备机强升后丢失数据对业务的影响,请勿使用本功能。 备机强升主相关介绍请参考《故障处理》备机强升主章节。
117
119
  :type enable_force_switch: bool
120
+ :param enable_single_float_ip: 单浮动IP策略,仅主备版支持。默认值是false,表示不开启单浮动IP策略。 取值范围: true:开启单浮动IP策略,实例将只有一个浮动IP绑定主节点,如果发生主备倒换,浮动IP不会发生变化。 false:不开启单浮动IP策略,每个节点都会绑定一个浮动IP,如果发生主备倒换,浮动IP会发生变化。 说明: 仅支持3.206及以上版本的主备版实例。
121
+ :type enable_single_float_ip: bool
118
122
  """
119
123
 
120
124
 
@@ -141,6 +145,7 @@ class OpenGaussInstanceRequestBody:
141
145
  self._coordinator_num = None
142
146
  self._replica_num = None
143
147
  self._enable_force_switch = None
148
+ self._enable_single_float_ip = None
144
149
  self.discriminator = None
145
150
 
146
151
  self.name = name
@@ -176,6 +181,8 @@ class OpenGaussInstanceRequestBody:
176
181
  self.replica_num = replica_num
177
182
  if enable_force_switch is not None:
178
183
  self.enable_force_switch = enable_force_switch
184
+ if enable_single_float_ip is not None:
185
+ self.enable_single_float_ip = enable_single_float_ip
179
186
 
180
187
  @property
181
188
  def name(self):
@@ -641,6 +648,28 @@ class OpenGaussInstanceRequestBody:
641
648
  """
642
649
  self._enable_force_switch = enable_force_switch
643
650
 
651
+ @property
652
+ def enable_single_float_ip(self):
653
+ """Gets the enable_single_float_ip of this OpenGaussInstanceRequestBody.
654
+
655
+ 单浮动IP策略,仅主备版支持。默认值是false,表示不开启单浮动IP策略。 取值范围: true:开启单浮动IP策略,实例将只有一个浮动IP绑定主节点,如果发生主备倒换,浮动IP不会发生变化。 false:不开启单浮动IP策略,每个节点都会绑定一个浮动IP,如果发生主备倒换,浮动IP会发生变化。 说明: 仅支持3.206及以上版本的主备版实例。
656
+
657
+ :return: The enable_single_float_ip of this OpenGaussInstanceRequestBody.
658
+ :rtype: bool
659
+ """
660
+ return self._enable_single_float_ip
661
+
662
+ @enable_single_float_ip.setter
663
+ def enable_single_float_ip(self, enable_single_float_ip):
664
+ """Sets the enable_single_float_ip of this OpenGaussInstanceRequestBody.
665
+
666
+ 单浮动IP策略,仅主备版支持。默认值是false,表示不开启单浮动IP策略。 取值范围: true:开启单浮动IP策略,实例将只有一个浮动IP绑定主节点,如果发生主备倒换,浮动IP不会发生变化。 false:不开启单浮动IP策略,每个节点都会绑定一个浮动IP,如果发生主备倒换,浮动IP会发生变化。 说明: 仅支持3.206及以上版本的主备版实例。
667
+
668
+ :param enable_single_float_ip: The enable_single_float_ip of this OpenGaussInstanceRequestBody.
669
+ :type enable_single_float_ip: bool
670
+ """
671
+ self._enable_single_float_ip = enable_single_float_ip
672
+
644
673
  def to_dict(self):
645
674
  """Returns the model properties as a dict"""
646
675
  result = {}
@@ -0,0 +1,257 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class RecoveryBackupSource:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'instance_id': 'str',
21
+ 'type': 'str',
22
+ 'backup_id': 'str',
23
+ 'restore_time': 'str',
24
+ 'table_list': 'list[RestoreTableListDetail]',
25
+ 'schema_type': 'str'
26
+ }
27
+
28
+ attribute_map = {
29
+ 'instance_id': 'instance_id',
30
+ 'type': 'type',
31
+ 'backup_id': 'backup_id',
32
+ 'restore_time': 'restore_time',
33
+ 'table_list': 'table_list',
34
+ 'schema_type': 'schema_type'
35
+ }
36
+
37
+ def __init__(self, instance_id=None, type=None, backup_id=None, restore_time=None, table_list=None, schema_type=None):
38
+ """RecoveryBackupSource
39
+
40
+ The model defined in huaweicloud sdk
41
+
42
+ :param instance_id: 实例ID
43
+ :type instance_id: str
44
+ :param type: 恢复备份类型:backup,timestamp,different
45
+ :type type: str
46
+ :param backup_id: 用于恢复的备份ID。
47
+ :type backup_id: str
48
+ :param restore_time: UTC时间,时间戳
49
+ :type restore_time: str
50
+ :param table_list: 表基础信息。
51
+ :type table_list: list[:class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreTableListDetail`]
52
+ :param schema_type: 备份级别取值, 默认值:INSTANCE
53
+ :type schema_type: str
54
+ """
55
+
56
+
57
+
58
+ self._instance_id = None
59
+ self._type = None
60
+ self._backup_id = None
61
+ self._restore_time = None
62
+ self._table_list = None
63
+ self._schema_type = None
64
+ self.discriminator = None
65
+
66
+ self.instance_id = instance_id
67
+ if type is not None:
68
+ self.type = type
69
+ self.backup_id = backup_id
70
+ self.restore_time = restore_time
71
+ if table_list is not None:
72
+ self.table_list = table_list
73
+ if schema_type is not None:
74
+ self.schema_type = schema_type
75
+
76
+ @property
77
+ def instance_id(self):
78
+ """Gets the instance_id of this RecoveryBackupSource.
79
+
80
+ 实例ID
81
+
82
+ :return: The instance_id of this RecoveryBackupSource.
83
+ :rtype: str
84
+ """
85
+ return self._instance_id
86
+
87
+ @instance_id.setter
88
+ def instance_id(self, instance_id):
89
+ """Sets the instance_id of this RecoveryBackupSource.
90
+
91
+ 实例ID
92
+
93
+ :param instance_id: The instance_id of this RecoveryBackupSource.
94
+ :type instance_id: str
95
+ """
96
+ self._instance_id = instance_id
97
+
98
+ @property
99
+ def type(self):
100
+ """Gets the type of this RecoveryBackupSource.
101
+
102
+ 恢复备份类型:backup,timestamp,different
103
+
104
+ :return: The type of this RecoveryBackupSource.
105
+ :rtype: str
106
+ """
107
+ return self._type
108
+
109
+ @type.setter
110
+ def type(self, type):
111
+ """Sets the type of this RecoveryBackupSource.
112
+
113
+ 恢复备份类型:backup,timestamp,different
114
+
115
+ :param type: The type of this RecoveryBackupSource.
116
+ :type type: str
117
+ """
118
+ self._type = type
119
+
120
+ @property
121
+ def backup_id(self):
122
+ """Gets the backup_id of this RecoveryBackupSource.
123
+
124
+ 用于恢复的备份ID。
125
+
126
+ :return: The backup_id of this RecoveryBackupSource.
127
+ :rtype: str
128
+ """
129
+ return self._backup_id
130
+
131
+ @backup_id.setter
132
+ def backup_id(self, backup_id):
133
+ """Sets the backup_id of this RecoveryBackupSource.
134
+
135
+ 用于恢复的备份ID。
136
+
137
+ :param backup_id: The backup_id of this RecoveryBackupSource.
138
+ :type backup_id: str
139
+ """
140
+ self._backup_id = backup_id
141
+
142
+ @property
143
+ def restore_time(self):
144
+ """Gets the restore_time of this RecoveryBackupSource.
145
+
146
+ UTC时间,时间戳
147
+
148
+ :return: The restore_time of this RecoveryBackupSource.
149
+ :rtype: str
150
+ """
151
+ return self._restore_time
152
+
153
+ @restore_time.setter
154
+ def restore_time(self, restore_time):
155
+ """Sets the restore_time of this RecoveryBackupSource.
156
+
157
+ UTC时间,时间戳
158
+
159
+ :param restore_time: The restore_time of this RecoveryBackupSource.
160
+ :type restore_time: str
161
+ """
162
+ self._restore_time = restore_time
163
+
164
+ @property
165
+ def table_list(self):
166
+ """Gets the table_list of this RecoveryBackupSource.
167
+
168
+ 表基础信息。
169
+
170
+ :return: The table_list of this RecoveryBackupSource.
171
+ :rtype: list[:class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreTableListDetail`]
172
+ """
173
+ return self._table_list
174
+
175
+ @table_list.setter
176
+ def table_list(self, table_list):
177
+ """Sets the table_list of this RecoveryBackupSource.
178
+
179
+ 表基础信息。
180
+
181
+ :param table_list: The table_list of this RecoveryBackupSource.
182
+ :type table_list: list[:class:`huaweicloudsdkgaussdbforopengauss.v3.RestoreTableListDetail`]
183
+ """
184
+ self._table_list = table_list
185
+
186
+ @property
187
+ def schema_type(self):
188
+ """Gets the schema_type of this RecoveryBackupSource.
189
+
190
+ 备份级别取值, 默认值:INSTANCE
191
+
192
+ :return: The schema_type of this RecoveryBackupSource.
193
+ :rtype: str
194
+ """
195
+ return self._schema_type
196
+
197
+ @schema_type.setter
198
+ def schema_type(self, schema_type):
199
+ """Sets the schema_type of this RecoveryBackupSource.
200
+
201
+ 备份级别取值, 默认值:INSTANCE
202
+
203
+ :param schema_type: The schema_type of this RecoveryBackupSource.
204
+ :type schema_type: str
205
+ """
206
+ self._schema_type = schema_type
207
+
208
+ def to_dict(self):
209
+ """Returns the model properties as a dict"""
210
+ result = {}
211
+
212
+ for attr, _ in six.iteritems(self.openapi_types):
213
+ value = getattr(self, attr)
214
+ if isinstance(value, list):
215
+ result[attr] = list(map(
216
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
217
+ value
218
+ ))
219
+ elif hasattr(value, "to_dict"):
220
+ result[attr] = value.to_dict()
221
+ elif isinstance(value, dict):
222
+ result[attr] = dict(map(
223
+ lambda item: (item[0], item[1].to_dict())
224
+ if hasattr(item[1], "to_dict") else item,
225
+ value.items()
226
+ ))
227
+ else:
228
+ if attr in self.sensitive_list:
229
+ result[attr] = "****"
230
+ else:
231
+ result[attr] = value
232
+
233
+ return result
234
+
235
+ def to_str(self):
236
+ """Returns the string representation of the model"""
237
+ import simplejson as json
238
+ if six.PY2:
239
+ import sys
240
+ reload(sys)
241
+ sys.setdefaultencoding("utf-8")
242
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
243
+
244
+ def __repr__(self):
245
+ """For `print`"""
246
+ return self.to_str()
247
+
248
+ def __eq__(self, other):
249
+ """Returns true if both objects are equal"""
250
+ if not isinstance(other, RecoveryBackupSource):
251
+ return False
252
+
253
+ return self.__dict__ == other.__dict__
254
+
255
+ def __ne__(self, other):
256
+ """Returns true if both objects are not equal"""
257
+ return not self == other
@@ -0,0 +1,114 @@
1
+ # coding: utf-8
2
+
3
+ import six
4
+
5
+ from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
6
+
7
+
8
+ class RecoveryBackupTarget:
9
+
10
+ """
11
+ Attributes:
12
+ openapi_types (dict): The key is attribute name
13
+ and the value is attribute type.
14
+ attribute_map (dict): The key is attribute name
15
+ and the value is json key in definition.
16
+ """
17
+ sensitive_list = []
18
+
19
+ openapi_types = {
20
+ 'instance_id': 'str'
21
+ }
22
+
23
+ attribute_map = {
24
+ 'instance_id': 'instance_id'
25
+ }
26
+
27
+ def __init__(self, instance_id=None):
28
+ """RecoveryBackupTarget
29
+
30
+ The model defined in huaweicloud sdk
31
+
32
+ :param instance_id: 实例ID
33
+ :type instance_id: str
34
+ """
35
+
36
+
37
+
38
+ self._instance_id = None
39
+ self.discriminator = None
40
+
41
+ self.instance_id = instance_id
42
+
43
+ @property
44
+ def instance_id(self):
45
+ """Gets the instance_id of this RecoveryBackupTarget.
46
+
47
+ 实例ID
48
+
49
+ :return: The instance_id of this RecoveryBackupTarget.
50
+ :rtype: str
51
+ """
52
+ return self._instance_id
53
+
54
+ @instance_id.setter
55
+ def instance_id(self, instance_id):
56
+ """Sets the instance_id of this RecoveryBackupTarget.
57
+
58
+ 实例ID
59
+
60
+ :param instance_id: The instance_id of this RecoveryBackupTarget.
61
+ :type instance_id: str
62
+ """
63
+ self._instance_id = instance_id
64
+
65
+ def to_dict(self):
66
+ """Returns the model properties as a dict"""
67
+ result = {}
68
+
69
+ for attr, _ in six.iteritems(self.openapi_types):
70
+ value = getattr(self, attr)
71
+ if isinstance(value, list):
72
+ result[attr] = list(map(
73
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
74
+ value
75
+ ))
76
+ elif hasattr(value, "to_dict"):
77
+ result[attr] = value.to_dict()
78
+ elif isinstance(value, dict):
79
+ result[attr] = dict(map(
80
+ lambda item: (item[0], item[1].to_dict())
81
+ if hasattr(item[1], "to_dict") else item,
82
+ value.items()
83
+ ))
84
+ else:
85
+ if attr in self.sensitive_list:
86
+ result[attr] = "****"
87
+ else:
88
+ result[attr] = value
89
+
90
+ return result
91
+
92
+ def to_str(self):
93
+ """Returns the string representation of the model"""
94
+ import simplejson as json
95
+ if six.PY2:
96
+ import sys
97
+ reload(sys)
98
+ sys.setdefaultencoding("utf-8")
99
+ return json.dumps(sanitize_for_serialization(self), ensure_ascii=False)
100
+
101
+ def __repr__(self):
102
+ """For `print`"""
103
+ return self.to_str()
104
+
105
+ def __eq__(self, other):
106
+ """Returns true if both objects are equal"""
107
+ if not isinstance(other, RecoveryBackupTarget):
108
+ return False
109
+
110
+ return self.__dict__ == other.__dict__
111
+
112
+ def __ne__(self, other):
113
+ """Returns true if both objects are not equal"""
114
+ return not self == other