Class: Comet::DestinationConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/comet/models/destination_config.rb

Overview

DestinationConfig is a typed class wrapper around the underlying Comet Server API data structure.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDestinationConfig

Returns a new instance of DestinationConfig.



252
253
254
# File 'lib/comet/models/destination_config.rb', line 252

def initialize
  clear
end

Instance Attribute Details

#azbaccount_keyObject

Returns the value of attribute azbaccount_key.



154
155
156
# File 'lib/comet/models/destination_config.rb', line 154

def azbaccount_key
  @azbaccount_key
end

#azbaccount_nameObject

Returns the value of attribute azbaccount_name.



151
152
153
# File 'lib/comet/models/destination_config.rb', line 151

def azbaccount_name
  @azbaccount_name
end

#azbcontainerObject

Returns the value of attribute azbcontainer.



157
158
159
# File 'lib/comet/models/destination_config.rb', line 157

def azbcontainer
  @azbcontainer
end

#azbprefixObject

Returns the value of attribute azbprefix.



164
165
166
# File 'lib/comet/models/destination_config.rb', line 164

def azbprefix
  @azbprefix
end

#azbrealmObject

The base URL for the Azure Blob Storage service. Leave blank to use the global default URL.



161
162
163
# File 'lib/comet/models/destination_config.rb', line 161

def azbrealm
  @azbrealm
end

#b2Object

Returns the value of attribute b2.



187
188
189
# File 'lib/comet/models/destination_config.rb', line 187

def b2
  @b2
end

#comet_bucketObject

Returns the value of attribute comet_bucket.



47
48
49
# File 'lib/comet/models/destination_config.rb', line 47

def comet_bucket
  @comet_bucket
end

#comet_bucket_keyObject

Returns the value of attribute comet_bucket_key.



50
51
52
# File 'lib/comet/models/destination_config.rb', line 50

def comet_bucket_key
  @comet_bucket_key
end

#comet_serverObject

The URL for the target Comet Server Storage Role, including http/https and trailing slash



44
45
46
# File 'lib/comet/models/destination_config.rb', line 44

def comet_server
  @comet_server
end

#create_timeObject

Unix timestamp in seconds



20
21
22
# File 'lib/comet/models/destination_config.rb', line 20

def create_time
  @create_time
end

#default_retentionObject

Configure the retention policy for this Storage Vault. The rules will be applied to any snapshot inside this Storage Vault, unless that snapshot belongs to a Protected Item source that has an overriding retention policy.



243
244
245
# File 'lib/comet/models/destination_config.rb', line 243

def default_retention
  @default_retention
end

#descriptionObject

Returns the value of attribute description.



16
17
18
# File 'lib/comet/models/destination_config.rb', line 16

def description
  @description
end

#destination_typeObject

One of the DESTINATIONTYPE_ constants



40
41
42
# File 'lib/comet/models/destination_config.rb', line 40

def destination_type
  @destination_type
end

#encrypted_encryption_keyObject

Returns the value of attribute encrypted_encryption_key.



221
222
223
# File 'lib/comet/models/destination_config.rb', line 221

def encrypted_encryption_key
  @encrypted_encryption_key
end

#encryption_key_encryption_methodObject

One of the ENCRYPTIONMETHOD_ constants



218
219
220
# File 'lib/comet/models/destination_config.rb', line 218

def encryption_key_encryption_method
  @encryption_key_encryption_method
end

#ftpaccept_invalid_sslObject

Returns the value of attribute ftpaccept_invalid_ssl.



148
149
150
# File 'lib/comet/models/destination_config.rb', line 148

def ftpaccept_invalid_ssl
  @ftpaccept_invalid_ssl
end

#ftpbase_use_home_directoryObject

If true, store data in the default home directory given by the FTP server. If false, store data in the FTPCustomBaseDirectory path.



130
131
132
# File 'lib/comet/models/destination_config.rb', line 130

def ftpbase_use_home_directory
  @ftpbase_use_home_directory
end

#ftpcustom_base_directoryObject

If FTPBaseUseHomeDirectory is false, this field controls the path where data is stored.



134
135
136
# File 'lib/comet/models/destination_config.rb', line 134

def ftpcustom_base_directory
  @ftpcustom_base_directory
end

#ftpmax_connectionsObject

If set to zero, uses a system default value that is not unlimited.



145
146
147
# File 'lib/comet/models/destination_config.rb', line 145

