Giter VIP home page Giter VIP logo

fastly-ruby's Introduction

fastly-ruby

A Ruby client library for interacting with most facets of the Fastly API.

Installation

To install via RubyGems, add the following to your project's Gemfile:

gem 'fastly', '~> 8.5.0'

Then run bundle install.

Usage

# Load the gem
require 'fastly'

# Authorize the client with a Fastly API token.
Fastly.configure do |config|
# Configure API key authorization: token
  config.api_token = 'YOUR API KEY'
end

api_instance = Fastly::AclApi.new

opts = {
  service_id: 'SU1Z0isxPaozGVKXdv0eY', # String
  version_id: 56, # Integer
  name: 'my_acl', # String
}

begin
  result = api_instance.create_acl(opts)
  p result
rescue Fastly::ApiError => e
  puts "Exception when calling AclApi->create_acl: #{e}"
end

Authorization

Note

The Fastly API requires an API token for most operations.

Set up the API token in the Ruby client by assigning to api_token of a configuration as shown:

# Authorize the client with a Fastly API token.
Fastly.configure do |config|
  # Configure API key authorization: token
  config.api_token = 'YOUR API KEY'
end

Alternatively, set the FASTLY_API_TOKEN environment variable instead of setting api_token.

API Endpoints

The main documentation for the Fastly API can be found on our Developer Hub.

