Class: JSS::Server
- Inherits:
-
Object
- Object
- JSS::Server
- Defined in:
- lib/jss/server.rb,
lib/jss.rb
Overview
A class representing a JSS Server.
The APIConnection instance has a JSS::Server instance in its @server attribute. It is created fresh every time APIConnection#connect is called.
That’s the only time it should be instantiated, and all access should be through JSS::API.server
Instance Attribute Summary collapse
-
#activation_code ⇒ String
readonly
The activation code for the server licence.
-
#license_type ⇒ String
readonly
The type of server licence.
-
#major_version ⇒ Object
readonly
@return [Integer].
-
#minor_version ⇒ Object
readonly
@return [Integer].
-
#organization ⇒ String
(also: #institution)
readonly
The organization to which the server is licensed.
-
#product ⇒ String
(also: #product_name)
readonly
The license product name.
-
#raw_version ⇒ Object
readonly
@return [String].
-
#revision_version ⇒ Object
readonly
@return [Integer].
-
#version ⇒ Object
readonly
@return [String] The version of the JSS.
Instance Method Summary collapse
-
#initialize ⇒ Server
constructor
Initialize!.
Constructor Details
#initialize ⇒ Server
Initialize!
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/jss/server.rb', line 78 def initialize begin # the jssuser resource is readable by anyone with a JSS acct # regardless of their permissions. # However, it's marked as 'deprecated'. Hopefully jamf will # keep this basic level of info available for basic authentication # and JSS version checking. ju = JSS::API.get_rsrc('jssuser')[:user] @license_type = ju[:license_type] @product = ju[:product] @raw_version = ju[:version] parsed = JSS.parse_jss_version(@raw_version) @major_version = parsed[:major] @minor_version = parsed[:minor] @revision_version = parsed[:revision] @version = parsed[:version] rescue RestClient::Request:: raise JSS::AuthenticationError, "Incorrect JSS username or password for '#{JSS::API.jss_user}@#{JSS::API.server_host}'." end end |
Instance Attribute Details
#activation_code ⇒ String (readonly)
Returns the activation code for the server licence.
48 49 50 |
# File 'lib/jss/server.rb', line 48 def activation_code @activation_code end |
#license_type ⇒ String (readonly)
Returns the type of server licence.
51 52 53 |
# File 'lib/jss/server.rb', line 51 def license_type @license_type end |
#major_version ⇒ Object (readonly)
@return [Integer]
60 61 62 |
# File 'lib/jss/server.rb', line 60 def major_version @major_version end |
#minor_version ⇒ Object (readonly)
@return [Integer]
63 64 65 |
# File 'lib/jss/server.rb', line 63 def minor_version @minor_version end |
#organization ⇒ String (readonly) Also known as: institution
Returns the organization to which the server is licensed.
44 45 46 |
# File 'lib/jss/server.rb', line 44 def organization @organization end |
#product ⇒ String (readonly) Also known as: product_name
Returns the license product name.
54 55 56 |
# File 'lib/jss/server.rb', line 54 def product @product end |
#raw_version ⇒ Object (readonly)
@return [String]
69 70 71 |
# File 'lib/jss/server.rb', line 69 def raw_version @raw_version end |
#revision_version ⇒ Object (readonly)
@return [Integer]
66 67 68 |
# File 'lib/jss/server.rb', line 66 def revision_version @revision_version end |
#version ⇒ Object (readonly)
@return [String] The version of the JSS. See the method JSS.parse_jss_version
57 58 59 |
# File 'lib/jss/server.rb', line 57 def version @version end |