vserver object-store-server bucket cors-rule create
Create a Cross-Origin rule
Availability: This command is available to cluster and Vserver administrators at the admin privilege level.
Description
The vserver object-store-server bucket cors-rule create
command creates a cross-origin resource sharing (CORS) rule for the object store server bucket.
Parameters
-vserver <Vserver Name>
- Vserver Name-
This parameter specifies the name of the Vserver hosting the object store server bucket for which the CORS rule will to be created.
-bucket <TextNoCase>
- Object Store Server Bucket Name-
This parameter specifies the name of the object store server bucket for which the CORS rule will to be created.
[-index <integer>]
- Cross-Origin Access Rule Index-
This parameter specifies the index of the object store server bucket CORS rule. This is an optional parameter. Its value is calculated automatically by the system, if not specified.
[-rule-id <text>]
- Cross-Origin Access Rule ID-
This parameter specifies the ID of the object store server bucket CORS rule.
-allowed-origins <text>,…
- List of the Origins Allowed for Cross-Origin Requests-
This parameter specifies a list of origins from where a cross-origin request is allowed to originate from for the object store bucket.
-allowed-methods <text>,…
- List of HTTP Request Methods Allowed in Cross-Origin Requests-
This parameter specifies a list of HTTP methods allowed in the cross-origin requests.
[-allowed-headers <text>,…]
- List of the Headers Allowed in Cross-Origin Requests-
This parameter specifies a list of HTTP headers allowed in the cross-origin requests.
[-expose-headers <text>,…]
- Headers that Servers Allow Clients to Access-
This parameter specifies a list of extra headers sent in the response that customers can access from their applications.
[-max-age-in-seconds <integer>]
- How Long ( in Seconds ) the Results of a Cross-Origin Pre-Flight Request Can Be Cached?-
This optional parameter specifies the time in seconds for your browser to cache the pre-flight response for the specified resource.
Examples
The following example creates an object store server bucket CORS rule for Vserver vs1 and bucket bb1.
cluster1::> vserver object-store-server bucket cors-rule create -vserver vs1 -bucket bb1 -allowed-origins example.com -allowed-methods POST,DELETE -allowed-headers x-amz-request-id -max-age-in-seconds 2000 -expose-headers x-purpose -rule-id rule1