Table of API endpoints
Class Method Description
Fastly::AclApi create_acl Create a new ACL
Fastly::AclApi delete_acl Delete an ACL
Fastly::AclApi get_acl Describe an ACL
Fastly::AclApi list_acls List ACLs
Fastly::AclApi update_acl Update an ACL
Fastly::AclEntryApi bulk_update_acl_entries Update multiple ACL entries
Fastly::AclEntryApi create_acl_entry Create an ACL entry
Fastly::AclEntryApi delete_acl_entry Delete an ACL entry
Fastly::AclEntryApi get_acl_entry Describe an ACL entry
Fastly::AclEntryApi list_acl_entries List ACL entries
Fastly::AclEntryApi update_acl_entry Update an ACL entry
Fastly::ApexRedirectApi create_apex_redirect Create an apex redirect
Fastly::ApexRedirectApi delete_apex_redirect Delete an apex redirect
Fastly::ApexRedirectApi get_apex_redirect Get an apex redirect
Fastly::ApexRedirectApi list_apex_redirects List apex redirects
Fastly::ApexRedirectApi update_apex_redirect Update an apex redirect
Fastly::AutomationTokensApi create_automation_token Create Automation Token
Fastly::AutomationTokensApi get_automation_token_id Retrieve an Automation Token by ID
Fastly::AutomationTokensApi get_automation_tokens_id_services List Automation Token Services
Fastly::AutomationTokensApi list_automation_tokens List Customer Automation Tokens
Fastly::AutomationTokensApi revoke_automation_token_id Revoke an Automation Token by ID
Fastly::BackendApi create_backend Create a backend
Fastly::BackendApi delete_backend Delete a backend
Fastly::BackendApi get_backend Describe a backend
Fastly::BackendApi list_backends List backends
Fastly::BackendApi update_backend Update a backend
Fastly::BillingApi get_invoice Get an invoice
Fastly::BillingApi get_invoice_by_id Get an invoice
Fastly::BillingApi get_invoice_mtd Get month-to-date billing estimate
Fastly::BillingAddressApi add_billing_addr Add a billing address to a customer
Fastly::BillingAddressApi delete_billing_addr Delete a billing address
Fastly::BillingAddressApi get_billing_addr Get a billing address
Fastly::BillingAddressApi update_billing_addr Update a billing address
Fastly::BillingInvoicesApi get_invoice_by_invoice_id Get invoice by ID.
Fastly::BillingInvoicesApi list_invoices List of invoices.
Fastly::CacheSettingsApi create_cache_settings Create a cache settings object
Fastly::CacheSettingsApi delete_cache_settings Delete a cache settings object
Fastly::CacheSettingsApi get_cache_settings Get a cache settings object
Fastly::CacheSettingsApi list_cache_settings List cache settings objects
Fastly::CacheSettingsApi update_cache_settings Update a cache settings object
Fastly::ConditionApi create_condition Create a condition
Fastly::ConditionApi delete_condition Delete a condition
Fastly::ConditionApi get_condition Describe a condition
Fastly::ConditionApi list_conditions List conditions
Fastly::ConditionApi update_condition Update a condition
Fastly::ConfigStoreApi create_config_store Create a config store
Fastly::ConfigStoreApi delete_config_store Delete a config store
Fastly::ConfigStoreApi get_config_store Describe a config store
Fastly::ConfigStoreApi get_config_store_info Get config store metadata
Fastly::ConfigStoreApi list_config_store_services List linked services
Fastly::ConfigStoreApi list_config_stores List config stores
Fastly::ConfigStoreApi update_config_store Update a config store
Fastly::ConfigStoreItemApi bulk_update_config_store_item Update multiple entries in a config store
Fastly::ConfigStoreItemApi create_config_store_item Create an entry in a config store
Fastly::ConfigStoreItemApi delete_config_store_item Delete an item from a config store
Fastly::ConfigStoreItemApi get_config_store_item Get an item from a config store
Fastly::ConfigStoreItemApi list_config_store_items List items in a config store
Fastly::ConfigStoreItemApi update_config_store_item Update an entry in a config store
Fastly::ConfigStoreItemApi upsert_config_store_item Insert or update an entry in a config store
Fastly::ContactApi create_contacts Add a new customer contact
Fastly::ContactApi delete_contact Delete a contact
Fastly::ContactApi list_contacts List contacts
Fastly::ContentApi content_check Check status of content in each POP's cache
Fastly::CustomerApi delete_customer Delete a customer
Fastly::CustomerApi get_customer Get a customer
Fastly::CustomerApi get_logged_in_customer Get the logged in customer
Fastly::CustomerApi list_users List users
Fastly::CustomerApi update_customer Update a customer
Fastly::DictionaryApi create_dictionary Create an edge dictionary
Fastly::DictionaryApi delete_dictionary Delete an edge dictionary
Fastly::DictionaryApi get_dictionary Get an edge dictionary
Fastly::DictionaryApi list_dictionaries List edge dictionaries
Fastly::DictionaryApi update_dictionary Update an edge dictionary
Fastly::DictionaryInfoApi get_dictionary_info Get edge dictionary metadata
Fastly::DictionaryItemApi bulk_update_dictionary_item Update multiple entries in an edge dictionary
Fastly::DictionaryItemApi create_dictionary_item Create an entry in an edge dictionary
Fastly::DictionaryItemApi delete_dictionary_item Delete an item from an edge dictionary
Fastly::DictionaryItemApi get_dictionary_item Get an item from an edge dictionary
Fastly::DictionaryItemApi list_dictionary_items List items in an edge dictionary
Fastly::DictionaryItemApi update_dictionary_item Update an entry in an edge dictionary
Fastly::DictionaryItemApi upsert_dictionary_item Insert or update an entry in an edge dictionary
Fastly::DiffApi diff_service_versions Diff two service versions
Fastly::DirectorApi create_director Create a director
Fastly::DirectorApi delete_director Delete a director
Fastly::DirectorApi get_director Get a director
Fastly::DirectorApi list_directors List directors
Fastly::DirectorApi update_director Update a director
Fastly::DirectorBackendApi create_director_backend Create a director-backend relationship
Fastly::DirectorBackendApi delete_director_backend Delete a director-backend relationship
Fastly::DirectorBackendApi get_director_backend Get a director-backend relationship
Fastly::DomainApi check_domain Validate DNS configuration for a single domain on a service
Fastly::DomainApi check_domains Validate DNS configuration for all domains on a service
Fastly::DomainApi create_domain Add a domain name to a service
Fastly::DomainApi delete_domain Remove a domain from a service
Fastly::DomainApi get_domain Describe a domain
Fastly::DomainApi list_domains List domains
Fastly::DomainApi update_domain Update a domain
Fastly::DomainInspectorHistoricalApi get_domain_inspector_historical Get historical domain data for a service
Fastly::DomainInspectorRealtimeApi get_domain_inspector_last120_seconds Get real-time domain data for the last 120 seconds
Fastly::DomainInspectorRealtimeApi get_domain_inspector_last_max_entries Get a limited number of real-time domain data entries
Fastly::DomainInspectorRealtimeApi get_domain_inspector_last_second Get real-time domain data from a specified time
Fastly::DomainOwnershipsApi list_domain_ownerships List domain-ownerships
Fastly::EnabledProductsApi disable_product Disable a product
Fastly::EnabledProductsApi enable_product Enable a product
Fastly::EnabledProductsApi get_enabled_product Get enabled product
Fastly::EventsApi get_event Get an event
Fastly::EventsApi list_events List events
Fastly::GzipApi create_gzip_config Create a gzip configuration
Fastly::GzipApi delete_gzip_config Delete a gzip configuration
Fastly::GzipApi get_gzip_configs Get a gzip configuration
Fastly::GzipApi list_gzip_configs List gzip configurations
Fastly::GzipApi update_gzip_config Update a gzip configuration
Fastly::HeaderApi create_header_object Create a Header object
Fastly::HeaderApi delete_header_object Delete a Header object
Fastly::HeaderApi get_header_object Get a Header object
Fastly::HeaderApi list_header_objects List Header objects
Fastly::HeaderApi update_header_object Update a Header object
Fastly::HealthcheckApi create_healthcheck Create a health check
Fastly::HealthcheckApi delete_healthcheck Delete a health check
Fastly::HealthcheckApi get_healthcheck Get a health check
Fastly::HealthcheckApi list_healthchecks List health checks
Fastly::HealthcheckApi update_healthcheck Update a health check
Fastly::HistoricalApi get_hist_stats Get historical stats
Fastly::HistoricalApi get_hist_stats_aggregated Get aggregated historical stats
Fastly::HistoricalApi get_hist_stats_field Get historical stats for a single field
Fastly::HistoricalApi get_hist_stats_service Get historical stats for a single service
Fastly::HistoricalApi get_hist_stats_service_field Get historical stats for a single service/field combination
Fastly::HistoricalApi get_regions Get region codes
Fastly::HistoricalApi get_usage Get usage statistics
Fastly::HistoricalApi get_usage_month Get month-to-date usage statistics
Fastly::HistoricalApi get_usage_service Get usage statistics per service
Fastly::Http3Api create_http3 Enable support for HTTP/3
Fastly::Http3Api delete_http3 Disable support for HTTP/3
Fastly::Http3Api get_http3 Get HTTP/3 status
Fastly::IamPermissionsApi list_permissions List permissions
Fastly::IamRolesApi add_role_permissions Add permissions to a role
Fastly::IamRolesApi create_a_role Create a role
Fastly::IamRolesApi delete_a_role Delete a role
Fastly::IamRolesApi get_a_role Get a role
Fastly::IamRolesApi list_role_permissions List permissions in a role
Fastly::IamRolesApi list_roles List roles
Fastly::IamRolesApi remove_role_permissions Remove permissions from a role
Fastly::IamRolesApi update_a_role Update a role
Fastly::IamServiceGroupsApi add_service_group_services Add services in a service group
Fastly::IamServiceGroupsApi create_a_service_group Create a service group
Fastly::IamServiceGroupsApi delete_a_service_group Delete a service group
Fastly::IamServiceGroupsApi get_a_service_group Get a service group
Fastly::IamServiceGroupsApi list_service_group_services List services to a service group
Fastly::IamServiceGroupsApi list_service_groups List service groups
Fastly::IamServiceGroupsApi remove_service_group_services Remove services from a service group
Fastly::IamServiceGroupsApi update_a_service_group Update a service group
Fastly::IamUserGroupsApi add_user_group_members Add members to a user group
Fastly::IamUserGroupsApi add_user_group_roles Add roles to a user group
Fastly::IamUserGroupsApi add_user_group_service_groups Add service groups to a user group
Fastly::IamUserGroupsApi create_a_user_group Create a user group
Fastly::IamUserGroupsApi delete_a_user_group Delete a user group
Fastly::IamUserGroupsApi get_a_user_group Get a user group
Fastly::IamUserGroupsApi list_user_group_members List members of a user group
Fastly::IamUserGroupsApi list_user_group_roles List roles in a user group
Fastly::IamUserGroupsApi list_user_group_service_groups List service groups in a user group
Fastly::IamUserGroupsApi list_user_groups List user groups
Fastly::IamUserGroupsApi remove_user_group_members Remove members of a user group
Fastly::IamUserGroupsApi remove_user_group_roles Remove roles from a user group
Fastly::IamUserGroupsApi remove_user_group_service_groups Remove service groups from a user group
Fastly::IamUserGroupsApi update_a_user_group Update a user group
Fastly::ImageOptimizerDefaultSettingsApi get_default_settings Get current Image Optimizer Default Settings
Fastly::ImageOptimizerDefaultSettingsApi update_default_settings Update Image Optimizer Default Settings
Fastly::InvitationsApi create_invitation Create an invitation
Fastly::InvitationsApi delete_invitation Delete an invitation
Fastly::InvitationsApi list_invitations List invitations
Fastly::KvStoreApi create_store Create a KV store.
Fastly::KvStoreApi delete_store Delete a KV store.
Fastly::KvStoreApi get_store Describe a KV store.
Fastly::KvStoreApi get_stores List KV stores.
Fastly::KvStoreItemApi delete_key_from_store Delete kv store item.
Fastly::KvStoreItemApi get_keys List kv store keys.
Fastly::KvStoreItemApi get_value_for_key Get the value of an kv store item
Fastly::KvStoreItemApi set_value_for_key Insert an item into an kv store
Fastly::LegacyWafConfigurationSetsApi list_waf_config_sets List configuration sets
Fastly::LegacyWafConfigurationSetsApi list_wafs_config_set List WAFs currently using a configuration set
Fastly::LegacyWafConfigurationSetsApi use_waf_config_set Apply a configuration set to a WAF
Fastly::LegacyWafFirewallApi create_legacy_waf_firewall_service Create a firewall
Fastly::LegacyWafFirewallApi disable_legacy_waf_firewall Disable a firewall
Fastly::LegacyWafFirewallApi enable_legacy_waf_firewall Enable a firewall
Fastly::LegacyWafFirewallApi get_legacy_waf_firewall Get a firewall object
Fastly::LegacyWafFirewallApi get_legacy_waf_firewall_service Get a firewall
Fastly::LegacyWafFirewallApi list_legacy_waf_firewalls List active firewalls
Fastly::LegacyWafFirewallApi list_legacy_waf_firewalls_service List firewalls
Fastly::LegacyWafFirewallApi update_legacy_waf_firewall_service Update a firewall
Fastly::LegacyWafOwaspApi create_owasp_settings Create an OWASP settings object
Fastly::LegacyWafOwaspApi get_owasp_settings Get the OWASP settings object
Fastly::LegacyWafOwaspApi update_owasp_settings Update the OWASP settings object
Fastly::LegacyWafRuleApi get_legacy_waf_firewall_rule_vcl Get VCL for a rule associated with a firewall
Fastly::LegacyWafRuleApi get_legacy_waf_rule Get a rule
Fastly::LegacyWafRuleApi get_legacy_waf_rule_vcl Get VCL for a rule
Fastly::LegacyWafRuleApi list_legacy_waf_rules List rules in the latest configuration set
Fastly::LegacyWafRuleStatusApi get_waf_firewall_rule_status Get the status of a rule on a firewall
Fastly::LegacyWafRuleStatusApi list_waf_firewall_rule_statuses List rule statuses
Fastly::LegacyWafRuleStatusApi update_waf_firewall_rule_status Update the status of a rule
Fastly::LegacyWafRuleStatusApi update_waf_firewall_rule_statuses_tag Create or update status of a tagged group of rules
Fastly::LegacyWafRulesetApi get_waf_ruleset Get a WAF ruleset
Fastly::LegacyWafRulesetApi get_waf_ruleset_vcl Generate WAF ruleset VCL
Fastly::LegacyWafRulesetApi update_waf_ruleset Update a WAF ruleset
Fastly::LegacyWafTagApi list_legacy_waf_tags List WAF tags
Fastly::LegacyWafUpdateStatusApi get_waf_update_status Get the status of a WAF update
Fastly::LegacyWafUpdateStatusApi list_waf_update_statuses List update statuses
Fastly::LoggingAzureblobApi create_log_azure Create an Azure Blob Storage log endpoint
Fastly::LoggingAzureblobApi delete_log_azure Delete the Azure Blob Storage log endpoint
Fastly::LoggingAzureblobApi get_log_azure Get an Azure Blob Storage log endpoint
Fastly::LoggingAzureblobApi list_log_azure List Azure Blob Storage log endpoints
Fastly::LoggingAzureblobApi update_log_azure Update an Azure Blob Storage log endpoint
Fastly::LoggingBigqueryApi create_log_bigquery Create a BigQuery log endpoint
Fastly::LoggingBigqueryApi delete_log_bigquery Delete a BigQuery log endpoint
Fastly::LoggingBigqueryApi get_log_bigquery Get a BigQuery log endpoint
Fastly::LoggingBigqueryApi list_log_bigquery List BigQuery log endpoints
Fastly::LoggingBigqueryApi update_log_bigquery Update a BigQuery log endpoint
Fastly::LoggingCloudfilesApi create_log_cloudfiles Create a Cloud Files log endpoint
Fastly::LoggingCloudfilesApi delete_log_cloudfiles Delete the Cloud Files log endpoint
Fastly::LoggingCloudfilesApi get_log_cloudfiles Get a Cloud Files log endpoint
Fastly::LoggingCloudfilesApi list_log_cloudfiles List Cloud Files log endpoints
Fastly::LoggingCloudfilesApi update_log_cloudfiles Update the Cloud Files log endpoint
Fastly::LoggingDatadogApi create_log_datadog Create a Datadog log endpoint
Fastly::LoggingDatadogApi delete_log_datadog Delete a Datadog log endpoint
Fastly::LoggingDatadogApi get_log_datadog Get a Datadog log endpoint
Fastly::LoggingDatadogApi list_log_datadog List Datadog log endpoints
Fastly::LoggingDatadogApi update_log_datadog Update a Datadog log endpoint
Fastly::LoggingDigitaloceanApi create_log_digocean Create a DigitalOcean Spaces log endpoint
Fastly::LoggingDigitaloceanApi delete_log_digocean Delete a DigitalOcean Spaces log endpoint
Fastly::LoggingDigitaloceanApi get_log_digocean Get a DigitalOcean Spaces log endpoint
Fastly::LoggingDigitaloceanApi list_log_digocean List DigitalOcean Spaces log endpoints
Fastly::LoggingDigitaloceanApi update_log_digocean Update a DigitalOcean Spaces log endpoint
Fastly::LoggingElasticsearchApi create_log_elasticsearch Create an Elasticsearch log endpoint
Fastly::LoggingElasticsearchApi delete_log_elasticsearch Delete an Elasticsearch log endpoint
Fastly::LoggingElasticsearchApi get_log_elasticsearch Get an Elasticsearch log endpoint
Fastly::LoggingElasticsearchApi list_log_elasticsearch List Elasticsearch log endpoints
Fastly::LoggingElasticsearchApi update_log_elasticsearch Update an Elasticsearch log endpoint
Fastly::LoggingFtpApi create_log_ftp Create an FTP log endpoint
Fastly::LoggingFtpApi delete_log_ftp Delete an FTP log endpoint
Fastly::LoggingFtpApi get_log_ftp Get an FTP log endpoint
Fastly::LoggingFtpApi list_log_ftp List FTP log endpoints
Fastly::LoggingFtpApi update_log_ftp Update an FTP log endpoint
Fastly::LoggingGcsApi create_log_gcs Create a GCS log endpoint
Fastly::LoggingGcsApi delete_log_gcs Delete a GCS log endpoint
Fastly::LoggingGcsApi get_log_gcs Get a GCS log endpoint
Fastly::LoggingGcsApi list_log_gcs List GCS log endpoints
Fastly::LoggingGcsApi update_log_gcs Update a GCS log endpoint
Fastly::LoggingHerokuApi create_log_heroku Create a Heroku log endpoint
Fastly::LoggingHerokuApi delete_log_heroku Delete the Heroku log endpoint
Fastly::LoggingHerokuApi get_log_heroku Get a Heroku log endpoint
Fastly::LoggingHerokuApi list_log_heroku List Heroku log endpoints
Fastly::LoggingHerokuApi update_log_heroku Update the Heroku log endpoint
Fastly::LoggingHoneycombApi create_log_honeycomb Create a Honeycomb log endpoint
Fastly::LoggingHoneycombApi delete_log_honeycomb Delete the Honeycomb log endpoint
Fastly::LoggingHoneycombApi get_log_honeycomb Get a Honeycomb log endpoint
Fastly::LoggingHoneycombApi list_log_honeycomb List Honeycomb log endpoints
Fastly::LoggingHoneycombApi update_log_honeycomb Update a Honeycomb log endpoint
Fastly::LoggingHttpsApi create_log_https Create an HTTPS log endpoint
Fastly::LoggingHttpsApi delete_log_https Delete an HTTPS log endpoint
Fastly::LoggingHttpsApi get_log_https Get an HTTPS log endpoint
Fastly::LoggingHttpsApi list_log_https List HTTPS log endpoints
Fastly::LoggingHttpsApi update_log_https Update an HTTPS log endpoint
Fastly::LoggingKafkaApi create_log_kafka Create a Kafka log endpoint
Fastly::LoggingKafkaApi delete_log_kafka Delete the Kafka log endpoint
Fastly::LoggingKafkaApi get_log_kafka Get a Kafka log endpoint
Fastly::LoggingKafkaApi list_log_kafka List Kafka log endpoints
Fastly::LoggingKafkaApi update_log_kafka Update the Kafka log endpoint
Fastly::LoggingKinesisApi create_log_kinesis Create an Amazon Kinesis log endpoint
Fastly::LoggingKinesisApi delete_log_kinesis Delete the Amazon Kinesis log endpoint
Fastly::LoggingKinesisApi get_log_kinesis Get an Amazon Kinesis log endpoint
Fastly::LoggingKinesisApi list_log_kinesis List Amazon Kinesis log endpoints
Fastly::LoggingKinesisApi update_log_kinesis Update the Amazon Kinesis log endpoint
Fastly::LoggingLogentriesApi create_log_logentries Create a Logentries log endpoint
Fastly::LoggingLogentriesApi delete_log_logentries Delete a Logentries log endpoint
Fastly::LoggingLogentriesApi get_log_logentries Get a Logentries log endpoint
Fastly::LoggingLogentriesApi list_log_logentries List Logentries log endpoints
Fastly::LoggingLogentriesApi update_log_logentries Update a Logentries log endpoint
Fastly::LoggingLogglyApi create_log_loggly Create a Loggly log endpoint
Fastly::LoggingLogglyApi delete_log_loggly Delete a Loggly log endpoint
Fastly::LoggingLogglyApi get_log_loggly Get a Loggly log endpoint
Fastly::LoggingLogglyApi list_log_loggly List Loggly log endpoints
Fastly::LoggingLogglyApi update_log_loggly Update a Loggly log endpoint
Fastly::LoggingLogshuttleApi create_log_logshuttle Create a Log Shuttle log endpoint
Fastly::LoggingLogshuttleApi delete_log_logshuttle Delete a Log Shuttle log endpoint
Fastly::LoggingLogshuttleApi get_log_logshuttle Get a Log Shuttle log endpoint
Fastly::LoggingLogshuttleApi list_log_logshuttle List Log Shuttle log endpoints
Fastly::LoggingLogshuttleApi update_log_logshuttle Update a Log Shuttle log endpoint
Fastly::LoggingNewrelicApi create_log_newrelic Create a New Relic log endpoint
Fastly::LoggingNewrelicApi delete_log_newrelic Delete a New Relic log endpoint
Fastly::LoggingNewrelicApi get_log_newrelic Get a New Relic log endpoint
Fastly::LoggingNewrelicApi list_log_newrelic List New Relic log endpoints
Fastly::LoggingNewrelicApi update_log_newrelic Update a New Relic log endpoint
Fastly::LoggingNewrelicotlpApi create_log_newrelicotlp Create a New Relic OTLP endpoint
Fastly::LoggingNewrelicotlpApi delete_log_newrelicotlp Delete a New Relic OTLP endpoint
Fastly::LoggingNewrelicotlpApi get_log_newrelicotlp Get a New Relic OTLP endpoint
Fastly::LoggingNewrelicotlpApi list_log_newrelicotlp List New Relic OTLP endpoints
Fastly::LoggingNewrelicotlpApi update_log_newrelicotlp Update a New Relic log endpoint
Fastly::LoggingOpenstackApi create_log_openstack Create an OpenStack log endpoint
Fastly::LoggingOpenstackApi delete_log_openstack Delete an OpenStack log endpoint
Fastly::LoggingOpenstackApi get_log_openstack Get an OpenStack log endpoint
Fastly::LoggingOpenstackApi list_log_openstack List OpenStack log endpoints
Fastly::LoggingOpenstackApi update_log_openstack Update an OpenStack log endpoint
Fastly::LoggingPapertrailApi create_log_papertrail Create a Papertrail log endpoint
Fastly::LoggingPapertrailApi delete_log_papertrail Delete a Papertrail log endpoint
Fastly::LoggingPapertrailApi get_log_papertrail Get a Papertrail log endpoint
Fastly::LoggingPapertrailApi list_log_papertrail List Papertrail log endpoints
Fastly::LoggingPapertrailApi update_log_papertrail Update a Papertrail log endpoint
Fastly::LoggingPubsubApi create_log_gcp_pubsub Create a GCP Cloud Pub/Sub log endpoint
Fastly::LoggingPubsubApi delete_log_gcp_pubsub Delete a GCP Cloud Pub/Sub log endpoint
Fastly::LoggingPubsubApi get_log_gcp_pubsub Get a GCP Cloud Pub/Sub log endpoint
Fastly::LoggingPubsubApi list_log_gcp_pubsub List GCP Cloud Pub/Sub log endpoints
Fastly::LoggingPubsubApi update_log_gcp_pubsub Update a GCP Cloud Pub/Sub log endpoint
Fastly::LoggingS3Api create_log_aws_s3 Create an AWS S3 log endpoint
Fastly::LoggingS3Api delete_log_aws_s3 Delete an AWS S3 log endpoint
Fastly::LoggingS3Api get_log_aws_s3 Get an AWS S3 log endpoint
Fastly::LoggingS3Api list_log_aws_s3 List AWS S3 log endpoints
Fastly::LoggingS3Api update_log_aws_s3 Update an AWS S3 log endpoint
Fastly::LoggingScalyrApi create_log_scalyr Create a Scalyr log endpoint
Fastly::LoggingScalyrApi delete_log_scalyr Delete the Scalyr log endpoint
Fastly::LoggingScalyrApi get_log_scalyr Get a Scalyr log endpoint
Fastly::LoggingScalyrApi list_log_scalyr List Scalyr log endpoints
Fastly::LoggingScalyrApi update_log_scalyr Update the Scalyr log endpoint
Fastly::LoggingSftpApi create_log_sftp Create an SFTP log endpoint
Fastly::LoggingSftpApi delete_log_sftp Delete an SFTP log endpoint
Fastly::LoggingSftpApi get_log_sftp Get an SFTP log endpoint
Fastly::LoggingSftpApi list_log_sftp List SFTP log endpoints
Fastly::LoggingSftpApi update_log_sftp Update an SFTP log endpoint
Fastly::LoggingSplunkApi create_log_splunk Create a Splunk log endpoint
Fastly::LoggingSplunkApi delete_log_splunk Delete a Splunk log endpoint
Fastly::LoggingSplunkApi get_log_splunk Get a Splunk log endpoint
Fastly::LoggingSplunkApi list_log_splunk List Splunk log endpoints
Fastly::LoggingSplunkApi update_log_splunk Update a Splunk log endpoint
Fastly::LoggingSumologicApi create_log_sumologic Create a Sumologic log endpoint
Fastly::LoggingSumologicApi delete_log_sumologic Delete a Sumologic log endpoint
Fastly::LoggingSumologicApi get_log_sumologic Get a Sumologic log endpoint
Fastly::LoggingSumologicApi list_log_sumologic List Sumologic log endpoints
Fastly::LoggingSumologicApi update_log_sumologic Update a Sumologic log endpoint
Fastly::LoggingSyslogApi create_log_syslog Create a syslog log endpoint
Fastly::LoggingSyslogApi delete_log_syslog Delete a syslog log endpoint
Fastly::LoggingSyslogApi get_log_syslog Get a syslog log endpoint
Fastly::LoggingSyslogApi list_log_syslog List Syslog log endpoints
Fastly::LoggingSyslogApi update_log_syslog Update a syslog log endpoint
Fastly::MutualAuthenticationApi create_mutual_tls_authentication Create a Mutual Authentication
Fastly::MutualAuthenticationApi delete_mutual_tls Delete a Mutual TLS
Fastly::MutualAuthenticationApi get_mutual_authentication Get a Mutual Authentication
Fastly::MutualAuthenticationApi list_mutual_authentications List Mutual Authentications
Fastly::MutualAuthenticationApi patch_mutual_authentication Update a Mutual Authentication
Fastly::OriginInspectorHistoricalApi get_origin_inspector_historical Get historical origin data for a service
Fastly::OriginInspectorRealtimeApi get_origin_inspector_last120_seconds Get real-time origin data for the last 120 seconds
Fastly::OriginInspectorRealtimeApi get_origin_inspector_last_max_entries Get a limited number of real-time origin data entries
Fastly::OriginInspectorRealtimeApi get_origin_inspector_last_second Get real-time origin data from specific time.
Fastly::PackageApi get_package Get details of the service's Compute package.
Fastly::PackageApi put_package Upload a Compute package.
Fastly::PoolApi create_server_pool Create a server pool
Fastly::PoolApi delete_server_pool Delete a server pool
Fastly::PoolApi get_server_pool Get a server pool
Fastly::PoolApi list_server_pools List server pools
Fastly::PoolApi update_server_pool Update a server pool
Fastly::PopApi list_pops List Fastly POPs
Fastly::PublicIpListApi list_fastly_ips List Fastly's public IPs
Fastly::PublishApi publish Send messages to Fanout subscribers
Fastly::PurgeApi bulk_purge_tag Purge multiple surrogate key tags
Fastly::PurgeApi purge_all Purge everything from a service
Fastly::PurgeApi purge_single_url Purge a URL
Fastly::PurgeApi purge_tag Purge by surrogate key tag
Fastly::RateLimiterApi create_rate_limiter Create a rate limiter
Fastly::RateLimiterApi delete_rate_limiter Delete a rate limiter
Fastly::RateLimiterApi get_rate_limiter Get a rate limiter
Fastly::RateLimiterApi list_rate_limiters List rate limiters
Fastly::RateLimiterApi update_rate_limiter Update a rate limiter
Fastly::RealtimeApi get_stats_last120_seconds Get real-time data for the last 120 seconds
Fastly::RealtimeApi get_stats_last120_seconds_limit_entries Get a limited number of real-time data entries
Fastly::RealtimeApi get_stats_last_second Get real-time data from specified time
Fastly::RequestSettingsApi create_request_settings Create a Request Settings object
Fastly::RequestSettingsApi delete_request_settings Delete a Request Settings object
Fastly::RequestSettingsApi get_request_settings Get a Request Settings object
Fastly::RequestSettingsApi list_request_settings List Request Settings objects
Fastly::RequestSettingsApi update_request_settings Update a Request Settings object
Fastly::ResourceApi create_resource Create a resource link
Fastly::ResourceApi delete_resource Delete a resource link
Fastly::ResourceApi get_resource Display a resource link
Fastly::ResourceApi list_resources List resource links
Fastly::ResourceApi update_resource Update a resource link
Fastly::ResponseObjectApi create_response_object Create a Response object
Fastly::ResponseObjectApi delete_response_object Delete a Response Object
Fastly::ResponseObjectApi get_response_object Get a Response object
Fastly::ResponseObjectApi list_response_objects List Response objects
Fastly::ResponseObjectApi update_response_object Update a Response object
Fastly::SecretStoreApi client_key Create new client key
Fastly::SecretStoreApi create_secret_store Create new secret store
Fastly::SecretStoreApi delete_secret_store Delete secret store
Fastly::SecretStoreApi get_secret_store Get secret store by ID
Fastly::SecretStoreApi get_secret_stores Get all secret stores
Fastly::SecretStoreApi signing_key Get public key
Fastly::SecretStoreItemApi create_secret Create a new secret in a store.
Fastly::SecretStoreItemApi delete_secret Delete a secret from a store.
Fastly::SecretStoreItemApi get_secret Get secret metadata.
Fastly::SecretStoreItemApi get_secrets List secrets within a store.
Fastly::SecretStoreItemApi must_recreate_secret Recreate a secret in a store.
Fastly::SecretStoreItemApi recreate_secret Create or recreate a secret in a store.
Fastly::ServerApi create_pool_server Add a server to a pool
Fastly::ServerApi delete_pool_server Delete a server from a pool
Fastly::ServerApi get_pool_server Get a pool server
Fastly::ServerApi list_pool_servers List servers in a pool
Fastly::ServerApi update_pool_server Update a server
Fastly::ServiceApi create_service Create a service
Fastly::ServiceApi delete_service Delete a service
Fastly::ServiceApi get_service Get a service
Fastly::ServiceApi get_service_detail Get service details
Fastly::ServiceApi list_service_domains List the domains within a service
Fastly::ServiceApi list_services List services
Fastly::ServiceApi search_service Search for a service by name
Fastly::ServiceApi update_service Update a service
Fastly::ServiceAuthorizationsApi create_service_authorization Create service authorization
Fastly::ServiceAuthorizationsApi delete_service_authorization Delete service authorization
Fastly::ServiceAuthorizationsApi delete_service_authorization2 Delete service authorizations
Fastly::ServiceAuthorizationsApi list_service_authorization List service authorizations
Fastly::ServiceAuthorizationsApi show_service_authorization Show service authorization
Fastly::ServiceAuthorizationsApi update_service_authorization Update service authorization
Fastly::ServiceAuthorizationsApi update_service_authorization2 Update service authorizations
Fastly::SettingsApi get_service_settings Get service settings
Fastly::SettingsApi update_service_settings Update service settings
Fastly::SnippetApi create_snippet Create a snippet
Fastly::SnippetApi delete_snippet Delete a snippet
Fastly::SnippetApi get_snippet Get a versioned snippet
Fastly::SnippetApi get_snippet_dynamic Get a dynamic snippet
Fastly::SnippetApi list_snippets List snippets
Fastly::SnippetApi update_snippet Update a versioned snippet
Fastly::SnippetApi update_snippet_dynamic Update a dynamic snippet
Fastly::StarApi create_service_star Create a star
Fastly::StarApi delete_service_star Delete a star
Fastly::StarApi get_service_star Get a star
Fastly::StarApi list_service_stars List stars
Fastly::StatsApi get_service_stats Get stats for a service
Fastly::SudoApi request_sudo_access Request Sudo access
Fastly::TlsActivationsApi create_tls_activation Enable TLS for a domain using a custom certificate
Fastly::TlsActivationsApi delete_tls_activation Disable TLS on a domain
Fastly::TlsActivationsApi get_tls_activation Get a TLS activation
Fastly::TlsActivationsApi list_tls_activations List TLS activations
Fastly::TlsActivationsApi update_tls_activation Update a certificate
Fastly::TlsBulkCertificatesApi delete_bulk_tls_cert Delete a certificate
Fastly::TlsBulkCertificatesApi get_tls_bulk_cert Get a certificate
Fastly::TlsBulkCertificatesApi list_tls_bulk_certs List certificates
Fastly::TlsBulkCertificatesApi update_bulk_tls_cert Update a certificate
Fastly::TlsBulkCertificatesApi upload_tls_bulk_cert Upload a certificate
Fastly::TlsCertificatesApi create_tls_cert Create a TLS certificate
Fastly::TlsCertificatesApi delete_tls_cert Delete a TLS certificate
Fastly::TlsCertificatesApi get_tls_cert Get a TLS certificate
Fastly::TlsCertificatesApi list_tls_certs List TLS certificates
Fastly::TlsCertificatesApi update_tls_cert Update a TLS certificate
Fastly::TlsConfigurationsApi get_tls_config Get a TLS configuration
Fastly::TlsConfigurationsApi list_tls_configs List TLS configurations
Fastly::TlsConfigurationsApi update_tls_config Update a TLS configuration
Fastly::TlsCsrsApi create_csr Create CSR
Fastly::TlsDomainsApi list_tls_domains List TLS domains
Fastly::TlsPrivateKeysApi create_tls_key Create a TLS private key
Fastly::TlsPrivateKeysApi delete_tls_key Delete a TLS private key
Fastly::TlsPrivateKeysApi get_tls_key Get a TLS private key
Fastly::TlsPrivateKeysApi list_tls_keys List TLS private keys
Fastly::TlsSubscriptionsApi create_globalsign_email_challenge Creates a GlobalSign email challenge.
Fastly::TlsSubscriptionsApi create_tls_sub Create a TLS subscription
Fastly::TlsSubscriptionsApi delete_globalsign_email_challenge Delete a GlobalSign email challenge
Fastly::TlsSubscriptionsApi delete_tls_sub Delete a TLS subscription
Fastly::TlsSubscriptionsApi get_tls_sub Get a TLS subscription
Fastly::TlsSubscriptionsApi list_tls_subs List TLS subscriptions
Fastly::TlsSubscriptionsApi patch_tls_sub Update a TLS subscription
Fastly::TokensApi bulk_revoke_tokens Revoke multiple tokens
Fastly::TokensApi create_token Create a token
Fastly::TokensApi get_token Get a token
Fastly::TokensApi get_token_current Get the current token
Fastly::TokensApi list_tokens_customer List tokens for a customer
Fastly::TokensApi list_tokens_user List tokens for the authenticated user
Fastly::TokensApi revoke_token Revoke a token
Fastly::TokensApi revoke_token_current Revoke the current token
Fastly::UserApi create_user Create a user
Fastly::UserApi delete_user Delete a user
Fastly::UserApi get_current_user Get the current user
Fastly::UserApi get_user Get a user
Fastly::UserApi request_password_reset Request a password reset
Fastly::UserApi update_user Update a user
Fastly::UserApi update_user_password Update the user's password
Fastly::VclApi create_custom_vcl Create a custom VCL file
Fastly::VclApi delete_custom_vcl Delete a custom VCL file
Fastly::VclApi get_custom_vcl Get a custom VCL file
Fastly::VclApi get_custom_vcl_boilerplate Get boilerplate VCL
Fastly::VclApi get_custom_vcl_generated Get the generated VCL for a service
Fastly::VclApi get_custom_vcl_generated_highlighted Get the generated VCL with syntax highlighting
Fastly::VclApi get_custom_vcl_highlighted Get a custom VCL file with syntax highlighting
Fastly::VclApi get_custom_vcl_raw Download a custom VCL file
Fastly::VclApi lint_vcl_default Lint (validate) VCL using a default set of flags.
Fastly::VclApi lint_vcl_for_service Lint (validate) VCL using flags set for the service.
Fastly::VclApi list_custom_vcl List custom VCL files
Fastly::VclApi set_custom_vcl_main Set a custom VCL file as main
Fastly::VclApi update_custom_vcl Update a custom VCL file
Fastly::VclDiffApi vcl_diff_service_versions Get a comparison of the VCL changes between two service versions
Fastly::VersionApi activate_service_version Activate a service version
Fastly::VersionApi clone_service_version Clone a service version
Fastly::VersionApi create_service_version Create a service version
Fastly::VersionApi deactivate_service_version Deactivate a service version
Fastly::VersionApi get_service_version Get a version of a service
Fastly::VersionApi list_service_versions List versions of a service
Fastly::VersionApi lock_service_version Lock a service version
Fastly::VersionApi update_service_version Update a service version
Fastly::VersionApi validate_service_version Validate a service version
Fastly::WafActiveRulesApi bulk_delete_waf_active_rules Delete multiple active rules from a WAF
Fastly::WafActiveRulesApi bulk_update_waf_active_rules Update multiple active rules
Fastly::WafActiveRulesApi create_waf_active_rule Add a rule to a WAF as an active rule
Fastly::WafActiveRulesApi create_waf_active_rules_tag Create active rules by tag
Fastly::WafActiveRulesApi delete_waf_active_rule Delete an active rule
Fastly::WafActiveRulesApi get_waf_active_rule Get an active WAF rule object
Fastly::WafActiveRulesApi list_waf_active_rules List active rules on a WAF
Fastly::WafActiveRulesApi update_waf_active_rule Update an active rule
Fastly::WafExclusionsApi create_waf_rule_exclusion Create a WAF rule exclusion
Fastly::WafExclusionsApi delete_waf_rule_exclusion Delete a WAF rule exclusion
Fastly::WafExclusionsApi get_waf_rule_exclusion Get a WAF rule exclusion
Fastly::WafExclusionsApi list_waf_rule_exclusions List WAF rule exclusions
Fastly::WafExclusionsApi update_waf_rule_exclusion Update a WAF rule exclusion
Fastly::WafFirewallVersionsApi clone_waf_firewall_version Clone a firewall version
Fastly::WafFirewallVersionsApi create_waf_firewall_version Create a firewall version
Fastly::WafFirewallVersionsApi deploy_activate_waf_firewall_version Deploy or activate a firewall version
Fastly::WafFirewallVersionsApi get_waf_firewall_version Get a firewall version
Fastly::WafFirewallVersionsApi list_waf_firewall_versions List firewall versions
Fastly::WafFirewallVersionsApi update_waf_firewall_version Update a firewall version
Fastly::WafFirewallsApi create_waf_firewall Create a firewall
Fastly::WafFirewallsApi delete_waf_firewall Delete a firewall
Fastly::WafFirewallsApi get_waf_firewall Get a firewall
Fastly::WafFirewallsApi list_waf_firewalls List firewalls
Fastly::WafFirewallsApi update_waf_firewall Update a firewall
Fastly::WafRuleRevisionsApi get_waf_rule_revision Get a revision of a rule
Fastly::WafRuleRevisionsApi list_waf_rule_revisions List revisions for a rule
Fastly::WafRulesApi get_waf_rule Get a rule
Fastly::WafRulesApi list_waf_rules List available WAF rules
Fastly::WafTagsApi list_waf_tags List tags
Fastly::WholePlatformDdosHistoricalApi get_platform_ddos_historical Get historical DDoS metrics for the entire Fastly platform

