CenturyLinkCloud / clc-java-sdk

Apache License 2.0
6 stars 4 forks source link

Perform action on behalf of sub accounts #204

Open khomco opened 8 years ago

khomco commented 8 years ago

With the CLC platform being structured with account hierarchy, it would be ideal to perform actions through the API for sub accounts. This is in fact how many of the internal teams are using the API to support our customers and therefore not realistic to leverage a modifying Credentials Provider between calls on different sub accounts.

Below is an example of how I might like to interact with the library:

OperationFuture<ServerMetadata> operationFuture = clcSdk
                .serverService()
                .account("AccountAlias")
                .create(new CreateServerConfig()
                                .name(serverName)
                                .description(templateName)
                                .type(ServerType.STANDARD)
                                .group(getGroup())
                                .password(password)
                                .machine(new Machine()
                                                .cpuCount(2)
                                                .ram(4)
                                )
                                .template(Template.refByName().name(templateName).dataCenter(DataCenter.refById(dataCenter))
                                )
                                .timeToLive(ZonedDateTime.now().plusDays(1))
                )
                .waitUntilComplete();
tonycapone commented 8 years ago

Yeah something like this is a must-have feature actually.