Skip to content

Commit 44507a7

Browse files
author
Will Meek
committed
Readme updates
1 parent ebc4696 commit 44507a7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,26 @@ The generated unit tests in `spec/unit/puppet/provider/foo_spec.rb` get automati
174174

175175
## Remote Resources
176176

177-
Support for remote resources is enabled through the use of a `transport`. A transport class conatins the code for managing connections and processing information to/from the remote resource. Please see the [RSAPI specification](https://github.com/puppetlabs/puppet-specifications/tree/master/language/resource-api#transport) document on how to create a transport.
177+
Support for remote resources is enabled through the use of a `transport` class. A transport class contains the code for managing connections and processing information to/from the remote resource. Please see the [Resource API specification](https://github.com/puppetlabs/puppet-specifications/tree/master/language/resource-api#transport) document on how to create a transport class.
178178

179179
### `puppet device` support
180180

181-
To connect to a remote resource through `puppet device` a `transport` must be called through a device shim.
181+
To connect to a remote resource through `puppet device` a `transport` class must be called through a device shim.
182+
183+
For example:
182184

183185
```ruby
184-
# lib/puppet/util/network_device/remote_thing.rb
186+
# lib/puppet/util/network_device/device_type/device.rb
185187

186188
require 'puppet'
187189
require 'puppet/resource_api/transport/wrapper'
188-
# force registering the transport
189-
require 'puppet/transport/schema/remote_thing'
190+
# force registering the transport schema
191+
require 'puppet/transport/schema/device_type'
190192

191-
module Puppet::Util::NetworkDevice::RemoteThing
193+
module Puppet::Util::NetworkDevice::DeviceType
192194
class Device < Puppet::ResourceApi::Transport::Wrapper
193195
def initialize(url_or_config, _options = {})
194-
super('remote_thing', url_or_config)
196+
super('device_type', url_or_config)
195197
end
196198
end
197199
end
@@ -201,7 +203,7 @@ After this, `puppet device` will be able to use the new provider, and supply it
201203

202204
#### Transport/Device specific providers
203205

204-
To allow modules to deal with different backends independently of each other, the Resource API also implements a mechanism to use different API providers side-by-side. For a given transport/device (see above), the Resource API will first try to load a `Puppet::Provider::TypeName::DeviceType` class from `lib/puppet/provider/type_name/device_type.rb`, before falling back to the regular provider at `Puppet::Provider::TypeName::TypeName`.
206+
To allow modules to deal with different backends independently of each other, the Resource API also implements a mechanism to use different API providers side-by-side. For a given transport/device class (see above), the Resource API will first try to load a `Puppet::Provider::TypeName::DeviceType` class from `lib/puppet/provider/type_name/device_type.rb`, before falling back to the regular provider at `Puppet::Provider::TypeName::TypeName`.
205207

206208
## Further Reading
207209

0 commit comments

Comments
 (0)