Sha256: edaa508cc99897a3071376bcde9d56d56129c678399cdb266238faf576db68d9

Contents?: true

Size: 795 Bytes

Versions: 2

Compression:

Stored size: 795 Bytes

Contents

require 'hashdiff'

module Vcloud
  class EdgeGatewayServices

    def initialize
      @config_loader = Vcloud::ConfigLoader.new
    end

    def update(config_file = nil)
      config = @config_loader.load_config(config_file, Vcloud::Schema::EDGE_GATEWAY_SERVICES)

      edge_gateway = Core::EdgeGateway.get_by_name config[:gateway]
      remote_config = edge_gateway.vcloud_attributes[:Configuration][:EdgeGatewayServiceConfiguration]

      proposed_config = EdgeGateway::EdgeGatewayConfiguration.new(config)

      if proposed_config.update_required?(remote_config)
        edge_gateway.update_configuration proposed_config.config
      else
        Vcloud::EdgeGateway.logger.info("EdgeGatewayServices.update: Configuration is already up to date. Skipping.")
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vcloud-edge_gateway-0.0.2 lib/vcloud/edge_gateway_services.rb
vcloud-edge_gateway-0.0.1 lib/vcloud/edge_gateway_services.rb