Class: Puppet::NetDev::CE::Device

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/provider/ce/device/device.rb

Constant Summary collapse

@@session =
nil
@@telnet_session =
nil
@@ssh_session =
nil
@@netconf_hostip =
nil
@@netconf_username =
nil
@@netconf_password =
nil
@@interface_api =
nil
@@l3_interface_api =
nil
@@vlan_api =
nil
@@user_api =
nil
@@system_api =
nil
@@trunk_api =
nil
@@channel_api =
nil
@@car_api =
nil
@@diffserv_api =
nil
@@vlan_batch_api =
nil

Class Method Summary collapse

Class Method Details

.car_apiObject

create CarApi instance



106
107
108
109
# File 'lib/puppet/provider/ce/device/device.rb', line 106

def self.car_api
  @@car_api = CarApi.new if nil == @@car_api
  @@car_api
end

.channel_apiObject

create ChannelApi instance



100
101
102
103
# File 'lib/puppet/provider/ce/device/device.rb', line 100

def self.channel_api
  @@channel_api = ChannelApi.new if nil == @@channel_api
  @@channel_api
end

.diffserv_apiObject

create DiffervApi instance



112
113
114
115
# File 'lib/puppet/provider/ce/device/device.rb', line 112

def self.diffserv_api
  @@diffserv_api = DiffervApi.new if nil == @@diffserv_api
  @@diffserv_api
end

.interface_apiObject

create InterfaceApi instance



64
65
66
67
# File 'lib/puppet/provider/ce/device/device.rb', line 64

def self.interface_api
  @@interface_api = InterfaceApi.new if nil == @@interface_api
  @@interface_api
end

.l3_interface_apiObject

create L3InterfaceApi instance



70
71
72
73
# File 'lib/puppet/provider/ce/device/device.rb', line 70

def self.l3_interface_api
  @@l3_interface_api = L3InterfaceApi.new if nil == @@l3_interface_api
  @@l3_interface_api
end

.netconf_instance(netconf_ipaddress, netconf_username, netconf_password) ⇒ Object



57
58
59
60
61
# File 'lib/puppet/provider/ce/device/device.rb', line 57

def self.netconf_instance(netconf_ipaddress, netconf_username, netconf_password)
  @@netconf_hostip   = netconf_ipaddress
  @@netconf_username = netconf_username
  @@netconf_password = netconf_password
end

.sessionObject



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/puppet/provider/ce/device/device.rb', line 45

def self.session
  if nil == @@session && nil != @@netconf_hostip && nil != @@netconf_username && nil != @@netconf_password

    ssh_session = Puppet::NetDev::CE::Session.new(@@netconf_hostip, @@netconf_username, @@netconf_password)
    @@session = ssh_session.connect
    puts 'create session in normal way'
    
  end

  @@session
end

.system_apiObject

create SystemApi instance



88
89
90
91
# File 'lib/puppet/provider/ce/device/device.rb', line 88

def self.system_api
  @@system_api = SystemApi.new if nil == @@system_api
  @@system_api
end

.trunk_apiObject

create TrunkApi instance



94
95
96
97
# File 'lib/puppet/provider/ce/device/device.rb', line 94

def self.trunk_api
  @@trunk_api = TrunkApi.new if nil == @@trunk_api
  @@trunk_api
end

.user_apiObject

create UserApi instance



82
83
84
85
# File 'lib/puppet/provider/ce/device/device.rb', line 82

def self.user_api
  @@user_api = UserApi.new if nil == @@user_api
  @@user_api
end

.vlan_apiObject

create VlanApi instance



76
77
78
79
# File 'lib/puppet/provider/ce/device/device.rb', line 76

def self.vlan_api
  @@vlan_api = VlanApi.new if nil == @@vlan_api
  @@vlan_api
end

.vlan_batch_apiObject

create VlanBatchApi instance



118
119
120
121
# File 'lib/puppet/provider/ce/device/device.rb', line 118

def self.vlan_batch_api
  @@vlan_batch_api = VlanBatchApi.new if nil == @@vlan_batch_api
  @@vlan_batch_api
end