Skip to content

Update RSAPI spec to match actual implementation #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions language/resource-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -526,16 +526,16 @@ Puppet::ResourceApi.register_type(

# lib/puppet/provider/apt_key/apt_key.rb
class Puppet::Provider::AptKey::AptKey
def get(context, names = nil)
if names == nil
def get(context, names = [])
if names.empty?
return all_instances
else
names.collect { |n| find_instance(n) }
end
end
```

Some resources are very expensive to enumerate. The provider can implement `simple_get_filter` to signal extended capabilities of the `get` method to address this. The provider's `get` method will be called with an array of resource names, or `nil`. The `get` method must at least return the resources mentioned in the `names` array, but may return more than those. If the `names` parameter is `nil`, all existing resources should be returned. The `names` parameter defaults to `nil` to allow simple runtimes to ignore this feature.
Some resources are very expensive to enumerate. The provider can implement `simple_get_filter` to signal extended capabilities of the `get` method to address this. The provider's `get` method will be called with an array of resource names. The `get` method must at least return the resources mentioned in the `names` array, but may return more than those. If the `names` parameter is an empty array, all existing resources should be returned. The `names` parameter defaults to `[]` to allow simple runtimes to ignore this feature.

For types with multiple namevars, the `names` array will consist of hashes of the namevars and their values instead of simple values:

Expand Down