-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add get/list probe command #204
Conversation
there seems to be some permission issue in pre-commit file |
Yep I'll check that. We have to manually give permissions I'll check to automate it. |
b87fc6f
to
22f1d1d
Compare
two things:
|
|
|
pkg/cmd/get/probe.go
Outdated
utils.White.Fprintln(writer, "CREATED BY\t", probeGetData.CreatedBy.Username) | ||
utils.White.Fprintln(writer, "UPDATED AT\t", updatedTime) | ||
utils.White.Fprintln(writer, "UPDATED BY\t", probeGetData.UpdatedBy.Username) | ||
utils.White.Fprintln(writer, "TAGS\t", strings.Join(probeGetData.Tags, ", ")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we print all properties for a specific probe type, for e.g if HTTP probe prints URL, Criteria etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printed all the properties for different probe types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please share a screenshot for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./litmusctl get probes --project-id="8adf62d5-64f8-4c66-ab53-63729db9dd9a" --probe-id="shivamcmd"
PROBE DETAILS
PROBE ID shivamcmd
PROBE DESCRIPTION
PROBE TYPE cmdProbe
PROBE INFRASTRUCTURE TYPE Kubernetes
TIMEOUT 1s
INTERVAL 1s
CREATED AT 56175-10-19 08:28:39 +0530 IST
CREATED BY admin
UPDATED AT 56175-10-19 08:28:39 +0530 IST
UPDATED BY admin
TAGS
./litmusctl get probes --project-id="8adf62d5-64f8-4c66-ab53-63729db9dd9a"
✔ No
You chose "No"
PROBE ID PROBE TYPE CREATED AT CREATED BY
http probe test httpProbe admin 56047-11-12 19:12:28 +0530 IST
newhttp httpProbe admin 56142-12-05 08:29:41 +0530 IST
shivam99 httpProbe admin 56175-07-01 21:35:07 +0530 IST
shivamcmd cmdProbe admin 56175-10-19 08:28:39 +0530 IST
shivamcmd1 cmdProbe admin 56176-02-14 18:40:30 +0530 IST
Press Enter to show more probes (or type 'q' to quit): q
|
||
var probesCmd = &cobra.Command{ | ||
Use: "probes", | ||
Short: "Display list of probes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can write this: "Display a list or a specific probe"
WDYT @SarthakJain26 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about "Details of a specific probe" we can avoid using "list"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but we are now majorly listing the probes and giving few details if passed probe_id. We are using describe for that right?
} | ||
ProbeID, err := cmd.Flags().GetString("probe-id") | ||
|
||
if ProbeID == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shivam-Purohit , please try to split the functions into multiple small functions, it will help in reducing the cognitive complexity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done PTAL
7cb686f
to
fadf760
Compare
its failing as soon as i rebased the master. But was working fine on local. what should i do? Edit : fixed |
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
5e60dfb
to
e2e6e5b
Compare
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
kubernetesHTTPProperties{ | ||
probeTimeout | ||
interval | ||
retry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we using all the properties? If not, then we can consider removing them from query
pkg/cmd/get/probe.go
Outdated
totalProbes := len(probes_data) | ||
|
||
writer := tabwriter.NewWriter(os.Stdout, 8, 8, 8, '\t', tabwriter.AlignRight) | ||
utils.White_B.Fprintln(writer, "PROBE ID\t PROBE TYPE\t CREATED BY\t CREATED AT") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have referencedBy
also here ( as we also show this UI Overview )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done you can take a look
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
Signed-off-by: Shivam Purohit <[email protected]>
closes #176
This will add a new command to litmusctl that will enable the user to get the created probes in a given project