All Products
Search
Document Center

Platform For AI:How do I preview OSS objects in Designer?

Last Updated:Oct 26, 2023

To preview CSV and JSON objects stored in an Object Storage Service (OSS) bucket in Machine Learning Designer, you must enable cross-origin resource sharing (CORS) for the bucket. This topic describes how to enable CORS for an OSS bucket.

Prerequisites

You are granted permissions to access the OSS bucket that stores the objects to be previewed. For more information, see Grant the permissions that are required to use Machine Learning Designer.

Procedure

  1. Go to the details page of a bucket.

    1. Log on to the OSS console.

    2. In the left-side navigation pane, click Buckets.

    3. On the Buckets page, find the OSS bucket that you want to manage and click the bucket name.

  2. On the details page of the bucket, choose Content Security > Cross-Origin Resource Sharing (CORS).

  3. On the Cross-Origin Resource Sharing (CORS) page, click Create Rule. In the Create Rule panel, configure the parameters described in the following table.

    Parameter

    Required

    Description

    Sources

    Yes

    The sources of cross-region requests that you want to allow. Use the following addresses for this parameter:

    https://*.console.aliyun.com
    http://*.console.aliyun.com

    Allowed Methods

    Yes

    The methods that cross-region requests are allowed to use. Select the following methods:

    PUT
    GET
    POST
    HEAD

    Allowed Headers

    Yes

    The response headers for the allowed cross-region requests. Use the following headers for this parameter:

    authorization
    content-md5
    content-type
    x-oss-date
    x-oss-security-token
    x-oss-user-agent
    range

    Exposed Headers

    Yes

    The response headers that are exposed to your applications. Use the following headers for this parameter:

    etag
    x-oss-request-id

    Cache Timeout (Seconds)

    No

    The timeout period of the response that is cached by the browser for an OPTIONS preflight request destined for specific resources.

    Vary: Origin

    No

    Specifies whether to return the Vary: Origin header.

    If both CORS and non-CORS requests are sent to OSS, or if the Origin header has multiple possible values, we recommend that you select the Vary: Origin header to prevent errors in the local cache.

    Important

    If Vary: Origin is selected, visits over the browser or the CDN back-to-origin requests may increase.

  4. Click OK.