You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: main.go
+71-28Lines changed: 71 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -29,32 +29,38 @@ import (
29
29
"google.golang.org/protobuf/proto"
30
30
)
31
31
32
-
varasConfigFilestring
33
-
varcsConfigFilestring
34
-
varnsConfigFiles []string
35
-
vardevEUIListFilestring
36
-
varcsSessionTTLint
37
-
vardropTenantAndUsersbool
38
-
varmigrateUsersbool
39
-
varmigrateTenantsbool
40
-
varmigrateApplicationsbool
41
-
varmigrateGatewaysbool
42
-
varmigrateDeviceProfilesbool
43
-
varmigrateDevicesbool
44
-
varmigrateGatewayMetricsbool
45
-
varmigrateDeviceMetricsbool
32
+
// CLI parameters
33
+
var (
34
+
asConfigFilestring
35
+
csConfigFilestring
36
+
nsConfigFiles []string
37
+
deviceProfileIDListFilestring
38
+
devEUIListFilestring
39
+
csSessionTTLint
40
+
dropTenantAndUsersbool
41
+
migrateUsersbool
42
+
migrateTenantsbool
43
+
migrateApplicationsbool
44
+
migrateGatewaysbool
45
+
migrateDeviceProfilesbool
46
+
migrateDevicesbool
47
+
migrateGatewayMetricsbool
48
+
migrateDeviceMetricsbool
49
+
)
46
50
51
+
// Internal state
47
52
var (
48
-
nsDB*sqlx.DB
49
-
asDB*sqlx.DB
50
-
csDB*sqlx.DB
51
-
nsRedis redis.UniversalClient
52
-
asRedis redis.UniversalClient
53
-
csRedis redis.UniversalClient
54
-
nsPrefixstring
55
-
asPrefixstring
56
-
csPrefixstring
57
-
devEUIsList [][]byte
53
+
nsDB*sqlx.DB
54
+
asDB*sqlx.DB
55
+
csDB*sqlx.DB
56
+
nsRedis redis.UniversalClient
57
+
asRedis redis.UniversalClient
58
+
csRedis redis.UniversalClient
59
+
nsPrefixstring
60
+
asPrefixstring
61
+
csPrefixstring
62
+
devEUIsList [][]byte
63
+
deviceProfileIDList []uuid.UUID
58
64
)
59
65
60
66
varrootCmd=&cobra.Command{
@@ -85,6 +91,7 @@ func init() {
85
91
rootCmd.PersistentFlags().StringVarP(&asConfigFile, "as-config-file", "", "", "Path to chirpstack-application-server.toml configuration file")
86
92
rootCmd.PersistentFlags().StringArrayVarP(&nsConfigFiles, "ns-config-file", "", []string{}, "Path to chirpstack-network-server.toml configuration file (can be repeated)")
87
93
rootCmd.PersistentFlags().StringVarP(&devEUIListFile, "deveui-list-file", "", "", "Path to file containing DevEUIs to migrate (one DevEUI per line)")
94
+
rootCmd.PersistentFlags().StringVarP(&deviceProfileIDListFile, "device-profile-id-list-file", "", "", "Path to file containing list of Device Profile IDs to migrate (one per line)")
88
95
rootCmd.PersistentFlags().IntVarP(&csSessionTTL, "device-session-ttl-days", "", 31, "Device-session TTL in days")
89
96
rootCmd.PersistentFlags().BoolVarP(&dropTenantAndUsers, "drop-tenants-and-users", "", false, "Drop tenants and users before migration")
0 commit comments