lib/fastly.rb in fastly-1.01 vs lib/fastly.rb in fastly-1.1.0

- old
+ new

@@ -3,26 +3,34 @@ # License:: Distributes under the same terms as Ruby # A client library for interacting with the Fastly web acceleration service class Fastly require 'fastly/gem_version' + require 'fastly/string' require 'fastly/fetcher' require 'fastly/client' require 'fastly/base' require 'fastly/belongs_to_service_and_version' require 'fastly/backend' + require 'fastly/cache_setting' + require 'fastly/condition' require 'fastly/customer' require 'fastly/director' require 'fastly/domain' + require 'fastly/header' require 'fastly/healthcheck' + require 'fastly/gzip' require 'fastly/invoice' require 'fastly/match' require 'fastly/origin' + require 'fastly/request_setting' + require 'fastly/response_object' require 'fastly/service' require 'fastly/settings' require 'fastly/syslog' + require 'fastly/s3_logging' require 'fastly/user' require 'fastly/vcl' require 'fastly/version' include Fastly::Fetcher @@ -144,12 +152,12 @@ # Fetches the list of codes for regions that are covered by the Fastly CDN service. def regions client.get_stats("/stats/regions") end - [User, Customer, Backend, Director, Domain, Healthcheck, Match, Origin, Service, Syslog, VCL, Version].each do |klass| - type = klass.to_s.downcase.split("::")[-1] + [User, Customer, Backend, CacheSetting, Condition, Director, Domain, Header, Healthcheck, Gzip, Match, Origin, RequestSetting, ResponseObject, Service, S3Logging, Syslog, VCL, Version].each do |klass| + type = klass.to_s.split("::")[-1].underscore # unless the class doesn't have a list path or it already exists unless klass.list_path.nil? || klass.respond_to?("list_#{type}s".to_sym) self.send :define_method, "list_#{type}s".to_sym do |*args| list(klass, *args) end @@ -199,10 +207,14 @@ ## # :method: create_healthcheck(opts) # opts must contain service_id, version and name params ## + # :method: create_s3_logging(opts) + # opts must contain service_id, version and name params + + ## # :method: create_syslog(opts) # opts must contain service_id, version and name params ## # :method: create_vcl(opts) @@ -211,10 +223,30 @@ ## # :method: create_condition(opts) # opts must contain service_id, version and name params ## + # :method: create_cache_setting(opts) + # opts must contain service_id, version and name params + + ## + # :method: create_header(opts) + # opts must contain service_id, version and name params + + ## + # :method: create_gzip(opts) + # opts must contain service_id, version and name params + + ## + # :method: create_request_setting(opts) + # opts must contain service_id, version and name params + + ## + # :method: create_response_object(opts) + # opts must contain service_id, version and name params + + ## # :method: get_user(id) # Get a User ## # :method: get_customer(id) @@ -249,10 +281,14 @@ # Get a Match ## # :method: get_origin(service_id, number, name) # Get an Origin + + ## + # :method: get_s3_logging(service_id, number, name) + # Get a S3 logging ## # :method: get_syslog(service_id, number, name) # Get a Syslog @@ -266,10 +302,34 @@ ## # :method: get_settings(service_id, number, name) # Get a Settings + ## + # :method: get_condition(service_id, number, name) + # Get a Condition + + ## + # :method: get_cache_setting(service_id, number, name) + # Get a Cache Setting + + ## + # :method: get_gzip(service_id, number, name) + # Get a Gzip + + ## + # :method: get_header(service_id, number, name) + # Get a Header + + ## + # :method: get_request_setting(service_id, number, name) + # Get a Request Setting + + ## + # :method: get_response_object(service_id, number, name) + # Get a Response Object + ## # :method: update_user(user) # You can also call # user.save! @@ -322,20 +382,50 @@ # :method: update_settings(settings) # You can also call # settings.save! ## + # :method: update_s3_logging(s3_logging) + # You can also call + # s3_logging.save! + + ## # :method: update_syslog(syslog) # You can also call # syslog.save! ## # :method: update_vcl(vcl) # You can also call # vcl.save! ## + # :method: update_cache_setting(cache_setting) + # You can also call + # cache_setting.save! + + ## + # :method: update_header(header) + # You can also call + # header.save! + + ## + # :method: update_gzip(gzip) + # You can also call + # gzip.save! + + ## + # :method: update_request_setting(request_setting) + # You can also call + # request_setting.save! + + ## + # :method: update_response_object(response_object) + # You can also call + # response_object.save! + + ## # :method: update_condition(condition) # You can also call # condition.save! ## @@ -398,10 +488,15 @@ # :method: delete_origin(origin) # You can also call # origin.delete! ## + # :method: delete_s3_logging(s3_logging) + # You can also call + # s3_logging.delete! + + ## # :method: delete_syslog(syslog) # You can also call # syslog.delete! @@ -409,73 +504,118 @@ # :method: delete_vcl(vcl) # You can also call # vcl.delete! ## + # :method: delete_cache_setting(cache_setting) + # You can also call + # cache_setting.delete! + + ## + # :method: delete_header(header) + # You can also call + # header.delete! + + ## + # :method: delete_gzip(gzip) + # You can also call + # gzip.delete! + + ## + # :method: delete_request_setting(request_setting) + # You can also call + # request_setting.delete! + + ## + # :method: delete_response_object(response_object) + # You can also call + # response_object.delete! + + ## # :method: delete_condition(condition) # You can also call # condition.delete! ## # :method: delete_version(version) # You can also call # version.delete! - # :method: list_users + # :method: list_users(:service_id => service.id, :version => version.number) # # Get a list of all users - # :method: list_customers + # :method: list_customers(:service_id => service.id, :version => version.number) # # Get a list of all customers - # :method: list_versions + # :method: list_versions(:service_id => service.id, :version => version.number) # # Get a list of all versions - # :method: list_services + # :method: list_services(:service_id => service.id, :version => version.number) # # Get a list of all services - # :method: list_backends + # :method: list_backends(:service_id => service.id, :version => version.number) # # Get a list of all backends - # :method: list_directors + # :method: list_directors(:service_id => service.id, :version => version.number) # # Get a list of all directors - # :method: list_domains + # :method: list_domains(:service_id => service.id, :version => version.number) # # Get a list of all domains - # :method: list_healthchecks + # :method: list_healthchecks(:service_id => service.id, :version => version.number) # # Get a list of all healthchecks - # :method: list_matchs + # :method: list_matchs(:service_id => service.id, :version => version.number) # # Get a list of all matches - # :method: list_origins + # :method: list_origins(:service_id => service.id, :version => version.number) # # Get a list of all origins - # :method: list_syslogs + # :method: list_syslogs(:service_id => service.id, :version => version.number) # # Get a list of all syslogs - # :method: list_vcls + # :method: list_vcls(:service_id => service.id, :version => version.number) # # Get a list of all vcls - # :method: list_conditions + # :method: list_conditions(:service_id => service.id, :version => version.number) # # Get a list of all conditions - # :method: list_versions + # :method: list_cache_settings(:service_id => service.id, :version => version.number) # + # Get a list of all cache settings + + # :method: list_headers(:service_id => service.id, :version => version.number) + # + # Get a list of all headers + + # :method: list_gzips(:service_id => service.id, :version => version.number) + # + # Get a list of all gzips + + # :method: list_request_settings(:service_id => service.id, :version => version.number) + # + # Get a list of all request_settings + + # :method: list_response_objects(:service_id => service.id, :version => version.number) + # + # Get a list of all response_objects + + # :method: list_versions(:service_id => service.id, :version => version.number) + # # Get a list of all versions ## @@ -528,5 +668,6 @@ end raise"Couldn't find options from command line arguments or #{files.join(', ')}" unless options.size>0 options; end end +