ogre 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/README.md +16 -2
  4. data/lib/ogre.rb +10 -0
  5. data/lib/ogre/config.rb +2 -0
  6. data/lib/ogre/messages.rb +12 -0
  7. data/lib/ogre/org-create.rb +30 -6
  8. data/lib/ogre/org-list.rb +13 -0
  9. data/lib/ogre/org-show.rb +45 -0
  10. data/lib/ogre/runner.rb +0 -2
  11. data/lib/ogre/user-list.rb +13 -0
  12. data/lib/ogre/version.rb +2 -2
  13. data/ogre.gemspec +5 -4
  14. data/spec/fixtures/vcr_cassettes/org-list.yml +73 -0
  15. data/spec/fixtures/vcr_cassettes/org-show.yml +205 -0
  16. data/spec/fixtures/vcr_cassettes/user-list.yml +75 -0
  17. data/spec/ogre/org-create_spec.rb +3 -2
  18. data/spec/ogre/org-list_spec.rb +26 -0
  19. data/spec/ogre/org-show_spec.rb +27 -0
  20. data/spec/ogre/user-list_spec.rb +26 -0
  21. data/spec/spec_helper.rb +4 -4
  22. metadata +48 -57
  23. data/lib/ogre/skeletons/code_generator/files/default/chefignore +0 -95
  24. data/lib/ogre/skeletons/code_generator/files/default/cookbook_readmes/README-policy.md +0 -9
  25. data/lib/ogre/skeletons/code_generator/files/default/cookbook_readmes/README.md +0 -54
  26. data/lib/ogre/skeletons/code_generator/files/default/gitignore +0 -16
  27. data/lib/ogre/skeletons/code_generator/files/default/repo/README.md +0 -66
  28. data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/attributes/default.rb +0 -7
  29. data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/metadata.rb +0 -3
  30. data/lib/ogre/skeletons/code_generator/files/default/repo/cookbooks/example/recipes/default.rb +0 -8
  31. data/lib/ogre/skeletons/code_generator/files/default/repo/data_bags/README.md +0 -58
  32. data/lib/ogre/skeletons/code_generator/files/default/repo/data_bags/example/example_item.json +0 -4
  33. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/README.md +0 -9
  34. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/_default.json +0 -9
  35. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/dev.json +0 -21
  36. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/example.json +0 -13
  37. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/int.json +0 -21
  38. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/prod.json +0 -21
  39. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/qa.json +0 -21
  40. data/lib/ogre/skeletons/code_generator/files/default/repo/environments/stage.json +0 -21
  41. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/README.md +0 -9
  42. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/active-base.json +0 -12
  43. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/example.json +0 -13
  44. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_caeast.json +0 -13
  45. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_canada.json +0 -13
  46. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_cawest.json +0 -13
  47. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_useast.json +0 -13
  48. data/lib/ogre/skeletons/code_generator/files/default/repo/roles/loc_uswest.json +0 -13
  49. data/lib/ogre/skeletons/code_generator/metadata.rb +0 -8
  50. data/lib/ogre/skeletons/code_generator/recipes/repo.rb +0 -52
  51. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.all_rights.erb +0 -3
  52. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.apache2.erb +0 -201
  53. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.gplv2.erb +0 -339
  54. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.gplv3.erb +0 -674
  55. data/lib/ogre/skeletons/code_generator/templates/default/LICENSE.mit.erb +0 -21
  56. data/lib/ogre/skeletons/code_generator/templates/default/README.md.erb +0 -4
  57. data/lib/ogre/skeletons/code_generator/templates/default/cookbook_file.erb +0 -0
  58. data/lib/ogre/skeletons/code_generator/templates/default/knife.rb.erb +0 -44
  59. data/lib/ogre/skeletons/code_generator/templates/default/metadata.rb.erb +0 -8
  60. data/lib/ogre/skeletons/code_generator/templates/default/repo/gitignore.erb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab64b2a720b2448573c9832df1022b4053f829d7