def ftpmax_connections
  @ftpmax_connections
end

#ftppasswordObject

Returns the value of attribute ftppassword.



125
126
127
# File 'lib/comet/models/destination_config.rb', line 125

def ftppassword
  @ftppassword
end

#ftpportObject

Returns the value of attribute ftpport.



141
142
143
# File 'lib/comet/models/destination_config.rb', line 141

def ftpport
  @ftpport
end

#ftpserverObject

Returns the value of attribute ftpserver.



119
120
121
# File 'lib/comet/models/destination_config.rb', line 119

def ftpserver
  @ftpserver
end

#ftpsmodeObject

Control whether this is plaintext FTP or secure FTPS by using one of the FTPS_MODE_ constants.



138
139
140
# File 'lib/comet/models/destination_config.rb', line 138

def ftpsmode
  @ftpsmode
end

#ftpusernameObject

Returns the value of attribute ftpusername.



122
123
124
# File 'lib/comet/models/destination_config.rb', line 122

def ftpusername
  @ftpusername
end

#localcopy_pathObject

Returns the value of attribute localcopy_path.



167
168
169
# File 'lib/comet/models/destination_config.rb', line 167

def localcopy_path
  @localcopy_path
end

#localcopy_win_smbpasswordObject

If logging in to a Windows network share (SMB/CIFS) is required, enter the password here. The password may be hashed as per the LocalcopyWinSMBPasswordFormat field.



176
177
178
# File 'lib/comet/models/destination_config.rb', line 176

def localcopy_win_smbpassword
  @localcopy_win_smbpassword
end

#localcopy_win_smbpassword_formatObject

One of the PASSWORD_FORMAT_ constants. It controls the hash format of the LocalcopyWinSMBPassword field.



181
182
183
# File 'lib/comet/models/destination_config.rb', line 181

def localcopy_win_smbpassword_format
  @localcopy_win_smbpassword_format
end

#localcopy_win_smbusernameObject

If logging in to a Windows network share (SMB/CIFS) is required, enter the username here.



171
172
173
# File 'lib/comet/models/destination_config.rb', line 171

def localcopy_win_smbusername
  @localcopy_win_smbusername
end

#modify_timeObject

Unix timestamp in seconds



24
25
26
# File 'lib/comet/models/destination_config.rb', line 24

def modify_time
  @modify_time
end

#post_execObject

Custom commands to run after the job



36
37
38
# File 'lib/comet/models/destination_config.rb', line 36

def post_exec
  @post_exec
end

#pre_execObject

Custom commands to run before the job



28
29
30
# File 'lib/comet/models/destination_config.rb', line 28

def pre_exec
  @pre_exec
end

#rebrand_storageObject

The “Prevent users from viewing the actual storage type” option



247
248
249
# File 'lib/comet/models/destination_config.rb', line 247

def rebrand_storage
  @rebrand_storage
end

#repo_init_timestampObject

Unix timestamp in seconds. If zero, the Storage Vault has not yet been initialized for the first time.



226
227
228
# File 'lib/comet/models/destination_config.rb', line 226

def repo_init_timestamp
  @repo_init_timestamp
end

#s3access_keyObject

Returns the value of attribute s3access_key.



59
60
61
# File 'lib/comet/models/destination_config.rb', line 59

def s3access_key
  @s3access_key
end

#s3bucket_nameObject

Returns the value of attribute s3bucket_name.



65
66
67
# File 'lib/comet/models/destination_config.rb', line 65

def s3bucket_name
  @s3bucket_name
end

#s3custom_regionObject

Returns the value of attribute s3custom_region.



71
72
73
# File 'lib/comet/models/destination_config.rb', line 71

def s3custom_region
  @s3custom_region
end

#s3object_lock_daysObject

Returns the value of attribute s3object_lock_days.



84
85
86
# File 'lib/comet/models/destination_config.rb', line 84

def s3object_lock_days
  @s3object_lock_days
end

#s3object_lock_modeObject

Returns the value of attribute s3object_lock_mode.



81
82
83
# File 'lib/comet/models/destination_config.rb', line 81

def s3object_lock_mode
  @s3object_lock_mode
end

#s3remove_deletedObject

Returns the value of attribute s3remove_deleted.



78
79
80
# File 'lib/comet/models/destination_config.rb', line 78

def s3remove_deleted
  @s3remove_deleted
end

#s3secret_keyObject

