class Chef::Knife::EncryptedAttributeCreate
knife encrypted attribute create command.
“` $ knife encrypted attribute create NODE ATTRIBUTE (options) “`
Public Instance Methods
(see EncryptedAttributeBase#assert_valid_args) @raise [ArgumentError] if the attribute path format is wrong.
# File lib/chef/knife/encrypted_attribute_create.rb, line 46 def assert_valid_args # check if the encrypted attribute already exists assert_attribute_does_not_exist(@node_name, @attr_ary) end
Runs knife command.
@raise [RuntimeError] if the editing command fails. @raise [ArgumentError] if the attribute path format or the user list is
wrong.
@raise [UnacceptableEncryptedAttributeFormat] if encrypted attribute
format is wrong or does not exist.
@raise [UnsupportedEncryptedAttributeFormat] if encrypted attribute
format is not supported or unknown.
@raise [EncryptionFailure] if there are encryption errors. @raise [MessageAuthenticationFailure] if HMAC calculation error. @raise [InvalidPublicKey] if it is not a valid RSA public key. @raise [InvalidKey] if the RSA key format is wrong. @raise [InsufficientPrivileges] if you lack enough privileges to read
the keys from the Chef Server.
@raise [ClientNotFound] if client does not exist. @raise [Net::HTTPServerException] for Chef
Server HTTP errors. @raise [RequirementsFailure] if the specified encrypted attribute
version cannot be used.
@raise [SearchFailure] if there is a Chef
search error. @raise [SearchFatalError] if the Chef
search response is wrong. @raise [InvalidSearchKeys] if search keys structure is wrong. @return void
# File lib/chef/knife/encrypted_attribute_create.rb, line 74 def run parse_args # create encrypted attribute output = edit_data(nil, config[:input_format]) enc_attr = Chef::EncryptedAttribute.new( Chef::Config[:knife][:encrypted_attributes] ) enc_attr.create_on_node(@node_name, @attr_ary, output) end