ruby-jss 2.0.0b1 → 2.0.0rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe30c0681cd2c394be81e8f15797e5222d6ce95c7458717a206c91d9d1704137
4
- data.tar.gz: 275bfb95e7924dd12612e4077fea75da21105b2b8fc7239e989704cdc9bca65a
3
+ metadata.gz: 89974abcf43374bb65bbb1e0e91a2c147b0a28e7143f8f5e995c372c7ecdef7d
4
+ data.tar.gz: 720708403ca790ca523b11cedffa5c4c218f67720bc0ef3cce57f97ef9ce7490
5
5
  SHA512:
6
- metadata.gz: 747af106fa7e86e60535a831cbd36af1b850e6682cacee07fea2e30ed079188be1ddf6c17e06d25d8887cbda3e35411329fe91a5d2e60c49b5f93a3d2e1b03a3
7
- data.tar.gz: 5e56d93b2dc5fa52faa6a385352d71b5d5691ce9a7428f459eece369d991504729b3ddfe0eea721f6e888306e524684a0bade6572e5c96752605d0179c8e923f
6
+ metadata.gz: b0e93ad88ec4cf67ae0200d5bd57b57b2a56ccd5eac63a4ee6d44a6ec6f8d750d35f6f8a73166c6be23fe1ad2ae749ba2edeada06cce2679dac5eee6636b591e
7
+ data.tar.gz: 5f7cc9072b0b180fb2f066b4caf89869e59b426dba275f2ee7431b9db99aa236b00ac799eb4ba6e1aa08a1a64c053cd5c754342c2b24805ba4323070fd641c95
data/CHANGES.md CHANGED
@@ -26,6 +26,7 @@ Here are the high-level changes and there are many many others. For more details
26
26
  - Base classes for JamfPro API objects are automatically generated from the OAPI3 Schema available at https://your.jamf.server/api/schema. This make it much simpler for ruby-jss to implement and update new and changed objects and endpoints in the Jamf Pro API.
27
27
  - Code is auto-loaded from disk
