-
Notifications
You must be signed in to change notification settings - Fork 4
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 support for Broker API #78
Add support for Broker API #78
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.
Please add the test results, and also plan to include the test cases for the new api
@mahesh-hpe Thanks for the review. I've added unit-tests. @gandharvas Could you re-review as well? |
In this PR we add support for the Broker API. The Broker API will be used for two calls: - to get Subscription Details, from which we extract the Subscription ID and the Morpheus URL - to exchange the IAM API Client token for Morpheus access and refresh tokens The Morpheus URL and both tokens will then be returned to the calling terraform provider code. The Changes: - we add pkg/models/broker.go to define three structs, two for use with each broker API call and the third returned to the calling terraform provider code - we add pkg/client/broker.go to define the BrokerAPIService which implements GetMorpheusDetails, to make both broker API calls and return the details - we add a boolean removeVmaasCMPBasePath to pkg/client/api.go which is used to toggle removal of VmaasCmpAPIBasePath from the path if true (in the case of the broker API) or include it if false (in the case of the cmp API) - we add two methods to the APIClientHandler interface which will be used in broker client creation by the terraform provider code: - SetMetaFnAndVersion() which will be used to set the meta, tokenFunc and cmpVersion fields in APIClient, this avoids a call to the CMP API to get version information when initialising the Broker Client - GetSCMVersion() to return the CMP version when initialising the Broker Client after the CMP client, we add this as opposed to exporting the existing getVersion() to avoid approx 190 line changes - we add two constants to pkg/common used to set the Broker API paths
Signed-off-by: Eamonn O'Toole <[email protected]>
In this commit we add: - access_token_expires_in - refresh_token_expires
This is for use by the provider code.
We only add access_token and expires to MorpheusTokenResponse and MorpheusDetails.
5baf36d
to
c6c630e
Compare
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.
The changes look good, pl attach a screenshot of your test. Which can include the get morpheus details datasource call, and a vmaas cloud datasource call
|
|
In this PR we add support for the Broker API. The Broker API will be used for two calls:
The Morpheus URL and both tokens will then be returned to the calling terraform provider code.
The Changes: