Skip to content
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 to the Runtime Defined Entities (RDE) framework with RDEs (3/3) #544

Merged
merged 62 commits into from
Mar 21, 2023

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Jan 25, 2023

Overview

This PR implements the foundations to onboard the RDE framework to the Terraform VCD Provider, by adding CRUD capabilities of RDE instances.

Detailed description

This PR adds the following features:

RDE types

  • Adds the following methods to the existing DefinedEntityType type:
    • GetAllRdes to get all RDE instances from the given type, supports parameters like filtering.
    • GetRdeByName to get a unique RDE with given name. To make it unique it uses also the vendor+namespace+version from the given type, as one can have same name with this 3-tuple different combinations.
    • GetRdeById gets a unique RDE with given URN.
    • CreateRde to create a RDE instance. Creation is tricky, as it just returns a Task that remains at 1% progress in VCD. It will remain like that until it is "resolved" (see below method). So this method creates the RDE in an async way and recovers its refreshed state with an immediate get to return it.

RDE instances

  • Adds the following methods to the new DefinedEntity type:
    • Resolve to resolve the entity. On creation, the RDE instance is just a Task that remains at 1% in VCD. It needs this method to be called to check the entity against the schema of the RDE type. If it's OK, the task is completed and RDE instance state is RESOLVED. Otherwise, it gets RESOLUTION_ERROR.
    • Update to update the entity. It is a bit smart to avoid errors if Name is not populated for update (ie: User doesn't want to update it, but it's mandatory). One use case for Update is to fix the JSON entity if we get a RESOLUTION_ERROR.
    • Delete to delete the entity. The entity needs to be resolved first.

Client

  • Added OpenApiGetItemAndHeaders and OpenApiPostItemAndGetHeaders to retrieve all the response headers when performing a call to an OpenAPI endpoint.

abarreiro added 4 commits January 25, 2023 10:13
#
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
abarreiro added 4 commits January 25, 2023 10:50
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
abarreiro added 20 commits January 26, 2023 10:51
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
#
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
#
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
abarreiro added 12 commits February 9, 2023 11:42
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
@adambarreiro adambarreiro self-assigned this Mar 10, 2023
abarreiro added 2 commits March 14, 2023 13:52
Signed-off-by: abarreiro <[email protected]>
Signed-off-by: abarreiro <[email protected]>
@adambarreiro adambarreiro marked this pull request as ready for review March 14, 2023 13:23
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I have one ask that is inline, but can also mention here for the Client.OpenApiX functions.

IMO they could all return all headers instead of querying one specific. The reason is that these are our core client functions and people (or we) might find the need to fetch multiple headers in future and that would require multiple API calls instead of one

abarreiro added 2 commits March 16, 2023 10:17
Signed-off-by: abarreiro <[email protected]>
@adambarreiro adambarreiro merged commit ae88a73 into vmware:main Mar 21, 2023
@adambarreiro adambarreiro deleted the add-rde-support-3 branch March 21, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants