comet_backup_ruby_sdk 2.42.0 → 2.44.0

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/Gemfile.lock +1 -1
  4. data/comet_backup_ruby_sdk.gemspec +1 -1
  5. data/lib/comet/comet_server.rb +259 -9
  6. data/lib/comet/definitions.rb +21 -2
  7. data/lib/comet/models/backup_job_advanced_options.rb +10 -0
  8. data/lib/comet/models/backup_job_detail.rb +12 -12
  9. data/lib/comet/models/backup_rule_config.rb +10 -0
  10. data/lib/comet/models/branding_options.rb +30 -0
  11. data/lib/comet/models/branding_properties.rb +30 -0
  12. data/lib/comet/models/destination_config.rb +11 -0
  13. data/lib/comet/models/{pverestore_selection.rb → dispatch_with_job_idresponse.rb} +24 -24
  14. data/lib/comet/models/get_shared_storage_quota_response.rb +110 -0
  15. data/lib/comet/models/list_shared_storage_quota_response.rb +98 -0
  16. data/lib/comet/models/private_branding_properties.rb +30 -0
  17. data/lib/comet/models/protected_item_with_backup_rules_response.rb +119 -0
  18. data/lib/comet/models/pvebackup_disk.rb +6 -0
  19. data/lib/comet/models/pvebackup_node.rb +5 -0
  20. data/lib/comet/models/pvebackup_vm.rb +6 -0
  21. data/lib/comet/models/pvedisk.rb +4 -3
  22. data/lib/comet/models/pveparams.rb +13 -11
  23. data/lib/comet/models/pvestorage_name.rb +16 -0
  24. data/lib/comet/models/pvevm.rb +2 -0
  25. data/lib/comet/models/{block_info.rb → set_shared_storage_quota_response.rb} +24 -14
  26. data/lib/comet/models/shared_storage_quota.rb +94 -0
  27. data/lib/comet/models/source_config.rb +7 -0
  28. data/lib/comet/models/user_profile_config.rb +8 -0
  29. data/lib/comet/models/vault_snapshot.rb +19 -0
  30. data/lib/comet/models/windows_code_sign_properties.rb +30 -0
  31. data/lib/comet_backup_ruby_sdk.rb +6 -5
  32. metadata +8 -4
@@ -149,6 +149,18 @@ module Comet
149
149
  # @type [String] windows_code_sign_azure_tenant_id
150
150
  attr_accessor :windows_code_sign_azure_tenant_id
151
151
 
152
+ # URL of the SAS Relic server, with protocol (https://) and trailing slash
153
+ # @type [String] windows_code_sign_relic_server_url
154
+ attr_accessor :windows_code_sign_relic_server_url
155
+
156
+ # The SAS Relic client keypair in PEM format
157
+ # @type [String] windows_code_sign_relic_keypair_file
158
+ attr_accessor :windows_code_sign_relic_keypair_file
159
+
160
+ # The name of the key to select on the remote SAS Relic server
161
+ # @type [String] windows_code_sign_relic_key_name
162
+ attr_accessor :windows_code_sign_relic_key_name
163
+
152
164
  # @type [Comet::MacOSCodeSignProperties] mac_oscode_sign
153
165
  attr_accessor :mac_oscode_sign
154
166
 
@@ -198,6 +210,9 @@ module Comet
198
210
  @windows_code_sign_azure_app_secret_format = 0
199
211
  @windows_code_sign_azure_app_secret = ''
200
212
  @windows_code_sign_azure_tenant_id = ''
213
+ @windows_code_sign_relic_server_url = ''
214
+ @windows_code_sign_relic_keypair_file = ''
215
+ @windows_code_sign_relic_key_name = ''
201
216
  @mac_oscode_sign = Comet::MacOSCodeSignProperties.new
202
217
  @unknown_json_fields = {}
203
218
  end
@@ -377,6 +392,18 @@ module Comet
377
392
  raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
378
393
 
379
394
  @windows_code_sign_azure_tenant_id = v