Returns the value of attribute s3secret_key.



62
63
64
# File 'lib/comet/models/destination_config.rb', line 62

def s3secret_key
  @s3secret_key
end

#s3serverObject

Returns the value of attribute s3server.



53
54
55
# File 'lib/comet/models/destination_config.rb', line 53

def s3server
  @s3server
end

#s3subdirObject

Returns the value of attribute s3subdir.



68
69
70
# File 'lib/comet/models/destination_config.rb', line 68

def s3subdir
  @s3subdir
end

#s3uses_tlsObject

Returns the value of attribute s3uses_tls.



56
57
58
# File 'lib/comet/models/destination_config.rb', line 56

def s3uses_tls
  @s3uses_tls
end

#s3uses_v2signingObject

If true, use legacy v2 signing. If false (default), use modern v4 signing



75
76
77
# File 'lib/comet/models/destination_config.rb', line 75

def s3uses_v2signing
  @s3uses_v2signing
end

#sftpauth_modeObject

One of the DESTINATION_SFTP_AUTHMODE_ constants



98
99
100
# File 'lib/comet/models/destination_config.rb', line 98

def sftpauth_mode
  @sftpauth_mode
end

#sftpcustom_auth__known_hosts_fileObject

If SFTPCustomAuth_UseKnownHostFile is true, the path to the SSH known_hosts file.



116
117
118
# File 'lib/comet/models/destination_config.rb', line 116

def sftpcustom_auth__known_hosts_file
  @sftpcustom_auth__known_hosts_file
end

#sftpcustom_auth__use_known_hosts_fileObject

If true, then the SFTPCustomAuth_KnownHostsFile will be used to verify the remote SSH server’s host key, using Trust On First Use (TOFU).



112
113
114
# File 'lib/comet/models/destination_config.rb', line 112

def sftpcustom_auth__use_known_hosts_file
  @sftpcustom_auth__use_known_hosts_file
end

#sftppasswordObject

For use with DESTINATION_SFTP_AUTHMODE_PASSWORD only: the SSH password to connect with



102
103
104
# File 'lib/comet/models/destination_config.rb', line 102

def sftppassword
  @sftppassword
end

#sftpprivate_keyObject

For use with DESTINATION_SFTP_AUTHMODE_PRIVATEKEY only: the SSH private key to connect with, in OpenSSH format.



107
108
109
# File 'lib/comet/models/destination_config.rb', line 107

def sftpprivate_key
  @sftpprivate_key
end

#sftpremote_pathObject

The directory on the SFTP server in which data is stored.



94
95
96
# File 'lib/comet/models/destination_config.rb', line 94

def sftpremote_path
  @sftpremote_path
end

#sftpserverObject

Returns the value of attribute sftpserver.



87
88
89
# File 'lib/comet/models/destination_config.rb', line 87

def sftpserver
  @sftpserver
end

#sftpusernameObject

Returns the value of attribute sftpusername.



90
91
92
# File 'lib/comet/models/destination_config.rb', line 90

def sftpusername
  @sftpusername
end

#span_targetsObject

A list of underlying destinations, that will be combined and presented as one.



198
199
200
# File 'lib/comet/models/destination_config.rb', line 198

def span_targets
  @span_targets
end

#span_use_static_slotsObject

If true, this Spanned destination will use a consistent hashing scheme to immediately find specific files on exactly one of the target destinations. In the Static Slots mode, the span targets cannot be moved or merged, and the files must always remain in their original location.

If false, the Spanned destination system will search all targets to find the requested file. This is slightly slower, but allows you to freely merge, split, and reorder the underlying destination locations.

The default option is false.



211
212
213
# File 'lib/comet/models/destination_config.rb', line 211

def span_use_static_slots
  @span_use_static_slots
end

#statisticsObject

Returns the value of attribute statistics.



237
238
239
# File 'lib/comet/models/destination_config.rb', line 237

def statistics
  @statistics
end

#storage_limit_bytesObject

Storage Vault quota



234
235
236
# File 'lib/comet/models/destination_config.rb', line 234

def storage_limit_bytes
  @storage_limit_bytes
end

#storage_limit_enabledObject

Storage Vault quota



230
231
232
# File 'lib/comet/models/destination_config.rb', line 230

def storage_limit_enabled
  @storage_limit_enabled
end

#storjObject

Returns the value of attribute storj.



