cf-java-client icon indicating copy to clipboard operation
cf-java-client copied to clipboard

Add v3 organization quotas and service keys APIs

Open lxdv163 opened this issue 3 years ago • 4 comments
trafficstars

Hi guys, I am upgrading java client API from v2 to v3. I am using cloudfoundry-client-5.9.0.RELEASE.jar lib. But I found some functions missing in V3 version, but available in V2. I am not sure if it's my mistake or v3 lib is not complete. Such as:

  1. Get organization quotas. I can't find an API to get organization quotas, such as memory and instance limit. But v2 API provide organizationQuotaDefinitions interface.
  2. Service Key operations. How to create, delete or get a service key by V3 API? If V3 is not providing the API, so we have to use V2 for them? It's very appreciative if anyone could help answer the questions.

lxdv163 avatar Oct 19 '22 08:10 lxdv163

You are correct in that not all functionality is available in the cf-java-client v3 implementation. There are also changes in the v2 API to v3 API, so it's possible that how you access the information you want has also changed. If you tell me which API endpoint you're trying to access, I can tell you if we've implemented it or not.

If the API you require isn't implemented yet, there are two choices. 1.) Implement it and send a PR, we'll happily review & incorporate PRs. 2.) Drop back and use the v2 API. As a note, the v2 API is deprecated but no timeline has been set for it's removal which means it is still fairly safe to use.

Hope that helps!

dmikusa avatar Oct 19 '22 12:10 dmikusa

You are correct in that not all functionality is available in the cf-java-client v3 implementation. There are also changes in the v2 API to v3 API, so it's possible that how you access the information you want has also changed. If you tell me which API endpoint you're trying to access, I can tell you if we've implemented it or not.

If the API you require isn't implemented yet, there are two choices. 1.) Implement it and send a PR, we'll happily review & incorporate PRs. 2.) Drop back and use the v2 API. As a note, the v2 API is deprecated but no timeline has been set for it's removal which means it is still fairly safe to use.

Hope that helps!

Hi, much thanks for the reply. Just as I mentioned, org quota API is not found from cf-java-client v3 implementation. But from doc, it's available from here: https://v3-apidocs.cloudfoundry.org/version/3.126.0/index.html#organization-quotas. serviceKeys related API seems only available in v2 like cloudFoundryClient.serviceKeys(). So Should we still use v2 version for this API? At the same time, we will use the new v3 API for some other API as follow: cloudFoundryClient.applicationsV3() cloudFoundryClient.serviceInstancesV3() So v2 and v3 API can be used together?

lxdv163 avatar Oct 20 '22 02:10 lxdv163

org quota API is not found from cf-java-client v3 implementation. But from doc, it's available from here: https://v3-apidocs.cloudfoundry.org/version/3.126.0/index.html#organization-quotas. serviceKeys related API seems only available in v2 like cloudFoundryClient.serviceKeys().

Confirmed. Those are not in the client presently. We would welcome a contribution if you'd like to submit a PR. We can leave this issue open as a tracker for adding this functionality.

So v2 and v3 API can be used together?

Until they are added, yes. You just mix and match.

dmikusa avatar Oct 20 '22 02:10 dmikusa

service key API is implemented by service binding, but service route binding API is missing in V3 version.

lxdv163 avatar Nov 03 '22 02:11 lxdv163