395
+ when 'WindowsCodeSignRelicServerURL'
396
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
397
+
398
+ @windows_code_sign_relic_server_url = v
399
+ when 'WindowsCodeSignRelicKeypairFile'
400
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
401
+
402
+ @windows_code_sign_relic_keypair_file = v
403
+ when 'WindowsCodeSignRelicKeyName'
404
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
405
+
406
+ @windows_code_sign_relic_key_name = v
380
407
  when 'MacOSCodeSign'
381
408
  @mac_oscode_sign = Comet::MacOSCodeSignProperties.new
382
409
  @mac_oscode_sign.from_hash(v)
@@ -432,6 +459,9 @@ module Comet
432
459
  ret['WindowsCodeSignAzureAppSecretFormat'] = @windows_code_sign_azure_app_secret_format
433
460
  ret['WindowsCodeSignAzureAppSecret'] = @windows_code_sign_azure_app_secret
434
461
  ret['WindowsCodeSignAzureTenantID'] = @windows_code_sign_azure_tenant_id
462
+ ret['WindowsCodeSignRelicServerURL'] = @windows_code_sign_relic_server_url
463
+ ret['WindowsCodeSignRelicKeypairFile'] = @windows_code_sign_relic_keypair_file
464
+ ret['WindowsCodeSignRelicKeyName'] = @windows_code_sign_relic_key_name
435
465
  ret['MacOSCodeSign'] = @mac_oscode_sign
436
466
  @unknown_json_fields.each do |k, v|
437
467
  ret[k] = v
@@ -126,6 +126,18 @@ module Comet
126
126
  # @type [String] windows_code_sign_azure_tenant_id
127
127
  attr_accessor :windows_code_sign_azure_tenant_id
128
128
 
129
+ # URL of the SAS Relic server, with protocol (https://) and trailing slash
130
+ # @type [String] windows_code_sign_relic_server_url
131
+ attr_accessor :windows_code_sign_relic_server_url
132
+
133
+ # The SAS Relic client keypair in PEM format
134
+ # @type [String] windows_code_sign_relic_keypair_file
135
+ attr_accessor :windows_code_sign_relic_keypair_file
136
+
137
+ # The name of the key to select on the remote SAS Relic server
138
+ # @type [String] windows_code_sign_relic_key_name
139
+ attr_accessor :windows_code_sign_relic_key_name
140
+
129
141
  # @type [Comet::MacOSCodeSignProperties] mac_oscode_sign
130
142
  attr_accessor :mac_oscode_sign
131
143
 
@@ -169,6 +181,9 @@ module Comet
169
181
  @windows_code_sign_azure_app_secret_format = 0
170
182
  @windows_code_sign_azure_app_secret = ''
171
183
  @windows_code_sign_azure_tenant_id = ''
184
+ @windows_code_sign_relic_server_url = ''
185
+ @windows_code_sign_relic_keypair_file = ''
186
+ @windows_code_sign_relic_key_name = ''
172
187
  @mac_oscode_sign = Comet::MacOSCodeSignProperties.new
173
188
  @unknown_json_fields = {}
174
189
  end
@@ -322,6 +337,18 @@ module Comet
322
337
  raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
323
338
 
324
339
  @windows_code_sign_azure_tenant_id = v
340
+ when 'WindowsCodeSignRelicServerURL'
341
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
342
+
343
+ @windows_code_sign_relic_server_url = v
344
+ when 'WindowsCodeSignRelicKeypairFile'
345
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
346
+
347
+ @windows_code_sign_relic_keypair_file = v
348
+ when 'WindowsCodeSignRelicKeyName'
349
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
350
+
351
+ @windows_code_sign_relic_key_name = v
325
352
  when 'MacOSCodeSign'
326
353
  @mac_oscode_sign = Comet::MacOSCodeSignProperties.new
327
354
  @mac_oscode_sign.from_hash(v)
@@ -370,6 +397,9 @@ module Comet
370
397
  ret['WindowsCodeSignAzureAppSecretFormat'] = @windows_code_sign_azure_app_secret_format
