-
Notifications
You must be signed in to change notification settings - Fork 174
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
Tags: Add session export/import capabilities #7464
Conversation
This adds session ID export/import functionality to facilitate session re-use. This is important during highly concurrent or successive operations to prevent the REST API from returning errors.
It's a POST, not a GET.
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.
Looks good to me, but would like @dougm to review this too.
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.
Very nice, had been hoping to see this functionality (#6376 (comment))
Thanks all! Just made a couple of grammar fixes to the function docs too. |
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.
Approved.
@dougm I would like to discuss moving the tags package into govmomi.
It's a misnomer given it's not part of vmomi so I'm somewhat on the fence, but govmomi is being used to expose various function beyond the vmomi API already iirc and this is at the same functional level.
@hickeng yes, had started discussing this with @markpeek and others. There have also been requests for govc to support tags vmware/govmomi#957 and content library vmware/govmomi#735 |
Codecov Report
@@ Coverage Diff @@
## master #7464 +/- ##
=========================================
+ Coverage 31.42% 31.5% +0.08%
=========================================
Files 282 282
Lines 42168 42168
=========================================
+ Hits 13252 13287 +35
+ Misses 27757 27720 -37
- Partials 1159 1161 +2
Continue to review full report at Codecov.
|
This adds session ID export/import functionality to facilitate session re-use. This is important during highly concurrent or successive operations to prevent the REST API from returning errors.
This adds session ID export/import functionality to facilitate session re-use. This is important during highly concurrent or successive operations to prevent the REST API from returning errors.
This creates helpers for exporting session IDs out of the
tag
package's REST client.This allows programs to re-use sessions that are created using the REST client (a feature that already exists in https://github.com/vmware/govmomi/tree/master/govc), allowing clients that make use of the features to scale to a large amount of operations made over multiple single invocations of an external program - without stressing the server - by ensuring that new sessions are not created for every operation.
The functionality is a simple export of the session cookie value and a re-import of the cookie after the fact.
Valid
checks against the existing session using the?~action=get
query string to verify validity.This is being done as we are having issues in https://github.com/terraform-providers/terraform-provider-vsphere that seem to be coming up due to rejected logins in the middle of a full sweep of our acceptance tests, which due to how they are run, end up running a brand new instance of the provider connection several times, even during a single test. We hit session limits in the SOAP API and the error messages from the REST API such as
Rejecting login on a session where login failed
leads me to believe that a similar thing is happening in the REST API.