-
Notifications
You must be signed in to change notification settings - Fork 118
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
Support event subscription and submitTestEvent for various vendors #187
Conversation
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.
Imports still need to be cleaned up. Make sure to run make
or make lint
locally.
Looks like some local files were accidentally included.
References to oem code still need to be removed from the core.
2431ad0
to
bf88f9e
Compare
Hi Sean,
I tried to run goimports -w on these files, to no avail. what to do?
|
4d96540
to
8a200b8
Compare
all done and ready to merge? |
.gitignore
Outdated
@@ -15,3 +15,4 @@ bin/* | |||
**/gofiles/* | |||
**/*.zip | |||
**/DSP* | |||
.idea/ |
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.
Please remove this line. See header at top of file.
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
oem/zt/zt.go
Outdated
ID int `json:"ID"` | ||
Name string `json:"Name"` | ||
Protocol string `json:"Protocol"` | ||
common.Status `json:"Status"` |
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.
This doesn't look right. Defined this way, the properties of the Status
struct are direct properties of the response type. But according to the JSON in the test code, there should be a Status
property of type common.Status
.
So current definition is:
{
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
But the example from the test JSON is:
{
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
}
}
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
oem/zt/zt.go
Outdated
} | ||
|
||
// SubmitTestEvent sends event according to msgId and returns error. | ||
func SubmitTestEvent(client common.Client, msgID string) error { |
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.
Sorry, looking closer here and notice this isn't quite right yet either. Like the example given earlier, these calls need to be done on OEM versions of the standard objects. So you would get an EventService
instance, then to access the OEM specific implementations for that you would need to get the right version. Something like:
eventService, _ := x.EventService()
ztEventService, _ := zt.FromEventService(eventService)
ztEventService.SubmitTestEvent("my message")
So there still needs to be a ZTEventService
defined, then this would be a call on an instance of that object.
https://github.com/stmcginnis/gofish/blob/main/redfish/eventservice.go#L334
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.
I think its ok now. please provide feedback if not
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.
Still a few issues, but I will clean up with a follow up. Thanks for working through all of this!
No description provided.