371
398
  ret['WindowsCodeSignAzureAppSecret'] = @windows_code_sign_azure_app_secret
372
399
  ret['WindowsCodeSignAzureTenantID'] = @windows_code_sign_azure_tenant_id
400
+ ret['WindowsCodeSignRelicServerURL'] = @windows_code_sign_relic_server_url
401
+ ret['WindowsCodeSignRelicKeypairFile'] = @windows_code_sign_relic_keypair_file
402
+ ret['WindowsCodeSignRelicKeyName'] = @windows_code_sign_relic_key_name
373
403
  ret['MacOSCodeSign'] = @mac_oscode_sign
374
404
  @unknown_json_fields.each do |k, v|
375
405
  ret[k] = v
@@ -236,6 +236,11 @@ module Comet
236
236
  # @type [Number] storage_limit_bytes
237
237
  attr_accessor :storage_limit_bytes
238
238
 
239
+ # If set, use a shared Storage Vault quota from the Comet Management Console. The direct value of
240
+ # StorageLimitBytes is ignored.
241
+ # @type [String] storage_limit_id
242
+ attr_accessor :storage_limit_id
243
+
239
244
  # @type [Comet::DestinationStatistics] statistics
240
245
  attr_accessor :statistics
241
246
 
@@ -316,6 +321,7 @@ module Comet
316
321
  @encrypted_encryption_key = ''
317
322
  @repo_init_timestamp = 0
318
323
  @storage_limit_bytes = 0
324
+ @storage_limit_id = ''
319
325
  @statistics = Comet::DestinationStatistics.new
320
326
  @default_retention = Comet::RetentionPolicy.new
321
327
  @retention_error = ''
@@ -582,6 +588,10 @@ module Comet
582
588
  raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
583
589
 
584
590
  @storage_limit_bytes = v
591
+ when 'StorageLimitID'
592
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
593
+
594
+ @storage_limit_id = v
585
595
  when 'Statistics'
586
596
  @statistics = Comet::DestinationStatistics.new
587
597
  @statistics.from_hash(v)
@@ -674,6 +684,7 @@ module Comet
674
684
  ret['RepoInitTimestamp'] = @repo_init_timestamp
675
685
  ret['StorageLimitEnabled'] = @storage_limit_enabled
676
686
  ret['StorageLimitBytes'] = @storage_limit_bytes
687
+ ret['StorageLimitID'] = @storage_limit_id
677
688
  unless @statistics.nil?
678
689
  ret['Statistics'] = @statistics
679
690
  end
@@ -9,17 +9,18 @@ require 'json'
9
9
 
10
10
  module Comet
11
11
 
12
- # PVERestoreSelection is a typed class wrapper around the underlying Comet Server API data structure.
13
- class PVERestoreSelection
12
+ # DispatchWithJobIDResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ class DispatchWithJobIDResponse
14
14
 
15
- # @type [String] id
16
- attr_accessor :id
15
+ # If the operation was successful, the status will be in the 200-299 range.
16
+ # @type [Number] status
17
+ attr_accessor :status
17
18
 
18
- # @type [String] name
19
- attr_accessor :name
19
+ # @type [String] message
20
+ attr_accessor :message
20
21
 
21
- # @type [Comet::PVEVM] target_vm
22
- attr_accessor :target_vm
22
+ # @type [String] job_id
23
+ attr_accessor :job_id
23
24
 
24
25
  # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
25
26
  attr_accessor :unknown_json_fields
@@ -29,9 +30,9 @@ module Comet
29
30
  end
30
31
 
31
32
  def clear
32
- @id = ''
33
- @name = ''
34
- @target_vm = Comet::PVEVM.new
33
+ @status = 0
34
+ @message = ''
35
+ @job_id = ''
35
36
  @unknown_json_fields = {}
36
37
  end
37
38
 
@@ -48,17 +49,18 @@ module Comet
48
49
 
