This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection.request( | |
:body => "dataset=77a82164-ae77-11e2-aa0c-1fc90b223177&package=awesomepkg", | |
:headers => headers | |
:method => :post, | |
:path => '/my/machines' | |
) | |
2013-06-26 11:10:32Z WARN: ErrorSent(requestId=06d4ac57-2c12-4715-8a51-d4f59b081820): HttpCode=400, RestCode=InvalidArgument, message=Invalid Content: Unexpected token ILLEGAL: | |
HttpError: Invalid Content: Unexpected token ILLEGAL | |
at /opt/smartdc/cloudapi/node_modules/restify/lib/error.js:21:13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Headers | |
'Accept' => 'application/json', | |
'Authorization' => signature['Authorization'], | |
'Content-Type' => 'application/json', | |
'Date' => signature['Date'], | |
'X-Api-Version' => '~6.5' | |
"name" => 'jsmith', | |
"dataset" => '<random_image_id>', | |
"package" => '<package_name>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"allow_restricted_traffic": true, | |
"allow_ip_spoofing": true, | |
"allow_mac_spoofing": true, | |
"allow_dhcp_spoofing": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
metadata :name => "Users Agent", | |
:description => "Agent to list users", | |
:author => "Michael Carruthers", | |
:license => "GPLv2", | |
:version => "0.0.1", | |
:url => 'homepage | |
:timeout => 20 | |
action "info", :description => "View user information" do | |
display :always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MCollective | |
module Agent | |
class User < RPC::Agent | |
require 'etc' | |
metadata :name => "User", | |
:description => "List user information", | |
:author => "Michael Carruthers", | |
:license => "internal-only", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action "info" do | |
validate :user, String | |
user = request[:user] | |
reply[:user] = user_info(user) | |
end | |
private | |
require 'etc' | |
def user_info(req_user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -c ' | |
if [ ! -f /opt/local/bin/chef-client ]; then | |
cd /tmp | |
pkgin -y install gcc-compiler gcc-runtime gcc-tools-0 ruby18-base ruby18-readline scmgit-base scmgit-docs gmake | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz | |
tar -xzf rubygems-1.8.10.tgz | |
cd rubygems-1.8.10 | |
ruby setup.rb --no-format-executable | |
gem install --no-ri --no-rdoc json_pure | |
gem install --no-ri --no-rdoc -v=0.10.10 chef -- --with-cflags=-m64 --with-ldflags=-m64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
knife-staging () { | |
knife $* -c ~/.chef/knife.staging.rb | |
} | |
knife-production () { | |
knife $* -c ~/.chef/knife.production.rb | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
client = OAuth::AccessToken.new(OAuth::Consumer.new('foo', 'bar', {:site => 'https://api.cloudkick.com'})) | |
ruby-1.9.2-p180 :052 > client.request(:post, "/2.0/checks", "{:monitor_id => 'qc00000000000', :type => 'HTTP'}").body | |
=> "Unauthorized Request" | |
ruby-1.9.2-p180 :053 > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"applications.messenger.staging.working": { | |
"message_dispatch_adhoc": { | |
"count": 1 | |
}, | |
"messenger_retriever": { | |
}, | |
"facebook_page_adhoc": { | |
"count": 1 | |
}, |
NewerOlder