Class: JSS::Server
- Inherits:
-
Object
- Object
- JSS::Server
- Defined in:
- lib/jss-api/server.rb,
lib/jss-api.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!
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/jss-api/server.rb', line 77 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)
47 48 49 |
# File 'lib/jss-api/server.rb', line 47 def activation_code @activation_code end |
#license_type ⇒ String (readonly)
50 51 52 |
# File 'lib/jss-api/server.rb', line 50 def license_type @license_type end |
#major_version ⇒ Object (readonly)
@return [Integer]
59 60 61 |
# File 'lib/jss-api/server.rb', line 59 def major_version @major_version end |
#minor_version ⇒ Object (readonly)
@return [Integer]
62 63 64 |
# File 'lib/jss-api/server.rb', line 62 def minor_version @minor_version end |
#organization ⇒ String (readonly) Also known as: institution
43 44 45 |
# File 'lib/jss-api/server.rb', line 43 def organization @organization end |
#product ⇒ String (readonly) Also known as: product_name
53 54 55 |
# File 'lib/jss-api/server.rb', line 53 def product @product end |
#raw_version ⇒ Object (readonly)
@return [String]
68 69 70 |
# File 'lib/jss-api/server.rb', line 68 def raw_version @raw_version end |
#revision_version ⇒ Object (readonly)
@return [Integer]
65 66 67 |
# File 'lib/jss-api/server.rb', line 65 def revision_version @revision_version end |
#version ⇒ Object (readonly)
@return [String] The version of the JSS. See the method JSS.parse_jss_version
56 57 58 |
# File 'lib/jss-api/server.rb', line 56 def version @version end |