Skip to content

Commit

Permalink
turns out stage names are useful information, so let's keep it
Browse files Browse the repository at this point in the history
  • Loading branch information
rajagopalans committed Oct 14, 2023
1 parent 29acb3e commit d36959a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
37 changes: 19 additions & 18 deletions apstra/api_iba_probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,25 @@ const (
)

type IbaProbe struct {
Id ObjectId `json:"id"`
Label string `json:"label"`
TaskError string `json:"task_error"`
AnomalyCount int `json:"anomaly_count"`
Tags []string `json:"tags"`
LastError interface{} `json:"last_error"`
UpdatedAt string `json:"updated_at"`
UpdatedBy string `json:"updated_by"`
Disabled bool `json:"disabled"`
ConfigCompletedAt string `json:"config_completed_at"`
State string `json:"state"`
Version int `json:"version"`
HostNode string `json:"host_node"`
TaskState string `json:"task_state"`
ConfigStartedAt string `json:"config_started_at"`
IbaUnit string `json:"iba_unit"`
PredefinedProbe string `json:"predefined_probe"`
Description string `json:"description"`
Id ObjectId `json:"id"`
Label string `json:"label"`
TaskError string `json:"task_error"`
Stages []map[string]interface{} `json:"stages"`
AnomalyCount int `json:"anomaly_count"`
Tags []string `json:"tags"`
LastError interface{} `json:"last_error"`
UpdatedAt string `json:"updated_at"`
UpdatedBy string `json:"updated_by"`
Disabled bool `json:"disabled"`
ConfigCompletedAt string `json:"config_completed_at"`
State string `json:"state"`
Version int `json:"version"`
HostNode string `json:"host_node"`
TaskState string `json:"task_state"`
ConfigStartedAt string `json:"config_started_at"`
IbaUnit string `json:"iba_unit"`
PredefinedProbe string `json:"predefined_probe"`
Description string `json:"description"`
}

func (o *Client) getAllIbaProbes(ctx context.Context, bpId ObjectId) ([]IbaProbe, error) {
Expand Down
5 changes: 3 additions & 2 deletions apstra/api_iba_probes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ func TestIbaProbes(t *testing.T) {
t.Logf("Description %s", p.Description)
t.Log(p)
t.Logf("Delete probe")
for _, i := range p.Stages {
t.Logf("Stage name %s", i["name"])
}
err = bpClient.DeleteIbaProbe(ctx, probeId)
if err != nil {
t.Fatal(err)
}

t.Logf("Delete Probe again, this should fail")

err = bpClient.DeleteIbaProbe(ctx, probeId)
if err == nil {
t.Fatal("Probe Deletion should have failed")
Expand Down

0 comments on commit d36959a

Please sign in to comment.