code: public static String getRegion() throws IOException {
          String url = getMetadataUrl() + "/placement/availability-zone";
          String zone = invokeUrl(url);
          zone = zone.trim();
  
          // In case of AWS, the zone includes an extra character
          // at the end such as "us-east-1a", "us-east-1b", "eu-west-1a",
          // etc. We have to strip that last character to get the
          // correct region.
          String region = zone.substring(0, zone.length() - 1);
          assert region != null;
          return region;
      }
docs: Returns the region in which the instance is running.
  
  @return String       representing the region where the instance is
  running
  @throws java.io.IOException  if failed to retrieve the region information
  using the Cloud infrastructure