class Comet::DestinationConfig

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

Attributes

azbaccount_key[RW]

@type [String] azbaccount_key

azbaccount_name[RW]

@type [String] azbaccount_name

azbcontainer[RW]

@type [String] azbcontainer

azbprefix[RW]

@type [String] azbprefix

azbrealm[RW]

@type [String] azbrealm

b2[RW]

@type [Comet::B2DestinationLocation] b2

comet_bucket[RW]

@type [String] comet_bucket

comet_bucket_key[RW]

@type [String] comet_bucket_key

comet_server[RW]

@type [String] comet_server

create_time[RW]

@type [Number] create_time

default_retention[RW]

@type [Comet::RetentionPolicy] default_retention

description[RW]

@type [String] description

destination_type[RW]

@type [Number] destination_type

encrypted_encryption_key[RW]

@type [String] encrypted_encryption_key

encryption_key_encryption_method[RW]
ftpaccept_invalid_ssl[RW]

@type [Boolean] ftpaccept_invalid_ssl

ftpbase_use_home_directory[RW]

@type [Boolean] ftpbase_use_home_directory

ftpcustom_base_directory[RW]

@type [String] ftpcustom_base_directory

ftpmax_connections[RW]

@type [Number] ftpmax_connections

ftppassword[RW]

@type [String] ftppassword

ftpport[RW]

@type [Number] ftpport

ftpserver[RW]

@type [String] ftpserver

ftpsmode[RW]

@type [Number] ftpsmode

ftpusername[RW]

@type [String] ftpusername

localcopy_path[RW]

@type [String] localcopy_path

localcopy_win_smbpassword[RW]

@type [String] localcopy_win_smbpassword

localcopy_win_smbpassword_format[RW]
localcopy_win_smbusername[RW]

@type [String] localcopy_win_smbusername

modify_time[RW]

@type [Number] modify_time

post_exec[RW]

@type [Array<String>] post_exec

pre_exec[RW]

@type [Array<String>] pre_exec

rebrand_storage[RW]

@type [Boolean] rebrand_storage

repo_init_timestamp[RW]

@type [Number] repo_init_timestamp

s3access_key[RW]

@type [String] s3access_key

s3bucket_name[RW]

@type [String] s3bucket_name

s3secret_key[RW]

@type [String] s3secret_key

s3server[RW]

@type [String] s3server

s3subdir[RW]

@type [String] s3subdir

s3uses_tls[RW]

@type [Boolean] s3uses_tls

s3uses_v2signing[RW]

@type [Boolean] s3uses_v2signing

sftpauth_mode[RW]

@type [Number] sftpauth_mode

sftpcustom_auth__known_hosts_file[RW]
sftpcustom_auth__use_known_hosts_file[RW]
sftppassword[RW]

@type [String] sftppassword

sftpprivate_key[RW]

@type [String] sftpprivate_key

sftpremote_path[RW]

@type [String] sftpremote_path

sftpserver[RW]

@type [String] sftpserver

sftpusername[RW]

@type [String] sftpusername

span_targets[RW]

@type [Array<Comet::DestinationLocation>] span_targets

span_use_static_slots[RW]

@type [Boolean] span_use_static_slots

statistics[RW]

@type [Comet::DestinationStatistics] statistics

storage_limit_bytes[RW]

@type [Number] storage_limit_bytes

storage_limit_enabled[RW]

@type [Boolean] storage_limit_enabled

swift[RW]

@type [Comet::SwiftDestinationLocation] swift

thaw_exec[RW]

@type [Array<String>] thaw_exec

unknown_json_fields[RW]

@type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations

Public Class Methods

new() click to toggle source
# File lib/comet/models/destination_config.rb, line 185
def initialize
  clear
end

Public Instance Methods

clear() click to toggle source
# File lib/comet/models/destination_config.rb, line 189
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 = ''
  @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
  @span_targets = []
  @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) click to toggle source

@param [Hash] obj The complete object as a Ruby hash

# File lib/comet/models/destination_config.rb, line 248
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 'S3UsesV2Signing'
      @s3uses_v2signing = 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 '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 '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) click to toggle source

@param [String] json_string The complete object in JSON format

# File lib/comet/models/destination_config.rb, line 241
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_h() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/destination_config.rb, line 553
def to_h
  to_hash
end
to_hash() click to toggle source

@return [Hash] The complete object as a Ruby hash

# File lib/comet/models/destination_config.rb, line 487
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['S3UsesV2Signing'] = @s3uses_v2signing
  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['SpanTargets'] = @span_targets
  ret['SpanUseStaticSlots'] = @span_use_static_slots
  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 = {}) click to toggle source

@return [String] The complete object as a JSON string

# File lib/comet/models/destination_config.rb, line 558
def to_json(options = {})
  to_hash.to_json(options)
end