class Chef::ChefFS::FileSystem::ChefServer::PolicyRevisionEntry

/policies/NAME-REVISION.json Represents the actual data at /organizations/ORG/policies/NAME/revisions/REVISION

Public Instance Methods

api_path(options = {}) click to toggle source

/policies/foo-1.0.0.json -> /policies/foo/revisions/1.0.0

# File lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb, line 13
def api_path(options = {})
  "#{parent.api_path}/#{policy_name}/revisions/#{revision_id}"
end
display_path() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb, line 17
def display_path
  "/policies/#{policy_name}-#{revision_id}.json"
end
policy_name() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb, line 25
def policy_name
  policy_name, revision_id = data_handler.name_and_revision(name)
  policy_name
end
revision_id() click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb, line 30
def revision_id
  policy_name, revision_id = data_handler.name_and_revision(name)
  revision_id
end
write(file_contents) click to toggle source
# File lib/chef/chef_fs/file_system/chef_server/policy_revision_entry.rb, line 21
def write(file_contents)
  raise OperationNotAllowedError.new(:write, self, nil, "cannot be updated: policy revisions are immutable once uploaded. If you want to change the policy, create a new revision with your changes")
end