You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: language/resource-api/README.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,6 @@ Each resource being managed must be identified by a unique title. Usually this i
77
77
78
78
If multiple attributes are defined with the `namevar` behaviour, the type SHOULD specify `title_patterns` that will tell Resource API how to get at the attributes from the title. If `title_patterns` is not specified a default pattern is applied, and matches against the first declared `namevar`.
79
79
80
-
81
80
> Note: The order of title_patterns is important. You should declare the most specific pattern first and end with the most generic.
82
81
83
82
Each title pattern contains the:
@@ -184,7 +183,7 @@ A missing `:should` entry indicates that a resource should be removed from the s
184
183
185
184
The `set` method should always return `nil`. Any progress signaling should be done through the logging utilities described below. If the `set` method throws an exception, all resources that should change in this call and haven't already been marked with a definite state, will be marked as failed. The runtime will only call the `set` method if there are changes to be made, especially in the case of resources marked with `noop => true` (either locally or through a global flag). The runtime will not pass them to `set`. See `supports_noop` below for changing this behaviour if required.
186
185
187
-
Both methods take a `context` parameter which provides utilties from the runtime environment, and is decribed in more detail there.
186
+
Both methods take a `context` parameter which provides utilities from the runtime environment, and is described in more detail in its own section below.
188
187
189
188
## Implementing simple providers
190
189
@@ -208,17 +207,17 @@ class Puppet::Provider::AptKey::AptKey < Puppet::ResourceApi::SimpleProvider
208
207
Once all of that is in place, instead of the `set` method, the provider needs to implement the `create`, `update` or `delete` methods:
209
208
210
209
*`create(context, name, should)`: This is called when a new resource should be created.
211
-
*`context`: provides utilties from the runtime environment, and is decribed in more detail there.
210
+
*`context`: provides utilities from the runtime environment, and is described in more detail in its own section below.
212
211
*`name`: the name or hash of the new resource.
213
212
*`should`: a hash of the attributes for the new instance.
214
213
215
214
*`update(context, name, should)`: This is called when a resource should be updated.
216
-
*`context`: provides utilties from the runtime environment, and is decribed in more detail there.
215
+
*`context`: provides utilities from the runtime environment, and is described in more detail in its own section below.
217
216
*`name`: the name or hash of the resource to change.
218
217
*`should`: a hash of the desired state of the attributes.
219
218
220
219
*`delete(context, name)`: This is called when a resource should be deleted.
221
-
*`context`: provides utilties from the runtime environment, and is decribed in more detail there.
220
+
*`context`: provides utilities from the runtime environment, and is described in more detail in its own section below.
222
221
*`name`: the name or hash of the resource that should be deleted.
223
222
224
223
The `SimpleProvider` takes care of basic logging, and error handling.
0 commit comments