49
50
  obj.each do |k, v|
50
51
  case k
51
- when 'ID'
52
+ when 'Status'
53
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
54
+
55
+ @status = v
56
+ when 'Message'
52
57
  raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
53
58
 
54
- @id = v
55
- when 'Name'
59
+ @message = v
60
+ when 'JobID'
56
61
  raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
57
62
 
58
- @name = v
59
- when 'TargetVM'
60
- @target_vm = Comet::PVEVM.new
61
- @target_vm.from_hash(v)
63
+ @job_id = v
62
64
  else
63
65
  @unknown_json_fields[k] = v
64
66
  end
@@ -68,13 +70,11 @@ module Comet
68
70
  # @return [Hash] The complete object as a Ruby hash
69
71
  def to_hash
70
72
  ret = {}
71
- unless @id.nil?
72
- ret['ID'] = @id
73
- end
74
- unless @name.nil?
75
- ret['Name'] = @name
73
+ ret['Status'] = @status
74
+ ret['Message'] = @message
75
+ unless @job_id.nil?
76
+ ret['JobID'] = @job_id
76
77
  end
77
- ret['TargetVM'] = @target_vm
78
78
  @unknown_json_fields.each do |k, v|
79
79
  ret[k] = v
80
80
  end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # GetSharedStorageQuotaResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ class GetSharedStorageQuotaResponse