Issues

The fastly-ruby API client currently does not support the following endpoints:

If you encounter any non-security-related bug or unexpected behavior, please file an issue using the bug report template.

Security issues

Please see our SECURITY.md for guidance on reporting security-related issues.

License

MIT.

fastly-ruby's People

Contributors

alexmuller avatar andriantoniades avatar annawinkler avatar aspires avatar athomason avatar blithe avatar conniechu929 avatar ctdk avatar demersus avatar drbrain avatar eddieroger avatar ezkl avatar gschorkopf avatar harmony7 avatar icco avatar ichiee avatar integralist avatar lanej avatar leklund avatar malachy-mcconnell avatar mastfissh avatar mmay avatar phlipper avatar rb-stripe avatar schisamo avatar sgerrand avatar simonwistow avatar thommahoney avatar tyler avatar werkshy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastly-ruby's Issues

Support for soft purging all

The current method purge_all does a hard purge. I need a method to support soft purging as well.

    def purge_all
      fetcher.client.post("#{Service.get_path(id)}/purge_all")
    end

Every invocation of fastly_upload_vcl from v0.95 dies with an error

Hey all - Fastly is looking great!

I installed the fastly gem on my machine. I'm running Lion with ruby 1.9.2-p290 on a MacBook Air.

Here's the install:

 ┌┤smerrill@tinier-shinier [Dec 20 21:47:01] ~
 └╼ gem install fastly
