Class: Chef::Knife::RuleCreate

Inherits:
ChefAnalytics::Knife
  • Object
show all
Defined in:
lib/chef/knife/rule_create.rb

Instance Method Summary collapse

Instance Method Details

#runObject



36
37
38
39
40
41
42
43
44
# File 'lib/chef/knife/rule_create.rb', line 36

def run
  validate_and_set_params

  @rest = ChefAnalytics::ServerAPI.new(analytics_server_url, fetch_token)

  headers = {"Content-Type" => "application/json"}
  response = @rest.post("/rules", File.read(name_args[0]), headers)
  output(response)
end