<commit_before>require 'puppet/property/netscaler_truthy'

Puppet::Type.newtype(:netscaler_service_lbmonitor_bind) do
  @doc = 'Manage a binding between a service and a loadbalancing monitor.'

  apply_to_device
  ensurable

  newparam(:name, :namevar => true) do
    desc "service_name/lbmonitor_name"
  end

  newproperty(:weight) do
    desc "Weight to assign to the monitor-service binding. When a monitor is UP, the weight assigned to its binding with the service determines how much the monitor contributes toward keeping the health of the service above the value configured for the Monitor Threshold parameter.

    Min = 1
    Max = 100"
    newvalues(/^\d+$/)
    munge do |value|
      Integer(value)
    end
  end

  newproperty(:state, :parent => Puppet::Property::NetscalerTruthy) do
    truthy_property('The configured state (enable/disable) of the bound monitor.','ENABLED','DISABLED')
  end

  # newproperty(:passive, :parent => Puppet::Property::NetscalerTruthy) do
  #   truthy_property('Indicates if the monitor is passive. A passive monitor does not remove service from LB decision when the threshold is breached.','true','false')
  # end

  autorequire(:netscaler_service) do
    self[:name].split('/')[0]
  end
  autorequire(:netscaler_lbmonitor) do
    self[:name].split('/')[1]
  end
end<commit_msg>Added comment as to why passive is commented out.<commit_after>require 'puppet/property/netscaler_truthy'

Puppet::Type.newtype(:netscaler_service_lbmonitor_bind) do
  @doc = 'Manage a binding between a service and a loadbalancing monitor.'

  apply_to_device
  ensurable

  newparam(:name, :namevar => true) do
    desc "service_name/lbmonitor_name"
  end

  newproperty(:weight) do
    desc "Weight to assign to the monitor-service binding. When a monitor is UP, the weight assigned to its binding with the service determines how much the monitor contributes toward keeping the health of the service above the value configured for the Monitor Threshold parameter.

    Min = 1
    Max = 100"
    newvalues(/^\d+$/)
    munge do |value|
      Integer(value)
    end
  end

  newproperty(:state, :parent => Puppet::Property::NetscalerTruthy) do
    truthy_property('The configured state (enable/disable) of the bound monitor.','ENABLED','DISABLED')
  end

  # Always appears as false in the get REST API response. May go back in
  # if this behaviour changes.
  # newproperty(:passive, :parent => Puppet::Property::NetscalerTruthy) do
  #   truthy_property('Indicates if the monitor is passive. A passive monitor does not remove service from LB decision when the threshold is breached.','true','false')
  # end

  autorequire(:netscaler_service) do
    self[:name].split('/')[0]
  end
  autorequire(:netscaler_lbmonitor) do
    self[:name].split('/')[1]
  end
end
{'fraction_non_alphanumeric': 0.09511844938980617, 'fraction_numerical': 0.004307250538406317, 'mean_word_length': 4.318702290076335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7315170', 'n_tokens_mistral': 844, 'n_tokens_neox': 822, 'n_words': 283}