Fetching: rack-test-0.6.1.gem (100%)
Fetching: curb-fu-0.6.1.gem (100%)
Fetching: rdoc-3.12.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Fetching: fastly-0.95.gem (100%)
Successfully installed rack-test-0.6.1
Successfully installed curb-fu-0.6.1
Successfully installed rdoc-3.12
Successfully installed fastly-0.95
4 gems installed
Installing ri documentation for rack-test-0.6.1...
Installing ri documentation for curb-fu-0.6.1...
Installing ri documentation for rdoc-3.12...
Installing ri documentation for fastly-0.95...
Installing RDoc documentation for rack-test-0.6.1...
Installing RDoc documentation for curb-fu-0.6.1...
Installing RDoc documentation for rdoc-3.12...
Installing RDoc documentation for fastly-0.95...

I do have a ~/.fastly file with my api key in it.

On any invocation of fastly_upload_vcl (no matter the parameters,) I get the following error:

 ┌┤smerrill@tinier-shinier [Dec 20 22:00:49] ~/Documents/Development/fastly on master ?
 └╼ fastly_upload_vcl default.vcl 
/Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/fastly-0.95/lib/fastly.rb:433:in `get_options': wrong number of arguments (2 for 1) (ArgumentError)
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/fastly-0.95/bin/fastly_upload_vcl:40:in `<top (required)>'
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/bin/fastly_upload_vcl:19:in `load'
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/bin/fastly_upload_vcl:19:in `<main>'
 ┌┤smerrill@tinier-shinier:1 [Dec 20 22:00:55] ~/Documents/Development/fastly on master ?
 └╼ fastly_upload_vcl cwaHjaeh9EaK9RcZ9Hm9F ./default.vcl 
/Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/fastly-0.95/lib/fastly.rb:433:in `get_options': wrong number of arguments (2 for 1) (ArgumentError)
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/fastly-0.95/bin/fastly_upload_vcl:40:in `<top (required)>'
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/bin/fastly_upload_vcl:19:in `load'
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/bin/fastly_upload_vcl:19:in `<main>'
 ┌┤smerrill@tinier-shinier:1 [Dec 20 22:01:33] ~/Documents/Development/fastly on master ?
 └╼ fastly_upload_vcl
/Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/fastly-0.95/lib/fastly.rb:433:in `get_options': wrong number of arguments (2 for 1) (ArgumentError)
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/gems/fastly-0.95/bin/fastly_upload_vcl:40:in `<top (required)>'
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/bin/fastly_upload_vcl:19:in `load'
    from /Users/smerrill/.rvm/gems/ruby-1.9.2-p290/bin/fastly_upload_vcl:19:in `<main>'

Let me know how I can help test.

ACL Entry - NEGATED constant not defined

Version
5.1.1
What happened
Attempting to use this API results in a NameError

acl_entry_api.bulk_update_acl_entries({ service_id: 'service id', acl_id: 'acl-id', bulk_update_acl_entries_request: Fastly::BulkUpdateAclEntriesRequest.new(entries: [Fastly::BulkUpdateAclEntry.new(id: 'entry_id')]) })

