Sha256: f9a3e2a134806b4bc25c4c30ccb37f8680a337483ea33da77a5c3f5c0977f52a

Contents?: true

Size: 995 Bytes

Versions: 14

Compression:

Stored size: 995 Bytes

Contents

# 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&joinsecuritygroup]
        def join_security_group(server_id, group_id)
          _action = 'JoinSecurityGroup'
          _sigNonce = randonStr
          _time = Time.new.utc

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

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

          _parameters['SecurityGroupId'] = group_id
          _pathURL += '&SecurityGroupId=' + group_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

14 entries across 14 versions & 1 rubygems

Version Path
fog-aliyun-0.4.0 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.19 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.18 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.17 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.16 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.15 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.13 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.12 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.11 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.10 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.9 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.8 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.7 lib/fog/aliyun/requests/compute/join_security_group.rb
fog-aliyun-0.3.6 lib/fog/aliyun/requests/compute/join_security_group.rb