Class: Vlag

Inherits:
Object
  • Object
show all
Defined in:
lib/cnos-rbapi/vlag.rb

Overview

The Vlag class provides a class implementation and methods for managing the Vlags on the node. This class presents an abstraction

Constant Summary collapse

@@cfg =
'/nos/api/cfg/vlag'

Class Method Summary collapse

Class Method Details

.create_vlag_inst(conn, params) ⇒ Object

parameters:

conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
    {
      


185
186
187
188
189
190
191
# File 'lib/cnos-rbapi/vlag.rb', line 185

def self.create_vlag_inst(conn, params)
        url = form_url(conn, @@cfg + '/instance')
        hdr = form_hdr(conn)
        params = params.to_json
    Rest.post(conn, url, hdr, params)

end

.delete_vlag_inst(conn, inst_id) ⇒ Object

parameters:

conn - connection object to the node
inst_id - Vlag instance ID number

return: JSON response



225
226
227
228
229
# File 'lib/cnos-rbapi/vlag.rb', line 225

def self.delete_vlag_inst(conn, inst_id)
    url = form_url(conn, @@cfg + '/instance/' + inst_id.to_s)
    hdr = form_hdr(conn)
    Rest.delete(conn, url, hdr)
end

.get_all_vlag(conn) ⇒ Object

parameters:

conn - connection object to the node

return: JSON response


252
253
254
255
256
# File 'lib/cnos-rbapi/vlag.rb', line 252

def self.get_all_vlag(conn)
        url = form_url(conn, @@cfg + '/instance')
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.get_global_vlag(conn) ⇒ Object

parameters:

conn - connection object to the node

return: JSON response


79
80
81
82
83
84
85
# File 'lib/cnos-rbapi/vlag.rb', line 79

def self.get_global_vlag(conn)
    temp = @@cfg.dup
    temp.sub! 'cfg' , 'info'
        url = form_url(conn, temp)
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.get_vlag_conf(conn) ⇒ Object

parameters:

conn - connection object to the node

return: JSON response


36
37
38
39
40
# File 'lib/cnos-rbapi/vlag.rb', line 36

def self.get_vlag_conf(conn)
        url = form_url(conn, @@cfg)
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.get_vlag_health(conn) ⇒ Object

parameters:

conn - connection object to the node

return: JSON response


129
130
131
132
133
134
135
# File 'lib/cnos-rbapi/vlag.rb', line 129

def self.get_vlag_health(conn)
        temp = @@cfg.dup
        temp.sub! 'cfg' , 'info'
        url = form_url(conn, temp + '/health_check')
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.get_vlag_inst_confg(conn, inst_id) ⇒ Object

parameters:

conn - connection object to the node
inst_id - Vlag instance ID number

return: JSON response


239
240
241
242
243
# File 'lib/cnos-rbapi/vlag.rb', line 239

def self.get_vlag_inst_confg(conn, inst_id)
        url = form_url(conn, @@cfg + '/instance/' + inst_id.to_s)
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.get_vlag_inst_info(conn, inst_id) ⇒ Object

parameters:

conn - connection object to the node
inst_id - Vlag instance ID number

return: JSON response


266
267
268
269
270
271
272
# File 'lib/cnos-rbapi/vlag.rb', line 266

def self.get_vlag_inst_info(conn, inst_id)
    temp = @@cfg.dup
        temp.sub! 'cfg' , 'info'
    url = form_url(conn, temp + '/instance/' + inst_id.to_s)
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.get_vlag_isl(conn) ⇒ Object

parameters:

conn - connection object to the node

return: JSON response


94
95
96
97
98
99
100
# File 'lib/cnos-rbapi/vlag.rb', line 94

def self.get_vlag_isl(conn)
    temp = @@cfg.dup
    temp.sub! 'cfg' , 'info'
        url = form_url(conn, temp + '/isl')
        hdr = form_hdr(conn)
    Rest.get(conn, url, hdr)
end

.update_vlag_conf(conn, params) ⇒ Object

parameters:

conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
    {
      "status": "<status>",
    


65
66
67
68
69
70
# File 'lib/cnos-rbapi/vlag.rb', line 65

def self.update_vlag_conf(conn, params)
        url = form_url(conn, @@cfg)
        hdr = form_hdr(conn)
        params = params.to_json
    Rest.put(conn, url, hdr, params)
end

.update_vlag_health(conn, params) ⇒ Object

parameters:

conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
    {
      

30.

keepalive_attempts :Number of keepalive attempts made before declaring the peer is
           down; an integer from 1


161
162
163
164
165
166
# File 'lib/cnos-rbapi/vlag.rb', line 161

def self.update_vlag_health(conn, params)
        url = form_url(conn, @@cfg + '/health_check')
        hdr = form_hdr(conn)
        params = params.to_json
    Rest.put(conn, url, hdr, params)
end

.update_vlag_inst(conn, inst_id, params) ⇒ Object

parameters:

conn - connection object to the node
inst_id - Vlan instance ID number 
params - dictionary that requires the following format of key-value pairs
    {
      


209
210
211
212
213
214
215
# File 'lib/cnos-rbapi/vlag.rb', line 209

def self.update_vlag_inst(conn, inst_id, params)
        url = form_url(conn, @@cfg + '/instance/' + inst_id.to_s)
        hdr = form_hdr(conn)
        params = params.to_json
    Rest.post(conn, url, hdr, params)

end

.update_vlag_isl(conn, params) ⇒ Object

parameters:

conn - connection object to the node
params - dictionary that requires the following format of key-value pairs
    {
      


115
116
117
118
119
120
# File 'lib/cnos-rbapi/vlag.rb', line 115

def self.update_vlag_isl(conn, params)
        url = form_url(conn, @@cfg + '/isl')
        hdr = form_hdr(conn)
        params = params.to_json
    Rest.put(conn, url, hdr, params)
end