Documentation Index

Fetch the complete documentation index at: https://kb.vastdata.com/llms.txt

Use this file to discover all available pages before exploring further.

view create-s3cors-configuration

Prev Next

This command creates a CORS configuration for a view that exposes an S3 bucket.

Usage

view create-s3cors-configuration --id ID
                                [--cors-configuration-file FILEPATH|--cors-configuration STRING]

Required Parameters

--id ID

The ID of the view for which the CORS configuration is created.

Options

--cors-configuration-file FILEPATH

This option lets you specify a file path to upload a JSON file that contains CORS rules.

--cors-configuration STRING

Use this option to supply CORS rules in JSON format on the command line.

Example

To upload a CORS configuration from a file:

vcli: admin> view create-s3cors-configuration --id 31 ----cors-configuration-file path/to/configuration_file.json

To create a CORS configuration from the command line:

vcli: admin> view create-s3cors-configuration --id 5 --cors-configuration '{
    "cors_rules": [
        {
            "allowed_origins": ["http://example.com"],
            "allowed_methods": ["GET", "HEAD"],
            "allowed_headers": ["Content-MD5"],
            "expose_headers": ["x-amz-server-side-encryption"],
            "max_age_seconds": 3600
        },
        {
            "allowed_origins": ["*"],
            "allowed_methods": ["DELETE"]
        }
    ]
}'

To create a CORS configuration from the command line in AWS format:

vcli: admin> view create-s3cors-configuration --id 4 --cors-configuration '{
    "aws_cors_rules": [
        {
            "AllowedOrigins": ["https://example.com"],
            "AllowedMethods": ["GET", "PUT"],
            "AllowedHeaders": ["*"],
            "ExposeHeaders": ["ETag", "x-amz-server-side-encryption"],
            "MaxAgeSeconds": 3600
        }
    ]
}'