spice 1.0.0.rc → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile +0 -14
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/TODO.md +2 -1
- data/lib/spice.rb +47 -72
- data/lib/spice/authentication.rb +23 -45
- data/lib/spice/base.rb +104 -0
- data/lib/spice/client.rb +8 -48
- data/lib/spice/config.rb +37 -19
- data/lib/spice/connection.rb +33 -117
- data/lib/spice/connection/clients.rb +26 -6
- data/lib/spice/connection/cookbooks.rb +19 -14
- data/lib/spice/connection/data_bags.rb +31 -20
- data/lib/spice/connection/environments.rb +6 -7
- data/lib/spice/connection/nodes.rb +23 -6
- data/lib/spice/connection/roles.rb +5 -5
- data/lib/spice/connection/search.rb +12 -12
- data/lib/spice/cookbook.rb +3 -29
- data/lib/spice/cookbook_version.rb +9 -61
- data/lib/spice/core_ext/array.rb +7 -0
- data/lib/spice/core_ext/enumerable.rb +11 -0
- data/lib/spice/core_ext/hash.rb +49 -0
- data/lib/spice/core_ext/mash.rb +219 -0
- data/lib/spice/data_bag.rb +3 -37
- data/lib/spice/data_bag_item.rb +7 -47
- data/lib/spice/environment.rb +12 -27
- data/lib/spice/error.rb +22 -10
- data/lib/spice/identity_map.rb +8 -0
- data/lib/spice/node.rb +13 -34
- data/lib/spice/request.rb +73 -11
- data/lib/spice/response/parse_json.rb +8 -3
- data/lib/spice/role.rb +8 -33
- data/lib/spice/version.rb +1 -1
- data/spec/fixtures/client.pem +27 -0
- data/spec/fixtures/clients/create.json +4 -0
- data/spec/fixtures/clients/index.json +5 -0
- data/spec/fixtures/clients/reregister.json +5 -0
- data/spec/fixtures/clients/show.json +8 -0
- data/spec/fixtures/clients/update.json +5 -0
- data/spec/fixtures/cookbook_versions/show.json +108 -0
- data/spec/fixtures/cookbook_versions/update.json +62 -0
- data/spec/fixtures/cookbooks/index-0.10.json +28 -0
- data/spec/fixtures/cookbooks/index-0.9.json +4 -0
- data/spec/fixtures/cookbooks/show-0.10.json +15 -0
- data/spec/fixtures/cookbooks/show-apache2-0.9.json +5 -0
- data/spec/fixtures/cookbooks/show-unicorn-0.9.json +5 -0
- data/spec/fixtures/data_bag_items/create.json +1 -0
- data/spec/fixtures/data_bag_items/show.json +4 -0
- data/spec/fixtures/data_bag_items/update.json +4 -0
- data/spec/fixtures/data_bags/create.json +3 -0
- data/spec/fixtures/data_bags/index.json +3 -0
- data/spec/fixtures/data_bags/show.json +3 -0
- data/spec/fixtures/environments/cookbook.json +15 -0
- data/spec/fixtures/environments/cookbooks.json +28 -0
- data/spec/fixtures/environments/create.json +1 -0
- data/spec/fixtures/environments/delete.json +8 -0
- data/spec/fixtures/environments/index.json +3 -0
- data/spec/fixtures/environments/show.json +8 -0
- data/spec/fixtures/environments/update.json +8 -0
- data/spec/fixtures/nodes/cookbooks.json +41 -0
- data/spec/fixtures/nodes/create.json +1 -0
- data/spec/fixtures/nodes/delete.json +17 -0
- data/spec/fixtures/nodes/index.json +3 -0
- data/spec/fixtures/nodes/show.json +17 -0
- data/spec/fixtures/nodes/update.json +13 -0
- data/spec/fixtures/roles/create.json +1 -0
- data/spec/fixtures/roles/delete.json +11 -0
- data/spec/fixtures/roles/index.json +3 -0
- data/spec/fixtures/roles/show.json +12 -0
- data/spec/fixtures/roles/update.json +11 -0
- data/spec/fixtures/search/client.json +1 -0
- data/spec/fixtures/search/data_bag.json +1 -0
- data/spec/fixtures/search/environment.json +1 -0
- data/spec/fixtures/search/node.json +1 -0
- data/spec/fixtures/search/role.json +1 -0
- data/spec/spec_helper.rb +5 -4
- data/spec/spice/base_spec.rb +34 -0
- data/spec/spice/client_spec.rb +0 -61
- data/spec/spice/config_spec.rb +14 -0
- data/spec/spice/connection/clients_spec.rb +82 -0
- data/spec/spice/connection/cookbooks_spec.rb +86 -0
- data/spec/spice/connection/data_bags_spec.rb +126 -0
- data/spec/spice/connection_spec.rb +63 -0
- data/spec/spice/cookbook_spec.rb +0 -61
- data/spec/spice/data_bag_item_spec.rb +7 -0
- data/spec/spice/data_bag_spec.rb +0 -160
- data/spec/spice/environment_spec.rb +0 -89
- data/spec/spice/node_spec.rb +0 -74
- data/spec/spice/role_spec.rb +0 -61
- data/spec/spice_spec.rb +8 -116
- data/spec/support/helpers.rb +58 -0
- data/spice.gemspec +13 -15
- metadata +227 -87
- data/.watchr +0 -22
- data/lib/spice/connection/authentication.rb +0 -47
- data/lib/spice/mock.rb +0 -46
- data/lib/spice/persistence.rb +0 -62
- data/spec/spice/chef_spec.rb +0 -52
- data/spec/spice/search_spec.rb +0 -2
- data/spec/support/chef_requests.rb +0 -0
- data/spec/support/client_requests.rb +0 -95
- data/spec/support/cookbook_requests.rb +0 -95
- data/spec/support/data_bag_item_requests.rb +0 -138
- data/spec/support/data_bag_requests.rb +0 -95
- data/spec/support/environment_requests.rb +0 -221
- data/spec/support/node_requests.rb +0 -138
- data/spec/support/respond_with_matcher.rb +0 -53
- data/spec/support/role_requests.rb +0 -95
@@ -0,0 +1,108 @@
|
|
1
|
+
{
|
2
|
+
"definitions": [
|
3
|
+
{
|
4
|
+
"name": "unicorn_config.rb",
|
5
|
+
"url": "https://s3.amazonaws.com/opscode-platform-production-data/organization-(...)",
|
6
|
+
"checksum": "c92b659171552e896074caa58dada0c2",
|
7
|
+
"path": "definitions/unicorn_config.rb",
|
8
|
+
"specificity": "default"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"name": "unicorn-0.1.2",
|
12
|
+
"attributes": [
|
13
|
+
|
14
|
+
],
|
15
|
+
"files": [
|
16
|
+
|
17
|
+
],
|
18
|
+
"json_class": "Chef::CookbookVersion",
|
19
|
+
"providers": [
|
20
|
+
|
21
|
+
],
|
22
|
+
"metadata": {
|
23
|
+
"dependencies": {
|
24
|
+
"ruby": [
|
25
|
+
|
26
|
+
],
|
27
|
+
"rubygems": [
|
28
|
+
|
29
|
+
]
|
30
|
+
},
|
31
|
+
"name": "unicorn",
|
32
|
+
"maintainer_email": "ops@opscode.com",
|
33
|
+
"attributes": {
|
34
|
+
},
|
35
|
+
"license": "Apache 2.0",
|
36
|
+
"suggestions": {
|
37
|
+
},
|
38
|
+
"platforms": {
|
39
|
+
},
|
40
|
+
"maintainer": "Opscode, Inc",
|
41
|
+
"long_description": "= LICENSE AND AUTHOR:\n\nAuthor:: Adam Jacob <adam@opscode.com>\n\nCopyright 2009-2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (...)",
|
42
|
+
"recommendations": {
|
43
|
+
},
|
44
|
+
"version": "0.1.2",
|
45
|
+
"conflicting": {
|
46
|
+
},
|
47
|
+
"recipes": {
|
48
|
+
"unicorn": "Installs unicorn rubygem"
|
49
|
+
},
|
50
|
+
"groupings": {
|
51
|
+
},
|
52
|
+
"replacing": {
|
53
|
+
},
|
54
|
+
"description": "Installs/Configures unicorn",
|
55
|
+
"providing": {
|
56
|
+
}
|
57
|
+
},
|
58
|
+
"libraries": [
|
59
|
+
|
60
|
+
],
|
61
|
+
"templates": [
|
62
|
+
{
|
63
|
+
"name": "unicorn.rb.erb",
|
64
|
+
"url": "https://s3.amazonaws.com/opscode-platform-production-data/organization-(...)",
|
65
|
+
"checksum": "36a1cc1b225708db96d48026c3f624b2",
|
66
|
+
"path": "templates/default/unicorn.rb.erb",
|
67
|
+
"specificity": "default"
|
68
|
+
}
|
69
|
+
],
|
70
|
+
"resources": [
|
71
|
+
|
72
|
+
],
|
73
|
+
"cookbook_name": "unicorn",
|
74
|
+
"version": "0.1.2",
|
75
|
+
"recipes": [
|
76
|
+
{
|
77
|
+
"name": "default.rb",
|
78
|
+
"url": "https://s3.amazonaws.com/opscode-platform-production-data/organization-(...)",
|
79
|
+
"checksum": "ba0dadcbca26710a521e0e3160cc5e20",
|
80
|
+
"path": "recipes/default.rb",
|
81
|
+
"specificity": "default"
|
82
|
+
}
|
83
|
+
],
|
84
|
+
"root_files": [
|
85
|
+
{
|
86
|
+
"name": "README.rdoc",
|
87
|
+
"url": "https://s3.amazonaws.com/opscode-platform-production-data/organization-(...)",
|
88
|
+
"checksum": "d18c630c8a68ffa4852d13214d0525a6",
|
89
|
+
"path": "README.rdoc",
|
90
|
+
"specificity": "default"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"name": "metadata.rb",
|
94
|
+
"url": "https://s3.amazonaws.com/opscode-platform-production-data/organization-(...)",
|
95
|
+
"checksum": "967087a09f48f234028d3aa27a094882",
|
96
|
+
"path": "metadata.rb",
|
97
|
+
"specificity": "default"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"name": "metadata.json",
|
101
|
+
"url": "https://s3.amazonaws.com/opscode-platform-production-data/organization-(...)",
|
102
|
+
"checksum": "45b27c78955f6a738d2d42d88056c57c",
|
103
|
+
"path": "metadata.json",
|
104
|
+
"specificity": "default"
|
105
|
+
}
|
106
|
+
],
|
107
|
+
"chef_type": "cookbook_version"
|
108
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
{ "attributes" : [ ],
|
2
|
+
"chef_type" : "cookbook_version",
|
3
|
+
"cookbook_name" : "unicorn",
|
4
|
+
"definitions" : [ { "checksum" : "c92b659171552e896074caa58dada0c2",
|
5
|
+
"name" : "unicorn_config.rb",
|
6
|
+
"path" : "definitions/unicorn_config.rb",
|
7
|
+
"specificity" : "default"
|
8
|
+
} ],
|
9
|
+
"files" : [ ],
|
10
|
+
"json_class" : "Chef::CookbookVersion",
|
11
|
+
"libraries" : [ ],
|
12
|
+
"metadata" : { "attributes" : { },
|
13
|
+
"conflicting" : { },
|
14
|
+
"dependencies" : { "ruby" : [ ],
|
15
|
+
"rubygems" : [ ]
|
16
|
+
},
|
17
|
+
"description" : "Installs/Configures unicorn",
|
18
|
+
"groupings" : { },
|
19
|
+
"license" : "Apache 2.0",
|
20
|
+
"long_description" : "= LICENSE AND AUTHOR:\n\nAuthor:: Adam Jacob <adam@opscode.com>\n\nCopyright 2009-2010, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (...)",
|
21
|
+
"maintainer" : "Opscode, Inc",
|
22
|
+
"maintainer_email" : "ops@opscode.com",
|
23
|
+
"name" : "unicorn",
|
24
|
+
"platforms" : { },
|
25
|
+
"providing" : { },
|
26
|
+
"recipes" : { "unicorn" : "Installs unicorn rubygem" },
|
27
|
+
"recommendations" : { },
|
28
|
+
"replacing" : { },
|
29
|
+
"suggestions" : { },
|
30
|
+
"version" : "0.1.2"
|
31
|
+
},
|
32
|
+
"name" : "unicorn-0.1.2",
|
33
|
+
"providers" : [ ],
|
34
|
+
"recipes" : [ { "checksum" : "ba0dadcbca26710a521e0e3160cc5e20",
|
35
|
+
"name" : "default.rb",
|
36
|
+
"path" : "recipes/default.rb",
|
37
|
+
"specificity" : "default"
|
38
|
+
} ],
|
39
|
+
"resources" : [ ],
|
40
|
+
"root_files" : [ { "checksum" : "d18c630c8a68ffa4852d13214d0525a6",
|
41
|
+
"name" : "README.rdoc",
|
42
|
+
"path" : "README.rdoc",
|
43
|
+
"specificity" : "default"
|
44
|
+
},
|
45
|
+
{ "checksum" : "967087a09f48f234028d3aa27a094882",
|
46
|
+
"name" : "metadata.rb",
|
47
|
+
"path" : "metadata.rb",
|
48
|
+
"specificity" : "default"
|
49
|
+
},
|
50
|
+
{ "checksum" : "45b27c78955f6a738d2d42d88056c57c",
|
51
|
+
"name" : "metadata.json",
|
52
|
+
"path" : "metadata.json",
|
53
|
+
"specificity" : "default"
|
54
|
+
}
|
55
|
+
],
|
56
|
+
"templates" : [ { "checksum" : "36a1cc1b225708db96d48026c3f624b2",
|
57
|
+
"name" : "unicorn.rb.erb",
|
58
|
+
"path" : "templates/default/unicorn.rb.erb",
|
59
|
+
"specificity" : "default"
|
60
|
+
} ],
|
61
|
+
"version" : "0.1.2"
|
62
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"apache2": {
|
3
|
+
"url": "http://localhost:4000/cookbooks/apache2",
|
4
|
+
"versions": [
|
5
|
+
{
|
6
|
+
"url": "http://localhost:4000/cookbooks/apache2/5.1.0",
|
7
|
+
"version": "5.1.0"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"url": "http://localhost:4000/cookbooks/apache2/4.2.0",
|
11
|
+
"version": "4.2.0"
|
12
|
+
}
|
13
|
+
]
|
14
|
+
},
|
15
|
+
"nginx": {
|
16
|
+
"url": "http://localhost:4000/cookbooks/nginx",
|
17
|
+
"versions": [
|
18
|
+
{
|
19
|
+
"url": "http://localhost:4000/cookbooks/nginx/1.0.0",
|
20
|
+
"version": "1.0.0"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"url": "http://localhost:4000/cookbooks/nginx/0.3.0",
|
24
|
+
"version": "0.3.0"
|
25
|
+
}
|
26
|
+
]
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"apache2": {
|
3
|
+
"url": "http://localhost:4000/cookbooks/apache2",
|
4
|
+
"versions": [
|
5
|
+
{
|
6
|
+
"url": "http://localhost:4000/cookbooks/apache2/5.1.0",
|
7
|
+
"version": "5.1.0"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"url": "http://localhost:4000/cookbooks/apache2/4.2.0",
|
11
|
+
"version": "4.2.0"
|
12
|
+
}
|
13
|
+
]
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"chef_type":"data_bag_item", "id":"adam", "real_name":"Adam Jacob", "data_bag":"users"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"apache2": {
|
3
|
+
"url": "http://localhost:4000/cookbooks/apache2",
|
4
|
+
"versions": [
|
5
|
+
{
|
6
|
+
"url": "http://localhost:4000/cookbooks/apache2/5.1.0",
|
7
|
+
"version": "5.1.0"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"url": "http://localhost:4000/cookbooks/apache2/4.2.0",
|
11
|
+
"version": "4.2.0"
|
12
|
+
}
|
13
|
+
]
|
14
|
+
}
|
15
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"apache2": {
|
3
|
+
"url": "http://localhost:4000/cookbooks/apache2",
|
4
|
+
"versions": [
|
5
|
+
{
|
6
|
+
"url": "http://localhost:4000/cookbooks/apache2/5.1.0",
|
7
|
+
"version": "5.1.0"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"url": "http://localhost:4000/cookbooks/apache2/4.2.0",
|
11
|
+
"version": "4.2.0"
|
12
|
+
}
|
13
|
+
]
|
14
|
+
},
|
15
|
+
"nginx": {
|
16
|
+
"url": "http://localhost:4000/cookbooks/nginx",
|
17
|
+
"versions": [
|
18
|
+
{
|
19
|
+
"url": "http://localhost:4000/cookbooks/nginx/1.0.0",
|
20
|
+
"version": "1.0.0"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"url": "http://localhost:4000/cookbooks/nginx/0.3.0",
|
24
|
+
"version": "0.3.0"
|
25
|
+
}
|
26
|
+
]
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{ "uri": "http://localhost:4000/environments/dev" }
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"unicorn": {
|
3
|
+
"definitions": [
|
4
|
+
{
|
5
|
+
"name": "unicorn_config.rb",
|
6
|
+
"uri": "http://localhost:4000/cookbooks/unicorn/definitions?id=unicorn_config.rb",
|
7
|
+
"checksum": "72074229598611d7a6cdcc8176ffb76748adb4127be3a9651c89bb0afab6498f"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
"files": [
|
11
|
+
|
12
|
+
],
|
13
|
+
"providers": [
|
14
|
+
|
15
|
+
],
|
16
|
+
"templates": [
|
17
|
+
{
|
18
|
+
"name": "unicorn.rb.erb",
|
19
|
+
"uri": "http://localhost:4000/cookbooks/unicorn/templates?id=unicorn.rb.erb",
|
20
|
+
"checksum": "c1df9c8ec2bda7b14ecadc1c5a56802442cd8d7503f2524d4fa3f73dba1a1250",
|
21
|
+
"specificity": "default"
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"libraries": [
|
25
|
+
|
26
|
+
],
|
27
|
+
"resources": [
|
28
|
+
|
29
|
+
],
|
30
|
+
"attributes": [
|
31
|
+
|
32
|
+
],
|
33
|
+
"recipes": [
|
34
|
+
{
|
35
|
+
"name": "default.rb",
|
36
|
+
"uri": "http://localhost:4000/cookbooks/unicorn/recipes?id=default.rb",
|
37
|
+
"checksum": "87a3f720bf5bbd9227228ba22946436db6598a59f8aedff37515ebd4e1157644"
|
38
|
+
}
|
39
|
+
]
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{ "uri": "http://localhost:4000/nodes/latte" }
|