NameError: uninitialized constant Fastly::BulkUpdateAclEntry::NEGATED

Workaround: define it in the calling application

  Fastly::NEGATED = Module.new unless Fastly.const_defined?(:NEGATED)
  unless Fastly::NEGATED.const_defined?(:N0)
    Fastly::NEGATED.const_set(:N0, false)
  end

Deprecation warning appears to be unavoidable

I'm getting this warning locally: https://github.com/fastly/fastly-ruby/blob/master/lib/fastly/client.rb#L28-L30

DEPRECATION WARNING: Username/password authentication is deprecated and will not be available starting September 2020; please migrate to API tokens as soon as possible.

It appears that that warning is produced on any instantiation of Fastly::Client, which is performed on any instantiation of Fastly - am I missing something? I don't see any way to use this gem without producing that warning. Building an instance as described in the docs results in that message, for example:

2.7.2 :001 > require 'fastly'
 => true
2.7.2 :002 > fastly = Fastly.new(api_key: "fake-key")
DEPRECATION WARNING: Username/password authentication is deprecated
      and will not be available starting September 2020;
      please migrate to API tokens as soon as possible.
 => #<Fastly:0x00007fb06ea30ea0 @client=#<Fastly::Client:0x00007fb06ea30e50 @api_key="fake-key", @base_url="https://api....
2.7.2 :003 >

