-
Notifications
You must be signed in to change notification settings - Fork 6
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 morpheus_details data-source #255
Merged
reubenur-rahman
merged 9 commits into
HewlettPackard:master
from
eamonnotoole:morpheus-token-data-source
Sep 25, 2024
Merged
Add morpheus_details data-source #255
reubenur-rahman
merged 9 commits into
HewlettPackard:master
from
eamonnotoole:morpheus-token-data-source
Sep 25, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mahesh-hpe
reviewed
Sep 13, 2024
mahesh-hpe
reviewed
Sep 13, 2024
mahesh-hpe
reviewed
Sep 13, 2024
mahesh-hpe
reviewed
Sep 13, 2024
mahesh-hpe
reviewed
Sep 13, 2024
mahesh-hpe
reviewed
Sep 13, 2024
mahesh-hpe
reviewed
Sep 13, 2024
In this PR we add a data-source to fetch details for an on-prem Morpheus deployment. These details are: - access_token - access_token_expires_in - morpheus_url This data-source can be used to set the url and access_token fields in a Morpheus provider stanza, and should make it easier for customers to use the Morpheus provider with VMaaS deployments. The data-source is named hpegl_vmaas_morpheus_details The changes: - we've added tf examples in the examples directory - minimal.tf showing just one hpegl stanza for one location and/or space-name - multiple.tf showing two hpegl stanzas for two locations - we've added a tfdocs template that makes use of these examples in templates/data-sources/vmaas_morpheus_details.md.tmpl - we've added a definition of the data-source to resources/data_source_morpheus_token_broker.go - we've added a definition of a BrokerClient with a MorpheusDetails data-source to internal/cmp/broker_client.go - this BrokerClient is initialised with an APIClient instance created for the Broker API and a corresponding Configuration - we've added a newMorhpeusBroker definition in internal/cmp/morpheus_datasource_broker.go which is used in the above initialisation - we add a broker_url to the VMaaS provider block - we add the Broker Client to pgk/client - we add BrokerClient to the Client struct - we create the BrokerClient in NewClient - we add X-Tenant-ID to the headers for the BrokerClient - we don't add any default query parameters - we create a NewAPIClient with the broker_url - we create a new Configuration for the Broker, the main use of this configuration is to define the query parameters for use with one of the Broker API calls - we pass the Broker API Client and this new Configuration to the constructor defined in internal/cmp/broker_client.go
eamonnotoole
force-pushed
the
morpheus-token-data-source
branch
from
September 16, 2024 16:44
14203a5
to
d9a5ee5
Compare
We've changed the MorpheusDetails response from the SDK, and we adapt the data-source definition and and API Read implementation accordingly.
This version of the SDK supports creation of the Broker API Client. We've updated the fields returned from the data-source.
mahesh-hpe
reviewed
Sep 19, 2024
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.
Pl add tf acceptance test, inside acceptance_test
folder
We add an acceptance test to internal/acceptance_test. We've had to add a new helper function getBrokerAPIClient() and move some shared code into getHeadersAndQueryParamsAndIAMVersion() and apiClientSetMeta().
Fixed name of test file and added acc-testcases/data-sources/morpheus_details.yaml
Acceptance test execution:
|
Existing acceptance tests:
|
mahesh-hpe
reviewed
Sep 20, 2024
mahesh-hpe
approved these changes
Sep 23, 2024
manjunath-batakurki
approved these changes
Sep 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR we add a data-source to fetch details for an on-prem Morpheus deployment. These details are:
This data-source can be used to set the url and access_token fields in a Morpheus provider stanza, and should make it easier for customers to use the Morpheus provider with VMaaS deployments.
The data-source is named hpegl_vmaas_morpheus_details
The changes: