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 Behavior support to Defined Interfaces and Defined Entity Types #584

Merged
merged 19 commits into from
Jul 14, 2023

Conversation

adambarreiro
Copy link
Collaborator

@adambarreiro adambarreiro commented Jun 28, 2023

Overview

This PR serves as the foundations of vmware/terraform-provider-vcd#1074
It adds methods to both Defined Interface and Defined Entity Type types to manage Behaviors and Behavior Access Controls.

Context

Behaviors are explained here, but in simplified words, they're "procedures" that belong to RDE Interfaces, are inherited by the RDE Types that use those Interfaces and are invoked on the RDEs that instantiate those types.

Also, Behaviors can be overridden at the RDE Type level. For example, if you use a RDE Interface with behavior "A", you can override what it does in a Type that uses it.

Also, Behaviors have "Access Levels", which can define what operations can be done in that behavior.

Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
#
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro changed the title WIP: Improve RDEs Add Behavior support to Defined Interfaces and Defined Entity Types Jul 3, 2023
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro self-assigned this Jul 4, 2023
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro marked this pull request as ready for review July 4, 2023 11:32
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.

A few inline questions. Lots of boilerplate - which is sort of a good thing :)

types/v56/openapi.go Outdated Show resolved Hide resolved
types/v56/openapi.go Show resolved Hide resolved
govcd/defined_interface.go Show resolved Hide resolved
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.

Just a few queries as this is a lot of boilerplate. Will have to think in future on how to reduce code for standardized endpoints like these.

govcd/defined_entity.go Show resolved Hide resolved
govcd/defined_entity.go Outdated Show resolved Hide resolved
Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

I found it confusing to see "override" being used as a noun and as a verb in the same scope. (It's hard to tell whether it's a noun or verb in English with little context). So, I have added a suggestion to use a noun through out.

govcd/defined_entity.go Outdated Show resolved Hide resolved
Signed-off-by: abarreiro <abarreiro@vmware.com>
#
Signed-off-by: abarreiro <abarreiro@vmware.com>
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

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

Thank you for the adjustment!

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.

rde tests passed

Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
#
Signed-off-by: abarreiro <abarreiro@vmware.com>
Signed-off-by: abarreiro <abarreiro@vmware.com>
@adambarreiro adambarreiro merged commit 69317f6 into vmware:main Jul 14, 2023
2 checks passed
@adambarreiro adambarreiro deleted the add-defined-interface-behaviors branch July 14, 2023 09:56
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