14
+
15
+ # If the operation was successful, the status will be in the 200-299 range.
16
+ # @type [Number] status
17
+ attr_accessor :status
18
+
19
+ # @type [String] message
20
+ attr_accessor :message
21
+
22
+ # @type [Comet::SharedStorageQuota] shared_storage_quota
23
+ attr_accessor :shared_storage_quota
24
+
25
+ # @type [String] shared_storage_quota_hash
26
+ attr_accessor :shared_storage_quota_hash
27
+
28
+ # Bytes
29
+ # @type [Number] current_usage
30
+ attr_accessor :current_usage
31
+
32
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
33
+ attr_accessor :unknown_json_fields
34
+
35
+ def initialize
36
+ clear
37
+ end
38
+
39
+ def clear
40
+ @status = 0
41
+ @message = ''
42
+ @shared_storage_quota = Comet::SharedStorageQuota.new
43
+ @shared_storage_quota_hash = ''
44
+ @current_usage = 0
45
+ @unknown_json_fields = {}
46
+ end
47
+
48
+ # @param [String] json_string The complete object in JSON format
49
+ def from_json(json_string)
50
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
51
+
52
+ from_hash(JSON.parse(json_string))
53
+ end
54
+
55
+ # @param [Hash] obj The complete object as a Ruby hash
56
+ def from_hash(obj)
57
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
58
+
59
+ obj.each do |k, v|
60
+ case k
61
+ when 'Status'
62
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
63
+
64
+ @status = v
65
+ when 'Message'
66
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
67
+
68
+ @message = v
69
+ when 'SharedStorageQuota'
70
+ @shared_storage_quota = Comet::SharedStorageQuota.new
71
+ @shared_storage_quota.from_hash(v)
72
+ when 'SharedStorageQuotaHash'
73
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
74
+
75
+ @shared_storage_quota_hash = v
76
+ when 'CurrentUsage'
77
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
78
+
79
+ @current_usage = v
80
+ else
81
+ @unknown_json_fields[k] = v
82
+ end
83
+ end
84
+ end
85
+
86
+ # @return [Hash] The complete object as a Ruby hash
87
+ def to_hash
88
+ ret = {}
89
+ ret['Status'] = @status
90
+ ret['Message'] = @message
91
+ ret['SharedStorageQuota'] = @shared_storage_quota
92
+ ret['SharedStorageQuotaHash'] = @shared_storage_quota_hash
93
+ ret['CurrentUsage'] = @current_usage
94
+ @unknown_json_fields.each do |k, v|
95
+ ret[k] = v
96
+ end
97
+ ret
98
+ end
99
+
100
+ # @return [Hash] The complete object as a Ruby hash
101
+ def to_h
102
+ to_hash
103
+ end
104
+
105
+ # @return [String] The complete object as a JSON string
106
+ def to_json(options = {})
107
+ to_hash.to_json(options)
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # ListSharedStorageQuotaResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ class ListSharedStorageQuotaResponse
14
+
15
+ # If the operation was successful, the status will be in the 200-299 range.
16
+ # @type [Number] status
17
+ attr_accessor :status
18
+
19
+ # @type [String] message
20
+ attr_accessor :message
21
+
22
+ # @type [Hash{String => Comet::SharedStorageQuota}] entries
23
+ attr_accessor :entries
24
+
25
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
26
+ attr_accessor :unknown_json_fields
27
+
28
+ def initialize
29
+ clear
30
+ end
31
+
32
+ def clear
33
+ @status = 0
34
+ @message = ''
35
+ @entries = {}
36
+ @unknown_json_fields = {}
37
+ end
38
+
39
+ # @param [String] json_string The complete object in JSON format
40
+ def from_json(json_string)
41
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
42
+
43
+ from_hash(JSON.parse(json_string))
44
+ end
45
+
46
+ # @param [Hash] obj The complete object as a Ruby hash
47
+ def from_hash(obj)
48
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
49
+
50
+ obj.each do |k, v|
51
+ case k
52
+ when 'Status'
53
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
54
+
55
+ @status = v
56
+ when 'Message'
57
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
58
+
59
+ @message = v
60
+ when 'Entries'
61
+ @entries = {}
62
+ if v.nil?
63
+ @entries = {}
64
+ else
65
+ v.each do |k1, v1|
66
+ @entries[k1] = Comet::SharedStorageQuota.new
67
+ @entries[k1].from_hash(v1)
68
+ end
69
+ end
70
+ else
71
+ @unknown_json_fields[k] = v
72
+ end
73
+ end
74
+ end
75
+
76
+ # @return [Hash] The complete object as a Ruby hash
77
+ def to_hash
78
+ ret = {}
79
+ ret['Status'] = @status
80
+ ret['Message'] = @message
81
+ ret['Entries'] = @entries
82
+ @unknown_json_fields.each do |k, v|
83
+ ret[k] = v
84
+ end
85
+ ret
86
+ end
87
+
88
+ # @return [Hash] The complete object as a Ruby hash
89
+ def to_h
90
+ to_hash
91
+ end
92
+
93
+ # @return [String] The complete object as a JSON string
94
+ def to_json(options = {})
95
+ to_hash.to_json(options)
96
+ end
97
+ end
98
+ end
@@ -93,6 +93,18 @@ module Comet
93
93
  # @type [String] windows_code_sign_azure_tenant_id
94
94
  attr_accessor :windows_code_sign_azure_tenant_id
95
95
 
96
+ # URL of the SAS Relic server, with protocol (https://) and trailing slash
97
+ # @type [String] windows_code_sign_relic_server_url
98
+ attr_accessor :windows_code_sign_relic_server_url
99
+
100
+ # The SAS Relic client keypair in PEM format
101
+ # @type [String] windows_code_sign_relic_keypair_file
102
+ attr_accessor :windows_code_sign_relic_keypair_file
103
+
104
+ # The name of the key to select on the remote SAS Relic server
105
+ # @type [String] windows_code_sign_relic_key_name
106
+ attr_accessor :windows_code_sign_relic_key_name
107
+
96
108
  # @type [Comet::MacOSCodeSignProperties] mac_oscode_sign
97
109
  attr_accessor :mac_oscode_sign
98
110
 
@@ -129,6 +141,9 @@ module Comet
129
141
  @windows_code_sign_azure_app_secret_format = 0
130
142
  @windows_code_sign_azure_app_secret = ''
131
143
  @windows_code_sign_azure_tenant_id = ''
144
+ @windows_code_sign_relic_server_url = ''
145
+ @windows_code_sign_relic_keypair_file = ''
146
+ @windows_code_sign_relic_key_name = ''
132
147
  @mac_oscode_sign = Comet::MacOSCodeSignProperties.new
133
148
  @unknown_json_fields = {}
134
149
  end
@@ -246,6 +261,18 @@ module Comet
246
261
  raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
247
262
 
248
263
  @windows_code_sign_azure_tenant_id = v
264
+ when 'WindowsCodeSignRelicServerURL'
265
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
266
+
267
+ @windows_code_sign_relic_server_url = v
268
+ when 'WindowsCodeSignRelicKeypairFile'
269
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
270
+
271
+ @windows_code_sign_relic_keypair_file = v
272
+ when 'WindowsCodeSignRelicKeyName'
273
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
274
+
275
+ @windows_code_sign_relic_key_name = v
249
276
  when 'MacOSCodeSign'
250
277
  @mac_oscode_sign = Comet::MacOSCodeSignProperties.new
251
278
  @mac_oscode_sign.from_hash(v)
@@ -283,6 +310,9 @@ module Comet
283
310
  ret['WindowsCodeSignAzureAppSecretFormat'] = @windows_code_sign_azure_app_secret_format
284
311
  ret['WindowsCodeSignAzureAppSecret'] = @windows_code_sign_azure_app_secret
285
312
  ret['WindowsCodeSignAzureTenantID'] = @windows_code_sign_azure_tenant_id
313
+ ret['WindowsCodeSignRelicServerURL'] = @windows_code_sign_relic_server_url
314
+ ret['WindowsCodeSignRelicKeypairFile'] = @windows_code_sign_relic_keypair_file
315
+ ret['WindowsCodeSignRelicKeyName'] = @windows_code_sign_relic_key_name
286
316
  ret['MacOSCodeSign'] = @mac_oscode_sign
287
317
  @unknown_json_fields.each do |k, v|
288
318
  ret[k] = v
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright (c) 2020-2025 Comet Licensing Ltd.
4
+ # Please see the LICENSE file for usage information.
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+
8
+ require 'json'
9
+
10
+ module Comet
11
+
12
+ # ProtectedItemWithBackupRulesResponse is a typed class wrapper around the underlying Comet Server API data structure.
13
+ class ProtectedItemWithBackupRulesResponse
14
+
15
+ # If the operation was successful, the status will be in the 200-299 range.
16
+ # @type [Number] status
17
+ attr_accessor :status
18
+
19
+ # @type [String] message
20
+ attr_accessor :message
21
+
22
+ # The Protected Item configuration
23
+ # @type [Comet::SourceConfig] source
24
+ attr_accessor :source
25
+
26
+ # All backup rules for the Protected Item
27
+ # @type [Hash{String => Comet::BackupRuleConfig}] backup_rules
28
+ attr_accessor :backup_rules
29
+
30
+ # @type [String] profile_hash
31
+ attr_accessor :profile_hash
32
+
33
+ # @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
34
+ attr_accessor :unknown_json_fields
35
+
36
+ def initialize
37
+ clear
38
+ end
39
+
40
+ def clear
41
+ @status = 0
42
+ @message = ''
43
+ @source = Comet::SourceConfig.new
44
+ @backup_rules = {}
45
+ @profile_hash = ''
46
+ @unknown_json_fields = {}
47
+ end
48
+
49
+ # @param [String] json_string The complete object in JSON format
50
+ def from_json(json_string)
51
+ raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
52
+
53
+ from_hash(JSON.parse(json_string))
54
+ end
55
+
56
+ # @param [Hash] obj The complete object as a Ruby hash
57
+ def from_hash(obj)
58
+ raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
59
+
60
+ obj.each do |k, v|
61
+ case k
62
+ when 'Status'
63
+ raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
64
+
65
+ @status = v
66
+ when 'Message'
67
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
68
+
69
+ @message = v
70
+ when 'Source'
71
+ @source = Comet::SourceConfig.new
72
+ @source.from_hash(v)
73
+ when 'BackupRules'
74
+ @backup_rules = {}
75
+ if v.nil?
76
+ @backup_rules = {}
77
+ else
78
+ v.each do |k1, v1|
79
+ @backup_rules[k1] = Comet::BackupRuleConfig.new
80
+ @backup_rules[k1].from_hash(v1)
81
+ end
82
+ end
83
+ when 'ProfileHash'
84
+ raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String
85
+
86
+ @profile_hash = v
87
+ else
88
+ @unknown_json_fields[k] = v
89
+ end
90
+ end
91
+ end
92
+
93
+ # @return [Hash] The complete object as a Ruby hash
94
+ def to_hash
95
+ ret = {}
96
+ ret['Status'] = @status
97
+ ret['Message'] = @message
98
+ ret['Source'] = @source
99
+ unless @backup_rules.nil?
100
+ ret['BackupRules'] = @backup_rules
101
+ end
102
+ ret['ProfileHash'] = @profile_hash
103
+ @unknown_json_fields.each do |k, v|
104
+ ret[k] = v
105
+ end
106
+ ret
107
+ end
108
+
109
+ # @return [Hash] The complete object as a Ruby hash
110
+ def to_h
111
+ to_hash
112
+ end
113
+
114
+ # @return [String] The complete object as a JSON string
115
+ def to_json(options = {})
116
+ to_hash.to_json(options)
117
+ end
118
+ end
119
+ end
@@ -10,11 +10,17 @@ require 'json'
10
10
  module Comet
