Skip to content

Commit 0223fcf

Browse files
authored
Merge pull request #137 from puppetlabs/rsapi-reserved-transport-keywords
Add reserved and recommended keywords for transport schemas
2 parents 0286d30 + df914aa commit 0223fcf

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

language/resource-api/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ To support Puppet versions prior to 6, see the [Legacy Support](#legacy-support)
370370
### Transport
371371

372372
```ruby
373-
# lib/puppet/transport/nexus_schema.rb
373+
# lib/puppet/transport/schema/nexus.rb
374374
Puppet::ResourceAPI.register_transport(
375375
name: 'nexus', # points at class Puppet::Transport::Nexus
376376
desc: 'Connects to a Cisco Nexus device',
@@ -418,6 +418,24 @@ A transport connects providers to the remote target. It consists of the schema a
418418
419419
Password attributes should also set `sensitive: true` to ensure that the data is handled securely. Attributes marked with this flag allow any UI based off this schema to make appropriate presentation choices. The value will be passed to the transport wrapped in a `Puppet::Pops::Types::PSensitiveType::Sensitive`. This will keep the value from being logged or saved inadvertently while it is being transmitted between components. To access the value within the Transport use the `unwrap` method. e.g. `connection_info[:password].unwrap`.
420420
421+
A transport schema accepts the following keywords:
422+
423+
* `uri`: use when you need to specify a specific URL to connect to. All of the following keys will be computed from the `uri` when possible. In the future more url parts may be computed from the URI.
424+
* `host`: use to specify an IP or address to connect to.
425+
* `protocol`: use to specify which protocol the transport should use for example `http`, `https`, `ssh` or `tcp`.
426+
* `user`: the user the transport should connect as.
427+
* `port`: the port the transport should connect to.
428+
429+
Do not use the following keywords when writing a schema:
430+
431+
* `name`: transports should use `uri` instead of name.
432+
* `path`: reserved as a uri part.
433+
* `query`: reserved as a uri part.
434+
* `run-on`: This is used by Bolt to determine which target to proxy to. Transports should not rely on this key.
435+
* `remote-transport`: This is used to determine which transport to load. It should always be the transport class named "declassified".
436+
* `remote-*`: any key starting with `remote-` is reserved for future use.
437+
* `implementations`: reserved by Bolt.
438+
421439
The transport implementation must implement the following methods:
422440
423441
* `initialize(context, connection_info)`

0 commit comments

Comments
 (0)