code: public void resizeInstance(ResizeInstanceRequest request) {
          checkNotNull(request, "request should not be null.");
          if (Strings.isNullOrEmpty(request.getClientToken())) {
              request.setClientToken(this.generateClientToken());
          }
          checkStringNotEmpty(request.getInstanceId(), "request instanceId should not be empty.");
          if (request.getCpuCount() <= 0) {
              throw new IllegalArgumentException("request cpuCount should be positive.");
          }
          if (request.getMemoryCapacityInGB() <= 0) {
              throw new IllegalArgumentException("request memoryCapacityInGB should be positive.");
          }
          InternalRequest internalRequest = this.createRequest(
                  request, HttpMethodName.PUT, INSTANCE_PREFIX, request.getInstanceId());
          internalRequest.addParameter(InstanceAction.resize.name(), null);
          internalRequest.addParameter("clientToken", request.getClientToken());
          fillPayload(internalRequest, request);
          this.invokeHttpClient(internalRequest, AbstractBceResponse.class);
      }
docs: Resizing the instance owned by the user.
  
  The Prepaid instance can not be downgrade.
  Only the Running/Stopped instance can be resized,otherwise,it's will get <code>409</code> errorCode.
  After resizing the instance,it will be reboot once.
  
  This is an asynchronous interface,
  you can get the latest status by invoke {@link #getInstance(GetInstanceRequest)}
  
  @param request The request containing all options for resizing the instance.