<commit_before>#--
# Copyright (c) 2014 SoftLayer Technologies, Inc. All rights reserved.
#
# For licensing information see the LICENSE.md file in the project root.
#++

module SoftLayer
  ##
  # Instance of this class represent servers that are virtual machines in the
  # SoftLayer environment.
  #
  # This class roughly corresponds to the entity SoftLayer_Virtual_Guest in the
  # API.
  #
  class VirtualServer < Server
    include ::SoftLayer::DynamicAttribute

    ##
    # :attr_reader: cores
    # A count of the number of virtual processing cores allocated
    # to the server.
    sl_attr :cores, 'maxCpu'

    ##
    # :attr_reader:
    # The date the Virtual Server was provisioned.  This attribute can be
    # nil if the SoftLayer system has not yet finished provisioning the
    # server (consequently this attribute is used by the #wait_until_ready
    # method to determine when a server has been provisioned)
    sl_attr :provisionDate

    ##
    # :attr_reader:
    # The active transaction (if any) for this virtual server. Transactions
    # are used to make configuration changes to the server and only one
    # transaction can be active at a time.
    sl_attr :activeTransaction

    ##
    # :attr_reader:
    # Storage devices attached to the server. Storage may be local
    # to the host running the Virtual Server, or it may be located
    # on the SAN
    sl_attr :blockDevices

    ##
    # :attr_reader:
    # The last operating system reload transaction that was
    # run for this server. #wait_until_ready compares the
    # ID of this transaction to the ID of the active transaction
    # to determine if an OS reload is in progress.
    sl_attr :lastOperatingSystemReload

    ##
    # A lsst of configured network monitors.
    #
    sl_dynamic_attr :network_monitors do |resource|
      resource.should_update? do
        @network_monitors == nil
      end

      resource.to_update do
        network_monitors_data = self.service.object_mask(NetworkMonitor.default_object_mask).getNetworkMonitors

        network_monitors_data.map! do |network_monitor|
          NetworkMonitor.new(softlayer_client, network_monitor) unless network_monitor.empty?
        end

        network_monitors_data.compact
      end
    end<commit_msg>Forgot to remove attribute network_monitors from VirtualServer in commit 35f62f44daba63<commit_after>#--
# Copyright (c) 2014 SoftLayer Technologies, Inc. All rights reserved.
#
# For licensing information see the LICENSE.md file in the project root.
#++

module SoftLayer
  ##
  # Instance of this class represent servers that are virtual machines in the
  # SoftLayer environment.
  #
  # This class roughly corresponds to the entity SoftLayer_Virtual_Guest in the
  # API.
  #
  class VirtualServer < Server
    include ::SoftLayer::DynamicAttribute

    ##
    # :attr_reader: cores
    # A count of the number of virtual processing cores allocated
    # to the server.
    sl_attr :cores, 'maxCpu'

    ##
    # :attr_reader:
    # The date the Virtual Server was provisioned.  This attribute can be
    # nil if the SoftLayer system has not yet finished provisioning the
    # server (consequently this attribute is used by the #wait_until_ready
    # method to determine when a server has been provisioned)
    sl_attr :provisionDate

    ##
    # :attr_reader:
    # The active transaction (if any) for this virtual server. Transactions
    # are used to make configuration changes to the server and only one
    # transaction can be active at a time.
    sl_attr :activeTransaction

    ##
    # :attr_reader:
    # Storage devices attached to the server. Storage may be local
    # to the host running the Virtual Server, or it may be located
    # on the SAN
    sl_attr :blockDevices

    ##
    # :attr_reader:
    # The last operating system reload transaction that was
    # run for this server. #wait_until_ready compares the
    # ID of this transaction to the ID of the active transaction
    # to determine if an OS reload is in progress.
    sl_attr :lastOperatingSystemReload
{'fraction_non_alphanumeric': 0.05558288243974422, 'fraction_numerical': 0.003935071323167732, 'mean_word_length': 3.133130081300813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3603311', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1072, 'n_words': 462}