ogre 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +20 -0
- data/.rubocop.yml +16 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +102 -0
- data/Rakefile +18 -0
- data/bin/ogre +4 -0
- data/lib/ogre.rb +44 -0
- data/lib/ogre/associate.rb +57 -0
- data/lib/ogre/base.rb +21 -0
- data/lib/ogre/config.rb +18 -0
- data/lib/ogre/messages.rb +84 -0
- data/lib/ogre/org-create.rb +96 -0
- data/lib/ogre/org-delete.rb +29 -0
- data/lib/ogre/runner.rb +40 -0
- data/lib/ogre/set-private-key.rb +57 -0
- data/lib/ogre/skeletons/code_generator/files/default/chefignore +95 -0
- data/lib/ogre/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +9 -0
- data/lib/ogre/skeletons/code_generator/files/default/cookbook_readmes/README.md +54 -0
- data/lib/ogre/skeletons/code_generator/files/default/gitignore +16 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/README.md +66 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +7 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +3 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +8 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/data_bags/README.md +58 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/data_bags/example/example_item.json +4 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/README.md +9 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/_default.json +9 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/dev.json +21 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/example.json +13 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/int.json +21 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/prod.json +21 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/qa.json +21 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/environments/stage.json +21 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/README.md +9 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/active-base.json +12 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/example.json +13 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_caeast.json +13 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_canada.json +13 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_cawest.json +13 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_useast.json +13 -0
- data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_uswest.json +13 -0
- data/lib/ogre/skeletons/code_generator/metadata.rb +8 -0
- data/lib/ogre/skeletons/code_generator/recipes/repo.rb +52 -0
- data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.all_rights.erb +3 -0
- data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.apache2.erb +201 -0
- data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.gplv2.erb +339 -0
- data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.gplv3.erb +674 -0
- data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.mit.erb +21 -0
- data/lib/ogre/skeletons/code_generator/templates/default/README.md.erb +4 -0
- data/lib/ogre/skeletons/code_generator/templates/default/cookbook_file.erb +0 -0
- data/lib/ogre/skeletons/code_generator/templates/default/knife.rb.erb +44 -0
- data/lib/ogre/skeletons/code_generator/templates/default/metadata.rb.erb +8 -0
- data/lib/ogre/skeletons/code_generator/templates/default/repo/gitignore.erb +11 -0
- data/lib/ogre/user-create.rb +40 -0
- data/lib/ogre/user-delete.rb +39 -0
- data/lib/ogre/version.rb +5 -0
- data/ogre.gemspec +45 -0
- data/spec/fixtures/client_key/dummy.pem +27 -0
- data/spec/fixtures/vcr_cassettes/associate-no-org.yml +65 -0
- data/spec/fixtures/vcr_cassettes/associate-no-user.yml +65 -0
- data/spec/fixtures/vcr_cassettes/associate-user-exists.yml +135 -0
- data/spec/fixtures/vcr_cassettes/associate.yml +406 -0
- data/spec/fixtures/vcr_cassettes/org-create-exists.yml +69 -0
- data/spec/fixtures/vcr_cassettes/org-create.yml +71 -0
- data/spec/fixtures/vcr_cassettes/org-delete-no-org.yml +61 -0
- data/spec/fixtures/vcr_cassettes/org-delete.yml +68 -0
- data/spec/fixtures/vcr_cassettes/set-private-key.yml +239 -0
- data/spec/fixtures/vcr_cassettes/user-create-bad-email.yml +66 -0
- data/spec/fixtures/vcr_cassettes/user-create-exists.yml +70 -0
- data/spec/fixtures/vcr_cassettes/user-create-short-password.yml +66 -0
- data/spec/fixtures/vcr_cassettes/user-create.yml +72 -0
- data/spec/fixtures/vcr_cassettes/user-delete-not-found.yml +61 -0
- data/spec/fixtures/vcr_cassettes/user-delete.yml +136 -0
- data/spec/ogre/associate_spec.rb +67 -0
- data/spec/ogre/org-create_spec.rb +52 -0
- data/spec/ogre/org-delete_spec.rb +34 -0
- data/spec/ogre/set-private-key_spec.rb +16 -0
- data/spec/ogre/user-create_spec.rb +58 -0
- data/spec/ogre/user-delete_spec.rb +34 -0
- data/spec/spec_helper.rb +16 -0
- metadata +349 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <%= year %> <%= copyright_holder %>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
File without changes
|
@@ -0,0 +1,44 @@
|
|
1
|
+
#=====================================================================
|
2
|
+
# <%= org %>-chef/.chef/knife.rb
|
3
|
+
#
|
4
|
+
# <%= org %> Chef Knife Configuration
|
5
|
+
#
|
6
|
+
#---------------------------------------------------------------------
|
7
|
+
# Useful variables
|
8
|
+
#
|
9
|
+
current_dir = File.dirname(__FILE__)
|
10
|
+
user_email = `git config --get user.email`.delete!("\n")
|
11
|
+
home_dir = ENV['HOME'] || ENV['HOMEDRIVE']
|
12
|
+
org = "<%= org %>"
|
13
|
+
chef_server = "<%= chef_server_url %>"
|
14
|
+
|
15
|
+
knife_override = "#{home_dir}/.chef/knife_override.rb"
|
16
|
+
|
17
|
+
#---------------------------------------------------------------------
|
18
|
+
# Configuration directives
|
19
|
+
#
|
20
|
+
|
21
|
+
# Where is the chef server?
|
22
|
+
chef_server_url "#{chef_server}/organizations/#{org}"
|
23
|
+
|
24
|
+
# Logging defaults
|
25
|
+
log_level :info
|
26
|
+
log_location STDOUT
|
27
|
+
|
28
|
+
# USERNAME is UPPERCASE in Windows, but lowercase in the Chef server,
|
29
|
+
# so `downcase` it.
|
30
|
+
node_name ( ENV['USER'] || ENV['USERNAME'] ).downcase
|
31
|
+
client_key "#{home_dir}/.chef/#{node_name}_#{org}.pem"
|
32
|
+
cache_type 'BasicFile'
|
33
|
+
cache_options( :path => "#{home_dir}/.chef/checksums" )
|
34
|
+
|
35
|
+
# Validation, for use when bootstrapping nodes
|
36
|
+
validation_client_name "#{org}-validator"
|
37
|
+
validation_key "#{current_dir}/#{validation_client_name}.pem"
|
38
|
+
|
39
|
+
# We keep our cookbooks in separate repos under a ~/chef/cookbooks dir
|
40
|
+
cookbook_path [ "#{current_dir}/../../../cookbooks",
|
41
|
+
"#{current_dir}/../../../community" ]
|
42
|
+
cookbook_copyright <%=copyright_holder%>
|
43
|
+
cookbook_license "<%=license%>"
|
44
|
+
cookbook_email "<%=email%>"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
name '<%= cookbook_name %>'
|
2
|
+
maintainer '<%= copyright_holder %>'
|
3
|
+
maintainer_email '<%= email %>'
|
4
|
+
license '<%= license %>'
|
5
|
+
description 'Installs/Configures <%= cookbook_name %>'
|
6
|
+
long_description 'Installs/Configures <%= cookbook_name %>'
|
7
|
+
version '0.1.0'
|
8
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Ogre
|
2
|
+
# This is used to create a user in enterprise chef
|
3
|
+
class UserCreate < Ogre::Base
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
# required
|
7
|
+
argument :username, type: :string
|
8
|
+
argument :first_name, type: :string
|
9
|
+
argument :last_name, type: :string
|
10
|
+
argument :email, type: :string
|
11
|
+
argument :password, type: :string
|
12
|
+
|
13
|
+
# Create chef user
|
14
|
+
def user_create
|
15
|
+
# create user
|
16
|
+
user_json = {
|
17
|
+
username: username,
|
18
|
+
first_name: first_name,
|
19
|
+
last_name: last_name,
|
20
|
+
display_name: "#{first_name} #{last_name}",
|
21
|
+
email: email,
|
22
|
+
password: password
|
23
|
+
}
|
24
|
+
|
25
|
+
chef_rest.post_rest('/users', user_json)
|
26
|
+
|
27
|
+
puts "'#{username}' has been created."
|
28
|
+
|
29
|
+
# TODO: print/save pem key?
|
30
|
+
|
31
|
+
rescue Net::HTTPServerException => e
|
32
|
+
# already exists -- i will allow it
|
33
|
+
if e.response.code == '409'
|
34
|
+
puts "'#{username}' already exists."
|
35
|
+
else
|
36
|
+
raise e
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Ogre
|
2
|
+
# This is used to delete a user from enterprise chef
|
3
|
+
class UserDelete < Ogre::Base
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
# required
|
7
|
+
argument :username, type: :string
|
8
|
+
|
9
|
+
# optional
|
10
|
+
class_option :force, aliases: '-f', default: false, type: :boolean, desc: DESC_FORCE
|
11
|
+
|
12
|
+
# Delete user from enterprise chef
|
13
|
+
def user_delete
|
14
|
+
# prompt user
|
15
|
+
# rubocop:disable LineLength
|
16
|
+
exit unless options[:force] || HighLine.agree("Deleting '#{username}' is permanent. Do you want to proceed? (y/n)")
|
17
|
+
# rubocop:enable LineLength
|
18
|
+
|
19
|
+
# disassociate from all orgs
|
20
|
+
orgs = chef_rest.get_rest("users/#{username}/organizations")
|
21
|
+
org_names = orgs.map { |o| o['organization']['name'] }
|
22
|
+
org_names.each do |org|
|
23
|
+
puts chef_rest.delete_rest("organizations/#{org}/users/#{username}")
|
24
|
+
end
|
25
|
+
|
26
|
+
# delete user
|
27
|
+
chef_rest.delete_rest("users/#{username}")
|
28
|
+
puts "'#{username}' has been deleted."
|
29
|
+
|
30
|
+
rescue Net::HTTPServerException => e
|
31
|
+
# user not found -- i will allow it
|
32
|
+
if e.response.code == '404'
|
33
|
+
puts "'#{username}' not found."
|
34
|
+
else
|
35
|
+
raise e
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/ogre/version.rb
ADDED
data/ogre.gemspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# rubocop:disable all
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ogre/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'ogre'
|
8
|
+
spec.version = Ogre::VERSION
|
9
|
+
spec.authors = %w('Joe Nguyen')
|
10
|
+
spec.email = %w('joe.nguyen@activenetwork.com')
|
11
|
+
spec.summary = 'Automated generation of enterprise chef organizations'
|
12
|
+
spec.description = 'Command line tool to automate creation of chef orgs, chef policy repositories, and validation key integration with vco'
|
13
|
+
spec.homepage = 'https://github.com/activenetwork-automation/ogre'
|
14
|
+
spec.license = 'Apache 2.0'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.7.4'
|
22
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
23
|
+
spec.add_development_dependency 'rubocop', '~> 0.30.1'
|
24
|
+
# spec.add_development_dependency 'aruba', '>= 0.6'
|
25
|
+
spec.add_development_dependency 'rspec', '>= 3.0'
|
26
|
+
spec.add_development_dependency 'coveralls', '>= 0.7.9'
|
27
|
+
spec.add_development_dependency 'guard', '>= 2.10.0'
|
28
|
+
spec.add_development_dependency 'guard-rubocop', '>= 1.1.0'
|
29
|
+
# growl functionality in Guardfile depends on growl-notify
|
30
|
+
spec.add_development_dependency 'growl', '>= 1.0'
|
31
|
+
spec.add_development_dependency 'yard', '>= 0.8'
|
32
|
+
spec.add_development_dependency 'webmock', '>= 1.21.0'
|
33
|
+
spec.add_development_dependency 'vcr', '>= 2.9.3'
|
34
|
+
|
35
|
+
spec.add_dependency 'thor', '~> 0.19.1'
|
36
|
+
spec.add_dependency 'chef-dk', '~> 0.5.1'
|
37
|
+
spec.add_dependency 'vcoworkflows', '~> 0.1.2'
|
38
|
+
end
|
39
|
+
# rubocop:enable all
|
40
|
+
|
41
|
+
# spec.add_development_dependency('chef')
|
42
|
+
# spec.add_development_dependency('knife-vsphere')
|
43
|
+
#
|
44
|
+
# spec.add_dependency('open4')
|
45
|
+
# spec.add_dependency('english')
|
@@ -0,0 +1,27 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIIEowIBAAKCAQEA3SqsHlVmqP6OxcMBZm96sObwGHK3pM7LHl6F8TZ3poPzFgut
|
3
|
+
SVt2sBfHQZC2vXIN/lnwlExtixzttgd9F4VkGij5LX/crLZ8JV7he0/+c0Y/slAg
|
4
|
+
dqe2AMRNuxAL+s/FpqVnB7iiePIxlA9sDFhsYyHz6QtwzIRAaxnlC/ZWzJCYRHxE
|
5
|
+
hIwZMC1oZsPdSc9k5D60vIxJLHwQ/OOIhVjk6h+szS3uRUYpHiyywF09lwaCeKR0
|
6
|
+
FqxqSBb5yJv9lzLqhJkhHM6t0y88rNWggwj3nE3YmlCHcp/B81BTbyXT2EpF6mbt
|
7
|
+
CQbmDO118YHDDuXGiTuSimGx9oFyw9tMe8Nx/QIBIwKCAQEAl6g7goO0HBxEpN19
|
8
|
+
TY5FgJ5bfnqMjkSoidpqeYRvTZxO6ouqBmqah2DDJaUPl9kuKsFUgvKUQiJ3Hbv+
|
9
|
+
AYAKIJEf5K9yv5MTTNNYyZXwTwuZZFQzhJBCSast/J1KCxIhIdCBKd2xPP3Y2o47
|
10
|
+
di4BLginQLdjSmlQvngoCDPjv3fRNhvyoTNvKoiCXWFbw+Rnax1UpzAGL1u6JHjE
|
11
|
+
dfLfRmJNdnOQVpnfUQ2ELoF6iTTB2/mJsbDcfAmKIGeWmXFa006f1RO3YxS+925t
|
12
|
+
/7eoyPEAJ/fRBBzUZrkhoVjGaZXgEgmOw3k3rVQFbixZf0FXQpehwXyE4WCkY3rc
|
13
|
+
F1AZawKBgQD6Rq/u9S8xhR9nvibntCqko/jBhqqBD2hhXh+w0WWSZcISLPoKNC1F
|
14
|
+
L3ThiuBEm/jRpbxWJtfMNd0jcd4Nad8EoAHDxI7VYfsoYwVm2xnUe5ynAtpReOCC
|
15
|
+
2t6xMNdYIy4X+CtkM/1uYFZkGAb3nN1a9ZvQoh1Crb+5pxcIKsYuTwKBgQDiOY4+
|
16
|
+
ZEc64lxCixmlF/epbrstF2Zpwq3q1D5j3UZ3kw4+/iCxks3TmIQbHFV7naDAx3GK
|
17
|
+
d11ciAFCPNGJ4uPsGxoJlthtALXTIPnZPa33plG8B9d6fmqJV/j73a0FBcxHLULt
|
18
|
+
9/ixJSc0mM9zmHPMUoKgrhmC1WoetlvDWahz8wKBgQDzIBie/M7CZA/hHx56rwTa
|
19
|
+
c2atXj87i090h1H8OSDXW4lTfCYYinUeoyEVnNncP76Cg75FD8pRWOVy46SCDxMp
|
20
|
+
EHa+LKgCfHBTHl0E1NdDcMQP9CSJqJ+VDyF47Z392Qg0iq3PDe7gQFPsNJkNy5Uz
|
21
|
+
ygUT0K61zVspYHzGGuxnfwKBgQCbICcGNiI3AZ5Zg/RT8y17fyFDfcKRqhDbijlp
|
22
|
+
DMKbIwJ0VnzRiTyuWfQv2Ooo4R3GBRqoF1X2TqHHBSH4Jo2pNyfMD6pZX5KfZxG5
|
23
|
+
iWFZXBrKFAF4kTMcWZTJ9xeOamAwzpRLaDWAyQTw3dAUwE9niQkduTYQkldlhFwu
|
24
|
+
LtnpGwKBgHblG0jaKbPGeE2QANZ1koiOoOHV007tGunmq/Bv2paRpgn/yzjpU/l8
|
25
|
+
oLWSvbabIU3ANxu6Ich6OGTikQqo+b+Pi0v5lv66nSb1lZSGk2NIll3SEF4/rmx/
|
26
|
+
5ijGogq7y/I62ZoYUy4oZ/tKVQMqIgn3tGJ3sGImxeSwfKzxfLer
|
27
|
+
-----END RSA PRIVATE KEY-----
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://chef.server/organizations/non-existent-org/association_requests
|
6
|
+
body:
|
7
|
+
encoding: ASCII-8BIT
|
8
|
+
string: '{"user":"test"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
X-Ops-Sign:
|
17
|
+
- algorithm=sha1;version=1.0;
|
18
|
+
X-Ops-Userid: pivotal
|
19
|
+
X-Ops-Timestamp:
|
20
|
+
- '2015-04-29T17:35:33Z'
|
21
|
+
X-Ops-Content-Hash:
|
22
|
+
- "{{X-Ops-Content-Hash}}"
|
23
|
+
X-Ops-Authorization-1:
|
24
|
+
- "{{X-Ops-Authorization-1}}"
|
25
|
+
X-Ops-Authorization-2:
|
26
|
+
- "{{X-Ops-Authorization-2}}"
|
27
|
+
X-Ops-Authorization-3:
|
28
|
+
- "{{X-Ops-Authorization-3}}"
|
29
|
+
X-Ops-Authorization-4:
|
30
|
+
- "{{X-Ops-Authorization-4}}"
|
31
|
+
X-Ops-Authorization-5:
|
32
|
+
- "{{X-Ops-Authorization-5}}"
|
33
|
+
X-Ops-Authorization-6:
|
34
|
+
- "{{X-Ops-Authorization-6}}"
|
35
|
+
Host:
|
36
|
+
- chef.server:443
|
37
|
+
X-Remote-Request-Id:
|
38
|
+
- 6c5bd7e8-44f4-4aab-aaa3-c05d6376bb3f
|
39
|
+
Content-Length:
|
40
|
+
- '15'
|
41
|
+
X-Chef-Version:
|
42
|
+
- 12.3.0
|
43
|
+
User-Agent:
|
44
|
+
- ruby
|
45
|
+
response:
|
46
|
+
status:
|
47
|
+
code: 404
|
48
|
+
message: Object Not Found
|
49
|
+
headers:
|
50
|
+
Server:
|
51
|
+
- ngx_openresty/1.4.3.6
|
52
|
+
Date:
|
53
|
+
- Wed, 29 Apr 2015 17:35:32 GMT
|
54
|
+
Content-Length:
|
55
|
+
- '61'
|
56
|
+
Connection:
|
57
|
+
- keep-alive
|
58
|
+
X-Ops-Api-Info:
|
59
|
+
- flavor=cs;version=12.0.0;oc_erchef=1.5.0
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"error":["organization ''non-existent-org'' does not exist."]}'
|
63
|
+
http_version:
|
64
|
+
recorded_at: Wed, 29 Apr 2015 17:35:33 GMT
|
65
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://chef.server/organizations/my-org-name/association_requests
|
6
|
+
body:
|
7
|
+
encoding: ASCII-8BIT
|
8
|
+
string: '{"user":"non-existent-user"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
X-Ops-Sign:
|
17
|
+
- algorithm=sha1;version=1.0;
|
18
|
+
X-Ops-Userid: pivotal
|
19
|
+
X-Ops-Timestamp:
|
20
|
+
- '2015-04-29T17:41:28Z'
|
21
|
+
X-Ops-Content-Hash:
|
22
|
+
- "{{X-Ops-Content-Hash}}"
|
23
|
+
X-Ops-Authorization-1:
|
24
|
+
- "{{X-Ops-Authorization-1}}"
|
25
|
+
X-Ops-Authorization-2:
|
26
|
+
- "{{X-Ops-Authorization-2}}"
|
27
|
+
X-Ops-Authorization-3:
|
28
|
+
- "{{X-Ops-Authorization-3}}"
|
29
|
+
X-Ops-Authorization-4:
|
30
|
+
- "{{X-Ops-Authorization-4}}"
|
31
|
+
X-Ops-Authorization-5:
|
32
|
+
- "{{X-Ops-Authorization-5}}"
|
33
|
+
X-Ops-Authorization-6:
|
34
|
+
- "{{X-Ops-Authorization-6}}"
|
35
|
+
Host:
|
36
|
+
- chef.server:443
|
37
|
+
X-Remote-Request-Id:
|
38
|
+
- c2f3113f-655f-4ecb-baa5-e572f0d1aa9e
|
39
|
+
Content-Length:
|
40
|
+
- '28'
|
41
|
+
X-Chef-Version:
|
42
|
+
- 12.3.0
|
43
|
+
User-Agent:
|
44
|
+
- ruby
|
45
|
+
response:
|
46
|
+
status:
|
47
|
+
code: 404
|
48
|
+
message: Object Not Found
|
49
|
+
headers:
|
50
|
+
Server:
|
51
|
+
- ngx_openresty/1.4.3.6
|
52
|
+
Date:
|
53
|
+
- Wed, 29 Apr 2015 17:41:27 GMT
|
54
|
+
Content-Length:
|
55
|
+
- '49'
|
56
|
+
Connection:
|
57
|
+
- keep-alive
|
58
|
+
X-Ops-Api-Info:
|
59
|
+
- flavor=cs;version=12.0.0;oc_erchef=1.5.0
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"error":"Could not find user non-existent-user"}'
|
63
|
+
http_version:
|
64
|
+
recorded_at: Wed, 29 Apr 2015 17:41:28 GMT
|
65
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,135 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://chef.server/organizations/my-org-name/association_requests
|
6
|
+
body:
|
7
|
+
encoding: ASCII-8BIT
|
8
|
+
string: '{"user":"test"}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Accept:
|
13
|
+
- application/json
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
X-Ops-Sign:
|
17
|
+
- algorithm=sha1;version=1.0;
|
18
|
+
X-Ops-Userid: pivotal
|
19
|
+
X-Ops-Timestamp:
|
20
|
+
- '2015-04-29T17:19:58Z'
|
21
|
+
X-Ops-Content-Hash:
|
22
|
+
- "{{X-Ops-Content-Hash}}"
|
23
|
+
X-Ops-Authorization-1:
|
24
|
+
- "{{X-Ops-Authorization-1}}"
|
25
|
+
X-Ops-Authorization-2:
|
26
|
+
- "{{X-Ops-Authorization-2}}"
|
27
|
+
X-Ops-Authorization-3:
|
28
|
+
- "{{X-Ops-Authorization-3}}"
|
29
|
+
X-Ops-Authorization-4:
|
30
|
+
- "{{X-Ops-Authorization-4}}"
|
31
|
+
X-Ops-Authorization-5:
|
32
|
+
- "{{X-Ops-Authorization-5}}"
|
33
|
+
X-Ops-Authorization-6:
|
34
|
+
- "{{X-Ops-Authorization-6}}"
|
35
|
+
Host:
|
36
|
+
- chef.server:443
|
37
|
+
X-Remote-Request-Id:
|
38
|
+
- d32e6397-0c4a-4649-813d-25efddacc6ce
|
39
|
+
Content-Length:
|
40
|
+
- '15'
|
41
|
+
X-Chef-Version:
|
42
|
+
- 12.3.0
|
43
|
+
User-Agent:
|
44
|
+
- ruby
|
45
|
+
response:
|
46
|
+
status:
|
47
|
+
code: 409
|
48
|
+
message: Conflict
|
49
|
+
headers:
|
50
|
+
Server:
|
51
|
+
- ngx_openresty/1.4.3.6
|
52
|
+
Date:
|
53
|
+
- Wed, 29 Apr 2015 17:19:57 GMT
|
54
|
+
Content-Type:
|
55
|
+
- application/json
|
56
|
+
Content-Length:
|
57
|
+
- '43'
|
58
|
+
Connection:
|
59
|
+
- keep-alive
|
60
|
+
X-Ops-Api-Info:
|
61
|
+
- flavor=cs;version=12.0.0;oc_erchef=1.5.0
|
62
|
+
Location:
|
63
|
+
- http://chef.server/organizations/my-org-name/association_requests/invalid_path
|
64
|
+
body:
|
65
|
+
encoding: UTF-8
|
66
|
+
string: '{"error":"The association already exists."}'
|
67
|
+
http_version:
|
68
|
+
recorded_at: Wed, 29 Apr 2015 17:19:58 GMT
|
69
|
+
- request:
|
70
|
+
method: get
|
71
|
+
uri: https://chef.server/organizations/my-org-name/groups/users
|
72
|
+
body:
|
73
|
+
encoding: US-ASCII
|
74
|
+
string: ''
|
75
|
+
headers:
|
76
|
+
Accept:
|
77
|
+
- application/json
|
78
|
+
Accept-Encoding:
|
79
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
80
|
+
X-Ops-Sign:
|
81
|
+
- algorithm=sha1;version=1.0;
|
82
|
+
X-Ops-Userid: pivotal
|
83
|
+
X-Ops-Timestamp:
|
84
|
+
- '2015-04-29T17:19:58Z'
|
85
|
+
X-Ops-Content-Hash:
|
86
|
+
- "{{X-Ops-Content-Hash}}"
|
87
|
+
X-Ops-Authorization-1:
|
88
|
+
- "{{X-Ops-Authorization-1}}"
|
89
|
+
X-Ops-Authorization-2:
|
90
|
+
- "{{X-Ops-Authorization-2}}"
|
91
|
+
X-Ops-Authorization-3:
|
92
|
+
- "{{X-Ops-Authorization-3}}"
|
93
|
+
X-Ops-Authorization-4:
|
94
|
+
- "{{X-Ops-Authorization-4}}"
|
95
|
+
X-Ops-Authorization-5:
|
96
|
+
- "{{X-Ops-Authorization-5}}"
|
97
|
+
X-Ops-Authorization-6:
|
98
|
+
- "{{X-Ops-Authorization-6}}"
|
99
|
+
Host:
|
100
|
+
- chef.server:443
|
101
|
+
X-Remote-Request-Id:
|
102
|
+
- d32e6397-0c4a-4649-813d-25efddacc6ce
|
103
|
+
X-Chef-Version:
|
104
|
+
- 12.3.0
|
105
|
+
User-Agent:
|
106
|
+
- ruby
|
107
|
+
response:
|
108
|
+
status:
|
109
|
+
code: 200
|
110
|
+
message: OK
|
111
|
+
headers:
|
112
|
+
Server:
|
113
|
+
- ngx_openresty/1.4.3.6
|
114
|
+
Date:
|
115
|
+
- Wed, 29 Apr 2015 17:19:57 GMT
|
116
|
+
Content-Type:
|
117
|
+
- application/json
|
118
|
+
Transfer-Encoding:
|
119
|
+
- chunked
|
120
|
+
Connection:
|
121
|
+
- keep-alive
|
122
|
+
X-Ops-Api-Info:
|
123
|
+
- flavor=cs;version=12.0.0;oc_erchef=1.5.0
|
124
|
+
Content-Encoding:
|
125
|
+
- gzip
|
126
|
+
body:
|
127
|
+
encoding: ASCII-8BIT
|
128
|
+
string: !binary |-
|
129
|
+
H4sIAAAAAAAAA32OQQrCMBBF7zLrFpwGovYq4iKTzJRC25QkLYh4d5Poom6c
|
130
|
+
zed/Hrx5grHJhwj9DdZx98lM0EDimHJskQPcP/mfsNPISypMxofgt7Xyp8Oh
|
131
|
+
c/asiNAZTfoqyFZnxxHpBBU7QUISEtGduuji92FYzMzQw/xoc2lra+A7ljdj
|
132
|
+
rtX7s73e4g3mO98AAAA=
|
133
|
+
http_version:
|
134
|
+
recorded_at: Wed, 29 Apr 2015 17:19:58 GMT
|
135
|
+
recorded_with: VCR 2.9.3
|