fastly 17.0.0 → 17.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -1
- data/docs/DomainInspectorMeasurements.md +7 -0
- data/docs/ErrorResponse.md +13 -0
- data/docs/ErrorResponseErrors.md +12 -0
- data/docs/LogError.md +15 -0
- data/docs/LogErrorBatch.md +11 -0
- data/docs/LoggingDatadogAdditional.md +1 -1
- data/docs/LoggingDatadogApi.md +2 -2
- data/docs/LoggingDatadogResponse.md +1 -1
- data/docs/LoggingEndpointErrorsApi.md +61 -0
- data/docs/RealtimeEntryAggregated.md +17 -0
- data/docs/RealtimeEntryDatacenter.md +17 -0
- data/docs/RealtimeMeasurements.md +17 -0
- data/docs/Results.md +17 -0
- data/docs/Values.md +7 -0
- data/lib/fastly/api/logging_datadog_api.rb +4 -4
- data/lib/fastly/api/logging_endpoint_errors_api.rb +92 -0
- data/lib/fastly/configuration.rb +6 -0
- data/lib/fastly/models/domain_inspector_measurements.rb +74 -4
- data/lib/fastly/models/error_response.rb +248 -0
- data/lib/fastly/models/error_response_errors.rb +234 -0
- data/lib/fastly/models/log_error.rb +267 -0
- data/lib/fastly/models/log_error_batch.rb +228 -0
- data/lib/fastly/models/logging_datadog_additional.rb +1 -1
- data/lib/fastly/models/logging_datadog_response.rb +1 -1
- data/lib/fastly/models/realtime_entry_aggregated.rb +174 -4
- data/lib/fastly/models/realtime_entry_datacenter.rb +174 -4
- data/lib/fastly/models/realtime_measurements.rb +174 -4
- data/lib/fastly/models/results.rb +171 -1
- data/lib/fastly/models/values.rb +74 -4
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +5 -0
- data/sig.json +1 -1
- metadata +12 -2
|
@@ -24,7 +24,7 @@ module Fastly
|
|
|
24
24
|
# @option opts [String] :name The name for the real-time logging configuration.
|
|
25
25
|
# @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
|
|
26
26
|
# @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
|
|
27
|
-
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\"
|
|
27
|
+
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\": %{time.elapsed.msec}V,\"method\":\"%m\",\"url\":\"%{json.escape(req.url)}V\",\"useragent\":\"%{User-Agent}i\",\"referer\":\"%{Referer}i\",\"protocol\":\"%H\",\"request_x_forwarded_for\":\"%{X-Forwarded-For}i\",\"status_code\":\"%s\"},\"network\":{\"client\":{\"ip\":\"%h\",\"name\":\"%{client.as.name}V\",\"number\":\"%{client.as.number}V\",\"connection_speed\":\"%{client.geo.conn_speed}V\"},\"destination\":{\"ip\":\"%A\"},\"geoip\":{\"geo_city\":\"%{client.geo.city.utf8}V\",\"geo_country_code\":\"%{client.geo.country_code}V\",\"geo_continent_code\":\"%{client.geo.continent_code}V\",\"geo_region\":\"%{client.geo.region}V\"},\"bytes_written\":\"%B\",\"bytes_read\":\"%{req.body_bytes_read}V\"},\"host\":\"%{Fastly-Orig-Host}i\",\"origin_host\":\"%v\",\"is_ipv6\":\"%{if(req.is_ipv6, \\\"true\\\", \\\"false\\\")}V\",\"is_tls\":\"%{if(req.is_ssl, \\\"true\\\", \\\"false\\\")}V\",\"tls_client_protocol\":\"%{json.escape(tls.client.protocol)}V\",\"tls_client_servername\":\"%{json.escape(tls.client.servername)}V\",\"tls_client_cipher\":\"%{json.escape(tls.client.cipher)}V\",\"tls_client_cipher_sha\":\"%{json.escape(tls.client.ciphers_sha)}V\",\"tls_client_tlsexts_sha\":\"%{json.escape(tls.client.tlsexts_sha)}V\",\"is_h2\":\"%{if(fastly_info.is_h2, \\\"true\\\", \\\"false\\\")}V\",\"is_h2_push\":\"%{if(fastly_info.h2.is_push, \\\"true\\\", \\\"false\\\")}V\",\"h2_stream_id\":\"%{fastly_info.h2.stream_id}V\",\"request_accept_content\":\"%{Accept}i\",\"request_accept_language\":\"%{Accept-Language}i\",\"request_accept_encoding\":\"%{Accept-Encoding}i\",\"request_accept_charset\":\"%{Accept-Charset}i\",\"request_connection\":\"%{Connection}i\",\"request_dnt\":\"%{DNT}i\",\"request_forwarded\":\"%{Forwarded}i\",\"request_via\":\"%{Via}i\",\"request_cache_control\":\"%{Cache-Control}i\",\"request_x_requested_with\":\"%{X-Requested-With}i\",\"request_x_att_device_id\":\"%{X-ATT-Device-Id}i\",\"content_type\":\"%{Content-Type}o\",\"is_cacheable\":\"%{if(fastly_info.state~\\\"^(HIT|MISS)$\\\", \\\"true\\\", \\\"false\\\")}V\",\"response_age\":\"%{Age}o\",\"response_cache_control\":\"%{Cache-Control}o\",\"response_expires\":\"%{Expires}o\",\"response_last_modified\":\"%{Last-Modified}o\",\"response_tsv\":\"%{TSV}o\",\"server_datacenter\":\"%{server.datacenter}V\",\"req_header_size\":\"%{req.header_bytes_read}V\",\"resp_header_size\":\"%{resp.header_bytes_written}V\",\"socket_cwnd\":\"%{client.socket.cwnd}V\",\"socket_nexthop\":\"%{client.socket.nexthop}V\",\"socket_tcpi_rcv_mss\":\"%{client.socket.tcpi_rcv_mss}V\",\"socket_tcpi_snd_mss\":\"%{client.socket.tcpi_snd_mss}V\",\"socket_tcpi_rtt\":\"%{client.socket.tcpi_rtt}V\",\"socket_tcpi_rttvar\":\"%{client.socket.tcpi_rttvar}V\",\"socket_tcpi_rcv_rtt\":\"%{client.socket.tcpi_rcv_rtt}V\",\"socket_tcpi_rcv_space\":\"%{client.socket.tcpi_rcv_space}V\",\"socket_tcpi_last_data_sent\":\"%{client.socket.tcpi_last_data_sent}V\",\"socket_tcpi_total_retrans\":\"%{client.socket.tcpi_total_retrans}V\",\"socket_tcpi_delta_retrans\":\"%{client.socket.tcpi_delta_retrans}V\",\"socket_ploss\":\"%{client.socket.ploss}V\"}')
|
|
28
28
|
# @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
|
|
29
29
|
# @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
|
|
30
30
|
# @option opts [String] :region The region that log data will be sent to. (default to 'US')
|
|
@@ -42,7 +42,7 @@ module Fastly
|
|
|
42
42
|
# @option opts [String] :name The name for the real-time logging configuration.
|
|
43
43
|
# @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
|
|
44
44
|
# @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
|
|
45
|
-
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\"
|
|
45
|
+
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\": %{time.elapsed.msec}V,\"method\":\"%m\",\"url\":\"%{json.escape(req.url)}V\",\"useragent\":\"%{User-Agent}i\",\"referer\":\"%{Referer}i\",\"protocol\":\"%H\",\"request_x_forwarded_for\":\"%{X-Forwarded-For}i\",\"status_code\":\"%s\"},\"network\":{\"client\":{\"ip\":\"%h\",\"name\":\"%{client.as.name}V\",\"number\":\"%{client.as.number}V\",\"connection_speed\":\"%{client.geo.conn_speed}V\"},\"destination\":{\"ip\":\"%A\"},\"geoip\":{\"geo_city\":\"%{client.geo.city.utf8}V\",\"geo_country_code\":\"%{client.geo.country_code}V\",\"geo_continent_code\":\"%{client.geo.continent_code}V\",\"geo_region\":\"%{client.geo.region}V\"},\"bytes_written\":\"%B\",\"bytes_read\":\"%{req.body_bytes_read}V\"},\"host\":\"%{Fastly-Orig-Host}i\",\"origin_host\":\"%v\",\"is_ipv6\":\"%{if(req.is_ipv6, \\\"true\\\", \\\"false\\\")}V\",\"is_tls\":\"%{if(req.is_ssl, \\\"true\\\", \\\"false\\\")}V\",\"tls_client_protocol\":\"%{json.escape(tls.client.protocol)}V\",\"tls_client_servername\":\"%{json.escape(tls.client.servername)}V\",\"tls_client_cipher\":\"%{json.escape(tls.client.cipher)}V\",\"tls_client_cipher_sha\":\"%{json.escape(tls.client.ciphers_sha)}V\",\"tls_client_tlsexts_sha\":\"%{json.escape(tls.client.tlsexts_sha)}V\",\"is_h2\":\"%{if(fastly_info.is_h2, \\\"true\\\", \\\"false\\\")}V\",\"is_h2_push\":\"%{if(fastly_info.h2.is_push, \\\"true\\\", \\\"false\\\")}V\",\"h2_stream_id\":\"%{fastly_info.h2.stream_id}V\",\"request_accept_content\":\"%{Accept}i\",\"request_accept_language\":\"%{Accept-Language}i\",\"request_accept_encoding\":\"%{Accept-Encoding}i\",\"request_accept_charset\":\"%{Accept-Charset}i\",\"request_connection\":\"%{Connection}i\",\"request_dnt\":\"%{DNT}i\",\"request_forwarded\":\"%{Forwarded}i\",\"request_via\":\"%{Via}i\",\"request_cache_control\":\"%{Cache-Control}i\",\"request_x_requested_with\":\"%{X-Requested-With}i\",\"request_x_att_device_id\":\"%{X-ATT-Device-Id}i\",\"content_type\":\"%{Content-Type}o\",\"is_cacheable\":\"%{if(fastly_info.state~\\\"^(HIT|MISS)$\\\", \\\"true\\\", \\\"false\\\")}V\",\"response_age\":\"%{Age}o\",\"response_cache_control\":\"%{Cache-Control}o\",\"response_expires\":\"%{Expires}o\",\"response_last_modified\":\"%{Last-Modified}o\",\"response_tsv\":\"%{TSV}o\",\"server_datacenter\":\"%{server.datacenter}V\",\"req_header_size\":\"%{req.header_bytes_read}V\",\"resp_header_size\":\"%{resp.header_bytes_written}V\",\"socket_cwnd\":\"%{client.socket.cwnd}V\",\"socket_nexthop\":\"%{client.socket.nexthop}V\",\"socket_tcpi_rcv_mss\":\"%{client.socket.tcpi_rcv_mss}V\",\"socket_tcpi_snd_mss\":\"%{client.socket.tcpi_snd_mss}V\",\"socket_tcpi_rtt\":\"%{client.socket.tcpi_rtt}V\",\"socket_tcpi_rttvar\":\"%{client.socket.tcpi_rttvar}V\",\"socket_tcpi_rcv_rtt\":\"%{client.socket.tcpi_rcv_rtt}V\",\"socket_tcpi_rcv_space\":\"%{client.socket.tcpi_rcv_space}V\",\"socket_tcpi_last_data_sent\":\"%{client.socket.tcpi_last_data_sent}V\",\"socket_tcpi_total_retrans\":\"%{client.socket.tcpi_total_retrans}V\",\"socket_tcpi_delta_retrans\":\"%{client.socket.tcpi_delta_retrans}V\",\"socket_ploss\":\"%{client.socket.ploss}V\"}')
|
|
46
46
|
# @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
|
|
47
47
|
# @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
|
|
48
48
|
# @option opts [String] :region The region that log data will be sent to. (default to 'US')
|
|
@@ -364,7 +364,7 @@ module Fastly
|
|
|
364
364
|
# @option opts [String] :name The name for the real-time logging configuration.
|
|
365
365
|
# @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
|
|
366
366
|
# @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
|
|
367
|
-
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\"
|
|
367
|
+
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\": %{time.elapsed.msec}V,\"method\":\"%m\",\"url\":\"%{json.escape(req.url)}V\",\"useragent\":\"%{User-Agent}i\",\"referer\":\"%{Referer}i\",\"protocol\":\"%H\",\"request_x_forwarded_for\":\"%{X-Forwarded-For}i\",\"status_code\":\"%s\"},\"network\":{\"client\":{\"ip\":\"%h\",\"name\":\"%{client.as.name}V\",\"number\":\"%{client.as.number}V\",\"connection_speed\":\"%{client.geo.conn_speed}V\"},\"destination\":{\"ip\":\"%A\"},\"geoip\":{\"geo_city\":\"%{client.geo.city.utf8}V\",\"geo_country_code\":\"%{client.geo.country_code}V\",\"geo_continent_code\":\"%{client.geo.continent_code}V\",\"geo_region\":\"%{client.geo.region}V\"},\"bytes_written\":\"%B\",\"bytes_read\":\"%{req.body_bytes_read}V\"},\"host\":\"%{Fastly-Orig-Host}i\",\"origin_host\":\"%v\",\"is_ipv6\":\"%{if(req.is_ipv6, \\\"true\\\", \\\"false\\\")}V\",\"is_tls\":\"%{if(req.is_ssl, \\\"true\\\", \\\"false\\\")}V\",\"tls_client_protocol\":\"%{json.escape(tls.client.protocol)}V\",\"tls_client_servername\":\"%{json.escape(tls.client.servername)}V\",\"tls_client_cipher\":\"%{json.escape(tls.client.cipher)}V\",\"tls_client_cipher_sha\":\"%{json.escape(tls.client.ciphers_sha)}V\",\"tls_client_tlsexts_sha\":\"%{json.escape(tls.client.tlsexts_sha)}V\",\"is_h2\":\"%{if(fastly_info.is_h2, \\\"true\\\", \\\"false\\\")}V\",\"is_h2_push\":\"%{if(fastly_info.h2.is_push, \\\"true\\\", \\\"false\\\")}V\",\"h2_stream_id\":\"%{fastly_info.h2.stream_id}V\",\"request_accept_content\":\"%{Accept}i\",\"request_accept_language\":\"%{Accept-Language}i\",\"request_accept_encoding\":\"%{Accept-Encoding}i\",\"request_accept_charset\":\"%{Accept-Charset}i\",\"request_connection\":\"%{Connection}i\",\"request_dnt\":\"%{DNT}i\",\"request_forwarded\":\"%{Forwarded}i\",\"request_via\":\"%{Via}i\",\"request_cache_control\":\"%{Cache-Control}i\",\"request_x_requested_with\":\"%{X-Requested-With}i\",\"request_x_att_device_id\":\"%{X-ATT-Device-Id}i\",\"content_type\":\"%{Content-Type}o\",\"is_cacheable\":\"%{if(fastly_info.state~\\\"^(HIT|MISS)$\\\", \\\"true\\\", \\\"false\\\")}V\",\"response_age\":\"%{Age}o\",\"response_cache_control\":\"%{Cache-Control}o\",\"response_expires\":\"%{Expires}o\",\"response_last_modified\":\"%{Last-Modified}o\",\"response_tsv\":\"%{TSV}o\",\"server_datacenter\":\"%{server.datacenter}V\",\"req_header_size\":\"%{req.header_bytes_read}V\",\"resp_header_size\":\"%{resp.header_bytes_written}V\",\"socket_cwnd\":\"%{client.socket.cwnd}V\",\"socket_nexthop\":\"%{client.socket.nexthop}V\",\"socket_tcpi_rcv_mss\":\"%{client.socket.tcpi_rcv_mss}V\",\"socket_tcpi_snd_mss\":\"%{client.socket.tcpi_snd_mss}V\",\"socket_tcpi_rtt\":\"%{client.socket.tcpi_rtt}V\",\"socket_tcpi_rttvar\":\"%{client.socket.tcpi_rttvar}V\",\"socket_tcpi_rcv_rtt\":\"%{client.socket.tcpi_rcv_rtt}V\",\"socket_tcpi_rcv_space\":\"%{client.socket.tcpi_rcv_space}V\",\"socket_tcpi_last_data_sent\":\"%{client.socket.tcpi_last_data_sent}V\",\"socket_tcpi_total_retrans\":\"%{client.socket.tcpi_total_retrans}V\",\"socket_tcpi_delta_retrans\":\"%{client.socket.tcpi_delta_retrans}V\",\"socket_ploss\":\"%{client.socket.ploss}V\"}')
|
|
368
368
|
# @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
|
|
369
369
|
# @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
|
|
370
370
|
# @option opts [String] :region The region that log data will be sent to. (default to 'US')
|
|
@@ -383,7 +383,7 @@ module Fastly
|
|
|
383
383
|
# @option opts [String] :name The name for the real-time logging configuration.
|
|
384
384
|
# @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
|
|
385
385
|
# @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
|
|
386
|
-
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\"
|
|
386
|
+
# @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). Must produce valid JSON that Datadog can ingest. (default to '{\"ddsource\":\"fastly\",\"service\":\"%{req.service_id}V\",\"date\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_start\":\"%{begin:%Y-%m-%dT%H:%M:%S%Z}t\",\"time_end\":\"%{end:%Y-%m-%dT%H:%M:%S%Z}t\",\"http\":{\"request_time_ms\": %{time.elapsed.msec}V,\"method\":\"%m\",\"url\":\"%{json.escape(req.url)}V\",\"useragent\":\"%{User-Agent}i\",\"referer\":\"%{Referer}i\",\"protocol\":\"%H\",\"request_x_forwarded_for\":\"%{X-Forwarded-For}i\",\"status_code\":\"%s\"},\"network\":{\"client\":{\"ip\":\"%h\",\"name\":\"%{client.as.name}V\",\"number\":\"%{client.as.number}V\",\"connection_speed\":\"%{client.geo.conn_speed}V\"},\"destination\":{\"ip\":\"%A\"},\"geoip\":{\"geo_city\":\"%{client.geo.city.utf8}V\",\"geo_country_code\":\"%{client.geo.country_code}V\",\"geo_continent_code\":\"%{client.geo.continent_code}V\",\"geo_region\":\"%{client.geo.region}V\"},\"bytes_written\":\"%B\",\"bytes_read\":\"%{req.body_bytes_read}V\"},\"host\":\"%{Fastly-Orig-Host}i\",\"origin_host\":\"%v\",\"is_ipv6\":\"%{if(req.is_ipv6, \\\"true\\\", \\\"false\\\")}V\",\"is_tls\":\"%{if(req.is_ssl, \\\"true\\\", \\\"false\\\")}V\",\"tls_client_protocol\":\"%{json.escape(tls.client.protocol)}V\",\"tls_client_servername\":\"%{json.escape(tls.client.servername)}V\",\"tls_client_cipher\":\"%{json.escape(tls.client.cipher)}V\",\"tls_client_cipher_sha\":\"%{json.escape(tls.client.ciphers_sha)}V\",\"tls_client_tlsexts_sha\":\"%{json.escape(tls.client.tlsexts_sha)}V\",\"is_h2\":\"%{if(fastly_info.is_h2, \\\"true\\\", \\\"false\\\")}V\",\"is_h2_push\":\"%{if(fastly_info.h2.is_push, \\\"true\\\", \\\"false\\\")}V\",\"h2_stream_id\":\"%{fastly_info.h2.stream_id}V\",\"request_accept_content\":\"%{Accept}i\",\"request_accept_language\":\"%{Accept-Language}i\",\"request_accept_encoding\":\"%{Accept-Encoding}i\",\"request_accept_charset\":\"%{Accept-Charset}i\",\"request_connection\":\"%{Connection}i\",\"request_dnt\":\"%{DNT}i\",\"request_forwarded\":\"%{Forwarded}i\",\"request_via\":\"%{Via}i\",\"request_cache_control\":\"%{Cache-Control}i\",\"request_x_requested_with\":\"%{X-Requested-With}i\",\"request_x_att_device_id\":\"%{X-ATT-Device-Id}i\",\"content_type\":\"%{Content-Type}o\",\"is_cacheable\":\"%{if(fastly_info.state~\\\"^(HIT|MISS)$\\\", \\\"true\\\", \\\"false\\\")}V\",\"response_age\":\"%{Age}o\",\"response_cache_control\":\"%{Cache-Control}o\",\"response_expires\":\"%{Expires}o\",\"response_last_modified\":\"%{Last-Modified}o\",\"response_tsv\":\"%{TSV}o\",\"server_datacenter\":\"%{server.datacenter}V\",\"req_header_size\":\"%{req.header_bytes_read}V\",\"resp_header_size\":\"%{resp.header_bytes_written}V\",\"socket_cwnd\":\"%{client.socket.cwnd}V\",\"socket_nexthop\":\"%{client.socket.nexthop}V\",\"socket_tcpi_rcv_mss\":\"%{client.socket.tcpi_rcv_mss}V\",\"socket_tcpi_snd_mss\":\"%{client.socket.tcpi_snd_mss}V\",\"socket_tcpi_rtt\":\"%{client.socket.tcpi_rtt}V\",\"socket_tcpi_rttvar\":\"%{client.socket.tcpi_rttvar}V\",\"socket_tcpi_rcv_rtt\":\"%{client.socket.tcpi_rcv_rtt}V\",\"socket_tcpi_rcv_space\":\"%{client.socket.tcpi_rcv_space}V\",\"socket_tcpi_last_data_sent\":\"%{client.socket.tcpi_last_data_sent}V\",\"socket_tcpi_total_retrans\":\"%{client.socket.tcpi_total_retrans}V\",\"socket_tcpi_delta_retrans\":\"%{client.socket.tcpi_delta_retrans}V\",\"socket_ploss\":\"%{client.socket.ploss}V\"}')
|
|
387
387
|
# @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
|
|
388
388
|
# @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
|
|
389
389
|
# @option opts [String] :region The region that log data will be sent to. (default to 'US')
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Fastly API
|
|
3
|
+
|
|
4
|
+
#Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: oss@fastly.com
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require 'cgi'
|
|
12
|
+
|
|
13
|
+
module Fastly
|
|
14
|
+
class LoggingEndpointErrorsApi
|
|
15
|
+
attr_accessor :api_client
|
|
16
|
+
|
|
17
|
+
def initialize(api_client = ApiClient.default)
|
|
18
|
+
@api_client = api_client
|
|
19
|
+
end
|
|
20
|
+
# Stream Log Endpoint Errors
|
|
21
|
+
# Provides a near real-time stream of log errors through a hybrid short-polling model. A client should make an initial request using the `from` parameter to specify a start time. The `to` parameter should be used alongside the `from` parameter since the default bucket is 10 seconds. For pagination, use the URLs provided in the Link header of the response. These contain updated `from` timestamps for retrieving the next or previous page of logs. Defaults to `application/x-ndjson` format. Use `Accept: application/json` header to request standard JSON array format instead.
|
|
22
|
+
# @option opts [String] :service_id (required)
|
|
23
|
+
# @option opts [Integer] :from
|
|
24
|
+
# @option opts [Integer] :to
|
|
25
|
+
# @option opts [String] :filter_endpoint
|
|
26
|
+
# @return [String]
|
|
27
|
+
def get_log_endpoint_errors(opts = {})
|
|
28
|
+
data, _status_code, _headers = get_log_endpoint_errors_with_http_info(opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Stream Log Endpoint Errors
|
|
33
|
+
# Provides a near real-time stream of log errors through a hybrid short-polling model. A client should make an initial request using the `from` parameter to specify a start time. The `to` parameter should be used alongside the `from` parameter since the default bucket is 10 seconds. For pagination, use the URLs provided in the Link header of the response. These contain updated `from` timestamps for retrieving the next or previous page of logs. Defaults to `application/x-ndjson` format. Use `Accept: application/json` header to request standard JSON array format instead.
|
|
34
|
+
# @option opts [String] :service_id (required)
|
|
35
|
+
# @option opts [Integer] :from
|
|
36
|
+
# @option opts [Integer] :to
|
|
37
|
+
# @option opts [String] :filter_endpoint
|
|
38
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
|
39
|
+
def get_log_endpoint_errors_with_http_info(opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: LoggingEndpointErrorsApi.get_log_endpoint_errors ...'
|
|
42
|
+
end
|
|
43
|
+
# unbox the parameters from the hash
|
|
44
|
+
service_id = opts[:'service_id']
|
|
45
|
+
# verify the required parameter 'service_id' is set
|
|
46
|
+
if @api_client.config.client_side_validation && service_id.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'service_id' when calling LoggingEndpointErrorsApi.get_log_endpoint_errors"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/observability/service/{service_id}/logging/errors'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s))
|
|
51
|
+
|
|
52
|
+
# query parameters
|
|
53
|
+
query_params = opts[:query_params] || {}
|
|
54
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
|
55
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
|
56
|
+
query_params[:'filter[endpoint]'] = opts[:'filter_endpoint'] if !opts[:'filter_endpoint'].nil?
|
|
57
|
+
|
|
58
|
+
# header parameters
|
|
59
|
+
header_params = opts[:header_params] || {}
|
|
60
|
+
# HTTP header 'Accept' (if needed)
|
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/x-ndjson', 'application/json'])
|
|
62
|
+
|
|
63
|
+
# form parameters
|
|
64
|
+
form_params = opts[:form_params] || {}
|
|
65
|
+
|
|
66
|
+
# http body (model)
|
|
67
|
+
post_body = opts[:debug_body]
|
|
68
|
+
|
|
69
|
+
# return_type
|
|
70
|
+
return_type = opts[:debug_return_type] || 'String'
|
|
71
|
+
|
|
72
|
+
# auth_names
|
|
73
|
+
auth_names = opts[:debug_auth_names] || ['token']
|
|
74
|
+
|
|
75
|
+
new_options = opts.merge(
|
|
76
|
+
:operation => :"LoggingEndpointErrorsApi.get_log_endpoint_errors",
|
|
77
|
+
:header_params => header_params,
|
|
78
|
+
:query_params => query_params,
|
|
79
|
+
:form_params => form_params,
|
|
80
|
+
:body => post_body,
|
|
81
|
+
:auth_names => auth_names,
|
|
82
|
+
:return_type => return_type
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
86
|
+
if @api_client.config.debugging
|
|
87
|
+
@api_client.config.logger.debug "API called: LoggingEndpointErrorsApi#get_log_endpoint_errors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
88
|
+
end
|
|
89
|
+
return data, status_code, headers
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
data/lib/fastly/configuration.rb
CHANGED
|
@@ -1964,6 +1964,12 @@ module Fastly
|
|
|
1964
1964
|
description: "No description provided",
|
|
1965
1965
|
}
|
|
1966
1966
|
],
|
|
1967
|
+
"LoggingEndpointErrorsApi.get_log_endpoint_errors": [
|
|
1968
|
+
{
|
|
1969
|
+
url: "https://api.fastly.com",
|
|
1970
|
+
description: "No description provided",
|
|
1971
|
+
}
|
|
1972
|
+
],
|
|
1967
1973
|
"LoggingFtpApi.create_log_ftp": [
|
|
1968
1974
|
{
|
|
1969
1975
|
url: "https://api.fastly.com",
|
|
@@ -395,6 +395,27 @@ module Fastly
|
|
|
395
395
|
# Number of \"Server Error\" category status codes delivered by the Compute platform.
|
|
396
396
|
attr_accessor :compute_resp_status_5xx
|
|
397
397
|
|
|
398
|
+
# Number of requests received over HTTP/2.
|
|
399
|
+
attr_accessor :http2
|
|
400
|
+
|
|
401
|
+
# Number of requests received over HTTP/3.
|
|
402
|
+
attr_accessor :http3
|
|
403
|
+
|
|
404
|
+
# Number of requests received over TLS 1.0.
|
|
405
|
+
attr_accessor :tls_v10
|
|
406
|
+
|
|
407
|
+
# Number of requests received over TLS 1.1.
|
|
408
|
+
attr_accessor :tls_v11
|
|
409
|
+
|
|
410
|
+
# Number of requests received over TLS 1.2.
|
|
411
|
+
attr_accessor :tls_v12
|
|
412
|
+
|
|
413
|
+
# Number of requests received over TLS 1.3.
|
|
414
|
+
attr_accessor :tls_v13
|
|
415
|
+
|
|
416
|
+
# Number of responses sent with status code 499 (Client Disconnected).
|
|
417
|
+
attr_accessor :status_499
|
|
418
|
+
|
|
398
419
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
399
420
|
def self.attribute_map
|
|
400
421
|
{
|
|
@@ -524,7 +545,14 @@ module Fastly
|
|
|
524
545
|
:'compute_resp_status_504' => :'compute_resp_status_504',
|
|
525
546
|
:'compute_resp_status_505' => :'compute_resp_status_505',
|
|
526
547
|
:'compute_resp_status_530' => :'compute_resp_status_530',
|
|
527
|
-
:'compute_resp_status_5xx' => :'compute_resp_status_5xx'
|
|
548
|
+
:'compute_resp_status_5xx' => :'compute_resp_status_5xx',
|
|
549
|
+
:'http2' => :'http2',
|
|
550
|
+
:'http3' => :'http3',
|
|
551
|
+
:'tls_v10' => :'tls_v10',
|
|
552
|
+
:'tls_v11' => :'tls_v11',
|
|
553
|
+
:'tls_v12' => :'tls_v12',
|
|
554
|
+
:'tls_v13' => :'tls_v13',
|
|
555
|
+
:'status_499' => :'status_499'
|
|
528
556
|
}
|
|
529
557
|
end
|
|
530
558
|
|
|
@@ -662,7 +690,14 @@ module Fastly
|
|
|
662
690
|
:'compute_resp_status_504' => :'Integer',
|
|
663
691
|
:'compute_resp_status_505' => :'Integer',
|
|
664
692
|
:'compute_resp_status_530' => :'Integer',
|
|
665
|
-
:'compute_resp_status_5xx' => :'Integer'
|
|
693
|
+
:'compute_resp_status_5xx' => :'Integer',
|
|
694
|
+
:'http2' => :'Integer',
|
|
695
|
+
:'http3' => :'Integer',
|
|
696
|
+
:'tls_v10' => :'Integer',
|
|
697
|
+
:'tls_v11' => :'Integer',
|
|
698
|
+
:'tls_v12' => :'Integer',
|
|
699
|
+
:'tls_v13' => :'Integer',
|
|
700
|
+
:'status_499' => :'Integer'
|
|
666
701
|
}
|
|
667
702
|
end
|
|
668
703
|
|
|
@@ -1194,6 +1229,34 @@ module Fastly
|
|
|
1194
1229
|
if attributes.key?(:'compute_resp_status_5xx')
|
|
1195
1230
|
self.compute_resp_status_5xx = attributes[:'compute_resp_status_5xx']
|
|
1196
1231
|
end
|
|
1232
|
+
|
|
1233
|
+
if attributes.key?(:'http2')
|
|
1234
|
+
self.http2 = attributes[:'http2']
|
|
1235
|
+
end
|
|
1236
|
+
|
|
1237
|
+
if attributes.key?(:'http3')
|
|
1238
|
+
self.http3 = attributes[:'http3']
|
|
1239
|
+
end
|
|
1240
|
+
|
|
1241
|
+
if attributes.key?(:'tls_v10')
|
|
1242
|
+
self.tls_v10 = attributes[:'tls_v10']
|
|
1243
|
+
end
|
|
1244
|
+
|
|
1245
|
+
if attributes.key?(:'tls_v11')
|
|
1246
|
+
self.tls_v11 = attributes[:'tls_v11']
|
|
1247
|
+
end
|
|
1248
|
+
|
|
1249
|
+
if attributes.key?(:'tls_v12')
|
|
1250
|
+
self.tls_v12 = attributes[:'tls_v12']
|
|
1251
|
+
end
|
|
1252
|
+
|
|
1253
|
+
if attributes.key?(:'tls_v13')
|
|
1254
|
+
self.tls_v13 = attributes[:'tls_v13']
|
|
1255
|
+
end
|
|
1256
|
+
|
|
1257
|
+
if attributes.key?(:'status_499')
|
|
1258
|
+
self.status_499 = attributes[:'status_499']
|
|
1259
|
+
end
|
|
1197
1260
|
end
|
|
1198
1261
|
|
|
1199
1262
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -1340,7 +1403,14 @@ module Fastly
|
|
|
1340
1403
|
compute_resp_status_504 == o.compute_resp_status_504 &&
|
|
1341
1404
|
compute_resp_status_505 == o.compute_resp_status_505 &&
|
|
1342
1405
|
compute_resp_status_530 == o.compute_resp_status_530 &&
|
|
1343
|
-
compute_resp_status_5xx == o.compute_resp_status_5xx
|
|
1406
|
+
compute_resp_status_5xx == o.compute_resp_status_5xx &&
|
|
1407
|
+
http2 == o.http2 &&
|
|
1408
|
+
http3 == o.http3 &&
|
|
1409
|
+
tls_v10 == o.tls_v10 &&
|
|
1410
|
+
tls_v11 == o.tls_v11 &&
|
|
1411
|
+
tls_v12 == o.tls_v12 &&
|
|
1412
|
+
tls_v13 == o.tls_v13 &&
|
|
1413
|
+
status_499 == o.status_499
|
|
1344
1414
|
end
|
|
1345
1415
|
|
|
1346
1416
|
# @see the `==` method
|
|
@@ -1352,7 +1422,7 @@ module Fastly
|
|
|
1352
1422
|
# Calculates hash code according to all attributes.
|
|
1353
1423
|
# @return [Integer] Hash code
|
|
1354
1424
|
def hash
|
|
1355
|
-
[edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, status_530, requests, resp_header_bytes, resp_body_bytes, bereq_header_bytes, bereq_body_bytes, edge_hit_requests, edge_miss_requests, origin_fetches, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, bandwidth, edge_hit_ratio, origin_offload, origin_status_200, origin_status_204, origin_status_206, origin_status_301, origin_status_302, origin_status_304, origin_status_400, origin_status_401, origin_status_403, origin_status_404, origin_status_416, origin_status_429, origin_status_500, origin_status_501, origin_status_502, origin_status_503, origin_status_504, origin_status_505, origin_status_530, origin_status_1xx, origin_status_2xx, origin_status_3xx, origin_status_4xx, origin_status_5xx, compute_bereq_body_bytes, compute_bereq_errors, compute_bereq_header_bytes, compute_bereqs, compute_beresp_body_bytes, compute_beresp_header_bytes, compute_execution_time_ms, compute_origin_status_1xx, compute_origin_status_200, compute_origin_status_204, compute_origin_status_206, compute_origin_status_2xx, compute_origin_status_301, compute_origin_status_302, compute_origin_status_304, compute_origin_status_3xx, compute_origin_status_400, compute_origin_status_401, compute_origin_status_403, compute_origin_status_404, compute_origin_status_416, compute_origin_status_429, compute_origin_status_4xx, compute_origin_status_500, compute_origin_status_501, compute_origin_status_502, compute_origin_status_503, compute_origin_status_504, compute_origin_status_505, compute_origin_status_530, compute_origin_status_5xx, compute_req_body_bytes, compute_req_header_bytes, compute_request_time_billed_ms, compute_request_time_ms, compute_request, compute_resp_body_bytes, compute_resp_header_bytes, compute_resp_status_103, compute_resp_status_1xx, compute_resp_status_200, compute_resp_status_204, compute_resp_status_206, compute_resp_status_2xx, compute_resp_status_301, compute_resp_status_302, compute_resp_status_304, compute_resp_status_3xx, compute_resp_status_400, compute_resp_status_401, compute_resp_status_403, compute_resp_status_404, compute_resp_status_416, compute_resp_status_429, compute_resp_status_4xx, compute_resp_status_500, compute_resp_status_501, compute_resp_status_502, compute_resp_status_503, compute_resp_status_504, compute_resp_status_505, compute_resp_status_530, compute_resp_status_5xx].hash
|
|
1425
|
+
[edge_requests, edge_resp_header_bytes, edge_resp_body_bytes, status_1xx, status_2xx, status_3xx, status_4xx, status_5xx, status_200, status_204, status_206, status_301, status_302, status_304, status_400, status_401, status_403, status_404, status_416, status_429, status_500, status_501, status_502, status_503, status_504, status_505, status_530, requests, resp_header_bytes, resp_body_bytes, bereq_header_bytes, bereq_body_bytes, edge_hit_requests, edge_miss_requests, origin_fetches, origin_fetch_resp_header_bytes, origin_fetch_resp_body_bytes, bandwidth, edge_hit_ratio, origin_offload, origin_status_200, origin_status_204, origin_status_206, origin_status_301, origin_status_302, origin_status_304, origin_status_400, origin_status_401, origin_status_403, origin_status_404, origin_status_416, origin_status_429, origin_status_500, origin_status_501, origin_status_502, origin_status_503, origin_status_504, origin_status_505, origin_status_530, origin_status_1xx, origin_status_2xx, origin_status_3xx, origin_status_4xx, origin_status_5xx, compute_bereq_body_bytes, compute_bereq_errors, compute_bereq_header_bytes, compute_bereqs, compute_beresp_body_bytes, compute_beresp_header_bytes, compute_execution_time_ms, compute_origin_status_1xx, compute_origin_status_200, compute_origin_status_204, compute_origin_status_206, compute_origin_status_2xx, compute_origin_status_301, compute_origin_status_302, compute_origin_status_304, compute_origin_status_3xx, compute_origin_status_400, compute_origin_status_401, compute_origin_status_403, compute_origin_status_404, compute_origin_status_416, compute_origin_status_429, compute_origin_status_4xx, compute_origin_status_500, compute_origin_status_501, compute_origin_status_502, compute_origin_status_503, compute_origin_status_504, compute_origin_status_505, compute_origin_status_530, compute_origin_status_5xx, compute_req_body_bytes, compute_req_header_bytes, compute_request_time_billed_ms, compute_request_time_ms, compute_request, compute_resp_body_bytes, compute_resp_header_bytes, compute_resp_status_103, compute_resp_status_1xx, compute_resp_status_200, compute_resp_status_204, compute_resp_status_206, compute_resp_status_2xx, compute_resp_status_301, compute_resp_status_302, compute_resp_status_304, compute_resp_status_3xx, compute_resp_status_400, compute_resp_status_401, compute_resp_status_403, compute_resp_status_404, compute_resp_status_416, compute_resp_status_429, compute_resp_status_4xx, compute_resp_status_500, compute_resp_status_501, compute_resp_status_502, compute_resp_status_503, compute_resp_status_504, compute_resp_status_505, compute_resp_status_530, compute_resp_status_5xx, http2, http3, tls_v10, tls_v11, tls_v12, tls_v13, status_499].hash
|
|
1356
1426
|
end
|
|
1357
1427
|
|
|
1358
1428
|
# Builds the object from hash
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Fastly API
|
|
3
|
+
|
|
4
|
+
#Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: oss@fastly.com
|
|
8
|
+
|
|
9
|
+
=end
|
|
10
|
+
|
|
11
|
+
require 'date'
|
|
12
|
+
require 'time'
|
|
13
|
+
|
|
14
|
+
module Fastly
|
|
15
|
+
class ErrorResponse
|
|
16
|
+
# A URI reference that identifies the problem type.
|
|
17
|
+
attr_accessor :type
|
|
18
|
+
|
|
19
|
+
# A short, human-readable summary of the problem type.
|
|
20
|
+
attr_accessor :title
|
|
21
|
+
|
|
22
|
+
# A human-readable explanation specific to this occurrence of the problem.
|
|
23
|
+
attr_accessor :detail
|
|
24
|
+
|
|
25
|
+
attr_accessor :errors
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'type' => :'type',
|
|
31
|
+
:'title' => :'title',
|
|
32
|
+
:'detail' => :'detail',
|
|
33
|
+
:'errors' => :'errors'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.fastly_types
|
|
44
|
+
{
|
|
45
|
+
:'type' => :'String',
|
|
46
|
+
:'title' => :'String',
|
|
47
|
+
:'detail' => :'String',
|
|
48
|
+
:'errors' => :'Array<ErrorResponseErrors>'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# List of attributes with nullable: true
|
|
53
|
+
def self.fastly_nullable
|
|
54
|
+
Set.new([
|
|
55
|
+
])
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Initializes the object
|
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
60
|
+
def initialize(attributes = {})
|
|
61
|
+
if (!attributes.is_a?(Hash))
|
|
62
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ErrorResponse` initialize method"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'type')
|
|
74
|
+
self.type = attributes[:'type']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'title')
|
|
78
|
+
self.title = attributes[:'title']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'detail')
|
|
82
|
+
self.detail = attributes[:'detail']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'errors')
|
|
86
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
|
87
|
+
self.errors = value
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
93
|
+
# @return Array for valid properties with the reasons
|
|
94
|
+
def list_invalid_properties
|
|
95
|
+
invalid_properties = Array.new
|
|
96
|
+
invalid_properties
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Check to see if the all the properties in the model are valid
|
|
100
|
+
# @return true if the model is valid
|
|
101
|
+
def valid?
|
|
102
|
+
true
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Checks equality by comparing each attribute.
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def ==(o)
|
|
108
|
+
return true if self.equal?(o)
|
|
109
|
+
self.class == o.class &&
|
|
110
|
+
type == o.type &&
|
|
111
|
+
title == o.title &&
|
|
112
|
+
detail == o.detail &&
|
|
113
|
+
errors == o.errors
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# @see the `==` method
|
|
117
|
+
# @param [Object] Object to be compared
|
|
118
|
+
def eql?(o)
|
|
119
|
+
self == o
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Calculates hash code according to all attributes.
|
|
123
|
+
# @return [Integer] Hash code
|
|
124
|
+
def hash
|
|
125
|
+
[type, title, detail, errors].hash
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Builds the object from hash
|
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
+
# @return [Object] Returns the model itself
|
|
131
|
+
def self.build_from_hash(attributes)
|
|
132
|
+
new.build_from_hash(attributes)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Builds the object from hash
|
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
137
|
+
# @return [Object] Returns the model itself
|
|
138
|
+
def build_from_hash(attributes)
|
|
139
|
+
return nil unless attributes.is_a?(Hash)
|
|
140
|
+
self.class.fastly_types.each_pair do |key, type|
|
|
141
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
|
142
|
+
self.send("#{key}=", nil)
|
|
143
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
144
|
+
# check to ensure the input is an array given that the attribute
|
|
145
|
+
# is documented as an array but the input is not
|
|
146
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
147
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
148
|
+
end
|
|
149
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
150
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
self
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Deserializes the data based on type
|
|
158
|
+
# @param string type Data type
|
|
159
|
+
# @param string value Value to be deserialized
|
|
160
|
+
# @return [Object] Deserialized data
|
|
161
|
+
def _deserialize(type, value)
|
|
162
|
+
case type.to_sym
|
|
163
|
+
when :Time
|
|
164
|
+
Time.parse(value)
|
|
165
|
+
when :Date
|
|
166
|
+
Date.parse(value)
|
|
167
|
+
when :String
|
|
168
|
+
value.to_s
|
|
169
|
+
when :Integer
|
|
170
|
+
value.to_i
|
|
171
|
+
when :Float
|
|
172
|
+
value.to_f
|
|
173
|
+
when :Boolean
|
|
174
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
175
|
+
true
|
|
176
|
+
else
|
|
177
|
+
false
|
|
178
|
+
end
|
|
179
|
+
when :Object
|
|
180
|
+
# generic object (usually a Hash), return directly
|
|
181
|
+
value
|
|
182
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
183
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
184
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
185
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
186
|
+
k_type = Regexp.last_match[:k_type]
|
|
187
|
+
v_type = Regexp.last_match[:v_type]
|
|
188
|
+
{}.tap do |hash|
|
|
189
|
+
value.each do |k, v|
|
|
190
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
191
|
+
end
|
|
192
|
+
end
|
|
193
|
+
else # model
|
|
194
|
+
# models (e.g. Pet) or oneOf
|
|
195
|
+
klass = Fastly.const_get(type)
|
|
196
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# Returns the string representation of the object
|
|
201
|
+
# @return [String] String presentation of the object
|
|
202
|
+
def to_s
|
|
203
|
+
to_hash.to_s
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
|
208
|
+
def to_body
|
|
209
|
+
to_hash
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Returns the object in the form of hash
|
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
|
214
|
+
def to_hash
|
|
215
|
+
hash = {}
|
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
217
|
+
value = self.send(attr)
|
|
218
|
+
if value.nil?
|
|
219
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
|
220
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
hash[param] = _to_hash(value)
|
|
224
|
+
end
|
|
225
|
+
hash
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Outputs non-array value in the form of hash
|
|
229
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
230
|
+
# @param [Object] value Any valid value
|
|
231
|
+
# @return [Hash] Returns the value in the form of hash
|
|
232
|
+
def _to_hash(value)
|
|
233
|
+
if value.is_a?(Array)
|
|
234
|
+
value.compact.map { |v| _to_hash(v) }
|
|
235
|
+
elsif value.is_a?(Hash)
|
|
236
|
+
{}.tap do |hash|
|
|
237
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
238
|
+
end
|
|
239
|
+
elsif value.respond_to? :to_hash
|
|
240
|
+
value.to_hash
|
|
241
|
+
else
|
|
242
|
+
value
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
end
|