194
195
196
# File 'lib/comet/models/destination_config.rb', line 194

def storj
  @storj
end

#swiftObject

Returns the value of attribute swift.



184
185
186
# File 'lib/comet/models/destination_config.rb', line 184

def swift
  @swift
end

#tagObject

Returns the value of attribute tag.



214
215
216
# File 'lib/comet/models/destination_config.rb', line 214

def tag
  @tag
end

#thaw_execObject

Custom commands to run after taking a disk snapshot



32
33
34
# File 'lib/comet/models/destination_config.rb', line 32

def thaw_exec
  @thaw_exec
end

#unknown_json_fieldsObject

Returns the value of attribute unknown_json_fields.



250
251
252
# File 'lib/comet/models/destination_config.rb', line 250

def unknown_json_fields
  @unknown_json_fields
end

#web_davObject

This field is available in Comet 23.6.9 and later.



191
192
193
# File 'lib/comet/models/destination_config.rb', line 191

def web_dav
  @web_dav
end

Instance Method Details

#clearObject



256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/comet/models/destination_config.rb', line 256

def clear
  @description = ''
  @create_time = 0
  @modify_time = 0
  @pre_exec = []
  @thaw_exec = []
  @post_exec = []
  @destination_type = 0
  @comet_server = ''
  @comet_bucket = ''
  @comet_bucket_key = ''
  @s3server = ''
  @s3access_key = ''
  @s3secret_key = ''
  @s3bucket_name = ''
  @s3subdir = ''
  @s3custom_region = ''
  @s3object_lock_mode = 0
  @s3object_lock_days = 0
  @sftpserver = ''
  @sftpusername = ''
  @sftpremote_path = ''
  @sftpauth_mode = 0
  @sftppassword = ''
  @sftpprivate_key = ''
  @sftpcustom_auth__known_hosts_file = ''
  @ftpserver = ''
  @ftpusername = ''
  @ftppassword = ''
  @ftpcustom_base_directory = ''
  @ftpsmode = 0
  @ftpport = 0
  @ftpmax_connections = 0
  @azbaccount_name = ''
  @azbaccount_key = ''
  @azbcontainer = ''
  @azbrealm = ''
  @azbprefix = ''
  @localcopy_path = ''
  @localcopy_win_smbusername = ''
  @localcopy_win_smbpassword = ''
  @localcopy_win_smbpassword_format = 0
  @swift = Comet::SwiftDestinationLocation.new
  @b2 = Comet::B2DestinationLocation.new
  @web_dav = Comet::WebDavDestinationLocation.new
  @storj = Comet::StorjDestinationLocation.new
  @span_targets = []
  @tag = ''
  @encryption_key_encryption_method = 0
  @encrypted_encryption_key = ''
  @repo_init_timestamp = 0
  @storage_limit_bytes = 0
  @statistics = Comet::DestinationStatistics.new
  @default_retention = Comet::RetentionPolicy.new
  @unknown_json_fields = {}
end

#from_hash(obj) ⇒ Object

Parameters:

  • obj (Hash)

    The complete object as a Ruby hash

Raises:

  • (TypeError)


321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/comet/models/destination_config.rb', line 321

