Skip to content

Commit 391cd1e

Browse files
committed
Updated go.mod and deps
1 parent eaf7889 commit 391cd1e

File tree

10 files changed

+44
-43
lines changed

10 files changed

+44
-43
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module snmpsim-cli-manager
33
go 1.13
44

55
require (
6-
github.com/inexio/snmpsim-restapi-go-client v0.0.0-20200311131246-b484400d0e35
6+
github.com/inexio/snmpsim-restapi-go-client v0.0.0-20200414104837-83f8f76352de
77
github.com/rs/zerolog v1.18.0
88
github.com/spf13/cobra v0.0.5
99
github.com/spf13/viper v1.6.2

go.sum

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
1717
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
1818
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
1919
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
20+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2021
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2122
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
2223
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
@@ -50,8 +51,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
5051
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
5152
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
5253
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
53-
github.com/inexio/snmpsim-restapi-go-client v0.0.0-20200311131246-b484400d0e35 h1:adCxMQCFIdvJ6UAvQWDxqN+FA/zAAwITAxbVvTNsqFQ=
54-
github.com/inexio/snmpsim-restapi-go-client v0.0.0-20200311131246-b484400d0e35/go.mod h1:LcMZvVsZoVd7g2gkHd4B1ZQTNdS1/71RPm7ejPL7TJY=
54+
github.com/inexio/snmpsim-restapi-go-client v0.0.0-20200414104837-83f8f76352de h1:Mn1wZ6MAqyHVK3+0BasqnWEEqnyUzvwqzZ57K7xByOI=
55+
github.com/inexio/snmpsim-restapi-go-client v0.0.0-20200414104837-83f8f76352de/go.mod h1:LcMZvVsZoVd7g2gkHd4B1ZQTNdS1/71RPm7ejPL7TJY=
5556
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
5657
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
5758
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=

snmpsim/cmd/createSubcommands/createAgent.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var CreateAgentCmd = &cobra.Command{
8181
}
8282

8383
fmt.Println("Successfully created agent.")
84-
fmt.Println("Id:", agent.Id)
84+
fmt.Println("Id:", agent.ID)
8585

8686
//Add agent to lab (if lab flag is set)
8787
if cmd.Flag("lab").Changed {
@@ -102,13 +102,13 @@ var CreateAgentCmd = &cobra.Command{
102102
}
103103

104104
//Add agent to lab
105-
err = client.AddAgentToLab(labID, agent.Id)
105+
err = client.AddAgentToLab(labID, agent.ID)
106106
if err != nil {
107107
log.Error().
108108
Msg("Error while adding agent to lab")
109109
os.Exit(1)
110110
}
111-
fmt.Println("Successfully added agent", agent.Id, "to lab", labID)
111+
fmt.Println("Successfully added agent", agent.ID, "to lab", labID)
112112
}
113113
},
114114
}

snmpsim/cmd/createSubcommands/createEndpoint.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var CreateEndpointCmd = &cobra.Command{
8282
}
8383

8484
fmt.Println("Endpoint has been created successfully.")
85-
fmt.Println("Id:", endpoint.Id)
85+
fmt.Println("Id:", endpoint.ID)
8686

8787
//Add endpoint to engine (if engine flag is set)
8888
if cmd.Flag("engine").Changed {
@@ -103,13 +103,13 @@ var CreateEndpointCmd = &cobra.Command{
103103
}
104104

105105
//Add endpoint to engine
106-
err = client.AddEndpointToEngine(engineID, endpoint.Id)
106+
err = client.AddEndpointToEngine(engineID, endpoint.ID)
107107
if err != nil {
108108
log.Error().
109109
Msg("Error while adding endpoint to engine")
110110
os.Exit(1)
111111
}
112-
fmt.Println("Successfully added endpoint", endpoint.Id, "to engine", engineID)
112+
fmt.Println("Successfully added endpoint", endpoint.ID, "to engine", engineID)
113113
}
114114
},
115115
}

