Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

Bump cf-java-client to use CC API V3 (CC API V2 deprecates) #15

Open
gberche-orange opened this issue Mar 5, 2019 · 0 comments
Open

Comments

@gberche-orange
Copy link
Member

CC API V2 deprecation draft plan has been published. A 6 month overlap is planned by the time the CF CLI is not using CC API V2 anymore.

SandboxInfo sandboxInfo = new SandboxInfo(cloudfoundryTarget.getOrg(),userInfo.getUsername(), cloudfoundryTarget.getApiUrl());
LOGGER.info("Associates user {} with org {}",userInfo.getUsername(),sandboxInfo.getOrgName());
cloudFoundryClient.associateUserWithOrg(cloudfoundryTarget.getOrg(), userInfo.getUsername());
LOGGER.info("Creates space {} for user {}",sandboxInfo.getSpaceName(),userInfo.getUsername());
cloudFoundryClient.createSpace(sandboxInfo.getSpaceName());
LOGGER.info("Associates user {} (auditor, manager and developer) with space {}",userInfo.getUsername(),sandboxInfo.getSpaceName());
cloudFoundryClient.associateAuditorWithSpace(sandboxInfo.getOrgName(), sandboxInfo.getSpaceName(), userInfo.getUserId());
cloudFoundryClient.associateManagerWithSpace(sandboxInfo.getOrgName(), sandboxInfo.getSpaceName(), userInfo.getUserId());
cloudFoundryClient.associateDeveloperWithSpace(sandboxInfo.getOrgName(), sandboxInfo.getSpaceName(), userInfo.getUserId());

Corresponding CC API V3 java client available calls:
https://static.javadoc.io/org.cloudfoundry/cloudfoundry-client/3.15.0.RELEASE/org/cloudfoundry/client/v3/spaces/SpacesV3.html#create-org.cloudfoundry.client.v3.spaces.CreateSpaceRequest-

Upcoming V3 endpoints:

An alternative is to change the sandbox service to use terraform provider instead of direct CC api calls. See https://github.com/orange-cloudfoundry/paas-templates/issues/205

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant