@@ -86,16 +86,16 @@ When invoked with '--env-config' flag it can read the data contained in the give
86
86
87
87
//Create the environment according to the config
88
88
for _ , lab := range environment .Labs {
89
- labID := createObject ("lab" , tag .Id , lab .Name )
89
+ labID := createObject ("lab" , tag .ID , lab .Name )
90
90
for _ , agent := range lab .Agents {
91
- agentID := createObject ("agent" , tag .Id , agent .Name , agent .DataDir , strconv .Itoa (labID ))
91
+ agentID := createObject ("agent" , tag .ID , agent .Name , agent .DataDir , strconv .Itoa (labID ))
92
92
for _ , engine := range agent .Engines {
93
- engineID := createObject ("engine" , tag .Id , engine .Name , engine .engineID , strconv .Itoa (agentID ))
93
+ engineID := createObject ("engine" , tag .ID , engine .Name , engine .engineID , strconv .Itoa (agentID ))
94
94
for _ , endpoint := range engine .Endpoints {
95
- createObject ("endpoint" , tag .Id , endpoint .Name , endpoint .Address , endpoint .Protocol , strconv .Itoa (engineID ))
95
+ createObject ("endpoint" , tag .ID , endpoint .Name , endpoint .Address , endpoint .Protocol , strconv .Itoa (engineID ))
96
96
}
97
97
for _ , user := range engine .Users {
98
- createObject ("user" , tag .Id , user .Name , user .User , user .AuthKey , user .AuthProto , user .PrivKey , user .PrivProto , strconv .Itoa (engineID ))
98
+ createObject ("user" , tag .ID , user .Name , user .User , user .AuthKey , user .AuthProto , user .PrivKey , user .PrivProto , strconv .Itoa (engineID ))
99
99
}
100
100
}
101
101
}
@@ -137,13 +137,13 @@ When invoked with '--env-config' flag it can read the data contained in the give
137
137
}
138
138
139
139
for _ , object := range objects {
140
- createObjects (object , objectFields [object ], tag .Id )
140
+ createObjects (object , objectFields [object ], tag .ID )
141
141
}
142
142
}
143
143
144
144
fmt .Print ("\n " )
145
145
fmt .Println ("Environment" , tag .Name , "has been created successfully." )
146
- fmt .Println ("Id" , tag .Id )
146
+ fmt .Println ("Id" , tag .ID )
147
147
},
148
148
}
149
149
@@ -253,8 +253,8 @@ func createObject(objectType string, tagID int, args ...string) int {
253
253
Msg ("Error while creating lab" )
254
254
os .Exit (1 )
255
255
}
256
- fmt .Println ("Lab" , args [0 ], "has been created with the id" , lab .Id )
257
- id = lab .Id
256
+ fmt .Println ("Lab" , args [0 ], "has been created with the id" , lab .ID )
257
+ id = lab .ID
258
258
case "agent" :
259
259
//Create a tagged agent
260
260
agent , err := client .CreateAgentWithTag (args [0 ], args [1 ], tagID )
@@ -263,7 +263,7 @@ func createObject(objectType string, tagID int, args ...string) int {
263
263
Msg ("Error while creating agent" )
264
264
os .Exit (1 )
265
265
}
266
- fmt .Println ("Agent" , args [0 ], "has been created with the id" , agent .Id )
266
+ fmt .Println ("Agent" , args [0 ], "has been created with the id" , agent .ID )
267
267
268
268
//Read in the lab-id
269
269
labID , err := strconv .Atoi (args [2 ])
@@ -274,14 +274,14 @@ func createObject(objectType string, tagID int, args ...string) int {
274
274
}
275
275
276
276
//Add the agent to the lab
277
- err = client .AddAgentToLab (labID , agent .Id )
277
+ err = client .AddAgentToLab (labID , agent .ID )
278
278
if err != nil {
279
279
log .Error ().
280
280
Msg ("Error while adding agent to lab" )
281
281
os .Exit (1 )
282
282
}
283
- fmt .Println ("Agent" , agent .Id , "has been added to lab" , labID )
284
- id = agent .Id
283
+ fmt .Println ("Agent" , agent .ID , "has been added to lab" , labID )
284
+ id = agent .ID
285
285
case "engine" :
286
286
//Create a tagged engine
287
287
engine , err := client .CreateEngineWithTag (args [0 ], args [1 ], tagID )
@@ -290,7 +290,7 @@ func createObject(objectType string, tagID int, args ...string) int {
290
290
Msg ("Error while creating engine" )
291
291
os .Exit (1 )
292
292
}
293
- fmt .Println ("Engine" , args [0 ], "has been created with the id" , engine .Id )
293
+ fmt .Println ("Engine" , args [0 ], "has been created with the id" , engine .ID )
294
294
295
295
//Read in the agent-id
296
296
agentID , err := strconv .Atoi (args [2 ])
@@ -301,14 +301,14 @@ func createObject(objectType string, tagID int, args ...string) int {
301
301
}
302
302
303
303
//Add the engine to the agent
304
- err = client .AddEngineToAgent (agentID , engine .Id )
304
+ err = client .AddEngineToAgent (agentID , engine .ID )
305
305
if err != nil {
306
306
log .Error ().
307
307
Msg ("Error while adding engine to agent" )
308
308
os .Exit (1 )
309
309
}
310
- fmt .Println ("Engine" , engine .Id , "has been added to agent" , agentID )
311
- id = engine .Id
310
+ fmt .Println ("Engine" , engine .ID , "has been added to agent" , agentID )
311
+ id = engine .ID
312
312
case "endpoint" :
313
313
//Create a tagged endpoint
314
314
endpoint , err := client .CreateEndpointWithTag (args [0 ], args [1 ], args [2 ], tagID )
@@ -317,7 +317,7 @@ func createObject(objectType string, tagID int, args ...string) int {
317
317
Msg ("Error while creating endpoint" )
318
318
os .Exit (1 )
319
319
}
320
- fmt .Println ("Endpoint" , args [0 ], "has been created with the id" , endpoint .Id )
320
+ fmt .Println ("Endpoint" , args [0 ], "has been created with the id" , endpoint .ID )
321
321
322
322
//Read in the engine-id
323
323
engineID , err := strconv .Atoi (args [3 ])
@@ -328,14 +328,14 @@ func createObject(objectType string, tagID int, args ...string) int {
328
328
}
329
329
330
330
//Add the endpoint to the engine
331
- err = client .AddEndpointToEngine (engineID , endpoint .Id )
331
+ err = client .AddEndpointToEngine (engineID , endpoint .ID )
332
332
if err != nil {
333
333
log .Error ().
334
334
Msg ("Error while adding endpoint to engine" )
335
335
os .Exit (1 )
336
336
}
337
- fmt .Println ("Endpoint" , endpoint .Id , "has been added to engine" , engineID )
338
- id = endpoint .Id
337
+ fmt .Println ("Endpoint" , endpoint .ID , "has been added to engine" , engineID )
338
+ id = endpoint .ID
339
339
case "user" :
340
340
//Create a tagged user
341
341
user , err := client .CreateUserWithTag (args [0 ], args [1 ], args [2 ], args [3 ], args [4 ], args [5 ], tagID )
@@ -344,7 +344,7 @@ func createObject(objectType string, tagID int, args ...string) int {
344
344
Msg ("Error while creating user" )
345
345
os .Exit (1 )
346
346
}
347
- fmt .Println ("User" , args [0 ], "has been created with the id" , user .Id )
347
+ fmt .Println ("User" , args [0 ], "has been created with the id" , user .ID )
348
348
349
349
//Read in the engine-id
350
350
engineID , err := strconv .Atoi (args [6 ])
@@ -355,14 +355,14 @@ func createObject(objectType string, tagID int, args ...string) int {
355
355
}
356
356
357
357
//Add the user to the engine
358
- err = client .AddUserToEngine (engineID , user .Id )
358
+ err = client .AddUserToEngine (engineID , user .ID )
359
359
if err != nil {
360
360
log .Error ().
361
361
Msg ("Error while adding user to engine" )
362
362
os .Exit (1 )
363
363
}
364
- fmt .Println ("User" , user .Id , "has been added to engine" , engineID )
365
- id = user .Id
364
+ fmt .Println ("User" , user .ID , "has been added to engine" , engineID )
365
+ id = user .ID
366
366
default :
367
367
log .Debug ().
368
368
Msg ("Invalid object-type " + objectType )
0 commit comments