11
11
 
12
12
  # PVEBackupDisk is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # This type is used in the EngineProps for an "engine1/proxmox" Protected Item. It represents the
14
+ # selection state for a single disk attached to a single Proxmox VM or LXC Container. It is expected
15
+ # to be user-configurable.
16
+ # This type is available in Comet 25.8.0 and later.
13
17
  class PVEBackupDisk
14
18
 
19
+ # For a disk "scsi0", this field should contain: "scsi"
15
20
  # @type [String] device
16
21
  attr_accessor :device
17
22
 
23
+ # For a disk "scsi0", this field should contain: 0
18
24
  # @type [Number] device_num
19
25
  attr_accessor :device_num
20
26
 
@@ -10,11 +10,16 @@ require 'json'
10
10
  module Comet
11
11
 
12
12
  # PVEBackupNode is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # This type is used in the EngineProps for an "engine1/proxmox" Protected Item. It represents the
14
+ # selection state for a single Proxmox VE node. It is expected to be user-configurable.
15
+ # This type is available in Comet 25.8.0 and later.
13
16
  class PVEBackupNode
14
17
 
15
18
  # @type [Array<Comet::PVEBackupVM>] included_vms
16
19
  attr_accessor :included_vms
17
20
 
21
+ # Used as a cache if the device is offline when editing the Protected Item; not considered as part
22
+ # of the selection
18
23
  # @type [String] name
19
24
  attr_accessor :name
20
25
 
@@ -10,17 +10,23 @@ require 'json'
10
10
  module Comet
11
11
 
12
12
  # PVEBackupVM is a typed class wrapper around the underlying Comet Server API data structure.
13
+ # This type is used in the EngineProps for an "engine1/proxmox" Protected Item. It represents the
14
+ # selection state for a single Proxmox VM or LXC Container. It is expected to be user-configurable.
15
+ # This type is available in Comet 25.8.0 and later.
13
16
  class PVEBackupVM
14
17
 
15
18
  # @type [Array<Comet::PVEBackupDisk>] included_disks
16
19
  attr_accessor :included_disks
17
20
 
21
+ # Used as a cache if the device is offline when editing the Protected Item; not considered as part
22
+ # of the selection
18
23
  # @type [String] name
19
24
  attr_accessor :name
20
25
 
21
26
  # @type [Boolean] selected
22
27
  attr_accessor :selected
23
28
 
29
+ # One of the PROXMOX_TYPE_ constants
24
30
  # @type [String] type
25
31
  attr_accessor :type
26
32