1 http_request 'create-DMaaP-apiKeys' do
3 url 'http://23.253.97.75:3904/apiKeys/create'
4 message ({:some => 'data'}.to_json)
6 'Content-Type' => 'application/json'
11 selfEnviroment = node.chef_environment
13 ruby_block "create-DMaaP-apiKeys" do
16 #tricky way to load this Chef::Mixin::ShellOut utilities
17 Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
18 curl_command = "https://es_admin:Aa123456@#{application_host}:9200/_cluster/health?pretty=true --insecure"
19 resp = Net::HTTP.get_response URI.parse(curl_command)
20 stat = JSON.parse(resp.read_body)['status']
24 printf("\033[32m%s\n\033[0m", " ElasticSearch tests completed successfully.")
26 printf("\033[33m%s\n\033[0m", " ElasticSearch tests completed successfully, with warnings")
28 printf("\033[31m%s\n\033[0m", " ElasticSearch tests failed!!!")
33 curl POST -d '{"email":"Grinberg.Moti","description":"New Api Key for ASDC OS"}' http://23.253.97.75:3904/apiKeys/create