28
28
  - Because the auto-generated classes add hundreds of files to the gem, ruby-jss now uses [Zeitwerk](https://github.com/fxn/zeitwerk) to auto-load only the files it needs when they are needed.
29
+ - Support for Ruby 3.x
29
30
 
30
31
 
31
32
  ## \[1.6.7] - 2022-02-22
data/README-2.0.0.md CHANGED
@@ -2,50 +2,52 @@
2
2
 
3
3
  Version 2.0.0 is a major refactoring of ruby-jss. While attempting to provide as much backward compatibility as possible, there are some significant changes under the hood. **_PLEASE TEST YOUR CODE EXTENSIVELY_**
4
4
 
5
- This document discusses the high-level changes, listing the detailed changes that have already happened, as well as planned changes and deprecations. It also provides some discussion and background around all of this. It is a work-in-progress at the moment, and hopefully will prompt discussion and decision-making in the #ruby-jss channel of MacAdmins Slack (Please join us!)
5
+ This document discusses the high-level changes, a few specific changes that have already happened, as well as planned changes and deprecations. It also provides some discussion and background around all of this.
6
6
 
7
- These changes have been in mind for some time, but the ability (soon to be requirement) for the Classic API to authenticate with Bearer Tokens from the Jamf Pro API means that the time has come, so here we are!
7
+ This is a work-in-progress at the moment, and will probably remain so well after initial release. Hopefully this document will prompt discussion and decision-making in the [#ruby-jss channel of Macadmins Slack](https://macadmins.slack.com/archives/C03C7F563MK) (Please join us!)
8
+
9
+ These changes have been in mind for some time, but the requirement in late 2022 for the Classic API to authenticate with Bearer Tokens from the Jamf Pro API means that the time has come, so here we are!
8
10
 
9
11
  **CONTENTS**
10
12
 
11
13
  <!-- TOC -->
12
14
 
13
- - [ruby-jss 2.0: Combined access to the Classic and Jamf Pro APIs](#ruby-jss-20-combined-access-to-the-classic-and-jamf-pro-apis)
14
- - [Requirements](#requirements)
15
- - [High level changes](#high-level-changes)
16
- - [Ruby 3.x support](#ruby-3x-support)
17
- - [Combined API access](#combined-api-access)
18
- - [A single Connection class](#a-single-connection-class)
19
- - [Connecting to the API](#connecting-to-the-api)
20
- - [The default connection](#the-default-connection)
21
- - [A single namespace Jamf](#a-single-namespace-jamf)
22
- - [Inherant differences between the APIs](#inherant-differences-between-the-apis)
23
- - [Which API does an object come from?](#which-api-does-an-object-come-from)
24
- - [Automatic code generation](#automatic-code-generation)
25
- - [Autoloading with Zeitwerk](#autoloading-with-zeitwerk)
26
- - [Notable changes from ruby-jss 1.x](#notable-changes-from-ruby-jss-1x)
27
- - [Paged queries to the Jamf Pro API](#paged-queries-to-the-jamf-pro-api)
28
- - [API data are no longer cached ?](#api-data-are-no-longer-cached-)
29
- - [No Attribute aliases for Jamf Pro API objects](#no-attribute-aliases-for-jamf-pro-api-objects)
30
- - [Class/Mixin hierarchy for Jamf Pro API objects](#classmixin-hierarchy-for-jamf-pro-api-objects)
31
- - [Support for 'Sticky Sessions' in Jamf Cloud](#support-for-sticky-sessions-in-jamf-cloud)
32
- - [Planned deprecations](#planned-deprecations)
33
- - [Use of the term 'api' in method names, parameter names, and attributes](#use-of-the-term-api-in-method-names-parameter-names-and-attributes)
34
- - [.map_all_ids_to method for Classic API collection classes](#map_all_ids_to-method-for-classic-api-collection-classes)
35
- - [Using .make, #create, and #update for Classic API objects](#using-make-create-and-update-for-classic-api-objects)
36
- - [JSS::CONFIG](#jssconfig)
37
- - [Jamf::Connection instance methods #next_refresh, #secs_to_refresh, & #time_to_refresh](#jamfconnection-instance-methods-next_refresh-secs_to_refresh---time_to_refresh)
38
- - [Cross-object validation in setters](#cross-object-validation-in-setters)
39
- - [fetch :random](#fetch-random)
40
- - [Documentation](#documentation)
41
- - [How to install for testing](#how-to-install-for-testing)
42
- - [Contact](#contact)
15
+ - [Requirements](#requirements)
16
+ - [High level changes](#high-level-changes)
17
+ - [Ruby 3.x support](#ruby-3x-support)
18
+ - [Combined API access](#combined-api-access)
19
+ - [A single Connection class](#a-single-connection-class)
20
+ - [Connecting to the API](#connecting-to-the-api)
21
+ - [The default connection](#the-default-connection)
22
+ - [A single namespace Jamf](#a-single-namespace-jamf)
23
+ - [Inherant differences between the APIs](#inherant-differences-between-the-apis)
24
+ - [Which API does an object come from?](#which-api-does-an-object-come-from)
25
+ - [Automatic code generation](#automatic-code-generation)
26
+ - [Autoloading with Zeitwerk](#autoloading-with-zeitwerk)
27
+ - [Known Breaking Changes](#known-breaking-changes)
28
+ - [Notable changes from ruby-jss 1.x](#notable-changes-from-ruby-jss-1x)
29
+ - [Paged queries to the Jamf Pro API](#paged-queries-to-the-jamf-pro-api)
30
+ - [API data are no longer cached ?](#api-data-are-no-longer-cached-)
31
+ - [No Attribute aliases for Jamf Pro API objects](#no-attribute-aliases-for-jamf-pro-api-objects)
32
+ - [Class/Mixin hierarchy for Jamf Pro API objects](#classmixin-hierarchy-for-jamf-pro-api-objects)
33
+ - [Support for 'Sticky Sessions' in Jamf Cloud](#support-for-sticky-sessions-in-jamf-cloud)
34
+ - [Planned deprecations](#planned-deprecations)
35
+ - [Use of the term 'api'](#use-of-the-term-api)
36
+ - [.map_all_ids_to method for Classic API collection classes](#map_all_ids_to-method-for-classic-api-collection-classes)
37
+ - [Using .make, #create, and #update for Classic API objects](#using-make-create-and-update-for-classic-api-objects)
38
+ - [JSS::CONFIG](#jssconfig)
39
+ - [Jamf::Connection instance methods #next_refresh, #secs_to_refresh, & #time_to_refresh](#jamfconnection-instance-methods-next_refresh-secs_to_refresh---time_to_refresh)
40
+ - [Cross-object validation in setters](#cross-object-validation-in-setters)
41
+ - [fetch :random](#fetch-random)
42
+ - [Documentation](#documentation)
43
+ - [How to install for testing](#how-to-install-for-testing)
44
+ - [Contact](#contact)
43
45
 
44
46
  <!-- /TOC -->
45
47
 
46
48
  ## Requirements
47
49
 
48
- ruby-jss 2.0 requires ruby 2.6.3 or higher, and a Jamf Pro server running version 10.35 or higher.
50
+ ruby-jss 2.0,0 requires ruby 2.6.3 or higher, and a Jamf Pro server running version 10.35 or higher.
49
51
 
50
52
  This means it will work with the OS-supplied /usr/bin/ruby in macOS 10.15 Catalina and above, until Apple removes ruby from the OS.
51
53
 
@@ -57,15 +59,15 @@ The plan is for ruby-jss 2.0+ to be compatible with ruby 2.6.3 and higher, inclu
57
59
 
58
60
  As of this writing, basic access to the API seems to be working in ruby 3, but much much more testing is needed.
59
61
 
60
- It looks like the biggest changes have been dealing with keyword arguments as Hashs. Methods defined with `def methodname([...] foo = {}` need to be changed to `def methodname([...] **foo` and calls to those methods, even in your own code, need to be changed to `methodname([...] **foo)` when `foo` is a hash of keyword args.
62
+ It looks like the biggest changes have been dealing with keyword arguments as Hashs. Methods defined with `def methodname([...] foo = {})` need to be changed to `def methodname([...] **foo)` and calls to those methods, even in your own code, need to be changed to `methodname([...] **foo)` when `foo` is a hash of keyword args.
61
63
 
62
- **IMPORTANT**: do not pass raw hashes as 'keyword' args. Instead use the double-splat: `methodname(**hash)` which should be compatible with ruby 3.x and 2.7.x
64
+ **IMPORTANT**: This may be a breaking change. Do not pass raw hashes as 'keyword' args. Instead use the double-splat: `methodname(**hash)` which should be compatible with ruby 3.x and 2.6.x
63
65
 
64
- for more info see [Separation of positional and keyword arguments in Ruby 3.0](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)
66
+ For more info see [Separation of positional and keyword arguments in Ruby 3.0](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/)
65
67
 
66
68
  ### Combined API access
67
69
 
68
- ruby-jss has always used the `JSS` module to encapsulate all access to the Classic API. When the Jamf Pro API became a thing, the `Jamf` module was created as the way to interact with that API as it grew and developed.
70
+ Previous versions of ruby-jss used the `JSS` module to encapsulate all access to the Classic API. When the Jamf Pro API became a thing, it was a vary different beast, so the `Jamf` module was created as the way to interact with that API as it grew and developed.
69
71
 
70
72
  Even though the latest Jamf Pro release notes say the Jamf Pro API is still officially "open for user testing", it has stablized enough that it is used by many folks for production work.
71
73
 
@@ -77,23 +79,24 @@ There is now one `Jamf::Connection` class, instances of which are connections to
77
79
 
78
80
  ##### Connecting to the API
79
81
 
80
- Most of the previous methods and parameters for making API connections to either API should still work, including using a URL rather than individual connection parameters. So both of these are valid and identical:
82
+ Most of the previous methods and parameters for making connections to either API should still work, including using a URL rather than individual connection parameters. So both of these are valid and identical:
81
83
 
82
84
  ```ruby
83
85
  a_connection = Jamf::Connection.new 'https://apiuser@my.jamf.server:8443/', pw: :prompt
84
86
 
85
87
  another_connection = Jamf::Connection.new host: 'my.jamf.server', port: 8443, user: 'apiuser', pw: :prompt
86
88
  ```
87
-
88
89
  Other connection parameters can be passed in as normal.
89
90
 
90
91
  ###### The default connection
91
92
 
92
- The top-level module methods for accessing the 'default' connection are still available and are now synonyms: `Jamf.cnx` and `JSS.api` both return the current default Jamf::Connection instance. There is also a top-level methods`Jamf.connect` which is the same as `Jamf.cnx.connect`. The top-level methods for changing the default connection are still there. The use of `JSS::API` has been deprecated for years now, and still is (see below).
93
+ The top-level module methods for accessing the 'default' connection are still available and are now synonyms: `Jamf.cnx` and `JSS.api` both return the current default Jamf::Connection instance. There is also a top-level methods`Jamf.connect` which is the same as `Jamf.cnx.connect`. The top-level methods for changing the default connection are still there.
94
+
95
+ NOTE: The use of `JSS::API` has been deprecated for years now, and still is (see below).
93
96
 
94
97
  #### A single namespace `Jamf`
95
98
 
96
- Version 2.0.0 combines the `JSS` module and the `Jamf` module into a single `Jamf` module, with `JSS` aliased to it. This means you can use them interchangably to refer to the Jamf module, and existing code that used either should still work. The module name no longer indicates which API you're working with.
99
+ Version 2.0.0 combines the `JSS` module and the `Jamf` module into a single `Jamf` module, with `JSS` aliased to it. This means you can use the names interchangably to refer to the Jamf module, and existing code that used either should still work. The module name no longer indicates which API you're working with.
97
100
 
98
101
  For example, the `JSS::Computer` class, from the Classic API, is still a thing, but now just points to the `Jamf::Computer` class, still from the Classic API. The `Jamf::InventoryPreloadRecord` class, from the Jamf Pro API remains as is, but can also be referred to as `JSS::InventoryPreloadRecord`
99
102
 
@@ -103,9 +106,9 @@ In theory, you shouldn't need to worry about which classes and objects come from
103
106
 
104
107
  However, in reality the two APIs have different functionality, some of which must be reflected in the ruby classes that represent objects in those APIs.
105
108
 
106
- Take, for example, the classes for 'Collection Resources' - API endpoints that let you deal with collections of objects like Computers, or Inventory Preload Records. These classes implement a `.all` class method, which retrieves a list of some data about all members of the collection.
109
+ Take, for example, the classes for 'Collection Resources' - API endpoints that let you deal with collections of objects like Computers, or Inventory Preload Records. These classes implement a `.all` class method, which retrieves an Array of some data about all members of the collection.
107
110
 
108
- Not only is the data returned in such lists very different between the APIs, but in the Jamf Pro API, you can ask the server to return the list already sorted, possibly filtered, or 'paged' in groups of some number of items. None of that is possible in the Classic API.
111
+ Not only is the data returned in such Arrays very different between the APIs, but in the Jamf Pro API, you can ask the server to return the list already sorted, possibly filtered, or 'paged' in groups of some number of items. None of that is possible in the Classic API.
109
112
 
110
113
  The `.all` method, and its relatives like `.all_ids`, `.all_names`, etc. exist for Collection Resources in both APIs, but the methods take different parameters, e.g. to deal with sorting and filtering. Jamf Pro API classes have a `.pager` method which returns an object from which you can retrieve the 'pages' of your query.
111
114
 
@@ -121,9 +124,11 @@ The API documentation you see at your own Jamf Pro server at https://your.jamf.s
121
124
 
122
125
  In ruby-jss 2.0 and up, the OAPI spec is used to automatically generate hundreds of 'base' classes in ruby-jss, each with automatically generated attribute getters, setters, validators, and other useful methods. These base classes can then be used as the superclasses of the Jamt Pro API objects we implement for direct use in ruby-jss - and the majority of the coding is already done! The subclasses implementing objects in ruby-jss can then be expanded and customized beyond the simple, auto-generated superclass.
123
126
 
124
- Not only does this make it fast and simple to implement new objects in ruby-jss, but allows fast and simple updates to existing objects, when new functionality is introduced to the API.
127
+ Not only does this make it fast and simple to implement new objects in ruby-jss, but allows fast and simple updates to existing objects, when new functionality is introduced to the API.
125
128
 
126
- If you develop ruby-jss, please see (documentation link TBA) for more info about how to use the auto-generated classes.
129
+ Hopefully it will also allow a single version of ruby-jss to work with a wide range of Jamf Pro versions, as API endpoint versions are added and deprecated (details of how that'll work are TBD)
130
+
131
+ If you develop ruby-jss, please see (documentation link will go here) for more info about how to use the auto-generated classes, or reach out to us. (See [Contact](#contact), below)
127
132
 
128
133
  ### Autoloading with Zeitwerk
129
134
 
@@ -138,6 +143,19 @@ Then as files load, lines will be written to standard error indicating:
138
143
  - A module was mixed-in to some other module or class
139
144
  - A method was just automatically defined
140
145
 
146
+ ## Known Breaking Changes
147
+
148
+ So far we've only uncovered a few areas where our ruby-jss 1.x code didn't work with ruby-jss 2.0.0
149
+
150
+ - Using unsplatted Hashes as 'named parameters' to method calls.
151
+ - See [Ruby 3.x support](#ruby-3x-support) above
152
+
153
+ - Jamf Pro API objects no longer have aliases for their attributes
154
+ - See [No Attribute aliases for Jamf Pro API objects](#no-attribute-aliases-for-jamf-pro-api-objects) below
155
+
156
+ - Subclassing ruby-jss classes in your own code.
157
+ - Those classes, and methods called on them, may need to be updated to match the new ruby-jss classes, in order to maintain _their_ backward compatibility.
158
+
141
159
  ## Notable changes from ruby-jss 1.x
142
160
 
143
161
  ### Paged queries to the Jamf Pro API
@@ -150,26 +168,32 @@ The `.all` method will never deliver paged results, however if you give it a `fi
150
168
 
151
169
  ### API data are no longer cached (?)
152
170
 
153
- **NOTE:** As of this writing, caching has been removed for the objects from the Jamf Pro API, but caching remains in the Classic API. Its removal, or the re-instatement of caching for JP API objects, are pending discussion with users of ruby-jss.
171
+ **NOTE:** As of this writing, caching has been removed for the objects from the Jamf Pro API, but caching remains in the Classic API. Its removal, or the re-instatement of caching for JP API objects, are pending discussion with other users of ruby-jss.
154
172
 
155
173
  Pre-2.0, methods that would fetch large datasets from the server would always cache that data in the Connection object, and by default use the cache in future calls unless a `refresh` parameter is given. These datasets included:
156
174
 
157
175
  - collection lists, used by `.all` and friends, like `.all_ids` and `.valid_id`
158
- - Extension Attribute, definitions, used for validating Extension Attribute values
176
+ - Extension Attribute definitions, used for validating Extension Attribute values
159
177
 
160
178
  In 2.0+, that caching has been removed for objects from them Jamf Pro API.
161
179
 
162
- If you want to avoid repeated GET requests to the server when you aren't worried that the resulting data may have changed, you can store the results of `.all` in a variable, and either use it yourself, or pass it in to other methods via the `cached_list:` parameter. Passing in a cached_list wil prevent those methods from calling `.all` and reaching out to the server again.
180
+ If you want to avoid repeated GET requests to the server when you aren't worried that the resulting data may have changed, you can store the results of `.all` in a variable, and either use it yourself, or pass it in to other methods via the `cached_list:` parameter. Passing in a cached_list wil prevent those methods from calling `.all` and reaching out to the server again.
163
181
 
164
- **WARNING**: Be careful that the list you pass in via `cached_list` contains the correct data structure for the class, and came from the desired Connection instance.
182
+ **WARNING**: Caching a list yourself and using it with `cached_list` can cause all kinds of problems if you don't ensure these points:
183
+ - the cached_list contains the correct data structure for the class
184
+ - i.e. pass in the results of `.all` for that class, not `.all_ids` or other sub-lists.
185
+ - the cached_list came from the correct Connection instance
186
+ - the cached_list is sufficiently up to date.
165
187
 
166
188
  ### No Attribute aliases for Jamf Pro API objects
167
189
 
168
190
  Objects from the Jamf Pro API will no longer define aliases for the attribute names that come from the API itself. This means, e.g., to get the name of a ComputerPrestage or MobileDevicePrestage, you have to ask for its `displayName` not its `name`, since the property comes from the API as `displayName`. To see a list of all the names, you must use `.all_displayNames` not `.all_names`. For objects with a 'name' property (most of them) then you can use `.name` and `.all_names`.
169
191
 
170
- The reason behind this is twofold: 1) to simplify ruby-jss's code and automate as much as possible; 2) to reflect what Jamf actually gives us in the APIs.
192
+ The reason behind this is twofold:
193
+ 1) to simplify ruby-jss's code and automate as much as possible
194
+ 2) to reflect what Jamf actually gives us in the APIs
171
195
 
172
- This is a breaking change from earlier ruby-jss versions, for which Jamf Pro API objects had the potential for aliases of their attribute names.
196
+ **IMPORTANT** This is a breaking change from earlier ruby-jss versions, for which Jamf Pro API objects had the potential for aliases of their attribute names.
173
197
 
174
198
  ### Class/Mixin hierarchy for Jamf Pro API objects
175
199
 
@@ -177,11 +201,11 @@ If you contribute to ruby-jss, be aware that the structure of superclasses, subc
177
201
 
178
202
  There's a lot to document about these changes, and much of the current documentation is out of date, referring to how things were done when the Jamf module was separate and only talked to the Jamf Pro API.
179
203
 
180
- Give us time and we'll get everything updated. In the meantime, feel free to reach out in the #ruby-jss channel of Macadmins Slack, or open an issue on GitHub, or email ruby-jss@pixar.com.
204
+ Give us time and we'll get everything updated. In the meantime, feel free to reach out for assistance or questions. (See [Contact](#contact), below)
181
205
 
182
206
  ### Support for 'Sticky Sessions' in Jamf Cloud
183
207
 
184
- If you are connecting to a Jamf Cloud server, you can specifcy `sticky_sessions: true` when calling `Jamf::Connection.new` or `Jamf::Connection#connect`. If you already have a connected Connection object, you can enable or disable Sticky Sessions using `my_connection_object.sticky_session =` with a boolean value (for the default connection use `Jamf.cnx.sticky_session = <boolean>`). To see the actual cookie being sent to enable sticky sessions, use `Jamf::Connection#sticky_session_cookie`.
208
+ If you are connecting to a Jamf Cloud server, you can specifcy `sticky_session: true` when calling `Jamf::Connection.new` or `Jamf::Connection#connect`. If you already have a connected Connection object, you can enable or disable Sticky Sessions using `my_connection_object.sticky_session =` with a boolean value (for the default connection use `Jamf.cnx.sticky_session = <boolean>`). To see the actual cookie being sent to enable sticky sessions, use `Jamf::Connection#sticky_session_cookie`.
185
209
 
186
210
  Attempting to enable a sticky session with a connection to an on-prem server (host not ending in 'jamfcloud.com') will raise an error.
187
211
 
@@ -189,12 +213,27 @@ For details about Sticky Sessions see [Sticky Sessions for Jamf Cloud](https://d
189
213
 
190
214
  **WARNING:** Jamf recommends NOT using sticky sessions unless they are needed. Using them inappropriately may negatively impact performance, especially for large automated processes.
191
215
 
192
-
193
216
  ## Planned deprecations
194
217
 
195
- ### Use of the term 'api' in method names, parameter names, and attributes
218
+ Even though it was publically released in 2014, ruby-jss's origins are from 2009, so it's been around for a while. We've learned a lot since then, and lots of the old lingering code is terribly out of date.
196
219
 
197
- Use `cnx` instead. Example:
220
+ The move to 2.0.0 is our opportunity to start streamlining things and cleaning up not just the code, but how it's used.
221
+
222
+ We wanted to make the initial transition to 2.0.0 as backward-compatible as possible, but going forward, a lot of things will be changing or going away.
223
+
224
+ All of this is up for discussion! If you have suggestions or ideas for improvement, cleanup, or modernization, or if one of these deprecated items is important to you, [please reach out](#contact) and let us hear your thoughts.
225
+
226
+ As a side effect of these planned changes, and due to our attempts to adhere to [Semantic Versioning](https://semver.org), you can expect the major version number to start going up faster than it used to.
227
+
228
+ Here are the things we are planning on removing or changing in the coming months-to-years:
229
+
230
+ ### Use of the term 'api'
231
+
232
+ In ruby-jss < 2.0, the term `api` is used with the Classic API in method names, method parameters, instance variables, attributes, and constants. It is used to pass, access, refer to, or hold instances of JSS::APIConnnection, e.g. so a method that talks to the server would use the passed connection rather than the module-wide default connection.
233
+
234
+ The term 'api' is inappropriate because the thing being passed is a 'connection' not an 'api'. Now that there are actually two APIs at play, that usage is even less appropriate.
235
+
236
+ Going forward, use `cnx` (simpler to type than 'connection') instead. Example:
198
237
 
199
238
  ```ruby
200
239
  my_connection = Jamf::Connection.new 'https://user@my.jamf.server:8443/', pw: :prompt
@@ -214,11 +253,11 @@ comp = JSS::Computer.fetch id: 12, cnx: my_connection
214
253
  comp.cnx # => my_connection
215
254
  ```
216
255
 
217
- In ruby-jss < 2.0, the term `api` is used with the Classic API in method names, method parameters, instance variables, attributes, and constants. It is used to pass, access, or hold instances of JSS::APIConnnection, e.g. so a method that talks to the server would use the passed connection rather than the module-wide default connection. But, the thing being passed is a 'connection' not an 'API', and now that there are actually two APIs at play, that usage is even less appropriate.
256
+ The original Jamf module, which accessed only the Jamf Pro API, has always used the better-suited abbreviation `cnx` for this, and now that is standard everywhere.
218
257
 
219
- The Original Jamf module, which accessed only the Jamf Pro API, has always used the better-suited abbreviation `cnx` for this, and now that is standard everywhere. For now `api` should continue to work, but it will be removed 'eventually', so please start changing your code now.
258
+ For now `api` should continue to work, but it will be removed 'eventually', so please start changing your code now.
220
259
 
221
- Accordingly, `JSS::API` (which should never have been a constant to begin with) is also deprecated. To access the default connection, use `Jamf.cnx`
260
+ Accordingly, `JSS::API` (which should never have been a constant to begin with) has been deprecated for years in favor of `JSS.api`, which is now also deprecated. To access the default connection, use `Jamf.cnx`
222
261
 
223
262
  ### `.map_all_ids_to` method for Classic API collection classes
224
263
 
@@ -230,7 +269,7 @@ For now `map_all_ids_to` still works, however it's just a wrapper for `map_all`.
230
269
 
231
270
  Use `.create` and `#save` instead, as with the Jamf Pro API objects
232
271
 
233
- In previous ruby-jss, both APIs avoided the use of the ruby-standard `.new` on Collection Resource classes, because the word 'new' in this context is ambiguous: are you creating a new instance of the class in ruby (which might already exist on the server), or are you creating a new object in Jamf Pro that doesn't yet exist on the server?
272
+ All versions of ruby-jss have avoided the use of the ruby-standard `.new` on Collection Resource classes, because the word 'new' in this context is ambiguous: are you creating a new instance of the class in ruby (which might already exist on the server), or are you creating a new object in Jamf Pro that doesn't yet exist on the server?
234
273
 
235
274
  In v2.0.0 we are standardizing on the behavior of the previous Jamf module:
236
275
 
@@ -239,8 +278,6 @@ In v2.0.0 we are standardizing on the behavior of the previous Jamf module:
239
278
  - `Jamf::SomeCollectionClass#save` instance method for sending an object to the server to be created OR updated in Jamf pro.
240
279
  - Note that `#save` has been available for this use since the earliest versions of ruby-jss.
241
280
 
242
-
243
-
244
281
  This means that these deprecated methods will go away for Classic API objects
245
282
 
246
283
  - `Jamf::SomeCollectionClass.make` class method for instantiating a ruby object to be added as a new SomeCollectionClass to Jamf Pro
@@ -286,7 +323,7 @@ existing_policy.save
286
323
 
287
324
  ### JSS::CONFIG
288
325
 
289
- This also should never have been a constant. Use Jamf.config. JSS::CONFIG will go away eventually.
326
+ This should never have been a constant. Use Jamf.config. JSS::CONFIG will go away eventually.
290
327
 
291
328
  ### Jamf::Connection instance methods `#next_refresh`, `#secs_to_refresh`, & `#time_to_refresh`
292
329
 
@@ -320,7 +357,7 @@ You can still fetch random objects from a collection, but use `.fetch random: tr
320
357
 
321
358
  The YARD documentation for v2.0.0 is available before release in the [github.io site for ruby-jss](http://pixaranimationstudios.github.io/ruby-jss/docs/v2.x/index.html).
322
359
 
323
- All the documentation for ruby-jss is in need of updating, from the top-level README to the auto-generated YARD docs. If you have questions that aren't answered there, please reach out (see Contact, below)
360
+ All the documentation for ruby-jss is in serious need of updating, from the top-level README to the auto-generated YARD docs. Forgive us while we slowly get it up to snuff. If you have questions that aren't answered there, please reach out (see [Contact](#contact), below)
324
361
 
325
362
  ## How to install for testing
326
363