Sha256: 7e1ceae1345067165a754073e9000ecff113bbe34803b5baeccb23a162f7000b

Contents?: true

Size: 1.01 KB

Versions: 20

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Compute
    class Google
      class Mock
        def add_instance_group_instances(_group_name, _zone, _instances)
          Fog::Mock.not_implemented
        end
      end

      class Real
        def add_instance_group_instances(group_name, zone, instances)
          instances.map! do |instance|
            if instance.start_with?("https:")
              ::Google::Apis::ComputeV1::InstanceReference.new(:instance => instance)
            else
              ::Google::Apis::ComputeV1::InstanceReference.new(
                :instance => "https://www.googleapis.com/compute/#{api_version}/projects/#{@project}/zones/#{zone}/instances/#{instance}\n"
              )
            end
          end

          request = ::Google::Apis::ComputeV1::InstanceGroupsAddInstancesRequest.new(
            :instances => instances
          )
          @compute.add_instance_group_instances(
            @project,
            zone,
            group_name,
            request
          )
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
fog-google-1.9.1 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.9.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.8.2 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.8.1 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.8.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.7.1 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.7.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.6.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.5.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.4.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.3.3 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.3.2 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.3.1 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.3.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.2.2 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.2.1 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.2.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.1.0 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.0.1 lib/fog/compute/google/requests/add_instance_group_instances.rb
fog-google-1.0.0 lib/fog/compute/google/requests/add_instance_group_instances.rb