4
- data.tar.gz: 5139300f491641f52df462fcf5b5517532a92904
3
+ metadata.gz: 9a9a5ab2416254704942cda8f92d6ed8ca93aa8e
4
+ data.tar.gz: 81c7a7f5af5d918d9e8d42e42d9caa7302a322d6
5
5
  SHA512:
6
- metadata.gz: 006c0003dba55235fa9bbb6008ea15f36b39a3effede25e1605e45c47899fc1621355eaae30b9671625495a8d54e7e90d2781410d8900652dfc93aa561954873
7
- data.tar.gz: 867acbfe70c3e2d867982e216650ca6dcf50ed9ddeef5cd1c249c101413f977f073d7e8f9f5dfef79ad6859bf9c917256a4ded4db13d9b047c19f82059099072
6
+ metadata.gz: 4d76becd36eaf13a1c6c1ce22c2a5dfcf4720df00d23cc06023d4c4de084bdda0b216c8abfc144b29d210195e767d8cc28e21867a29f3c09b87167bc9eca2ffe
7
+ data.tar.gz: 46d5a13a8dc24a07fe22d0f33eff16fadfa91de54c91011f2c70337e871b7d30f7e9d793ae031a902d3ad6124053c4faec03db7d6cd18b34bb1acb60b98207f9
data/.gitignore CHANGED
@@ -17,4 +17,6 @@ mkmf.log
17
17
 
18
18
  *.sw?
19
19
 
20
+ *.gem
21
+
20
22
  .ruby-version
data/README.md CHANGED
@@ -14,7 +14,9 @@ While this functionality already exists in [knife-opc](https://github.com/chef/k
14
14
 
15
15
  ## Installation
16
16
 
17
- `gem install ogre`
17
+ There's an open ended dependency on the ChefDK and is expected you have it already installed. The best way to install ogre the least amount of dependencies is to:
18
+
19
+ `chef gem install ogre`
18
20
 
19
21
  ## Configuration
20
22
 
@@ -31,7 +33,8 @@ All of the parameters here are optional and can be passed in and/or overriden at
31
33
  "vco_user": "domain\\user",
32
34
  "vco_password":"password",
33
35
  "vco_wf_name":"vco_workflow_name",
34
- "vco_verify_ssl":"false"
36
+ "vco_verify_ssl":"false",
37
+ "repo_url":"https://path.to/skeleton_repo"
35
38
  }
36
39
 
