Vendor Passthru support for Subscriptions#2201
Conversation
|
Build failed.
|
|
openlab-ci seems to be broken =( |
|
Indeed. I've been meaning to open an Issue about this. I'll try to get to that today. |
3b3547c to
d291de6
Compare
|
Build failed.
|
|
@iurygregory Thanks for submitting this. At first review, I think the pattern being used here is too "high level" for Gophercloud and I couldn't find an existing similar implementation. Gophercloud should have relatively simple and low level API calls with little logic used to build the request. In this case, I suggest having each function require a Another possible option would be to combine type CreateSubscriptionOpts struct {
Method string `q:"method"`
Destination string `json:"Destination"`
EventTypes []string `json:"EventTypes,omitempty"`
Context string `json:"Context,omitempty"`
Protocol string `json:"Protocol,omitempty"`
}You can then call two methods on the struct: one to create the query string and one to create the request body. It's still not a clean, intuitive solution, though. I understand that this makes calling the functions rather awkward, but the way these routes are designed seem to be a little different than most. Let me know if you have any questions or would like to discuss further. |
|
Hi @jtopjian , thanks for the feedback! |
|
Having the Method inside the same struct was causing gophercloud to send as part of the request, I'm trying now to add CallVendorPassthruOpts as parameter for each function. |
d291de6 to
9c7c2d7
Compare
|
Build failed.
|
|
@iurygregory Thanks for making those changes. This code looks good to me, though I'm not familiar with Ironic. Have you been able to test this on a running Ironic service? If it works the way you're expecting, I can go ahead and merge this. |
This commit adds support for the following vendor passthru methods: - create_subscription - delete_subscription - get_subscription - get_all_subscriptions This methods are only supported by redfish implementations in ironic that are using the vendor passthru.
|
Hi @jtopjian I've tested and I've found one small issue in the delete - ironic returns 200, so I've added All other actions are working as expected, I'm pushing a new commit to address the problem with delete and it should be fine. Thanks! |
9c7c2d7 to
d9ea55c
Compare
|
Build failed.
|
|
@jtopjian let me know if there is something else I should do, thanks! =) |
|
@iurygregory Everything looks good. Sorry for the delay! |
|
@jtopjian Thanks! If possible can you publish a tag with this feature? It would make things easier to do the changes in metal3. |
|
@iurygregory Sure, I don't mind making a release for this. Do you have any additional PRs planned? If so, I can wait. But if not, I will create a release now. |
|
@jtopjian I've checked with some folks today, for now this would be the only PR we need to start working on the feature =) |
|
@iurygregory Sounds good. v0.20.0 has been created. |
For #1429
This PR adds support for the following vendor passthru methods:
This methods are only supported by redfish implementations in ironic
that are using the vendor passthru.
Introduced in Ironic in change 801064