Class: HighwindsAPI::Content
- Inherits:
-
Object
- Object
- HighwindsAPI::Content
- Includes:
- HTTParty
- Defined in:
- lib/highwinds-api/content.rb
Class Method Summary collapse
-
.purge_path(host_hash, path) ⇒ Object
This method returns the last item post result.
- .purge_url(url, recursive) ⇒ Object
Class Method Details
.purge_path(host_hash, path) ⇒ Object
This method returns the last item post result
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/highwinds-api/content.rb', line 18 def self.purge_path(host_hash, path) paths =[*path] paths = paths.map {|single_path| single_path.start_with?('/') ? single_path : '/' << single_path } res=nil paths.each do |path| = { :headers => { 'Authorization' => HighwindsAPI.get_token, 'Content-Type' => 'application/json'}, :body => {"list" => [{url: "http://cds.#{host_hash}.hwcdn.net#{path}", recursive: true }]}.to_json } res = self.post("/api/v1/accounts/#{get_account_hash}/purge", ) end res end |
.purge_url(url, recursive) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/highwinds-api/content.rb', line 9 def self.purge_url(url, recursive) = { :headers => { 'Authorization' => HighwindsAPI.get_token, 'Content-Type' => 'application/json'}, :body => {"list" => [{url: url, recursive: recursive }]}.to_json } self.post("/api/v1/accounts/#{get_account_hash}/purge", ) end |