-1

we are trying to provision VM in tokyo data center(Location Code: TOK02) using Order API and we are receiving the error below:

A datacenter could not be found with the name tok02

Below is the code :

Guest.Service service = Guest.service(agentClient); 
Guest guest = new Guest(); 
guest.setHostname(details.getServerName());
guest.setDomain(CloudConstants.SOFTLAYER_URL.getValue());
guest.setStartCpus(flavorCspResource.getCpu().getStartCPUs());
guest.setHourlyBillingFlag(true);
guest.setLocalDiskFlag(flavorCspResource.getDisk().getLocalDiskFlag());
guest.setOperatingSystemReferenceCode(details.getImageId());
guest.setMaxMemory(flavorCspResource.getRam().getMaxMemory());
guest.setDatacenter(new Location());
guest.getDatacenter().setName(details.getLocationCode());

Can you please check and let us know if we are missing something?

We are facing this issue for US, UK data centres as well

  • Check what? You haven't shown any code. – JJJ Feb 21 '18 at 15:40
  • Perhaps it's case-sensitive? Try `TOK02`? – ceejayoz Feb 21 '18 at 15:42
  • 1
    @user8937789 Don't add code in comments. Instead, [edit](https://stackoverflow.com/posts/48909835/edit) your question and intend the code with tabs or 4 spaces. – Filnor Feb 21 '18 at 15:53
  • Please set the logs in your client and post those logs to see what is happening, to set the logs do: ApiClient client = new RestApiClient().withCredentials("my user", "my api key").withLoggingEnabled(); – Nelson Raul Cabero Mendoza Feb 22 '18 at 13:05

1 Answers1

0

TOK02 is not allowed, because it is in uppercase you need to send "tok02" in lowercase