Sha256: 7f24c97116d5f035b88009f1400ac02f5f28b8ca89fc8e653a95d6c571045de6

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module Fog
  module Compute
    class Aliyun
      class Real
        # Start the server.
        #
        # === Parameters
        # * server_id <~String> - The ID of the server to be started.
        # === Returns
        # * success <~Boolean>
        # {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/instance&staetinstance]
        def start_server(server_id)
          _action = 'StartInstance'
          _sigNonce = randonStr
          _time = Time.new.utc

          _parameters = defalutParameters(_action, _sigNonce, _time)
          _pathURL = defaultAliyunUri(_action, _sigNonce, _time)

          _parameters['InstanceId'] = server_id
          _pathURL += '&InstanceId=' + server_id

          _signature = sign(@aliyun_accesskey_secret, _parameters)
          _pathURL += '&Signature=' + _signature

          request(
            expects: [200, 204],
            method: 'GET',
            path: _pathURL
          )
        end
      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
fog-aliyun-0.3.5 lib/fog/aliyun/requests/compute/start_server.rb
fog-aliyun-0.3.4 lib/fog/aliyun/requests/compute/start_server.rb
fog-aliyun-0.3.3 lib/fog/aliyun/requests/compute/start_server.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/requests/compute/start_server.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/requests/compute/start_server.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aliyun-0.3.2/lib/fog/aliyun/requests/compute/start_server.rb
fog-aliyun-0.3.2 lib/fog/aliyun/requests/compute/start_server.rb