Class: PEClient::Resource::PuppetV3::FileMetadata
- Defined in:
- lib/pe_client/resources/puppet.v3/file_metadata.rb
Overview
This endpoint returns select metadata for a single file or many files. Although the term “file_path” is used generically in the endpoint name and documentation, each returned item can be one of the following three types:
- File
- Directory
- Symbolic link
Constant Summary collapse
- BASE_PATH =
The base path for Puppet API v3 File Metadata endpoints.
"#{PuppetV3::BASE_PATH}/file_metadata".freeze
- SEARCH_BASE_PATH =
Search base path for Puppet API v3 File Metadata endpoints.
"#{BASE_PATH}s".freeze
Instance Method Summary collapse
-
#find(mount:, file_path:, environment:, links: nil, checksum_type: nil, source_permissions: nil) ⇒ Hash
Get file metadata for a single file.
-
#search(file_path:, environment:, recurse: "yes", ignore: nil, links: nil, checksum_type: nil, source_permissions: nil) ⇒ Array<Hash>
Get a list of metadata for multiple files.
Methods inherited from Base
Constructor Details
This class inherits a constructor from PEClient::Resource::Base
Instance Method Details
#find(mount:, file_path:, environment:, links: nil, checksum_type: nil, source_permissions: nil) ⇒ Hash
Get file metadata for a single file
60 61 62 |
# File 'lib/pe_client/resources/puppet.v3/file_metadata.rb', line 60 def find(mount:, file_path:, environment:, links: nil, checksum_type: nil, source_permissions: nil) @client.get File.join(BASE_PATH, mount, file_path), params: {environment:, links:, checksum_type:, source_permissions:}.compact end |
#search(file_path:, environment:, recurse: "yes", ignore: nil, links: nil, checksum_type: nil, source_permissions: nil) ⇒ Array<Hash>
Get a list of metadata for multiple files
81 82 83 |
# File 'lib/pe_client/resources/puppet.v3/file_metadata.rb', line 81 def search(file_path:, environment:, recurse: "yes", ignore: nil, links: nil, checksum_type: nil, source_permissions: nil) @client.get File.join(SEARCH_BASE_PATH, file_path), params: {environment:, recurse:, ignore:, links:, checksum_type:, source_permissions:}.compact end |