PUT
/
cdn
/
raw_log_settings
Change raw logs settings
curl --request PUT \
  --url https://api.gcore.com/cdn/raw_log_settings \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "enabled": true,
  "storage_type": "<string>",
  "ignore_empty_logs": true,
  "for_all_resources": true,
  "all_resources_bucket": "<string>",
  "all_resources_folder": "<string>",
  "folders": [
    {
      "id": 123,
      "bucket": "<string>",
      "folder": "<string>",
      "cdn_resource": 123
    }
  ],
  "s3_type": "<string>",
  "s3_aws_region": 123,
  "s3_access_key_id": "<string>",
  "s3_secret_key": "<string>",
  "s3_hostname": "<string>",
  "s3_host_bucket": "<string>",
  "s3_bucket_location": "<string>",
  "ftp_hostname": "<string>",
  "ftp_prepend_folder": "<string>",
  "ftp_login": "<string>",
  "ftp_password": "<string>",
  "sftp_hostname": "<string>",
  "sftp_prepend_folder": "<string>",
  "sftp_login": "<string>",
  "sftp_password": "<string>",
  "sftp_private_key": "<string>",
  "sftp_key_passphrase": "<string>",
  "archive_size_mb": 1250
}'

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Body

application/json
storage_type
string
required

Storage type.

Possible values:

  • ftp
  • sftp
  • s3
for_all_resources
boolean
required

Defines whether logs of all CDN resources are delivered to one folder/bucket or to separate ones.

Possible values:

  • true - Logs of all CDN resources are delivered to one folder/bucket.
  • false - Logs of different CDN resources are delivered to separate folders/buckets.
all_resources_bucket
string
required

Name of the S3 bucket to which logs for all CDN resources are delivered.

all_resources_folder
string
required

Parameter meaning depends on the value of the "storage_type" value:

  • If "storage_type": s3 - Name of the S3 bucket sub-folder to which logs for all CDN resources are delivered.
  • If "storage_type": ftp/sftp - Name of the folder (or path) to which logs for all CDN resources are delivered.
folders
object[]
required

List of folders/buckets for receiving CDN resources logs.

s3_type
string
required

Storage type compatible with S3.

Possible values:

  • amazon – AWS S3 storage.
  • other – Other (not AWS) S3 compatible storage.
s3_access_key_id
string
required

Access key ID for the S3 account.

Access Key ID is 20 alpha-numeric characters like 022QF06E7MXBSH9DHM02

s3_secret_key
string
required

Secret access key for the S3 account.

Secret Access Key is 20-50 alpha-numeric-slash-plus characters like kWcrlUX5JEDGM/LtmEENI/aVmYvHNif5zB+d9+ct

s3_hostname
string
required

S3 storage hostname.

It is required if "s3_type": other.

ftp_hostname
string
required

FTP storage hostname.

ftp_login
string
required

FTP storage login.

ftp_password
string
required

FTP storage password.

sftp_hostname
string
required

SFTP storage hostname.

sftp_login
string
required

SFTP storage login.

sftp_password
string
required

SFTP storage password.

It should be empty if "sftp_private_key" is set.

enabled
boolean

Enables or disables a log forwarding feature.

Possible values:

  • true - log forwarding feature is active.
  • false - log forwarding feature is deactivated.
ignore_empty_logs
boolean

Enables or disables the forwarding of empty logs.

Possible values:

  • true - Empty logs are not sent.
  • false - Empty logs are sent.
s3_aws_region
integer

Amazon AWS region.

s3_host_bucket
string

S3 bucket hostname.

Restrictions:

  • Maximum of 255 symbols.
  • Latin letters (A-Z, a-z,) digits (0-9,) dots, colons, dashes, and underscores.
  • Required if "s3_type": other.
s3_bucket_location
string

Location of S3 storage.

Restrictions:

  • Maximum of 255 symbols.
  • Latin letters (A-Z, a-z), digits (0-9), dots, colons, dashes, and underscores (.:_-).
ftp_prepend_folder
string

Name of the FTP prepend folder for log delivery.

Null is allowed.

sftp_prepend_folder
string

Name of the SFTP prepend folder for log delivery.

Null is allowed.

sftp_private_key
string

Private key for SFTP authorization.

Possible values:

  • RSA
  • ED25519

It should be empty if "sftp_password" is set.

sftp_key_passphrase
string

Passphrase for SFTP private key.

Restrictions:

  • Should be set if private key encoded with passphrase.
  • Should be empty if "sftp_password" is set.
archive_size_mb
integer | null

The size of a single piece of the archive in MB. In case of null value logs are delivered without slicing.

Required range: 500 <= x <= 2000

Response

200

Successful.