1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
# frozen_string_literal: true
module Fog
module Compute
class Aliyun
class Real
# {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/instance&rebootinstance]
def reboot_server(server_id, options = {})
_action = 'RebootInstance'
_sigNonce = randonStr
_time = Time.new.utc
_parameters = defaultParameters(_action, _sigNonce, _time)
_pathURL = defaultAliyunUri(_action, _sigNonce, _time)
_parameters['InstanceId'] = server_id
_pathURL += '&InstanceId=' + server_id
_ForceStop = options[:aliyun_ForceStop]
if _ForceStop
_parameters['ForceStop'] = _ForceStop
_pathURL += '&ForceStop=' + _ForceStop
end
_signature = sign(@aliyun_accesskey_secret, _parameters)
_pathURL += '&Signature=' + _signature
request(
expects: [200, 204],
method: 'GET',
path: _pathURL
)
end
end
end
end
end
|