def add_properties(self): super(BackupS3PropertiesMixin, self).add_properties() self.add_property( descr='Peer', name='s3_peer', usage=_("Peer name. Must match a peer of type s3"), get=lambda o: get_related(self.context, 'peer', o, 'properties.peer'), set=lambda o, v: set_related(self.context, 'peer', o, 'properties.peer', v), list=False, condition=lambda o: o['provider'] == 's3' ) self.add_property( descr='Bucket', name='s3_bucket', usage=_("""\ Enclose the valid hostname label between double quotes. This assumes you have already created a bucket."""), get='properties.bucket', list=False, condition=lambda o: o['provider'] == 's3' ) self.add_property( descr='Folder', name='s3_folder', usage=_("""\ The name of the folder within the bucket to backup to."""), get='properties.folder', list=False, condition=lambda o: o['provider'] == 's3' )
def add_properties(self): super(BackupS3PropertiesMixin, self).add_properties() self.add_property(descr='Peer', name='s3_peer', usage=_("Peer name. Must match a peer of type s3"), get=lambda o: get_related(self.context, 'peer', o, 'properties.peer'), set=lambda o, v: set_related(self.context, 'peer', o, 'properties.peer', v), list=False, condition=lambda o: o['provider'] == 's3') self.add_property(descr='Bucket', name='s3_bucket', usage=_("""\ Enclose the valid hostname label between double quotes. This assumes you have already created a bucket."""), get='properties.bucket', list=False, condition=lambda o: o['provider'] == 's3') self.add_property(descr='Folder', name='s3_folder', usage=_("""\ The name of the folder within the bucket to backup to."""), get='properties.folder', list=False, condition=lambda o: o['provider'] == 's3')
def add_properties(self): super(BackupSSHPropertiesMixin, self).add_properties() self.add_property( descr='Peer', name='ssh_peer', usage=_("Peer name. Must match a peer of type ssh"), get=lambda o: get_related(self.context, 'peer', o, 'properties.peer'), set=lambda o, v: set_related(self.context, 'peer', o, 'properties.peer', v), list=False, condition=lambda o: o['provider'] == 'ssh', enum=lambda: self.query([], { 'subscriber': 'peer', 'select': 'name' }), ) self.add_property(descr='Directory', name='ssh_directory', usage=_("""\ Name of existing directory to save the backups to."""), get='properties.directory', list=False, condition=lambda o: o['provider'] == 'ssh')
def __init__(self, name, context): super(SystemUINamespace, self).__init__(name, context) self.context = context self.config_call = 'system.ui.get_config' self.update_task = 'system.ui.update' self.add_property( descr='Redirect http to https', name='redirect_https', get='webui_http_redirect_https', type=ValueType.BOOLEAN ) self.add_property( descr='Web GUI Protocols in use', name='protocols', get='webui_protocol', type=ValueType.SET, enum=['HTTP', 'HTTPS'] ) self.add_property( descr='Web GUI IP Address (IPv4 and/or IPv6)', name='ip_addresses', get='webui_listen', type=ValueType.SET ) self.add_property( descr='HTTP port', name='http_port', get='webui_http_port', type=ValueType.NUMBER ) self.add_property( descr='HTTPS port', name='https_port', get='webui_https_port', type=ValueType.NUMBER ) self.add_property( descr='HTTPS certificate', name='https_certificate', get=lambda o: get_related(self.context, 'crypto.certificate', o, 'webui_https_certificate'), set=lambda o, v: set_related(self.context, 'crypto.certificate', o, 'webui_https_certificate', v), usage=_("""\ Name of the certificate """), complete=EntitySubscriberComplete( 'https_certificate=', 'crypto.certificate', lambda o: o['name'] if o['type'] != 'CERT_CSR' else None ), type=ValueType.STRING )
def add_properties(self): super(BackupSSHPropertiesMixin, self).add_properties() self.add_property(descr='Peer', name='ssh_peer', usage=_("Peer name. Must match a peer of type ssh"), get=lambda o: get_related(self.context, 'peer', o, 'properties.peer'), set=lambda o, v: set_related(self.context, 'peer', o, 'properties.peer', v), list=False, condition=lambda o: o['provider'] == 'ssh', complete=EntitySubscriberComplete( 'ssh_peer=', 'peer', lambda i: i['name'])) self.add_property(descr='Directory', name='ssh_directory', usage=_("""\ Name of existing directory to save the backups to."""), get='properties.directory', list=False, condition=lambda o: o['provider'] == 'ssh')
def add_properties(self): super(BackupSSHPropertiesMixin, self).add_properties() self.add_property( descr='Peer', name='ssh_peer', usage=_("Peer name. Must match a peer of type ssh"), get=lambda o: get_related(self.context, 'peer', o, 'properties.peer'), set=lambda o, v: set_related(self.context, 'peer', o, 'properties.peer', v), list=False, condition=lambda o: o['provider'] == 'ssh', complete=EntitySubscriberComplete('ssh_peer=', 'peer', lambda i: i['name']) ) self.add_property( descr='Directory', name='ssh_directory', usage=_("""\ Name of existing directory to save the backups to."""), get='properties.directory', list=False, condition=lambda o: o['provider'] == 'ssh' )