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

fix vrealize:push fails for vCD 10.5, API version 38.0 #183

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

vganevjb
Copy link
Contributor

@vganevjb vganevjb commented Nov 8, 2023

Description

VMware Cloud Director 10.5 and later do not support the /api/sessions API login endpoint.

The /api/sessions API login endpoint is deprecated since VMware Cloud Director API version 33.0. For version 38.0 and later, the /api/sessions API login endpoint is no longer supported. You can use the VMware Cloud Director OpenAPI login endpoints to access VMware Cloud Director.
Service provider access to the system organization- POST cloudapi/1.0.0/sessions/provider
Tenant access to all other organizations apart from the system organization- POST cloudapi/1.0.0/sessions
As per the backward compatibility commitment of VMware Cloud Director, versions 37.2 and earlier continue to support the /api/sessions API login endpoint.

Checklist

  • Lint and unit tests pass locally with my changes
  • I have added relevant error handling and logging messages to help troubleshooting
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have updated CHANGELOG.md with a short summary of the changes introduced
  • I have tested against live environment, if applicable
  • I have added relevant usage information (As-built)
  • Any structure and/or content vRA-NG improvements are synchronized with vra-ng and ts-vra-ng archetypes
  • Every new or updated Installer property is documented in docs/archive/doc/markdown/use-bundle-installer.md
  • Dependencies in pom.xml are up-to-date
  • My changes have been rebased and squashed to the minimal number of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixed #XXX - or Closed #XXX - prefix to auto-close the issue

Testing

Release Notes

Related issues and PRs

Fixed #166

@vganevjb vganevjb self-assigned this Nov 8, 2023
@vganevjb vganevjb requested a review from a team as a code owner November 8, 2023 11:12
*/
private static final String URL_SESSION = "/api/sessions";
private static final String PROVIDER_URL_SESSION = "/cloudapi/1.0.0/sessions/provider";

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest to make both the REST endpoint backward compatible with old API version, for example check the vCD API version and if it is >= 38.0 then use the PROVIDER_URL_SESSION otherwise to use URL_SESSION

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback.
According to the API documentation is available since API v33 - https://developer.vmware.com/apis/vmware-cloud-director/latest/cloudapi/1.0.0/sessions/provider/post/

From these docs we can see v33 is mapped to VCD 10, which is deprecated -> https://developer.vmware.com/docs/14143/vmware-cloud-director-api-programming-guide/

Should we support deprecated versions?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think @akantchev 's idea is to have support for backwards compatibility in case the user is running on an older vCD version which supports just the old api

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see the second link isn't working properly - I am attaching another one - https://docs.vmware.com/en/VMware-Cloud-Director/index.html
VCD API version <=34 is deprecated and not supported, and this change supports =>33

Copy link
Contributor

Choose a reason for hiding this comment

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

changing should be fine. The old endpoint will be for very old VCD versions that are out of support for more than an year (10.1 (v34) EOL is 2022-04-09)

@VenelinBakalov
Copy link
Collaborator

Hi, @vganevjb . I see you updated CHANGELOG.md which is great. Could you updated Release.md as well?
Here is a sample: https://github.com/vmware/build-tools-for-vmware-aria/pull/190/files#diff-2758ec22240769ca24b53db71e3dc4dc4a7990dabed3bc38bf2ec4456d19f3a1

@vganevjb vganevjb force-pushed the fix/vcd-105-acquire-token branch 2 times, most recently from 7c3485f to 9976783 Compare November 15, 2023 15:27
*/
private static final String URL_SESSION = "/api/sessions";
private static final String PROVIDER_URL_SESSION = "/cloudapi/1.0.0/sessions/provider";

Copy link
Contributor

Choose a reason for hiding this comment

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

changing should be fine. The old endpoint will be for very old VCD versions that are out of support for more than an year (10.1 (v34) EOL is 2022-04-09)

@Michaelpalacce
Copy link
Collaborator

@VenelinBakalov I'd say let's merge this

Copy link
Collaborator

@Michaelpalacce Michaelpalacce left a comment

Choose a reason for hiding this comment

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

lgtm

@VenelinBakalov
Copy link
Collaborator

@Michaelpalacce I've missed the notification for this..it seems now there are some merge conflicts
@vganevjb are you available for fixing them?
If not, I will check them, they are only changelog / release md so nothing big

Signed-off-by: Vladislav Ganev <gvladislav@vmware.com>
@VenelinBakalov VenelinBakalov merged commit ab8f5d0 into main Dec 13, 2023
13 checks passed
@VenelinBakalov VenelinBakalov deleted the fix/vcd-105-acquire-token branch December 13, 2023 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vrealize:push fails for vCD 10.5, API version 38.0
5 participants