public void purchaseReservedInstance ( PurchaseReservedInstanceRequeset request ) { checkNotNull ( request , "request should not be null." ) ; if ( Strings . isNullOrEmpty ( request . getClientToken ( ) ) ) { request . setClientToken ( this . generateClientToken ( ) ) ; } if ( null == request . getBilling ( ) ) { request . setBilling ( generateDefaultBillingWithReservation ( ) ) ; } checkStringNotEmpty ( request . getInstanceId ( ) , "request instanceId should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . PUT , INSTANCE_PREFIX , request . getInstanceId ( ) ) ; internalRequest . addParameter ( InstanceAction . purchaseReserved . name ( ) , null ) ; internalRequest . addParameter ( "clientToken" , request . getClientToken ( ) ) ; fillPayload ( internalRequest , request ) ; this . invokeHttpClient ( internalRequest , AbstractBceResponse . class ) ; }
Renewing the instance with fixed duration .