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

v2/info call getting triggered internally while creating CloudFoundryClient and consuming v3 api's #1229

Open
bhavinshah-mendix opened this issue Apr 15, 2024 · 1 comment

Comments

@bhavinshah-mendix
Copy link

Hello,

Could someone assist me in grasping why the invocation of v3 API functions such as organizationsV3(), spacesV3(), or routesV3() etc., triggers the automatic invocation of v2/info when I create a CloudFoundryOperation client using CloudFoundryClient?

CloudFoundryClient Creation code:

cloudFoundryClient = ReactorCloudFoundryClient.builder()
        		.connectionContext(connectionContext)
                .tokenProvider(tokenProvider)
                .build();

OperationClient Creation Code:

cloudFoundryOperations = DefaultCloudFoundryOperations.builder()
                .cloudFoundryClient(cloudFoundryClient)
                .organization(StringUtils.EMPTY)
                .space(StringUtils.EMPTY)
                .build();

Fetching Organization:

ListOrganizationsRequest orgListRequest = ListOrganizationsRequest.builder().build();
ListOrganizationsResponse listOrganizationsResponse =  cloudFoundryClient.organizationsV3().list(orgListRequest).timeout(CF_REQUEST_TIMEOUT).block();

After investigation, I discovered that within _ReactorCloudFoundryClient.java, there's a checkCompatibility() method annotated with @PostConstruct, triggering the info() function. However, it remains uncertain whether this is the sole factor contributing to the observed behaviour.

looping @anthonydahanne , as I noticed your impressive contribution to the repository! Your dedication and expertise shine through in your work, so could help me :)

@Lokowandtg
Copy link

I will try to replace the internal usages of /v2/info with corresponding calls in /3/info and in "/". Here is the mapping for calls I have found:

/v2/info.name						/v3/info.name
/v2/info.build						/v3/info.build
/v2/info.support					/v3/info.links.support.href
/v2/info.version					/v3/info.version
/v2/info.description				  	/v3/info.description
/v2/info.authorization_endpoint				/.links.login.href
/v2/info.token_endpoint					/.links.uaa.href
/v2/info.min_cli_version				/v3/info.cli_version.minimum
/v2/info.min_recommended_cli_version			/v3/info.cli_version.recommended 
/v2/info.app_ssh_endpoint				/.links.app_ssh.href
/v2/info.app_ssh_host_key_fingerprint			/.links.app_ssh.meta.host_key-fingerprint
/v2/info.app_ssh_oauth_client				/.links.app_ssh.meta.oauth_client
/v2/info.doppler_logging_endpoint			/.links.logging.href
/v2/info.api_version					/.links.cloud_controller_v2.meta.version
/v2/info.osbapi_version					missing	
/v2/info.user						missing

For the two "missing" fields I could not find a corresponding field in the other endpoints. Let's see if they are used at all.

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

No branches or pull requests

2 participants