snmpsim/cmd/createSubcommands/createEngine.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var CreateEngineCmd = &cobra.Command{
8181
}
8282

8383
fmt.Println("Engine has been created successfully.")
84-
fmt.Println("Id:", engine.Id)
84+
fmt.Println("Id:", engine.ID)
8585

8686
//Add engine to agent (if agent flag is set)
8787
if cmd.Flag("agent").Changed {
@@ -102,13 +102,13 @@ var CreateEngineCmd = &cobra.Command{
102102
}
103103

104104
//Add engine to agent
105-
err = client.AddEngineToAgent(agentID, engine.Id)
105+
err = client.AddEngineToAgent(agentID, engine.ID)
106106
if err != nil {
107107
log.Error().
108108
Msg("Error while adding engine to agent")
109109
os.Exit(1)
110110
}
111-
fmt.Println("Successfully added engine", engine.Id, "to agent ", agentID)
111+
fmt.Println("Successfully added engine", engine.ID, "to agent ", agentID)
112112
}
113113
},
114114
}

snmpsim/cmd/createSubcommands/createLab.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ var CreateLabCmd = &cobra.Command{
8080
}
8181

8282
fmt.Println("Lab has been created successfully.")
83-
fmt.Println("Id:", lab.Id)
83+
fmt.Println("Id:", lab.ID)
8484
},
8585
}
8686

snmpsim/cmd/createSubcommands/createTag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var CreateTagCmd = &cobra.Command{
4949
}
5050

5151
fmt.Println("Tag has been created successfully.")
52-
fmt.Println("Id:", tag.Id)
52+
fmt.Println("Id:", tag.ID)
5353
},
5454
}
5555

snmpsim/cmd/createSubcommands/createUser.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var CreateUserCmd = &cobra.Command{
8585
}
8686

8787
fmt.Println("User has been created successfully.")
88-
fmt.Println("Id:", user.Id)
88+
fmt.Println("Id:", user.ID)
8989

9090
//Add user to engine (if engine flag is set)
9191
if cmd.Flag("engine").Changed {
@@ -106,13 +106,13 @@ var CreateUserCmd = &cobra.Command{
106106
}
107107

108108
//Add user to engine
109-
err = client.AddUserToEngine(engineID, user.Id)
109+
err = client.AddUserToEngine(engineID, user.ID)
110110
if err != nil {
111111
log.Error().
112112
Msg("Error while adding user to engine")
113113
os.Exit(1)
114114
}
115-
fmt.Println("Successfully added user", user.Id, "to engine", engineID)
115+
fmt.Println("Successfully added user", user.ID, "to engine", engineID)
116116
}
117117
},
118118
}

snmpsim/cmd/deleteSubcommands/deleteTaggedObjects.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ var DeleteTaggedObjectsCmd = &cobra.Command{
5252
os.Exit(1)
5353
}
5454

55-
fmt.Println("All Objects tagged with", tag.Name, "(Id:", tag.Id, ") were deleted successfully.")
55+
fmt.Println("All Objects tagged with", tag.Name, "(Id:", tag.ID, ") were deleted successfully.")
5656
},
5757
}

snmpsim/cmd/setup-env.go

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ When invoked with '--env-config' flag it can read the data contained in the give
8686

8787
//Create the environment according to the config
8888
for _, lab := range environment.Labs {
89-
labID := createObject("lab", tag.Id, lab.Name)
89+
labID := createObject("lab", tag.ID, lab.Name)
9090
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))
9292
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))
9494
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))
9696
}
9797
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))
9999
}
100100
}
101101
}
@@ -137,13 +137,13 @@ When invoked with '--env-config' flag it can read the data contained in the give
137137
}
138138

139139
for _, object := range objects {
140-
createObjects(object, objectFields[object], tag.Id)
140+
createObjects(object, objectFields[object], tag.ID)
141141
}
142142
}
143143