37
40
  ```
@@ -44,6 +47,7 @@ ogre org-create ORG DESCRIPTION (options)
44
47
  - `-I`, `--license=LICENSE` Chef policy repository license
45
48
  - `-m`, `--email=EMAIL` Chef policy repository e-mail
46
49
  - `-C`, `--authors=AUTHORS` Chef policy repository authors
50
+ - `-r`, `--repo-url=REPO_URL` Chef Policy Repository skeleton url
47
51
 
48
52
  When using `-p`, Ogre will save the Chef policy repository as ~/.ogre/ORG-chef, otherwise it will output the validator key for the new organization.
49
53
 
@@ -51,6 +55,13 @@ ogre org-delete ORG (options)
51
55
  ---
52
56
  - `-f`, `--force` Delete without confirmation
53
57
 
58
+ ogre org-list ORG (options)
59
+ ---
60
+
61
+ ogre org-show ORG (options)
62
+ ---
63
+ Users in the admin group are prefixed with `@`
64
+
54
65
  ogre user-create USERNAME FIRST_NAME LAST_NAME EMAIL PASSWORD (options)
55
66
  ---
56
67
 
@@ -58,6 +69,9 @@ ogre user-delete USERNAME (options)
58
69
  ---
59
70
  - `-f`, `--force` Delete without confirmation
60
71
 
72
+ ogre user-list (options)
73
+ ---
74
+
61
75
  ogre associate ORG USER (options)
62
76
  ---
63
77
  - `-a`, `--admin` Add user to admin group within organization
@@ -6,9 +6,13 @@ require 'ogre/base'
6
6
  require 'ogre/associate'
7
7
  require 'ogre/org-create'
8
8
  require 'ogre/org-delete'
9
+ require 'ogre/org-list'
10
+ require 'ogre/org-show'
9
11
  require 'ogre/set-private-key'
10
12
  require 'ogre/user-create'
11
13
  require 'ogre/user-delete'
14
+ require 'ogre/user-list'
15
+ require 'ogre/version'
12
16
 
13
17
  module Ogre
14
18
  # Start of main CLI
@@ -27,8 +31,11 @@ module Ogre
27
31
  # subcommand in Thor called as registered class
28
32
  register(OrgCreate, 'org_create', 'org-create ' << OrgCreate.arguments.map(&:name).join(' ').upcase, DESC_CREATE)
29
33
  register(OrgDelete, 'org_delete', 'org-delete ' << OrgDelete.arguments.map(&:name).join(' ').upcase, DESC_DELETE)
34
+ register(OrgList, 'org_list', 'org-list ' << OrgList.arguments.map(&:name).join(' ').upcase, DESC_ORG_LIST)
35
+ register(OrgShow, 'org_show', 'org-show ' << OrgShow.arguments.map(&:name).join(' ').upcase, DESC_ORG_SHOW)
30
36
  register(UserCreate, 'user_create', 'user-create ' << UserCreate.arguments.map(&:name).join(' ').upcase, DESC_CREATE_USER)
31
37
  register(UserDelete, 'user_delete', 'user-delete ' << UserDelete.arguments.map(&:name).join(' ').upcase, DESC_DELETE_USER)
38
+ register(UserList, 'user_list', 'user-list ' << UserList.arguments.map(&:name).join(' ').upcase, DESC_USER_LIST)
32
39
  register(Associate, 'associate', 'associate ' << Associate.arguments.map(&:name).join(' ').upcase, DESC_ASSOCIATE_USERS)
33
40
  register(SetPrivateKey, 'set_private_key', 'set-private-key ' << SetPrivateKey.arguments.map(&:name).join(' ').upcase, DESC_SET_PRIVATE_KEY)
34
41
  # rubocop:enable LineLength
@@ -36,8 +43,11 @@ module Ogre
36
43
  # Workarounds to include options in 'ogre help command'
37
44
  tasks['user_create'].options = UserCreate.class_options
38
45
  tasks['user_delete'].options = UserDelete.class_options
46
+ tasks['user_list'].options = UserList.class_options
39
47
  tasks['org_create'].options = OrgCreate.class_options
40
48
  tasks['org_delete'].options = OrgDelete.class_options
49
+ tasks['org_list'].options = OrgList.class_options
50
+ tasks['org_show'].options = OrgShow.class_options
41
51
  tasks['associate'].options = Associate.class_options
42
52
  tasks['set_private_key'].options = SetPrivateKey.class_options
43
53
  end
@@ -7,6 +7,8 @@ module Ogre
7
7
  OGRE_HOME = "#{ENV['HOME']}/.ogre"
8
8
  # config path
9
9
  CONFIG_PATH = "#{OGRE_HOME}/config.json"
10
+ # default chef policy repo
11
+ REPO_URL = 'https://github.com/activenetwork-automation/code_generator'
10
12
 
11
13
  # Static method to make config parameters available
12
14
  class Config
@@ -16,6 +16,15 @@ module Ogre
16
16
  # org description
17
17
  DESC_ORG_DESC = 'Organization long name'
18
18
 
19
+ # org list
20
+ DESC_ORG_LIST = 'List organiations'
21
+
22
+ # org Show
23
+ DESC_ORG_SHOW = 'Show organization details'
24
+
25
+ # user list
26
+ DESC_USER_LIST = 'List users'
27
+
19
28
  # private key path
20
29
  DESC_PRIVATE_KEY = 'Path to private key file'
21
30
 
@@ -81,4 +90,7 @@ module Ogre
81
90
 
82
91
  # vCenter verify ssl param
83
92
  DESC_VCO_VERIFY_SSL = 'vCenter Orchestrator verify ssl'
93
+
94
+ # Chef Policy Repository skeleton url
95
+ DESC_REPO_URL = 'Chef Policy Repository skeleton url'
84
96
  end
@@ -1,10 +1,11 @@
1
1
  require 'chef-dk/command/generator_commands/repo'
2
+ require 'git'
2
3
 
3
4
  module Ogre
4
5
  # Create organization through Chef::REST with the option to create the
5
6
  # Chef policy repository
6
7
  class OrgCreate < Ogre::Base
7
- # rubocop:disable CyclomaticComplexity, PerceivedComplexity
8
+ # rubocop:disable PerceivedComplexity, Metrics/CyclomaticComplexity
8
9
  # required parameters
9
10
  argument :org, type: :string, desc: DESC_ORG
10
11
  argument :org_desc, type: :string, desc: DESC_ORG_DESC
@@ -15,6 +16,7 @@ module Ogre
15
16
  class_option :license, aliases: '-I', default: 'apache2', type: :string, desc: DESC_REPO_LICENSE
16
17
  class_option :email, aliases: '-m', type: :string, desc: DESC_REPO_EMAIL
17
18
  class_option :authors, aliases: '-C', type: :string, desc: DESC_REPO_AUTHORS
19
+ class_option :repo_url, aliases: '-r', type: :string, desc: DESC_REPO_URL
18
20
 
19
21
  # organization create method
20
22
  def org_create
@@ -24,15 +26,25 @@ module Ogre
24
26
 
25
27
  # use chef repo generate to create a chef policy repo
26
28
  if options[:create_repo]
29
+ # check for policy repo - order of precedence: cli, config.json, default
30
+ repo_url = Config.options[:repo_url] ? Config.options[:repo_url] : REPO_URL
31
+ repo_url = options[:repo_url] ? options[:repo_url] : repo_url
32
+
33
+ # get the repository name -- dependant on short name w/out '.git'
34
+ skeleton_repo_path = "#{OGRE_HOME}/policy_repo/#{repo_url.split('/').last}"
35
+
36
+ # get policy repo
37
+ get_chef_policy_repo(repo_url, skeleton_repo_path)
27
38
 
28
39
  # create parent dir for chef policy repo
29
40
  repo_path = options[:repo_path] ? options[:repo_path] : OGRE_HOME
30
41
  Dir.mkdir repo_path unless File.exist?(repo_path)
31
42
 
32
43
  # run cookbook generate
33
- generate_cmd = ChefDK::Command::GeneratorCommands::Repo.new(generate_params(repo_path))
44
+ generate_cmd = ChefDK::Command::GeneratorCommands::Repo.new(generate_params(repo_path, skeleton_repo_path))
34
45
  generate_cmd.run
35
46
 
47
+ # write out pem file
36
48
  File.open("#{repo_path}/#{org}-chef/.chef/#{response['clientname']}.pem", 'w') do |f|
37
49
  f.print(response['private_key'])
38
50
  end
@@ -42,7 +54,6 @@ module Ogre
42
54
  end
43
55
 
44
56
  rescue Net::HTTPServerException => e
45
-
46
57
  # already exists -- i will allow it
47
58
  if e.response.code == '409'
48
59
  puts "#{org} org already exists"
@@ -53,8 +64,21 @@ module Ogre
53
64
 
54
65
  private
55
66
 
67
+ # clone policy skeleton, if exists, get latest
68
+ def get_chef_policy_repo(repo_url, skeleton_repo_path)
69
+ # check for existing
70
+ if File.exist?(skeleton_repo_path)
71
+ # update if exists
72
+ local_repo = Git.open(skeleton_repo_path)
73
+ local_repo.pull
74
+ else
75
+ # get new if doesn't exist
76
+ Git.clone(repo_url, skeleton_repo_path)
77
+ end
78
+ end
79
+
56
80
  # concatenate parameters into a format ChefDK::Command::GeneratorCommands::Repo will accept
57
- def generate_params(parent_path)
81
+ def generate_params(parent_path, skeleton_repo_path)
58
82
  # chef policy repository parameters
59
83
  generate_str = ["#{parent_path}/#{org}-chef"]
60
84
 
@@ -68,7 +92,7 @@ module Ogre
68
92
 
69
93
  # generator skeleton
70
94
  generate_str << '-g'
71
- generate_str << File.expand_path('../skeletons/code_generator', __FILE__)
95
+ generate_str << skeleton_repo_path
72
96
 
73
97
  # optional license
74
98
  if options[:license]
@@ -93,4 +117,4 @@ module Ogre
93
117
  end
94
118
  end
95
119
 
96
- # rubocop:enable CyclomaticComplexity, PerceivedComplexity
120
+ # rubocop:enable PerceivedComplexity, Metrics/CyclomaticComplexity
@@ -0,0 +1,13 @@
1
+ module Ogre
2
+ # List organizations through Chef::REST object
3
+ class OrgList < Ogre::Base
4
+ include Thor::Actions
5
+
6
+ # Organizations list
7
+ def org_list
8
+ # pull down all orgs
9
+ results = chef_rest.get_rest('/organizations')
10
+ puts results.keys.sort { |a, b| a <=> b }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,45 @@
1
+ module Ogre
2
+ # Show org through Chef::REST object
3
+ class OrgShow < Ogre::Base
4
+ include Thor::Actions
5
+
6
+ # required
7
+ argument :org, type: :string, desc: DESC_ORG
8
+
9
+ # Show org details
10
+ def org_show
11
+ # get org details
12
+ results = chef_rest.get_rest("/organizations/#{org}")
13
+ puts colorize('name:') + " #{results['name']}"
14
+ puts colorize('description:') + " #{results['full_name']}"
15
+ puts colorize('guid:') + " #{results['guid']}"
16
+
17
+ # get admins
18
+ admins = chef_rest.get_rest("/organizations/#{org}/groups/admins")
19
+
20
+ # get normal users
21
+ users = chef_rest.get_rest("/organizations/#{org}/groups/users")
22
+
23
+ # output admins with a '@' prefix
24
+ admins['users'].each do |admin|
25
+ if admins['users'][0] == admin
26
+ puts colorize('users') + " @#{admin}"
27
+ else
28
+ puts " @#{admin}"
29
+ end
30
+ end
31
+
32
+ # output users that don't exist in the admin group
33
+ (users['users'] - admins['users']).each do |user|
34
+ puts " #{user}"
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ # fancy it up
41
+ def colorize(text)
42
+ "\033[36m#{text}\033[0m"
43
+ end
44
+ end
45
+ end
@@ -11,7 +11,6 @@ module Ogre
11
11
  @kernel = kernel
12
12
  end
13
13
 
14
- # rubocop:disable MethodLength
15
14
  def execute!
16
15
  exit_code = begin
17
16
  $stderr = @stderr
@@ -39,6 +38,5 @@ module Ogre
39
38
  # Proxy exit code back to the injected kernel.
40
39
  @kernel.exit(exit_code)
41
40
  end
42
- # rubocop:enable MethodLength
43
41
  end
44
42
  end
@@ -0,0 +1,13 @@
1
+ module Ogre
2
+ # List users through Chef::REST object
3
+ class UserList < Ogre::Base
4
+ include Thor::Actions
5
+
6
+ # Users list
7
+ def org_list
8
+ # pull down all users
9
+ results = chef_rest.get_rest('/users')
10
+ puts results.keys.sort { |a, b| a <=> b }
11
+ end
12
+ end
13
+ end
@@ -1,5 +1,5 @@
1
1
  # simple gem version number tracking
2
2
  module Ogre
3
- # version
4
- VERSION = '0.1.4'
3
+ # ogre version
4
+ VERSION = '0.1.5'
5
5
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency 'bundler', '>= 1.7'
22
22
  spec.add_development_dependency 'rake', '>= 10.0'
23
- spec.add_development_dependency 'rubocop', '>= 0.27.0'
23
+ spec.add_development_dependency 'rubocop', '>= 0.32.1'
24
24
  # spec.add_development_dependency 'aruba', '>= 0.6'
25
25
  spec.add_development_dependency 'rspec', '>= 3.0'
26
26
  spec.add_development_dependency 'coveralls', '>= 0.7.9'
@@ -32,9 +32,10 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'webmock', '>= 1.21.0'
33
33
  spec.add_development_dependency 'vcr', '>= 2.9.3'
34
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'
35
+ spec.add_dependency 'chef-dk'
36
+ spec.add_dependency 'vcoworkflows', '>= 0.2.1'
37
+ spec.add_dependency 'thor', '>= 0.19.1'
38
+ spec.add_dependency 'git', '>= 1.2.0'
38
39
  end
39
40
  # rubocop:enable all
40
41
 
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://chef.server/organizations
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ X-Ops-Sign:
15
+ - algorithm=sha1;version=1.0;
16
+ X-Ops-Userid: pivotal
17
+ X-Ops-Timestamp:
18
+ - '2015-08-05T14:09:42Z'
19
+ X-Ops-Content-Hash:
20
+ - "{{X-Ops-Content-Hash}}"
21
+ X-Ops-Authorization-1:
22
+ - "{{X-Ops-Authorization-1}}"
23
+ X-Ops-Authorization-2:
24
+ - "{{X-Ops-Authorization-2}}"
25
+ X-Ops-Authorization-3:
26
+ - "{{X-Ops-Authorization-3}}"
27
+ X-Ops-Authorization-4:
28
+ - "{{X-Ops-Authorization-4}}"
29
+ X-Ops-Authorization-5:
30
+ - "{{X-Ops-Authorization-5}}"
31
+ X-Ops-Authorization-6:
32
+ - "{{X-Ops-Authorization-6}}"
33
+ Host:
34
+ - chef.server:443
35
+ X-Ops-Server-Api-Version:
36
+ - '1'
37
+ X-Remote-Request-Id:
38
+ - 5606b2af-b172-4a94-aa86-5c2013eb3843
39
+ X-Chef-Version:
40
+ - 12.4.1
41
+ User-Agent:
42
+ - Chef Knife/12.4.1 (ruby-2.1.5-p273; ohai-8.5.0; x86_64-darwin12.0; +http://opscode.com)
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Server:
49
+ - openresty/1.7.10.1
50
+ Date:
51
+ - Wed, 05 Aug 2015 14:09:45 GMT
52
+ Content-Type:
53
+ - application/json
54
+ Transfer-Encoding:
55
+ - chunked
56
+ Connection:
57
+ - keep-alive
58
+ X-Ops-Api-Info:
59
+ - flavor=cs;version=12.0.0;oc_erchef=1.6.4
60
+ Content-Encoding:
61
+ - gzip
62
+ body:
63
+ encoding: ASCII-8BIT
64
+ string: !binary |-
65
+ H4sIAAAAAAAAA53VTW7DIBAF4LvMGtlqs8tlKkLAoDhgGWRXrXr3vgGf4O35
66
+ mOHx9ys2y11ia1u9z7OLPkxPf0zWtXT47NtZ9tfkynsu+2Jz+rEtlVxnKCMx
67
+ YACjBzRS3ZvhyoyED8ZCGbGtMlYZsFspDAa8UHZRWmJY8zflL6qTkFs2YI/u
68
+ izwyQxp5+P1F5T8gjk1JTArKsICTsVBGNqprqCs2rrLGptXLdjCdK0N9T2Fl
69
+ RnbP3bXuOv9kOu9uRBfDyV06hNet7nthmlCGJVBbB4W6liprQXFg8RYz/JJG
70
+ ltRW+2CmuCTeWe8Zrwyrf24MVgZ8o+xNaa3c1zQgJuC+JmV//9kSRZpVBwAA
71
+ http_version:
72
+ recorded_at: Wed, 05 Aug 2015 14:09:43 GMT
73
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,205 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://chef.server/organizations/my-test-org
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ X-Ops-Sign:
15
+ - algorithm=sha1;version=1.0;
16
+ X-Ops-Userid: pivotal
17
+ X-Ops-Timestamp:
18
+ - '2015-08-05T14:27:36Z'
19
+ X-Ops-Content-Hash:
20
+ - "{{X-Ops-Content-Hash}}"
21
+ X-Ops-Authorization-1:
22
+ - "{{X-Ops-Authorization-1}}"
23
+ X-Ops-Authorization-2:
24
+ - "{{X-Ops-Authorization-2}}"
25
+ X-Ops-Authorization-3:
26
+ - "{{X-Ops-Authorization-3}}"
27
+ X-Ops-Authorization-4:
28
+ - "{{X-Ops-Authorization-4}}"
29
+ X-Ops-Authorization-5:
30
+ - "{{X-Ops-Authorization-5}}"
31
+ X-Ops-Authorization-6:
32
+ - "{{X-Ops-Authorization-6}}"
33
+ Host:
34
+ - chef.server:443
35
+ X-Ops-Server-Api-Version:
36
+ - '1'
37
+ X-Remote-Request-Id:
38
+ - d9a2fb12-3470-403f-a7a4-ca6e78dc5650
39
+ X-Chef-Version:
40
+ - 12.4.1
41
+ User-Agent:
42
+ - Chef Knife/12.4.1 (ruby-2.1.5-p273; ohai-8.5.0; x86_64-darwin12.0; +http://opscode.com)
43
+ response:
44
+ status:
45
+ code: 200
46
+ message: OK
47
+ headers:
48
+ Server:
49
+ - openresty/1.7.10.1
50
+ Date:
51
+ - Wed, 05 Aug 2015 14:27:38 GMT
52
+ Content-Type:
53
+ - application/json
54
+ Transfer-Encoding:
55
+ - chunked
56
+ Connection:
57
+ - keep-alive
58
+ X-Ops-Api-Info:
59
+ - flavor=cs;version=12.0.0;oc_erchef=1.6.4
60
+ Content-Encoding:
61
+ - gzip
62
+ body:
63
+ encoding: ASCII-8BIT
64
+ string: !binary |-
65
+ H4sIAAAAAAAAA6tWykvMTVWyUsqt1C1JLS7RzS9KV9JRSivNyYmHyoCEFSDC
66
+ 6aWZKUC1BmapiUZmFsZpFskpZqmG5kBgmGZsZGJhlGRulJporFQLAMLz6N9X
67
+ AAAA
68
+ http_version:
69
+ recorded_at: Wed, 05 Aug 2015 14:27:36 GMT
70
+ - request:
71
+ method: get
72
+ uri: https://chef.server/organizations/my-test-org/groups/admins
73
+ body:
74
+ encoding: US-ASCII
75
+ string: ''
76
+ headers:
77
+ Accept:
78
+ - application/json
79
+ Accept-Encoding:
80
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
81
+ X-Ops-Sign:
82
+ - algorithm=sha1;version=1.0;
83
+ X-Ops-Userid: pivotal
84
+ X-Ops-Timestamp:
85
+ - '2015-08-05T14:27:36Z'
86
+ X-Ops-Content-Hash:
87
+ - "{{X-Ops-Content-Hash}}"
88
+ X-Ops-Authorization-1:
89
+ - "{{X-Ops-Authorization-1}}"
90
+ X-Ops-Authorization-2:
91
+ - "{{X-Ops-Authorization-2}}"
92
+ X-Ops-Authorization-3:
93
+ - "{{X-Ops-Authorization-3}}"
94
+ X-Ops-Authorization-4:
95
+ - "{{X-Ops-Authorization-4}}"
96
+ X-Ops-Authorization-5:
97
+ - "{{X-Ops-Authorization-5}}"
98
+ X-Ops-Authorization-6:
99
+ - "{{X-Ops-Authorization-6}}"
100
+ Host:
101
+ - chef.server:443
102
+ X-Ops-Server-Api-Version:
103
+ - '1'
104
+ X-Remote-Request-Id:
105
+ - d9a2fb12-3470-403f-a7a4-ca6e78dc5650
106
+ X-Chef-Version:
107
+ - 12.4.1
108
+ User-Agent:
109
+ - Chef Knife/12.4.1 (ruby-2.1.5-p273; ohai-8.5.0; x86_64-darwin12.0; +http://opscode.com)
110
+ response:
111
+ status:
112
+ code: 200
113
+ message: OK
114
+ headers:
115
+ Server:
116
+ - openresty/1.7.10.1
117
+ Date:
118
+ - Wed, 05 Aug 2015 14:27:38 GMT
119
+ Content-Type:
120
+ - application/json
121
+ Transfer-Encoding:
122
+ - chunked
123
+ Connection:
124
+ - keep-alive
125
+ X-Ops-Api-Info:
126
+ - flavor=cs;version=12.0.0;oc_erchef=1.6.4
127
+ Content-Encoding:
128
+ - gzip
129
+ body:
130
+ encoding: ASCII-8BIT
131
+ string: !binary |-
132
+ H4sIAAAAAAAAA32MOwqAMBBE7zK1uYBXEYs1CSGQH9mNIOLdjZLGxm7mzecE
133
+ acmVMS8ofs9CARNIWG3NB4N1QmP7m+vgbZLnoZddza0MnatLFC1mxEOJZVGd
134
+ 9PcByUSfuPt384XXDSKJqKGYAAAA
135
+ http_version:
136
+ recorded_at: Wed, 05 Aug 2015 14:27:36 GMT
137
+ - request:
138
+ method: get
139
+ uri: https://chef.server/organizations/my-test-org/groups/users
140
+ body:
141
+ encoding: US-ASCII
142
+ string: ''
143
+ headers:
144
+ Accept:
145
+ - application/json
146
+ Accept-Encoding:
147
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
148
+ X-Ops-Sign:
149
+ - algorithm=sha1;version=1.0;
150
+ X-Ops-Userid: pivotal
151
+ X-Ops-Timestamp:
152
+ - '2015-08-05T14:27:36Z'
153
+ X-Ops-Content-Hash:
154
+ - "{{X-Ops-Content-Hash}}"
155
+ X-Ops-Authorization-1:
156
+ - "{{X-Ops-Authorization-1}}"
157
+ X-Ops-Authorization-2:
158
+ - "{{X-Ops-Authorization-2}}"
159
+ X-Ops-Authorization-3:
160
+ - "{{X-Ops-Authorization-3}}"
161
+ X-Ops-Authorization-4:
162
+ - "{{X-Ops-Authorization-4}}"
163
+ X-Ops-Authorization-5:
164
+ - "{{X-Ops-Authorization-5}}"
165
+ X-Ops-Authorization-6:
166
+ - "{{X-Ops-Authorization-6}}"
167
+ Host:
168
+ - chef.server:443
169
+ X-Ops-Server-Api-Version:
170
+ - '1'
171
+ X-Remote-Request-Id:
172
+ - d9a2fb12-3470-403f-a7a4-ca6e78dc5650
173
+ X-Chef-Version:
174
+ - 12.4.1
175
+ User-Agent:
176
+ - Chef Knife/12.4.1 (ruby-2.1.5-p273; ohai-8.5.0; x86_64-darwin12.0; +http://opscode.com)
177
+ response:
178
+ status:
179
+ code: 200
180
+ message: OK
181
+ headers:
182
+ Server:
183
+ - openresty/1.7.10.1
184
+ Date:
185
+ - Wed, 05 Aug 2015 14:27:39 GMT
186
+ Content-Type:
187
+ - application/json
188
+ Transfer-Encoding:
189
+ - chunked
190
+ Connection:
191
+ - keep-alive
192
+ X-Ops-Api-Info:
193
+ - flavor=cs;version=12.0.0;oc_erchef=1.6.4
194
+ Content-Encoding:
195
+ - gzip
196
+ body:
197
+ encoding: ASCII-8BIT
198
+ string: !binary |-
199
+ H4sIAAAAAAAAA42OzQqDMBCE32XPBmxiiPoqpYfobiQ0GsmPUErfvbH1YG/d
200
+ 0/AxszNP0GPyIUJ/hdVuPmkHFQwU7pHp1RatU2RDtg7hVkGO9Ld3dJaWtH8u
201
+ wSn4vH5a6tMhopIdSTSGd2iEaqUslWeLVHhRpm5IGNEKiRwbvi/xYVr0TNDD
202
+ /GCJYmKFlOwBv0OP3h/2egOUm0+u8wAAAA==
203
+ http_version:
204
+ recorded_at: Wed, 05 Aug 2015 14:27:36 GMT
205
+ recorded_with: VCR 2.9.3