def from_hash(obj)
  raise TypeError, "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash

  obj.each do |k, v|
    case k
    when 'Description'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @description = v
    when 'CreateTime'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @create_time = v
    when 'ModifyTime'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @modify_time = v
    when 'PreExec'
      if v.nil?
        @pre_exec = []
      else
        @pre_exec = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String

          @pre_exec[i1] = v1
        end
      end
    when 'ThawExec'
      if v.nil?
        @thaw_exec = []
      else
        @thaw_exec = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String

          @thaw_exec[i1] = v1
        end
      end
    when 'PostExec'
      if v.nil?
        @post_exec = []
      else
        @post_exec = Array.new(v.length)
        v.each_with_index do |v1, i1|
          raise TypeError, "'v1' expected String, got #{v1.class}" unless v1.is_a? String

          @post_exec[i1] = v1
        end
      end
    when 'DestinationType'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @destination_type = v
    when 'CometServer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @comet_server = v
    when 'CometBucket'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @comet_bucket = v
    when 'CometBucketKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @comet_bucket_key = v
    when 'S3Server'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3server = v
    when 'S3UsesTLS'
      @s3uses_tls = v
    when 'S3AccessKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3access_key = v
    when 'S3SecretKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3secret_key = v
    when 'S3BucketName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3bucket_name = v
    when 'S3Subdir'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3subdir = v
    when 'S3CustomRegion'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @s3custom_region = v
    when 'S3UsesV2Signing'
      @s3uses_v2signing = v
    when 'S3RemoveDeleted'
      @s3remove_deleted = v
    when 'S3ObjectLockMode'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @s3object_lock_mode = v
    when 'S3ObjectLockDays'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @s3object_lock_days = v
    when 'SFTPServer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpserver = v
    when 'SFTPUsername'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpusername = v
    when 'SFTPRemotePath'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpremote_path = v
    when 'SFTPAuthMode'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @sftpauth_mode = v
    when 'SFTPPassword'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftppassword = v
    when 'SFTPPrivateKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpprivate_key = v
    when 'SFTPCustomAuth_UseKnownHostsFile'
      @sftpcustom_auth__use_known_hosts_file = v
    when 'SFTPCustomAuth_KnownHostsFile'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @sftpcustom_auth__known_hosts_file = v
    when 'FTPServer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftpserver = v
    when 'FTPUsername'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftpusername = v
    when 'FTPPassword'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftppassword = v
    when 'FTPBaseUseHomeDirectory'
      @ftpbase_use_home_directory = v
    when 'FTPCustomBaseDirectory'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @ftpcustom_base_directory = v
    when 'FTPSMode'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @ftpsmode = v
    when 'FTPPort'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @ftpport = v
    when 'FTPMaxConnections'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @ftpmax_connections = v
    when 'FTPAcceptInvalidSSL'
      @ftpaccept_invalid_ssl = v
    when 'AZBAccountName'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbaccount_name = v
    when 'AZBAccountKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbaccount_key = v
    when 'AZBContainer'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbcontainer = v
    when 'AZBRealm'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbrealm = v
    when 'AZBPrefix'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @azbprefix = v
    when 'LocalcopyPath'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @localcopy_path = v
    when 'LocalcopyWinSMBUsername'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @localcopy_win_smbusername = v
    when 'LocalcopyWinSMBPassword'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @localcopy_win_smbpassword = v
    when 'LocalcopyWinSMBPasswordFormat'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @localcopy_win_smbpassword_format = v
    when 'Swift'
      @swift = Comet::SwiftDestinationLocation.new
      @swift.from_hash(v)
    when 'B2'
      @b2 = Comet::B2DestinationLocation.new
      @b2.from_hash(v)
    when 'WebDav'
      @web_dav = Comet::WebDavDestinationLocation.new
      @web_dav.from_hash(v)
    when 'Storj'
      @storj = Comet::StorjDestinationLocation.new
      @storj.from_hash(v)
    when 'SpanTargets'
      if v.nil?
        @span_targets = []
      else
        @span_targets = Array.new(v.length)
        v.each_with_index do |v1, i1|
          @span_targets[i1] = Comet::DestinationLocation.new
          @span_targets[i1].from_hash(v1)
        end
      end
    when 'SpanUseStaticSlots'
      @span_use_static_slots = v
    when 'Tag'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @tag = v
    when 'EncryptionKeyEncryptionMethod'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @encryption_key_encryption_method = v
    when 'EncryptedEncryptionKey'
      raise TypeError, "'v' expected String, got #{v.class}" unless v.is_a? String

      @encrypted_encryption_key = v
    when 'RepoInitTimestamp'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @repo_init_timestamp = v
    when 'StorageLimitEnabled'
      @storage_limit_enabled = v
    when 'StorageLimitBytes'
      raise TypeError, "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric

      @storage_limit_bytes = v
    when 'Statistics'
      @statistics = Comet::DestinationStatistics.new
      @statistics.from_hash(v)
    when 'DefaultRetention'
      @default_retention = Comet::RetentionPolicy.new
      @default_retention.from_hash(v)
    when 'RebrandStorage'
      @rebrand_storage = v
    else
      @unknown_json_fields[k] = v
    end
  end
end

#from_json(json_string) ⇒ Object

Parameters:

  • json_string (String)

    The complete object in JSON format

Raises:

  • (TypeError)


314
315
316
317
318
# File 'lib/comet/models/destination_config.rb', line 314

def from_json(json_string)
  raise TypeError, "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String

  from_hash(JSON.parse(json_string))
end

#to_hHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



657
658
659
# File 'lib/comet/models/destination_config.rb', line 657

