summaryrefslogtreecommitdiff
path: root/lib/chef_zero/endpoints/policy_revisions_endpoint.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef_zero/endpoints/policy_revisions_endpoint.rb')
-rw-r--r--lib/chef_zero/endpoints/policy_revisions_endpoint.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/chef_zero/endpoints/policy_revisions_endpoint.rb b/lib/chef_zero/endpoints/policy_revisions_endpoint.rb
new file mode 100644
index 0000000..7c20a24
--- /dev/null
+++ b/lib/chef_zero/endpoints/policy_revisions_endpoint.rb
@@ -0,0 +1,15 @@
+require 'chef_zero/chef_data/data_normalizer'
+
+module ChefZero
+ module Endpoints
+ # /organizations/ORG/policies/NAME/revisions
+ class PolicyRevisionsEndpoint < RestBase
+ # POST /organizations/ORG/policies/NAME/revisions
+ def post(request)
+ policyfile_data = parse_json(request.body)
+ create_data(request, request.rest_path, policyfile_data["revision_id"], request.body, :create_dir)
+ return already_json_response(201, request.body)
+ end
+ end
+ end
+end