Sha256: 27e331029643c03643186801e644e940dfc15e101efabf977ec3f010fc76ca33

Contents?: true

Size: 1.95 KB

Versions: 44

Compression:

Stored size: 1.95 KB

Contents

module Fog
  module Terremark
    module Shared
      module Real

        # Reserve requested resources and deploy vApp
        #
        # ==== Parameters
        # * service_id<~String> - Id of service to add node to
        # * ip<~String> - Private ip of server to add to node
        # * name<~String> - Name of service
        # * port<~Integer> - Port of service
        # * options<~Hash>:
        #   * Enabled<~Boolean>: defaults to true
        #   * Description<~String>: optional description
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'endTime'<~String> - endTime of task
        #     * 'href'<~String> - link to task
        #     * 'startTime'<~String> - startTime of task
        #     * 'status'<~String> - status of task
        #     * 'type'<~String> - type of task
        #     * 'Owner'<~String> -
        #       * 'href'<~String> - href of owner
        #       * 'name'<~String> - name of owner
        #       * 'type'<~String> - type of owner
        def add_node_service(service_id, ip, name, port, options = {})
          unless options.has_key?('Enabled')
            options['Enabled'] = true
          end
          data = <<-DATA
  <NodeService xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:tmrk:vCloudExpress-1.0:request:createNodeService">
    <IpAddress>#{ip}</IpAddress>
    <Name>#{name}</Name>
    <Port>#{port}</Port>
    <Enabled>#{options['Enabled']}</Enabled>
    <Description>#{options['Description']}</Description>
  </NodeService>
  DATA
          request(
            :body     => data,
            :expects  => 200,
            :headers  => {'Content-Type' => 'application/xml'},
            :method   => 'POST',
            :parser   => Fog::Parsers::Terremark::Shared::InternetService.new,
            :path     => "internetServices/#{service_id}/nodes"
          )
        end

      end
    end
  end
end

Version data entries

44 entries across 44 versions & 9 rubygems

Version Path
fog-1.5.0 lib/fog/terremark/requests/shared/add_node_service.rb
rackspace-fog-1.4.2 lib/rackspace-fog/terremark/requests/shared/add_node_service.rb
fog-1.4.0 lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
michiels-fog-1.3.1 lib/fog/terremark/requests/shared/add_node_service.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
fog-1.3.1 lib/fog/terremark/requests/shared/add_node_service.rb
fog-1.3.0 lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
fog-1.2.0 lib/fog/terremark/requests/shared/add_node_service.rb
ktheory-fog-1.1.2 lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/terremark/requests/shared/add_node_service.rb
fog-1.1.2 lib/fog/terremark/requests/shared/add_node_service.rb
fog_tractical-1.1.4 lib/fog/terremark/requests/shared/add_node_service.rb
fog_tractical-1.1.3 lib/fog/terremark/requests/shared/add_node_service.rb