def to_h
  to_hash
end

#to_hashHash

Returns The complete object as a Ruby hash.

Returns:

  • (Hash)

    The complete object as a Ruby hash



584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
# File 'lib/comet/models/destination_config.rb', line 584

def to_hash
  ret = {}
  ret['Description'] = @description
  ret['CreateTime'] = @create_time
  ret['ModifyTime'] = @modify_time
  ret['PreExec'] = @pre_exec
  ret['ThawExec'] = @thaw_exec
  ret['PostExec'] = @post_exec
  ret['DestinationType'] = @destination_type
  ret['CometServer'] = @comet_server
  ret['CometBucket'] = @comet_bucket
  ret['CometBucketKey'] = @comet_bucket_key
  ret['S3Server'] = @s3server
  ret['S3UsesTLS'] = @s3uses_tls
  ret['S3AccessKey'] = @s3access_key
  ret['S3SecretKey'] = @s3secret_key
  ret['S3BucketName'] = @s3bucket_name
  ret['S3Subdir'] = @s3subdir
  ret['S3CustomRegion'] = @s3custom_region
  ret['S3UsesV2Signing'] = @s3uses_v2signing
  ret['S3RemoveDeleted'] = @s3remove_deleted
  ret['S3ObjectLockMode'] = @s3object_lock_mode
  ret['S3ObjectLockDays'] = @s3object_lock_days
  ret['SFTPServer'] = @sftpserver
  ret['SFTPUsername'] = @sftpusername
  ret['SFTPRemotePath'] = @sftpremote_path
  ret['SFTPAuthMode'] = @sftpauth_mode
  ret['SFTPPassword'] = @sftppassword
  ret['SFTPPrivateKey'] = @sftpprivate_key
  ret['SFTPCustomAuth_UseKnownHostsFile'] = @sftpcustom_auth__use_known_hosts_file
  ret['SFTPCustomAuth_KnownHostsFile'] = @sftpcustom_auth__known_hosts_file
  ret['FTPServer'] = @ftpserver
  ret['FTPUsername'] = @ftpusername
  ret['FTPPassword'] = @ftppassword
  ret['FTPBaseUseHomeDirectory'] = @ftpbase_use_home_directory
  ret['FTPCustomBaseDirectory'] = @ftpcustom_base_directory
  ret['FTPSMode'] = @ftpsmode
  ret['FTPPort'] = @ftpport
  ret['FTPMaxConnections'] = @ftpmax_connections
  ret['FTPAcceptInvalidSSL'] = @ftpaccept_invalid_ssl
  ret['AZBAccountName'] = @azbaccount_name
  ret['AZBAccountKey'] = @azbaccount_key
  ret['AZBContainer'] = @azbcontainer
  ret['AZBRealm'] = @azbrealm
  ret['AZBPrefix'] = @azbprefix
  ret['LocalcopyPath'] = @localcopy_path
  ret['LocalcopyWinSMBUsername'] = @localcopy_win_smbusername
  ret['LocalcopyWinSMBPassword'] = @localcopy_win_smbpassword
  ret['LocalcopyWinSMBPasswordFormat'] = @localcopy_win_smbpassword_format
  ret['Swift'] = @swift
  ret['B2'] = @b2
  ret['WebDav'] = @web_dav
  ret['Storj'] = @storj
  ret['SpanTargets'] = @span_targets
  ret['SpanUseStaticSlots'] = @span_use_static_slots
  ret['Tag'] = @tag
  ret['EncryptionKeyEncryptionMethod'] = @encryption_key_encryption_method
  ret['EncryptedEncryptionKey'] = @encrypted_encryption_key
  ret['RepoInitTimestamp'] = @repo_init_timestamp
  ret['StorageLimitEnabled'] = @storage_limit_enabled
  ret['StorageLimitBytes'] = @storage_limit_bytes
  unless @statistics.nil?
    ret['Statistics'] = @statistics
  end
  ret['DefaultRetention'] = @default_retention
  ret['RebrandStorage'] = @rebrand_storage
  @unknown_json_fields.each do |k, v|
    ret[k] = v
  end
  ret
end

#to_json(options = {}) ⇒ String

Returns The complete object as a JSON string.

Returns:

  • (String)

    The complete object as a JSON string



662
663
664
# File 'lib/comet/models/destination_config.rb', line 662

def to_json(options = {})
  to_hash.to_json(options)
end