diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cc7a19..a845da0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [v4.1.0](https://github.com/fastly/fastly-rust/releases/tag/release/v4.1.0) (2023-09-01) + +**Bug fixes:** + +- fix(user-agent): use consistent naming to other clients. + +**Enhancements:** + +- feat(backend): support share_key field. +- feat(events): support extra created_at filters. +- feat(logging/newrelic): add OTLP endpoints. +- feat(tls/subscriptions): support self_managed_http_challenge field. + +**Documentation:** + +- doc(secretstore): correct description for GET endpoint. + ## [v4.0.0](https://github.com/fastly/fastly-rust/releases/tag/release/v4.0.0) (2023-07-31) **Breaking:** diff --git a/Cargo.toml b/Cargo.toml index f676a1d..a5e1ffd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastly-api" -version = "4.0.0" +version = "4.1.0" authors = ["Fastly "] edition = "2021" description = "Fastly API client" diff --git a/README.md b/README.md index 1a97245..6d7909a 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Rust 2021 Edition Add the following to `Cargo.toml` under `[dependencies]`: ```toml -fastly-api = "4.0.0" +fastly-api = "4.1.0" ``` ## Usage @@ -350,6 +350,11 @@ Class | Method | HTTP request | Description *LoggingNewrelicApi* | [**get_log_newrelic**](docs/LoggingNewrelicApi.md#get_log_newrelic) | **GET** /service/{service_id}/version/{version_id}/logging/newrelic/{logging_newrelic_name} | Get a New Relic log endpoint *LoggingNewrelicApi* | [**list_log_newrelic**](docs/LoggingNewrelicApi.md#list_log_newrelic) | **GET** /service/{service_id}/version/{version_id}/logging/newrelic | List New Relic log endpoints *LoggingNewrelicApi* | [**update_log_newrelic**](docs/LoggingNewrelicApi.md#update_log_newrelic) | **PUT** /service/{service_id}/version/{version_id}/logging/newrelic/{logging_newrelic_name} | Update a New Relic log endpoint +*LoggingNewrelicotlpApi* | [**create_log_newrelicotlp**](docs/LoggingNewrelicotlpApi.md#create_log_newrelicotlp) | **POST** /service/{service_id}/version/{version_id}/logging/newrelicotlp | Create a New Relic OTLP endpoint +*LoggingNewrelicotlpApi* | [**delete_log_newrelicotlp**](docs/LoggingNewrelicotlpApi.md#delete_log_newrelicotlp) | **DELETE** /service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name} | Delete a New Relic OTLP endpoint +*LoggingNewrelicotlpApi* | [**get_log_newrelicotlp**](docs/LoggingNewrelicotlpApi.md#get_log_newrelicotlp) | **GET** /service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name} | Get a New Relic OTLP endpoint +*LoggingNewrelicotlpApi* | [**list_log_newrelicotlp**](docs/LoggingNewrelicotlpApi.md#list_log_newrelicotlp) | **GET** /service/{service_id}/version/{version_id}/logging/newrelicotlp | List New Relic OTLP endpoints +*LoggingNewrelicotlpApi* | [**update_log_newrelicotlp**](docs/LoggingNewrelicotlpApi.md#update_log_newrelicotlp) | **PUT** /service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name} | Update a New Relic log endpoint *LoggingOpenstackApi* | [**create_log_openstack**](docs/LoggingOpenstackApi.md#create_log_openstack) | **POST** /service/{service_id}/version/{version_id}/logging/openstack | Create an OpenStack log endpoint *LoggingOpenstackApi* | [**delete_log_openstack**](docs/LoggingOpenstackApi.md#delete_log_openstack) | **DELETE** /service/{service_id}/version/{version_id}/logging/openstack/{logging_openstack_name} | Delete an OpenStack log endpoint *LoggingOpenstackApi* | [**get_log_openstack**](docs/LoggingOpenstackApi.md#get_log_openstack) | **GET** /service/{service_id}/version/{version_id}/logging/openstack/{logging_openstack_name} | Get an OpenStack log endpoint @@ -444,7 +449,7 @@ Class | Method | HTTP request | Description *SecretStoreApi* | [**client_key**](docs/SecretStoreApi.md#client_key) | **POST** /resources/stores/secret/client-key | Create new client key *SecretStoreApi* | [**create_secret_store**](docs/SecretStoreApi.md#create_secret_store) | **POST** /resources/stores/secret | Create new secret store *SecretStoreApi* | [**delete_secret_store**](docs/SecretStoreApi.md#delete_secret_store) | **DELETE** /resources/stores/secret/{store_id} | Delete secret store -*SecretStoreApi* | [**get_secret_store**](docs/SecretStoreApi.md#get_secret_store) | **GET** /resources/stores/secret/{store_id} | Create secret store by ID +*SecretStoreApi* | [**get_secret_store**](docs/SecretStoreApi.md#get_secret_store) | **GET** /resources/stores/secret/{store_id} | Get secret store by ID *SecretStoreApi* | [**get_secret_stores**](docs/SecretStoreApi.md#get_secret_stores) | **GET** /resources/stores/secret | Get all secret stores *SecretStoreApi* | [**signing_key**](docs/SecretStoreApi.md#signing_key) | **GET** /resources/stores/secret/signing-key | Get public key *SecretStoreItemApi* | [**create_secret**](docs/SecretStoreItemApi.md#create_secret) | **POST** /resources/stores/secret/{store_id}/secrets | Create a new secret in a store. diff --git a/docs/Backend.md b/docs/Backend.md index 3437838..c5ba857 100644 --- a/docs/Backend.md +++ b/docs/Backend.md @@ -23,6 +23,7 @@ Name | Type | Description | Notes **override_host** | Option<**String**> | If set, will replace the client-supplied HTTP `Host` header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing `bereq.http.Host` in VCL. | **port** | Option<**i32**> | Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request. | **request_condition** | Option<**String**> | Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. | +**share_key** | Option<**String**> | Value that when shared across backends will enable those backends to share the same health check. | **shield** | Option<**String**> | Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). | **ssl_ca_cert** | Option<**String**> | CA certificate attached to origin. | **ssl_cert_hostname** | Option<**String**> | Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all. | diff --git a/docs/BackendApi.md b/docs/BackendApi.md index 366a3b4..2cf5d79 100644 --- a/docs/BackendApi.md +++ b/docs/BackendApi.md @@ -50,6 +50,7 @@ Name | Type | Description | Required | Notes **override_host** | Option\<**String**> | If set, will replace the client-supplied HTTP `Host` header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing `bereq.http.Host` in VCL. | | **port** | Option\<**i32**> | Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request. | | **request_condition** | Option\<**String**> | Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. | | +**share_key** | Option\<**String**> | Value that when shared across backends will enable those backends to share the same health check. | | **shield** | Option\<**String**> | Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). | | **ssl_ca_cert** | Option\<**String**> | CA certificate attached to origin. | | **ssl_cert_hostname** | Option\<**String**> | Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all. | | @@ -227,6 +228,7 @@ Name | Type | Description | Required | Notes **override_host** | Option\<**String**> | If set, will replace the client-supplied HTTP `Host` header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing `bereq.http.Host` in VCL. | | **port** | Option\<**i32**> | Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request. | | **request_condition** | Option\<**String**> | Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. | | +**share_key** | Option\<**String**> | Value that when shared across backends will enable those backends to share the same health check. | | **shield** | Option\<**String**> | Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). | | **ssl_ca_cert** | Option\<**String**> | CA certificate attached to origin. | | **ssl_cert_hostname** | Option\<**String**> | Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all. | | diff --git a/docs/BackendResponse.md b/docs/BackendResponse.md index 1e00af5..8a6079d 100644 --- a/docs/BackendResponse.md +++ b/docs/BackendResponse.md @@ -23,6 +23,7 @@ Name | Type | Description | Notes **override_host** | Option<**String**> | If set, will replace the client-supplied HTTP `Host` header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing `bereq.http.Host` in VCL. | **port** | Option<**i32**> | Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request. | **request_condition** | Option<**String**> | Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. | +**share_key** | Option<**String**> | Value that when shared across backends will enable those backends to share the same health check. | **shield** | Option<**String**> | Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). | **ssl_ca_cert** | Option<**String**> | CA certificate attached to origin. | **ssl_cert_hostname** | Option<**String**> | Overrides `ssl_hostname`, but only for cert verification. Does not affect SNI at all. | diff --git a/docs/LoggingNewrelicotlpAdditional.md b/docs/LoggingNewrelicotlpAdditional.md new file mode 100644 index 0000000..efc8e75 --- /dev/null +++ b/docs/LoggingNewrelicotlpAdditional.md @@ -0,0 +1,14 @@ +# LoggingNewrelicotlpAdditional + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**format** | Option<**String**> | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [default to {"timestamp":"%{begin:%Y-%m-%dT%H:%M:%S}t","time_elapsed":"%{time.elapsed.usec}V","is_tls":"%{if(req.is_ssl, \"true\", \"false\")}V","client_ip":"%{req.http.Fastly-Client-IP}V","geo_city":"%{client.geo.city}V","geo_country_code":"%{client.geo.country_code}V","request":"%{req.request}V","host":"%{req.http.Fastly-Orig-Host}V","url":"%{json.escape(req.url)}V","request_referer":"%{json.escape(req.http.Referer)}V","request_user_agent":"%{json.escape(req.http.User-Agent)}V","request_accept_language":"%{json.escape(req.http.Accept-Language)}V","request_accept_charset":"%{json.escape(req.http.Accept-Charset)}V","cache_status":"%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\2\\3\") }V"}] +**token** | Option<**String**> | The Insert API key from the Account page of your New Relic account. Required. | +**region** | Option<**String**> | The region to which to stream logs. | [default to Region_US] +**url** | Option<**String**> | (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. | [default to null] + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/LoggingNewrelicotlpApi.md b/docs/LoggingNewrelicotlpApi.md new file mode 100644 index 0000000..fb3a7bb --- /dev/null +++ b/docs/LoggingNewrelicotlpApi.md @@ -0,0 +1,212 @@ +# LoggingNewrelicotlpApi + +All URIs are relative to *https://api.fastly.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_log_newrelicotlp**](LoggingNewrelicotlpApi.md#create_log_newrelicotlp) | **POST** /service/{service_id}/version/{version_id}/logging/newrelicotlp | Create a New Relic OTLP endpoint +[**delete_log_newrelicotlp**](LoggingNewrelicotlpApi.md#delete_log_newrelicotlp) | **DELETE** /service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name} | Delete a New Relic OTLP endpoint +[**get_log_newrelicotlp**](LoggingNewrelicotlpApi.md#get_log_newrelicotlp) | **GET** /service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name} | Get a New Relic OTLP endpoint +[**list_log_newrelicotlp**](LoggingNewrelicotlpApi.md#list_log_newrelicotlp) | **GET** /service/{service_id}/version/{version_id}/logging/newrelicotlp | List New Relic OTLP endpoints +[**update_log_newrelicotlp**](LoggingNewrelicotlpApi.md#update_log_newrelicotlp) | **PUT** /service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name} | Update a New Relic log endpoint + + + +## create_log_newrelicotlp + +Create a New Relic OTLP logging object for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = CreateLogNewrelicotlpParams { + // parameters +}; +create_log_newrelicotlp(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**name** | Option\<**String**> | The name for the real-time logging configuration. | | +**placement** | Option\<**String**> | 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`. | | +**response_condition** | Option\<**String**> | The name of an existing condition in the configured endpoint, or leave blank to always execute. | | +**format** | Option\<**String**> | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | |[default to {"timestamp":"%{begin:%Y-%m-%dT%H:%M:%S}t","time_elapsed":"%{time.elapsed.usec}V","is_tls":"%{if(req.is_ssl, \"true\", \"false\")}V","client_ip":"%{req.http.Fastly-Client-IP}V","geo_city":"%{client.geo.city}V","geo_country_code":"%{client.geo.country_code}V","request":"%{req.request}V","host":"%{req.http.Fastly-Orig-Host}V","url":"%{json.escape(req.url)}V","request_referer":"%{json.escape(req.http.Referer)}V","request_user_agent":"%{json.escape(req.http.User-Agent)}V","request_accept_language":"%{json.escape(req.http.Accept-Language)}V","request_accept_charset":"%{json.escape(req.http.Accept-Charset)}V","cache_status":"%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\2\\3\") }V"}] +**format_version** | Option\<**i32**> | 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 FormatVersion_v2] +**token** | Option\<**String**> | The Insert API key from the Account page of your New Relic account. Required. | | +**region** | Option\<**String**> | The region to which to stream logs. | |[default to Region_US] +**url** | Option\<**String**> | (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. | |[default to null] + +### Return type + +[**crate::models::LoggingNewrelicotlpResponse**](LoggingNewrelicotlpResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## delete_log_newrelicotlp + +Delete the New Relic OTLP logging object for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = DeleteLogNewrelicotlpParams { + // parameters +}; +delete_log_newrelicotlp(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**logging_newrelicotlp_name** | **String** | The name for the real-time logging configuration. | [required] | + +### Return type + +[**crate::models::InlineResponse200**](InlineResponse200.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## get_log_newrelicotlp + +Get the details of a New Relic OTLP logging object for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = GetLogNewrelicotlpParams { + // parameters +}; +get_log_newrelicotlp(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**logging_newrelicotlp_name** | **String** | The name for the real-time logging configuration. | [required] | + +### Return type + +[**crate::models::LoggingNewrelicotlpResponse**](LoggingNewrelicotlpResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## list_log_newrelicotlp + +List all of the New Relic OTLP logging objects for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = ListLogNewrelicotlpParams { + // parameters +}; +list_log_newrelicotlp(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | + +### Return type + +[**Vec<crate::models::LoggingNewrelicotlpResponse>**](LoggingNewrelicotlpResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + +## update_log_newrelicotlp + +Update a New Relic OTLP logging object for a particular service and version. + +```rust +let cfg = &Configuration::default(); +let params = UpdateLogNewrelicotlpParams { + // parameters +}; +update_log_newrelicotlp(cfg, params) +``` + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**service_id** | **String** | Alphanumeric string identifying the service. | [required] | +**version_id** | **i32** | Integer identifying a service version. | [required] | +**logging_newrelicotlp_name** | **String** | The name for the real-time logging configuration. | [required] | +**name** | Option\<**String**> | The name for the real-time logging configuration. | | +**placement** | Option\<**String**> | 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`. | | +**response_condition** | Option\<**String**> | The name of an existing condition in the configured endpoint, or leave blank to always execute. | | +**format** | Option\<**String**> | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | |[default to {"timestamp":"%{begin:%Y-%m-%dT%H:%M:%S}t","time_elapsed":"%{time.elapsed.usec}V","is_tls":"%{if(req.is_ssl, \"true\", \"false\")}V","client_ip":"%{req.http.Fastly-Client-IP}V","geo_city":"%{client.geo.city}V","geo_country_code":"%{client.geo.country_code}V","request":"%{req.request}V","host":"%{req.http.Fastly-Orig-Host}V","url":"%{json.escape(req.url)}V","request_referer":"%{json.escape(req.http.Referer)}V","request_user_agent":"%{json.escape(req.http.User-Agent)}V","request_accept_language":"%{json.escape(req.http.Accept-Language)}V","request_accept_charset":"%{json.escape(req.http.Accept-Charset)}V","cache_status":"%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\2\\3\") }V"}] +**format_version** | Option\<**i32**> | 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 FormatVersion_v2] +**token** | Option\<**String**> | The Insert API key from the Account page of your New Relic account. Required. | | +**region** | Option\<**String**> | The region to which to stream logs. | |[default to Region_US] +**url** | Option\<**String**> | (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. | |[default to null] + +### Return type + +[**crate::models::LoggingNewrelicotlpResponse**](LoggingNewrelicotlpResponse.md) + +### Authorization + +[token](../README.md#token) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/LoggingNewrelicotlpResponse.md b/docs/LoggingNewrelicotlpResponse.md new file mode 100644 index 0000000..b88c7ca --- /dev/null +++ b/docs/LoggingNewrelicotlpResponse.md @@ -0,0 +1,23 @@ +# LoggingNewrelicotlpResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | The name for the real-time logging configuration. | +**placement** | Option<**String**> | 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`. | +**response_condition** | Option<**String**> | The name of an existing condition in the configured endpoint, or leave blank to always execute. | +**format** | Option<**String**> | A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). | [default to {"timestamp":"%{begin:%Y-%m-%dT%H:%M:%S}t","time_elapsed":"%{time.elapsed.usec}V","is_tls":"%{if(req.is_ssl, \"true\", \"false\")}V","client_ip":"%{req.http.Fastly-Client-IP}V","geo_city":"%{client.geo.city}V","geo_country_code":"%{client.geo.country_code}V","request":"%{req.request}V","host":"%{req.http.Fastly-Orig-Host}V","url":"%{json.escape(req.url)}V","request_referer":"%{json.escape(req.http.Referer)}V","request_user_agent":"%{json.escape(req.http.User-Agent)}V","request_accept_language":"%{json.escape(req.http.Accept-Language)}V","request_accept_charset":"%{json.escape(req.http.Accept-Charset)}V","cache_status":"%{regsub(fastly_info.state, \"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\", \"\\2\\3\") }V"}] +**format_version** | Option<**String**> | 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 FormatVersion_v2] +**token** | Option<**String**> | The Insert API key from the Account page of your New Relic account. Required. | +**region** | Option<**String**> | The region to which to stream logs. | [default to Region_US] +**url** | Option<**String**> | (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. | [default to null] +**created_at** | Option<**String**> | Date and time in ISO 8601 format. | [readonly] +**deleted_at** | Option<**String**> | Date and time in ISO 8601 format. | [readonly] +**updated_at** | Option<**String**> | Date and time in ISO 8601 format. | [readonly] +**service_id** | Option<**String**> | | [readonly] +**version** | Option<**String**> | | [readonly] + +[[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SecretStoreApi.md b/docs/SecretStoreApi.md index 075ef9a..fe40427 100644 --- a/docs/SecretStoreApi.md +++ b/docs/SecretStoreApi.md @@ -7,7 +7,7 @@ Method | HTTP request | Description [**client_key**](SecretStoreApi.md#client_key) | **POST** /resources/stores/secret/client-key | Create new client key [**create_secret_store**](SecretStoreApi.md#create_secret_store) | **POST** /resources/stores/secret | Create new secret store [**delete_secret_store**](SecretStoreApi.md#delete_secret_store) | **DELETE** /resources/stores/secret/{store_id} | Delete secret store -[**get_secret_store**](SecretStoreApi.md#get_secret_store) | **GET** /resources/stores/secret/{store_id} | Create secret store by ID +[**get_secret_store**](SecretStoreApi.md#get_secret_store) | **GET** /resources/stores/secret/{store_id} | Get secret store by ID [**get_secret_stores**](SecretStoreApi.md#get_secret_stores) | **GET** /resources/stores/secret | Get all secret stores [**signing_key**](SecretStoreApi.md#signing_key) | **GET** /resources/stores/secret/signing-key | Get public key diff --git a/docs/TlsDomainsApi.md b/docs/TlsDomainsApi.md index ad29a2c..33ace37 100644 --- a/docs/TlsDomainsApi.md +++ b/docs/TlsDomainsApi.md @@ -28,7 +28,7 @@ Name | Type | Description | Required | Notes **filter_in_use** | Option\<**String**> | Optional. Limit the returned domains to those currently using Fastly to terminate TLS with SNI (that is, domains considered \"in use\") Permitted values: true, false. | | **filter_tls_certificates_id** | Option\<**String**> | Optional. Limit the returned domains to those listed in the given TLS certificate's SAN list. | | **filter_tls_subscriptions_id** | Option\<**String**> | Optional. Limit the returned domains to those for a given TLS subscription. | | -**include** | Option\<**String**> | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, and `tls_authorizations.globalsign_email_challenge`. | | +**include** | Option\<**String**> | Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. | | **page_number** | Option\<**i32**> | Current page. | | **page_size** | Option\<**i32**> | Number of records per page. | |[default to 20] **sort** | Option\<**String**> | The order in which to list the results by creation date. | |[default to created_at] diff --git a/docs/TlsSubscriptionsApi.md b/docs/TlsSubscriptionsApi.md index 20074df..e18e6ce 100644 --- a/docs/TlsSubscriptionsApi.md +++ b/docs/TlsSubscriptionsApi.md @@ -177,7 +177,7 @@ get_tls_sub(cfg, params) Name | Type | Description | Required | Notes ------------- | ------------- | ------------- | ------------- | ------------- **tls_subscription_id** | **String** | Alphanumeric string identifying a TLS subscription. | [required] | -**include** | Option\<**String**> | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations` and `tls_authorizations.globalsign_email_challenge`. | | +**include** | Option\<**String**> | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. | | ### Return type @@ -215,7 +215,7 @@ Name | Type | Description | Required | Notes **filter_state** | Option\<**String**> | Limit the returned subscriptions by state. Valid values are `pending`, `processing`, `issued`, `renewing`, and `failed`. Accepts parameters: `not` (e.g., `filter[state][not]=renewing`). | | **filter_tls_domains_id** | Option\<**String**> | Limit the returned subscriptions to those that include the specific domain. | | **filter_has_active_order** | Option\<**bool**> | Limit the returned subscriptions to those that have currently active orders. Permitted values: `true`. | | -**include** | Option\<**String**> | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations` and `tls_authorizations.globalsign_email_challenge`. | | +**include** | Option\<**String**> | Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. | | **page_number** | Option\<**i32**> | Current page. | | **page_size** | Option\<**i32**> | Number of records per page. | |[default to 20] **sort** | Option\<**String**> | The order in which to list the results by creation date. | |[default to created_at] diff --git a/sig.json b/sig.json index 6585794..af51c00 100644 --- a/sig.json +++ b/sig.json @@ -1 +1 @@ -{"G": "2914592f", "D": "7e4f4edd"} +{"G": "a5d4c17e", "D": "6ddfaf95"} diff --git a/src/apis/backend_api.rs b/src/apis/backend_api.rs index d078c63..b3212dd 100644 --- a/src/apis/backend_api.rs +++ b/src/apis/backend_api.rs @@ -56,6 +56,8 @@ pub struct CreateBackendParams { pub port: Option, /// Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. pub request_condition: Option, + /// Value that when shared across backends will enable those backends to share the same health check. + pub share_key: Option, /// Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). pub shield: Option, /// CA certificate attached to origin. @@ -158,6 +160,8 @@ pub struct UpdateBackendParams { pub port: Option, /// Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. pub request_condition: Option, + /// Value that when shared across backends will enable those backends to share the same health check. + pub share_key: Option, /// Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). pub shield: Option, /// CA certificate attached to origin. @@ -245,6 +249,7 @@ pub async fn create_backend(configuration: &mut configuration::Configuration, pa let override_host = params.override_host; let port = params.port; let request_condition = params.request_condition; + let share_key = params.share_key; let shield = params.shield; let ssl_ca_cert = params.ssl_ca_cert; let ssl_cert_hostname = params.ssl_cert_hostname; @@ -332,6 +337,9 @@ pub async fn create_backend(configuration: &mut configuration::Configuration, pa if let Some(local_var_param_value) = request_condition { local_var_form_params.insert("request_condition", local_var_param_value.to_string()); } + if let Some(local_var_param_value) = share_key { + local_var_form_params.insert("share_key", local_var_param_value.to_string()); + } if let Some(local_var_param_value) = shield { local_var_form_params.insert("shield", local_var_param_value.to_string()); } @@ -582,6 +590,7 @@ pub async fn update_backend(configuration: &mut configuration::Configuration, pa let override_host = params.override_host; let port = params.port; let request_condition = params.request_condition; + let share_key = params.share_key; let shield = params.shield; let ssl_ca_cert = params.ssl_ca_cert; let ssl_cert_hostname = params.ssl_cert_hostname; @@ -669,6 +678,9 @@ pub async fn update_backend(configuration: &mut configuration::Configuration, pa if let Some(local_var_param_value) = request_condition { local_var_form_params.insert("request_condition", local_var_param_value.to_string()); } + if let Some(local_var_param_value) = share_key { + local_var_form_params.insert("share_key", local_var_param_value.to_string()); + } if let Some(local_var_param_value) = shield { local_var_form_params.insert("shield", local_var_param_value.to_string()); } diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs index 0828809..50eba32 100644 --- a/src/apis/configuration.rs +++ b/src/apis/configuration.rs @@ -49,7 +49,7 @@ impl Default for Configuration { Configuration { base_path: "https://api.fastly.com".to_owned(), - user_agent: Some("fastly-api/4.0.0/rust".to_owned()), + user_agent: Some("fastly-rust/4.1.0/rust".to_owned()), client: reqwest::Client::new(), basic_auth: None, oauth_access_token: None, diff --git a/src/apis/logging_newrelicotlp_api.rs b/src/apis/logging_newrelicotlp_api.rs new file mode 100644 index 0000000..a5bb8ea --- /dev/null +++ b/src/apis/logging_newrelicotlp_api.rs @@ -0,0 +1,469 @@ +/* + * Fastly API + * + * 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://developer.fastly.com/reference/api/) + * + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + +/// struct for passing parameters to the method [`create_log_newrelicotlp`] +#[derive(Clone, Debug, Default)] +pub struct CreateLogNewrelicotlpParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name for the real-time logging configuration. + pub name: Option, + /// 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`. + pub placement: Option, + /// The name of an existing condition in the configured endpoint, or leave blank to always execute. + pub response_condition: Option, + /// A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). + pub format: Option, + /// 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`. + pub format_version: Option, + /// The Insert API key from the Account page of your New Relic account. Required. + pub token: Option, + /// The region to which to stream logs. + pub region: Option, + /// (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. + pub url: Option +} + +/// struct for passing parameters to the method [`delete_log_newrelicotlp`] +#[derive(Clone, Debug, Default)] +pub struct DeleteLogNewrelicotlpParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name for the real-time logging configuration. + pub logging_newrelicotlp_name: String +} + +/// struct for passing parameters to the method [`get_log_newrelicotlp`] +#[derive(Clone, Debug, Default)] +pub struct GetLogNewrelicotlpParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name for the real-time logging configuration. + pub logging_newrelicotlp_name: String +} + +/// struct for passing parameters to the method [`list_log_newrelicotlp`] +#[derive(Clone, Debug, Default)] +pub struct ListLogNewrelicotlpParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32 +} + +/// struct for passing parameters to the method [`update_log_newrelicotlp`] +#[derive(Clone, Debug, Default)] +pub struct UpdateLogNewrelicotlpParams { + /// Alphanumeric string identifying the service. + pub service_id: String, + /// Integer identifying a service version. + pub version_id: i32, + /// The name for the real-time logging configuration. + pub logging_newrelicotlp_name: String, + /// The name for the real-time logging configuration. + pub name: Option, + /// 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`. + pub placement: Option, + /// The name of an existing condition in the configured endpoint, or leave blank to always execute. + pub response_condition: Option, + /// A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). + pub format: Option, + /// 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`. + pub format_version: Option, + /// The Insert API key from the Account page of your New Relic account. Required. + pub token: Option, + /// The region to which to stream logs. + pub region: Option, + /// (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. + pub url: Option +} + + +/// struct for typed errors of method [`create_log_newrelicotlp`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateLogNewrelicotlpError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_log_newrelicotlp`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteLogNewrelicotlpError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_log_newrelicotlp`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetLogNewrelicotlpError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_log_newrelicotlp`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLogNewrelicotlpError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_log_newrelicotlp`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateLogNewrelicotlpError { + UnknownValue(serde_json::Value), +} + + +/// Create a New Relic OTLP logging object for a particular service and version. +pub async fn create_log_newrelicotlp(configuration: &mut configuration::Configuration, params: CreateLogNewrelicotlpParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let name = params.name; + let placement = params.placement; + let response_condition = params.response_condition; + let format = params.format; + let format_version = params.format_version; + let token = params.token; + let region = params.region; + let url = params.url; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/newrelicotlp", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + let mut local_var_form_params = std::collections::HashMap::new(); + if let Some(local_var_param_value) = name { + local_var_form_params.insert("name", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = placement { + local_var_form_params.insert("placement", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = response_condition { + local_var_form_params.insert("response_condition", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = format { + local_var_form_params.insert("format", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = format_version { + local_var_form_params.insert("format_version", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = token { + local_var_form_params.insert("token", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = region { + local_var_form_params.insert("region", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = url { + local_var_form_params.insert("url", local_var_param_value.to_string()); + } + local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "POST" != "GET" && "POST" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete the New Relic OTLP logging object for a particular service and version. +pub async fn delete_log_newrelicotlp(configuration: &mut configuration::Configuration, params: DeleteLogNewrelicotlpParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let logging_newrelicotlp_name = params.logging_newrelicotlp_name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_newrelicotlp_name=crate::apis::urlencode(logging_newrelicotlp_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "DELETE" != "GET" && "DELETE" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the details of a New Relic OTLP logging object for a particular service and version. +pub async fn get_log_newrelicotlp(configuration: &mut configuration::Configuration, params: GetLogNewrelicotlpParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let logging_newrelicotlp_name = params.logging_newrelicotlp_name; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_newrelicotlp_name=crate::apis::urlencode(logging_newrelicotlp_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// List all of the New Relic OTLP logging objects for a particular service and version. +pub async fn list_log_newrelicotlp(configuration: &mut configuration::Configuration, params: ListLogNewrelicotlpParams) -> Result, Error> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/newrelicotlp", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "GET" != "GET" && "GET" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update a New Relic OTLP logging object for a particular service and version. +pub async fn update_log_newrelicotlp(configuration: &mut configuration::Configuration, params: UpdateLogNewrelicotlpParams) -> Result> { + let local_var_configuration = configuration; + + // unbox the parameters + let service_id = params.service_id; + let version_id = params.version_id; + let logging_newrelicotlp_name = params.logging_newrelicotlp_name; + let name = params.name; + let placement = params.placement; + let response_condition = params.response_condition; + let format = params.format; + let format_version = params.format_version; + let token = params.token; + let region = params.region; + let url = params.url; + + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/newrelicotlp/{logging_newrelicotlp_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_newrelicotlp_name=crate::apis::urlencode(logging_newrelicotlp_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value); + }; + let mut local_var_form_params = std::collections::HashMap::new(); + if let Some(local_var_param_value) = name { + local_var_form_params.insert("name", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = placement { + local_var_form_params.insert("placement", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = response_condition { + local_var_form_params.insert("response_condition", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = format { + local_var_form_params.insert("format", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = format_version { + local_var_form_params.insert("format_version", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = token { + local_var_form_params.insert("token", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = region { + local_var_form_params.insert("region", local_var_param_value.to_string()); + } + if let Some(local_var_param_value) = url { + local_var_form_params.insert("url", local_var_param_value.to_string()); + } + local_var_req_builder = local_var_req_builder.form(&local_var_form_params); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + if "PUT" != "GET" && "PUT" != "HEAD" { + let headers = local_var_resp.headers(); + local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => configuration::DEFAULT_RATELIMIT, + }; + local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") { + Some(v) => v.to_str().unwrap().parse().unwrap(), + None => 0, + }; + } + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/src/apis/mod.rs b/src/apis/mod.rs index 3358d50..16a085f 100644 --- a/src/apis/mod.rs +++ b/src/apis/mod.rs @@ -123,6 +123,7 @@ pub mod logging_logentries_api; pub mod logging_loggly_api; pub mod logging_logshuttle_api; pub mod logging_newrelic_api; +pub mod logging_newrelicotlp_api; pub mod logging_openstack_api; pub mod logging_papertrail_api; pub mod logging_pubsub_api; diff --git a/src/apis/tls_domains_api.rs b/src/apis/tls_domains_api.rs index 2cb5c57..9878e0a 100644 --- a/src/apis/tls_domains_api.rs +++ b/src/apis/tls_domains_api.rs @@ -20,7 +20,7 @@ pub struct ListTlsDomainsParams { pub filter_tls_certificates_id: Option, /// Optional. Limit the returned domains to those for a given TLS subscription. pub filter_tls_subscriptions_id: Option, - /// Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, and `tls_authorizations.globalsign_email_challenge`. + /// Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. pub include: Option, /// Current page. pub page_number: Option, diff --git a/src/apis/tls_subscriptions_api.rs b/src/apis/tls_subscriptions_api.rs index f3575d3..8e8d011 100644 --- a/src/apis/tls_subscriptions_api.rs +++ b/src/apis/tls_subscriptions_api.rs @@ -52,7 +52,7 @@ pub struct DeleteTlsSubParams { pub struct GetTlsSubParams { /// Alphanumeric string identifying a TLS subscription. pub tls_subscription_id: String, - /// Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations` and `tls_authorizations.globalsign_email_challenge`. + /// Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. pub include: Option } @@ -65,7 +65,7 @@ pub struct ListTlsSubsParams { pub filter_tls_domains_id: Option, /// Limit the returned subscriptions to those that have currently active orders. Permitted values: `true`. pub filter_has_active_order: Option, - /// Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations` and `tls_authorizations.globalsign_email_challenge`. + /// Include related objects. Optional, comma-separated values. Permitted values: `tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. pub include: Option, /// Current page. pub page_number: Option, diff --git a/src/models/backend.rs b/src/models/backend.rs index 9abee27..d8aee33 100644 --- a/src/models/backend.rs +++ b/src/models/backend.rs @@ -67,6 +67,9 @@ pub struct Backend { /// Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")] pub request_condition: Option, + /// Value that when shared across backends will enable those backends to share the same health check. + #[serde(rename = "share_key", skip_serializing_if = "Option::is_none")] + pub share_key: Option, /// Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). #[serde(rename = "shield", skip_serializing_if = "Option::is_none")] pub shield: Option, @@ -124,6 +127,7 @@ impl Backend { override_host: None, port: None, request_condition: None, + share_key: None, shield: None, ssl_ca_cert: None, ssl_cert_hostname: None, diff --git a/src/models/backend_response.rs b/src/models/backend_response.rs index e1b1b0a..b330908 100644 --- a/src/models/backend_response.rs +++ b/src/models/backend_response.rs @@ -67,6 +67,9 @@ pub struct BackendResponse { /// Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests. #[serde(rename = "request_condition", skip_serializing_if = "Option::is_none")] pub request_condition: Option, + /// Value that when shared across backends will enable those backends to share the same health check. + #[serde(rename = "share_key", skip_serializing_if = "Option::is_none")] + pub share_key: Option, /// Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding). #[serde(rename = "shield", skip_serializing_if = "Option::is_none")] pub shield: Option, @@ -140,6 +143,7 @@ impl BackendResponse { override_host: None, port: None, request_condition: None, + share_key: None, shield: None, ssl_ca_cert: None, ssl_cert_hostname: None, diff --git a/src/models/logging_newrelicotlp_additional.rs b/src/models/logging_newrelicotlp_additional.rs new file mode 100644 index 0000000..3c5cbee --- /dev/null +++ b/src/models/logging_newrelicotlp_additional.rs @@ -0,0 +1,52 @@ +/* + * Fastly API + * + * 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://developer.fastly.com/reference/api/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct LoggingNewrelicotlpAdditional { + /// A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). + #[serde(rename = "format", skip_serializing_if = "Option::is_none")] + pub format: Option, + /// The Insert API key from the Account page of your New Relic account. Required. + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, + /// The region to which to stream logs. + #[serde(rename = "region", skip_serializing_if = "Option::is_none")] + pub region: Option, + /// (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl LoggingNewrelicotlpAdditional { + pub fn new() -> LoggingNewrelicotlpAdditional { + LoggingNewrelicotlpAdditional { + format: None, + token: None, + region: None, + url: None, + } + } +} + +/// The region to which to stream logs. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Region { + #[serde(rename = "US")] + US, + #[serde(rename = "EU")] + EU, +} + +impl Default for Region { + fn default() -> Region { + Self::US + } +} + diff --git a/src/models/logging_newrelicotlp_response.rs b/src/models/logging_newrelicotlp_response.rs new file mode 100644 index 0000000..0713ff8 --- /dev/null +++ b/src/models/logging_newrelicotlp_response.rs @@ -0,0 +1,116 @@ +/* + * Fastly API + * + * 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://developer.fastly.com/reference/api/) + * + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct LoggingNewrelicotlpResponse { + /// The name for the real-time logging configuration. + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// 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`. + #[serde(rename = "placement", skip_serializing_if = "Option::is_none")] + pub placement: Option, + /// The name of an existing condition in the configured endpoint, or leave blank to always execute. + #[serde(rename = "response_condition", skip_serializing_if = "Option::is_none")] + pub response_condition: Option, + /// A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). + #[serde(rename = "format", skip_serializing_if = "Option::is_none")] + pub format: Option, + /// 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`. + #[serde(rename = "format_version", skip_serializing_if = "Option::is_none")] + pub format_version: Option, + /// The Insert API key from the Account page of your New Relic account. Required. + #[serde(rename = "token", skip_serializing_if = "Option::is_none")] + pub token: Option, + /// The region to which to stream logs. + #[serde(rename = "region", skip_serializing_if = "Option::is_none")] + pub region: Option, + /// (Optional) URL of the New Relic Trace Observer, if you are using New Relic Infinite Tracing. + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + /// Date and time in ISO 8601 format. + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + /// Date and time in ISO 8601 format. + #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")] + pub deleted_at: Option, + /// Date and time in ISO 8601 format. + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "service_id", skip_serializing_if = "Option::is_none")] + pub service_id: Option>, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option>, +} + +impl LoggingNewrelicotlpResponse { + pub fn new() -> LoggingNewrelicotlpResponse { + LoggingNewrelicotlpResponse { + name: None, + placement: None, + response_condition: None, + format: None, + format_version: None, + token: None, + region: None, + url: None, + created_at: None, + deleted_at: None, + updated_at: None, + service_id: None, + version: None, + } + } +} + +/// 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`. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Placement { + #[serde(rename = "none")] + None, + #[serde(rename = "waf_debug")] + WafDebug, + #[serde(rename = "null")] + Null, +} + +impl Default for Placement { + fn default() -> Placement { + Self::None + } +} +/// 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`. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum FormatVersion { + #[serde(rename = "1")] + V1, + #[serde(rename = "2")] + V2, +} + +impl Default for FormatVersion { + fn default() -> FormatVersion { + Self::V1 + } +} +/// The region to which to stream logs. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Region { + #[serde(rename = "US")] + US, + #[serde(rename = "EU")] + EU, +} + +impl Default for Region { + fn default() -> Region { + Self::US + } +} + diff --git a/src/models/mod.rs b/src/models/mod.rs index 0b16875..a60fea7 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -416,6 +416,10 @@ pub mod logging_newrelic_additional; pub use self::logging_newrelic_additional::LoggingNewrelicAdditional; pub mod logging_newrelic_response; pub use self::logging_newrelic_response::LoggingNewrelicResponse; +pub mod logging_newrelicotlp_additional; +pub use self::logging_newrelicotlp_additional::LoggingNewrelicotlpAdditional; +pub mod logging_newrelicotlp_response; +pub use self::logging_newrelicotlp_response::LoggingNewrelicotlpResponse; pub mod logging_openstack_additional; pub use self::logging_openstack_additional::LoggingOpenstackAdditional; pub mod logging_openstack_response; diff --git a/src/models/rate_limiter.rs b/src/models/rate_limiter.rs index 267cae9..7c82bd1 100644 --- a/src/models/rate_limiter.rs +++ b/src/models/rate_limiter.rs @@ -166,6 +166,8 @@ pub enum LoggerType { Logshuttle, #[serde(rename = "newrelic")] Newrelic, + #[serde(rename = "newrelicotlp")] + Newrelicotlp, #[serde(rename = "openstack")] Openstack, #[serde(rename = "papertrail")] diff --git a/src/models/rate_limiter_response.rs b/src/models/rate_limiter_response.rs index 4d5d05b..2ebb1ca 100644 --- a/src/models/rate_limiter_response.rs +++ b/src/models/rate_limiter_response.rs @@ -188,6 +188,8 @@ pub enum LoggerType { Logshuttle, #[serde(rename = "newrelic")] Newrelic, + #[serde(rename = "newrelicotlp")] + Newrelicotlp, #[serde(rename = "openstack")] Openstack, #[serde(rename = "papertrail")]