144144
fmt.Print("\n")
145145
fmt.Println("Environment", tag.Name, "has been created successfully.")
146-
fmt.Println("Id", tag.Id)
146+
fmt.Println("Id", tag.ID)
147147
},
148148
}
149149

@@ -253,8 +253,8 @@ func createObject(objectType string, tagID int, args ...string) int {
253253
Msg("Error while creating lab")
254254
os.Exit(1)
255255
}
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
258258
case "agent":
259259
//Create a tagged agent
260260
agent, err := client.CreateAgentWithTag(args[0], args[1], tagID)
@@ -263,7 +263,7 @@ func createObject(objectType string, tagID int, args ...string) int {
263263
Msg("Error while creating agent")
264264
os.Exit(1)
265265
}
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)
267267

268268
//Read in the lab-id
269269
labID, err := strconv.Atoi(args[2])
@@ -274,14 +274,14 @@ func createObject(objectType string, tagID int, args ...string) int {
274274
}
275275

276276
//Add the agent to the lab
277-
err = client.AddAgentToLab(labID, agent.Id)
277+
err = client.AddAgentToLab(labID, agent.ID)
278278
if err != nil {
279279
log.Error().
280280
Msg("Error while adding agent to lab")
281281
os.Exit(1)
282282
}
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
285285
case "engine":
286286
//Create a tagged engine
287287
engine, err := client.CreateEngineWithTag(args[0], args[1], tagID)
@@ -290,7 +290,7 @@ func createObject(objectType string, tagID int, args ...string) int {
290290
Msg("Error while creating engine")
291291
os.Exit(1)
292292
}
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)
294294

295295
//Read in the agent-id
296296
agentID, err := strconv.Atoi(args[2])
@@ -301,14 +301,14 @@ func createObject(objectType string, tagID int, args ...string) int {
301301
}
302302

303303
//Add the engine to the agent
304-
err = client.AddEngineToAgent(agentID, engine.Id)
304+
err = client.AddEngineToAgent(agentID, engine.ID)
305305
if err != nil {
306306
log.Error().
307307
Msg("Error while adding engine to agent")
308308
os.Exit(1)
309309
}
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
312312
case "endpoint":
313313
//Create a tagged endpoint
314314
endpoint, err := client.CreateEndpointWithTag(args[0], args[1], args[2], tagID)
@@ -317,7 +317,7 @@ func createObject(objectType string, tagID int, args ...string) int {
317317
Msg("Error while creating endpoint")
318318
os.Exit(1)
319319
}
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)
321321

322322
//Read in the engine-id
323323
engineID, err := strconv.Atoi(args[3])
@@ -328,14 +328,14 @@ func createObject(objectType string, tagID int, args ...string) int {
328328
}
329329

330330
//Add the endpoint to the engine
331-
err = client.AddEndpointToEngine(engineID, endpoint.Id)
331+
err = client.AddEndpointToEngine(engineID, endpoint.ID)
332332
if err != nil {
333333
log.Error().
334334
Msg("Error while adding endpoint to engine")
335335
os.Exit(1)
336336
}
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
339339
case "user":
340340
//Create a tagged user
341341
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 {
344344
Msg("Error while creating user")
345345
os.Exit(1)
346346
}
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)
348348

349349
//Read in the engine-id
350350
engineID, err := strconv.Atoi(args[6])
@@ -355,14 +355,14 @@ func createObject(objectType string, tagID int, args ...string) int {
355355
}
356356

357357
//Add the user to the engine
358-
err = client.AddUserToEngine(engineID, user.Id)
358+
err = client.AddUserToEngine(engineID, user.ID)
359359
if err != nil {
360360
log.Error().
361361
Msg("Error while adding user to engine")
362362
os.Exit(1)
363363
}
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
366366
default:
367367
log.Debug().
368368
Msg("Invalid object-type " + objectType)

0 commit comments

Comments
 (0)