Class: AkamaiApi::CLI::ECCU::Base
- Defined in:
- lib/akamai_api/cli/eccu/base.rb
Instance Method Summary collapse
- #last_request ⇒ Object
- #publish_xml(source, property) ⇒ Object
- #requests ⇒ Object
- #revalidate(revalidate_on, property, querystring) ⇒ Object
Instance Method Details
#last_request ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/akamai_api/cli/eccu/base.rb', line 20 def last_request load_config request = AkamaiApi::ECCURequest.last verbose: [:content] puts EntryRenderer.new(request).render rescue ::AkamaiApi::Unauthorized puts "Your login credentials are invalid." end |
#publish_xml(source, property) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/akamai_api/cli/eccu/base.rb', line 40 def publish_xml(source, property) load_config args = { :notes => [:notes], :property_exact_match => ![:no_exact_match], :property_type => [:property_type], :emails => [:emails] } id = AkamaiApi::ECCURequest.publish_file property, source, args puts "Request correctly published:" puts EntryRenderer.new(AkamaiApi::ECCURequest.find(id, :verbose => true)).render rescue ::AkamaiApi::Unauthorized puts "Your login credentials are invalid." rescue ::AkamaiApi::ECCU::InvalidDomain puts "You are not authorized to specify this digital property." rescue Savon::SOAPFault puts $!. end |
#requests ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/akamai_api/cli/eccu/base.rb', line 9 def requests load_config requests = AkamaiApi::ECCURequest.all :verbose => [:content] puts EntryRenderer.render requests rescue ::AkamaiApi::Unauthorized puts "Your login credentials are invalid." end |
#revalidate(revalidate_on, property, querystring) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/akamai_api/cli/eccu/base.rb', line 74 def revalidate(revalidate_on, property, querystring) load_config args = { :notes => [:notes], :property_exact_match => ![:no_exact_match], :property_type => [:property_type], :emails => [:emails] } parser = AkamaiApi::ECCUParser.new querystring, revalidate_on puts parser.xml if [:force] str = "Y" else print "\nPublish this XML? (Y/n)" begin system("stty raw -echo") str = STDIN.getc ensure system("stty -raw echo") end end if str == "Y" id = AkamaiApi::ECCURequest.publish property, parser.xml, args puts "\n\nRequest correctly published:" puts EntryRenderer.new(AkamaiApi::ECCURequest.find(id, :verbose => true)).render else puts "\n\nExit without publish request" end rescue Exception => e puts e. end |