github.com/LINBIT/golinstor@v0.52.0/client/controllerconfig.go (about) 1 // Copyright (C) LINBIT HA-Solutions GmbH 2 // All Rights Reserved. 3 // Author: Roland Kammerer <roland.kammerer@linbit.com> 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); you may 6 // not use this file except in compliance with the License. You may obtain 7 // a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 // License for the specific language governing permissions and limitations 15 // under the License. 16 17 package client 18 19 type ControllerConfig struct { 20 Config ControllerConfigConfig `json:"config,omitempty"` 21 Debug ControllerConfigDebug `json:"debug,omitempty"` 22 Log ControllerConfigLog `json:"log,omitempty"` 23 Db ControllerConfigDb `json:"db,omitempty"` 24 Http ControllerConfigHttp `json:"http,omitempty"` 25 Https ControllerConfigHttps `json:"https,omitempty"` 26 Ldap ControllerConfigLdap `json:"ldap,omitempty"` 27 } 28 29 type ControllerConfigConfig struct { 30 Dir string `json:"dir,omitempty"` 31 } 32 33 type ControllerConfigDbEtcd struct { 34 OperationsPerTransaction int32 `json:"operations_per_transaction,omitempty"` 35 Prefix string `json:"prefix,omitempty"` 36 } 37 38 type ControllerConfigDb struct { 39 ConnectionUrl string `json:"connection_url,omitempty"` 40 CaCertificate string `json:"ca_certificate,omitempty"` 41 ClientCertificate string `json:"client_certificate,omitempty"` 42 ClientKeyPkcs8Pem string `json:"client_key_pkcs8_pem,omitempty"` 43 InMemory string `json:"in_memory,omitempty"` 44 VersionCheckDisabled bool `json:"version_check_disabled,omitempty"` 45 Etcd ControllerConfigDbEtcd `json:"etcd,omitempty"` 46 } 47 48 type ControllerConfigDebug struct { 49 ConsoleEnabled bool `json:"console_enabled,omitempty"` 50 } 51 52 type ControllerConfigHttp struct { 53 Enabled bool `json:"enabled,omitempty"` 54 ListenAddress string `json:"listen_address,omitempty"` 55 Port int32 `json:"port,omitempty"` 56 } 57 58 type ControllerConfigHttps struct { 59 Enabled bool `json:"enabled,omitempty"` 60 ListenAddress string `json:"listen_address,omitempty"` 61 Port int32 `json:"port,omitempty"` 62 Keystore string `json:"keystore,omitempty"` 63 KeystorePassword string `json:"keystore_password,omitempty"` 64 Truststore string `json:"truststore,omitempty"` 65 TruststorePassword string `json:"truststore_password,omitempty"` 66 } 67 68 type ControllerConfigLdap struct { 69 Enabled bool `json:"enabled,omitempty"` 70 PublicAccessAllowed bool `json:"public_access_allowed,omitempty"` 71 Uri string `json:"uri,omitempty"` 72 Dn string `json:"dn,omitempty"` 73 SearchBase string `json:"search_base,omitempty"` 74 SearchFilter string `json:"search_filter,omitempty"` 75 } 76 77 type ControllerConfigLog struct { 78 PrintStackTrace bool `json:"print_stack_trace,omitempty"` 79 Directory string `json:"directory,omitempty"` 80 Level LogLevel `json:"level,omitempty"` 81 LevelGlobal LogLevel `json:"level_global,omitempty"` 82 LevelLinstor LogLevel `json:"level_linstor,omitempty"` 83 LevelLinstorGlobal LogLevel `json:"level_linstor_global,omitempty"` 84 RestAccessLogPath string `json:"rest_access_log_path,omitempty"` 85 RestAccessMode string `json:"rest_access_mode,omitempty"` 86 } 87 88 // SatelliteConfig struct for SatelliteConfig 89 type SatelliteConfig struct { 90 Config ControllerConfigConfig `json:"config,omitempty"` 91 Debug ControllerConfigDebug `json:"debug,omitempty"` 92 Log SatelliteConfigLog `json:"log,omitempty"` 93 StltOverrideNodeName string `json:"stlt_override_node_name,omitempty"` 94 RemoteSpdk bool `json:"remote_spdk,omitempty"` 95 Ebs bool `json:"ebs,omitempty"` 96 SpecialSatellite bool `json:"special_satellite,omitempty"` 97 DrbdKeepResPattern string `json:"drbd_keep_res_pattern,omitempty"` 98 Net SatelliteConfigNet `json:"net,omitempty"` 99 } 100 101 // SatelliteConfigLog struct for SatelliteConfigLog 102 type SatelliteConfigLog struct { 103 PrintStackTrace bool `json:"print_stack_trace,omitempty"` 104 Directory string `json:"directory,omitempty"` 105 Level LogLevel `json:"level,omitempty"` 106 LevelLinstor LogLevel `json:"level_linstor,omitempty"` 107 } 108 109 // SatelliteConfigNet struct for SatelliteConfigNet 110 type SatelliteConfigNet struct { 111 BindAddress string `json:"bind_address,omitempty"` 112 Port int32 `json:"port,omitempty"` 113 ComType string `json:"com_type,omitempty"` 114 } 115 116 type LogLevel string 117 118 // List of LogLevel 119 const ( 120 ERROR LogLevel = "ERROR" 121 WARN LogLevel = "WARN" 122 INFO LogLevel = "INFO" 123 DEBUG LogLevel = "DEBUG" 124 TRACE LogLevel = "TRACE" 125 )