We are actually instantiating like this in production: Fastly.new({ api_key: ENV.fetch("FASTLY_VIDEO_SERVICE_PURGING_TOKEN") - given that it didn't stop working late last year, can I assume that that is the appropriate way to use the gem, and that the deprecation warning is in error?

Can you bump the gem version?

It seems that version 1.1.4 has an older version of curb which is causing problems on Ruby 2.1. Can you bump the gem version? It looks like the latest gemspec has the new version of curb.

Fastly::FullAuthRequired exception generated when trying to create Fastly Client with API key.

The README file indicates there's an option to create a Fastly client with an API key, then right after makes a call to fastly.current_user, which in this case will raise an exception.

ReadMe.md

# use {api_key: 'your-key'} or {user: 'username', password: 'password'} as login options
fastly = Fastly.new(login_opts)

current_user     = fastly.current_user

fastly.rb

  # Return a User object representing the current logged in user.
  # NOTE: requires you to be fully authed - will not work with only an API key
  def current_user
    fail FullAuthRequired unless fully_authed?
    @current_user ||= get(User)
  end

To help users avoid this exception, can we clarify the README file or omit the calls to current_user/user right after we give them the option to log in/create Fastly client with API key?

Using the API key instead of username + password

Why do some methods require a username + password instead of the API key. I kind of hate having to use the user's password in the app because it is fairly easy for the user to change that and break things. Do you have a suggested way of handling this situation?

Requesting a specific configuration version of a service returns the wrong version.

In this example: we ask for version 1 and get version 2.

irb(main):001:0> require 'fastly'
=> true
irb(main):002:0> f = Fastly.new(:api_key => ENV['FASTLY_APIKEY'], :use_curb => false)
=> #<Fastly:0x007fd5539cbb68 @client=#<Fastly::Client:0x007fd5539cbac8 @api_key="xxxxxxxxxx", @http=#<Net::HTTP api.fastly.com:443 open=false>>>
irb(main):003:0> s = f.get_service('xxxxxxx')
REDACTED
irb(main):004:0> s.versions.count
=> 6
irb(main):005:0> s.version(1)
=> #<Fastly::Version:0x007fd553a2e088 @keys=["testing", "locked", "number", "active", "service_id", "staging", "comment", "deployed"], @testing=nil, @locked="1", @number="2", @active=nil, @service_id="xxxxxxx", @staging=nil, @comment="", @deployed=nil, @fetcher=#<Fastly:0x007fd5539cbb68 @client=#<Fastly::Client:0x007fd5539cbac8 @api_key="xxxxxxx", @http=#<Net::HTTP api.fastly.com:443 open=false>>>>

purging https url doesn't work

fix addressed in #99

when trying to purge https based URL, we are seeing a stack trace like below, this patches fixes the problem

EOFError: end of file reached
        from /usr/lib/ruby/2.2.0/net/protocol.rb:153:in `read_nonblock'
        from /usr/lib/ruby/2.2.0/net/protocol.rb:153:in `rbuf_fill'
        from /usr/lib/ruby/2.2.0/net/protocol.rb:134:in `readuntil'
        from /usr/lib/ruby/2.2.0/net/protocol.rb:144:in `readline'
        from /usr/lib/ruby/2.2.0/net/http/response.rb:39:in `read_status_line'
        from /usr/lib/ruby/2.2.0/net/http/response.rb:28:in `read_new'
        from /usr/lib/ruby/2.2.0/net/http.rb:1414:in `block in transport_request'
        from /usr/lib/ruby/2.2.0/net/http.rb:1411:in `catch'
        from /usr/lib/ruby/2.2.0/net/http.rb:1411:in `transport_request'
        from /usr/lib/ruby/2.2.0/net/http.rb:1384:in `request'
        from /usr/lib/ruby/2.2.0/net/http.rb:1377:in `block in request'
        from /usr/lib/ruby/2.2.0/net/http.rb:853:in `start'
        from /usr/lib/ruby/2.2.0/net/http.rb:1375:in `request'
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/fastly-1.6.1/lib/fastly/client.rb:105:in `purge'
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/fastly-1.6.1/lib/fastly.rb:83:in `purge'
        from (irb):25
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/console.rb:110:in `start'
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in `start'
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:68:in `console'
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from /app/primary/vendor/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Initializing Fastly.new with api_key option fails on version 1.2.2

Fastly.new({api_key: '''})
NameError: uninitialized constant Fastly::Client::OpenSSL
from /Users/thomas/.chefdk/gem/ruby/2.1.0/gems/fastly-1.2.2/lib/fastly/client.rb:21:in initialize' from /Users/thomas/.chefdk/gem/ruby/2.1.0/gems/fastly-1.2.2/lib/fastly/fetcher.rb:19:innew'
from /Users/thomas/.chefdk/gem/ruby/2.1.0/gems/fastly-1.2.2/lib/fastly/fetcher.rb:19:in client' from /Users/thomas/.chefdk/gem/ruby/2.1.0/gems/fastly-1.2.2/lib/fastly.rb:48:ininitialize'
from (irb):3:in new' from (irb):3 from /opt/chefdk/embedded/bin/irb:11:in

'

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.

How did I find you?

I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well

Purge by key returns status 200 but purge does not seem to fire

    begin
      fastly = Fastly.new(api_key: ENV['FASTLY_API_KEY'])
      service = Fastly::Service.new({id: ENV['FASTLY_SERVICE_ID']}, fastly)
      response = service.purge_by_key("/containers/#{@placement.id}")

      flash[:notice] = "Purge Success! - response: #{response["status"]}, id: #{response["id"]}"
    rescue Exception => e
      Rails.logger.error("A fastly error has occured! #{e}")
      e.backtrace.each { |line| Rails.logger.error line }
      flash[:notice] = "Container ID = #{@placement.id} - Purge failure! Purge manually"
    end

First is that the proper way to use purge_by_key? Or should it be full URL?
Second:
I tried using the normal dashboard purge and tried to purge a URL I knew was not a valid URL for our CDN but it still returns a status 200 with a purge id. So is there any checking for if the URL is valid or does this 200 status not mean what I think it means? Maybe it just means that I successfully sent the request regardless of what happens afterwards?

Add a pull request template

Adding a file in the path .github/PULL_REQUEST_TEMPLATE.md will allow us to have uniform pull requests. Some thoughts on what to put there:

  • What issue is this resolving?
  • Any particular things to focus on for review?
  • What kind of version bump (if any) does this require?

service name change fails on save!

Using fastly (1.02):

When executing the script below to change the name of a service, the script fails on save!

#!/usr/bin/env ruby
require 'bundler/setup'
require 'fastly'

fastly = Fastly.new(:api_key => ENV['GH_FASTLY_APIKEY'], :use_curb => false)
service = fastly.list_services.find { |s| s.name == 'testservice' }
service.name = "newtestservice"
service.save!

The output fails

$ ./scripts/rename.rb
/opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/fastly-1.02/lib/fastly/client.rb:90:in `post_and_put': Bad Request (Fastly::Error)
    from /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/fastly-1.02/lib/fastly/client.rb:77:in `put'
    from /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/fastly-1.02/lib/fastly/fetcher.rb:42:in `update'
    from /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/fastly-1.02/lib/fastly/base.rb:19:in `save!'

Release 1.2.1 Is a breaking change

After updating to 1.2.1 from 1.2.0, I get the following error when using the Fastly Gem to install Fastly code:

OpenSSL::SSL::SSLError:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

Cleanup admin-only functionality

From discussion in #38

I say kill the set_customer method since it can only be used by Fastly Admins and I'm of the opinion that we shouldn't muck up our "public" clients with special-for-fastly-use-only hacks.

TLS certificates not validated

The TLS connection to https://app.fastly.net does not validate the presented certificate introducing vulnerability to MITM attack.

To remediate we should be constructing a OpenSSL::X509::Store certificate store using the system default path, and setting the connection verify mode to OpenSSL::SSL::VERIFY_PEER.

Gem does not default site or port

I had to do this to get it to work

fastly = Fastly.new(api_key: 'xxx', base_url: 'https://api.fastly.com', base_port:443)

It had no site, and then it was trying to use port 80.

Also, doco says Net::Fastly. Needs amending.

I have raised a ticket on zendesk too.

Support Edge Dictionaries

It would be really useful for us if this gem supported the Edge Dictionary API methods. Do you have any plans to implement them in this gem? If we were able to would you review a pull request to add them?

regexp should be regex

create_header is not recognizing the 'regexp' attribute when creating a header

fastly.create_header(service_id: 123412341234, version: 42, name: 'MyHeader, type: 'request',
                                   action: 'regex',
                                   dst: 'url',
                                   src: 'req.url',
                                   regexp: '^/some(regexpthisvalueisnotset)?/',
                                   substitution: "/somenewvaluethisoneworks/",
                                   ignore_if_set: 0,
                                   priority: 10
)

This creates the header for service with id 123412341234, but the value for "match" is blank.

Dropping the "p" at the end of the regexp attribute works better:

regex: '^/some(regexpthisvalueisnotset)?/',

it doesn't make sense, because in the code it clearly states that it should be regexp. Here:
https://github.com/fastly/fastly-ruby/blob/master/lib/fastly/header.rb#L57
and attr_accessor definition here:
https://github.com/fastly/fastly-ruby/blob/master/lib/fastly/header.rb#L4

Suggested fix would be to switch attr_accessor to regex instead of regexp.

Fastly::Error gives no useable information

While exploring the fastly API, I was getting a Fastly::Error with a message of "Bad Request". Here's some sample output from my script:

⚡ ruby fastly-test.rb
/home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly/client.rb:90:in `post_and_put': Bad Request (Fastly::Error)
        from /home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly/client.rb:77:in `put'
        from /home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly/fetcher.rb:42:in `update'
        from /home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly.rb:175:in `block (2 levels) in <class:Fastly>'
        from failover.rb:15:in `<main>'

Being unfamiliar with the API, it was impossible to debug what I was doing wrong.

I added some debuging to the fastly gem, and then output of my script became:

⚡ ruby fastly-test.rb
{"msg":"An error occurred while connecting to the fastly API, please try your request again.","detail":"Version '4' for service 'XXXXXXX' is locked"}
/home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly/client.rb:90:in `post_and_put': Bad Request (Fastly::Error)
        from /home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly/client.rb:77:in `put'
        from /home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly/fetcher.rb:42:in `update'
        from /home/jh/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastly-1.1.3/lib/fastly.rb:175:in `block (2 levels) in <class:Fastly>'
        from failover.rb:15:in `<main>'

It would be super helpful if the error message in the body of the response was added to the Fastly::Error object to make it easier to see what's going on.

Allow proxy arguments for Fastly client

The Fastly client should accept proxy arguments that can then be passed down when constructing the Net::HTTP client. This is useful for customers that use a proxy for external network access.

When chaining methods to purge by surrogate key, get_service API call is executed every time

We needed to purge objects by a surrogate key, and had the code shown in the image below (red). We were instantiating Fastly.new object, then calling get_service(), and then chaining purge_by_key(key). This usage ends up calling an API to get service every time for each purge, and we ended up exceeding rate limits for the API.

The solution is shown in green, and should probably be documented somewhere. Perhaps another class Purge should take care of executing these calls efficiently, given that all keys and api_keys are known ahead of time.

Diff that got rid of an extra get_service API call to Fastly per purge

Does purge_by_key require more then API_KEY to work?

Following the implementation on the readme I provided the API_KEY and SERVICE_ID as ENV variables. When I try to purge by key I get error unauthorized. Do I need username/password as well and did I miss those instructions somewhere? Running a rails app and hosting data via S3.

As a follow up why would I need username/password if I have API KEY?

fastly = Fastly.new(api_key: 'YOUR_API_KEY')
service = Fastly::Service.new({ id: 'YOUR_SERVICE_ID' }, fastly)

service.purge_by_key("/key")

Where to use full auth vs. token auth?

Is there a convention for which methods require full auth vs. api key auth? e.g. full auth for write vs. token auth for read?

Just curious, I didn't see anything in the docs.

purge method doesn't take options hash

According to the API docs, when the purge method is used the Host header should be passed in.

In the gem however, the purge method does not take said options hash, only the path.

This means that the method is effectively broken, since there's no way to give it the Host to which the path applies.

purge url lead to Malformed purge request

Version
4.2.0

What happened
when using the same example as the one in the api documentation and activating the debug

Fastly.configure { |c| c.debugging = true }
api_instance = Fastly::PurgeApi.new
options = {
  cached_url: 'www.example.com/path/to/object-to-purge',
}
begin
  result = api_instance.purge_single_url(options)
  p result
rescue Fastly::ApiError => e
  puts "Exception when calling PurgeApi->purge_single_url: #{e}"
end

I have the following logs:

Too old connection (317 seconds idle), disconnect it
Connection 3 seems to be dead
Closing connection 3
  Trying 199.232.26.35:443...
Connected to api.fastly.com (199.232.26.35) port 443 (#4)
ALPN: offers h2,http/1.1
SSL re-using session ID
TLSv1.3 (OUT), TLS handshake, Client hello (1):
jTLSv1.3 (IN), TLS handshake, Server hello (2):

TLSv1.2 (IN), TLS handshake, Certificate (11):
,TLSv1.2 (IN), TLS handshake, Server key exchange (12):
TLSv1.2 (IN), TLS handshake, Server finished (14):
%TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
(TLSv1.2 (OUT), TLS handshake, Finished (20):
(TLSv1.2 (IN), TLS handshake, Finished (20):
old SSL session ID is stale, removing
SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
ALPN: server accepted h2
Server certificate:
 subject: CN=api.fastly.com
 start date: Nov 20 19:45:23 2022 GMT
 expire date: Dec 22 19:45:22 2023 GMT
 subjectAltName: host "api.fastly.com" matched cert's "api.fastly.com"
 issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Atlas R3 DV TLS CA 2022 Q4
 SSL certificate verify ok.
Xusing HTTP/2
h2h3 [:method: POST]
h2h3 [:path: /purge/www.example.com%2Fpath%2Fto%2Fobject-to-purge]
h2h3 [:scheme: https]
h2h3 [:authority: api.fastly.com]
h2h3 [user-agent: fastly-ruby/4.2.0]
h2h3 [content-type: application/json]
h2h3 [accept: application/json]
h2h3 [fastly-key: FASTLY_API_TOKEN]
h2h3 [content-length: 0]
Using Stream ID: 1 (easy handle 0x7ff33f896000)
POST /purge/www.example.com%2Fpath%2Fto%2Fobject-to-purge HTTP/2
Host: api.fastly.com
user-agent: fastly-ruby/4.2.0
content-type: application/json
accept: application/json
fastly-key: FASTLY_API_TOKEN
content-length: 0

=!HTTP/2 400 
server: Varnish
retry-after: 0
content-type: application/json
accept-ranges: bytes
date: Mon, 03 Apr 2023 10:36:26 GMT
via: 1.1 varnish
content-length: 34

Connection #4 to host api.fastly.com left intact
Exception when calling PurgeApi->purge_single_url: Error message: the server returns an error
HTTP status code: 400
Response headers: {"server"=>"Varnish", "retry-after"=>"0", "content-type"=>"application/json", "accept-ranges"=>"bytes", "date"=>"Mon, 03 Apr 2023 10:36:26 GMT", "via"=>"1.1 varnish", "content-length"=>"34"}
Response body: {"msg":"Malformed purge request"}

I can reproduce it with curl and it seems that the issue is because the url to purge is encoded

curl -i  -X POST "https://api.fastly.com/purge/www.example.com%2Fpath%2Fto%2Fobject-to-purge" -H "Fastly-Key: FASTLY_API_TOKEN" -H "fastly-soft-purge: 1" -H "Accept: application/json" 
HTTP/2 400 
server: Varnish
retry-after: 0
content-type: application/json
accept-ranges: bytes
date: Mon, 03 Apr 2023 10:32:59 GMT
via: 1.1 varnish
content-length: 34

{"msg":"Malformed purge request"}


curl -i  -X POST "https://api.fastly.com/purge/www.example.com/path/to/object-to-purge" -H "Fastly-Key: FASTLY_API_TOKEN" -H "fastly-soft-purge: 1" -H "Accept: application/json"                                    
HTTP/2 200 
content-type: application/json
fastly-instant-rate: 0
accept-ranges: bytes
date: Mon, 03 Apr 2023 10:33:19 GMT
x-varnish: 3296612971
via: 1.1 varnish
x-served-by: cache-bru1480049-BRU
content-length: 52

{ "status": "ok", "id": "1480049-1680231553-34616" }

Fastly#update_backend fails when the backend name has a space

I created a backend via the web UI that contained a space in the name.

I then tried to use the rubygem to update the backend address, however the update request was failing. Once I used the web UI to remove the space from the backend name, the update request from ruby worked as expected.

Ruby 2.5.0, fastly-1.15.0: Purge Errors

In upgrading our Rails App, I also updated the fastly-rails gem from 0.2 to 0.8.0. But in doing so, I am now seeing a whole string of new failures related to the fastly-rails gem. Roughly ~800 failures in a 24 hour period from a single worker. We also updated Ruby from 2.3.1 to 2.5.0. Perhaps, related?

Environment:

  • Rails 5.1.5
  • Ruby 2.5.0
  • fastly-rails 0.8.0
  • fastly-ruby 1.15.0

Here is the assortment of errors we are seeing with relevant stacktraces.

Anyone else seeing anything like this? Any suggestions?

I posted this issue to fastly-rails, but looking at the stacktrace, it looks like it may actually be a fastly-ruby issue.

  • JSON::ParserError: Empty input at line 1, column 1 [parse.c:926] in 'HTTP/1.1 200 OK Content-Type: application/json C
1 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 124 in parse
2 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 124 in post_and_put
3 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 87 in post
4 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/service.rb" line 74 in purge_by_key
5 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails/client.rb" line 12 in purge_by_key
6 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails.rb" line 26 in purge_by_key
7 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails/active_record/surrogate_key.rb" line 37 in purge
  • Net::HTTPBadResponse: wrong status line: "ntent-Length: 50”
1 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 42 in read_status_line
2 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 29 in read_new
3 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1494 in block in transport_request
4 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1491 in catch
5 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1491 in transport_request
6 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1464 in request
16 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1478 in send_entity
17 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1266 in post
18 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 122 in post_and_put
19 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 87 in post
20 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/service.rb" line 74 in purge_by_key
21 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails/client.rb" line 12 in purge_by_key
22 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails.rb" line 26 in purge_by_key
23 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails/active_record/surrogate_key.rb" line 37 in purge
  • Errno::EBADF: Bad file descriptor
1 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 181 in wait_readable
2 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 181 in rbuf_fill
3 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 125 in read
4 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 293 in block in read_body_0
5 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 278 in inflater
6 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 283 in read_body_0
7 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 204 in read_body
8 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1479 in block in send_entity
9 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1503 in block in transport_request
10 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 165 in reading_body
11 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1502 in transport_request
12 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1464 in request
  • IOError: closed stream
1 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 181 in wait_readable
2 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 181 in rbuf_fill
3 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 157 in readuntil
4 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/protocol.rb" line 167 in readline
5 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 40 in read_status_line
6 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http/response.rb" line 29 in read_new
7 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1494 in block in transport_request
8 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1491 in catch
9 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1491 in transport_request
10 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1464 in request
20 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1478 in send_entity
21 File "/app/vendor/ruby-2.5.0/lib/ruby/2.5.0/net/http.rb" line 1266 in post
22 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 122 in post_and_put
23 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/client.rb" line 87 in post
24 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-1.15.0/lib/fastly/service.rb" line 74 in purge_by_key
25 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails/client.rb" line 12 in purge_by_key
26 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails.rb" line 26 in purge_by_key
27 File "/app/vendor/bundle/ruby/2.5.0/gems/fastly-rails-0.8.0/lib/fastly-rails/active_record/surrogate_key.rb" line 37 in purge

Settings general.default_host and general.default_ttl settings broken

I'm getting an error when trying to set the settings for an existing service:

settings = fastly.update_settings( service_id: service.id, version: latest_version.number, settings: {"general.default_host"=>"www.example.com", "general.default_ttl" => 500})
NoMethodError: undefined method `service_id' for #<Hash:0x0000000dfaecb0>
from /home/vagrant/.rvm/gems/ruby-2.0.0-p353/gems/fastly-1.1.5/lib/fastly/settings.rb:31:in `put_path'

I may be using the update_settings call wrong, but from the code it looks like those variables should be available.

Add Contributing.md

The readme has guidelines for contributing. Let's move that out into a Contributing.md.

Let's add to this document:

  • Each PR is reviewed by one other Fastly person.
  • If the PR is approved, it is merged, and the version is bumped according to semantic versioning (add a link please).
  • We tag the repository (I use the github release functionality) with that version.
  • We release the new gem (if appropriate). The gem release process is:
Run on your local laptop:
$ gem build *.gemspec
$ gem push *.gem

Fix unit test warnings

There are two warnings when running rake test:unit. Please fix the warnings (there should be 0 warnings).

purging endpoints that are also h2 pushed

Has anyone else had inconsistent results when purging when using this gem. The server response is 'OK' as though the request had succeeded, but the url is not purged. This is hard to reproduce because the gem sometimes works for this url, but purging using a curl -XPURGE from the commandline always work. The url has the following headers for what it's worth

         response.headers["Cache-Control"] = "max-age=600, public"
         response.headers["Surrogate-Control"] = "max-age=315360000, stale-if-error=86400"

for what it's worth.

Purging our other assets via this gem is never an issue, only this one. The only difference between this and our other assets is that we H2 push this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.