Class: MistApi::OrgSettingJunosShellAccess

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/org_setting_junos_shell_access.rb

Overview

junos_shell_access: Manages role-based web-shell access. When junos_shell access is not defined (Default) - No additional users are configured and web-shell uses default ‘mist` user to login. When junos_shell_access is defined - Additional users mist-web-admin (admin permission), mist-web-viewer(viewer permission) are configured on the device and web-shell logs in with the mist-web-admin/mist-web-viewer user depending upon the shell access level. Setting the shell access level to “none”, disables web-shell access for that specific role.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(admin = OrgSettingJunosShellAccessAdminEnum::ADMIN, helpdesk = OrgSettingJunosShellAccessHelpdeskEnum::NONE, read = OrgSettingJunosShellAccessReadEnum::NONE, write = OrgSettingJunosShellAccessWriteEnum::ADMIN) ⇒ OrgSettingJunosShellAccess

Returns a new instance of OrgSettingJunosShellAccess.



60
61
62
63
64
65
66
67
68
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 60

def initialize(admin = OrgSettingJunosShellAccessAdminEnum::ADMIN,
               helpdesk = OrgSettingJunosShellAccessHelpdeskEnum::NONE,
               read = OrgSettingJunosShellAccessReadEnum::NONE,
               write = OrgSettingJunosShellAccessWriteEnum::ADMIN)
  @admin = admin unless admin == SKIP
  @helpdesk = helpdesk unless helpdesk == SKIP
  @read = read unless read == SKIP
  @write = write unless write == SKIP
end

Instance Attribute Details

#adminOrgSettingJunosShellAccessAdminEnum

enum: ‘admin`, `viewer`, `none`



21
22
23
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 21

def admin
  @admin
end

#helpdeskOrgSettingJunosShellAccessHelpdeskEnum

enum: ‘admin`, `viewer`, `none`



25
26
27
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 25

def helpdesk
  @helpdesk
end

#readOrgSettingJunosShellAccessReadEnum

enum: ‘admin`, `viewer`, `none`



29
30
31
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 29

def read
  @read
end

#writeOrgSettingJunosShellAccessWriteEnum

enum: ‘admin`, `viewer`, `none`



33
34
35
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 33

def write
  @write
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 71

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  admin = hash['admin'] ||= OrgSettingJunosShellAccessAdminEnum::ADMIN
  helpdesk =
    hash['helpdesk'] ||= OrgSettingJunosShellAccessHelpdeskEnum::NONE
  read = hash['read'] ||= OrgSettingJunosShellAccessReadEnum::NONE
  write = hash['write'] ||= OrgSettingJunosShellAccessWriteEnum::ADMIN

  # Create object from extracted values.
  OrgSettingJunosShellAccess.new(admin,
                                 helpdesk,
                                 read,
                                 write)
end

.namesObject

A mapping from model property names to API property names.



36
37
38
39
40
41
42
43
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 36

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['admin'] = 'admin'
  @_hash['helpdesk'] = 'helpdesk'
  @_hash['read'] = 'read'
  @_hash['write'] = 'write'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



46
47
48
49
50
51
52
53
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 46

def self.optionals
  %w[
    admin
    helpdesk
    read
    write
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 96

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} admin: #{@admin.inspect}, helpdesk: #{@helpdesk.inspect}, read:"\
  " #{@read.inspect}, write: #{@write.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



89
90
91
92
93
# File 'lib/mist_api/models/org_setting_junos_shell_access.rb', line 89

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} admin: #{@admin}, helpdesk: #{@helpdesk}, read: #{@read}, write:"\
  " #{@write}>"
end