Integrate with Alibaba Cloud OSS

更新时间:
复制 MD 格式

The Mobi platform provides powerful integration with Alibaba Cloud Object Storage Service (OSS). This feature lets you seamlessly connect to and interact with data in Alibaba Cloud OSS using a simple configuration. This document describes how to create and use an Alibaba Cloud OSS integration.

Features

The Alibaba Cloud OSS integration on the Mobi platform supports the following features:

  • Custom trigger methods: Set integration operations to run manually or automatically to meet various business needs.

  • Callbacks and data transformation: Run specific integration operation events when a query succeeds or fails. You can also customize how the returned data is processed.

  • Advanced settings: Use debounce and disable execution conditions to optimize the performance of integration operations.

For more information about events, see Integration operation events.

Use the Alibaba Cloud OSS integration

Step 1: Create an Alibaba Cloud OSS integration

  1. Log on to the Mobi platform and go to the console.

  2. In the navigation pane, choose Resources > Integration. Then, click Create Integration.

  3. Select Alibaba Cloud OSS and enter a name and description for the integration.

  4. Configure the Alibaba Cloud OSS integration details for different environments. This includes the Region, Bucket Name, and AccessKey.

  5. Click OK to create the Alibaba Cloud OSS integration.

Step 2: Create an integration operation within an application

  1. Open the Code panel. Click the + icon in the relevant scope and select Integration Operation.

  2. Select the Alibaba Cloud OSS integration that you created as the resource. Select an operation type to view all its parameters. Configure the parameters and click Run to view the returned result.

  3. Click Run to preview the query result.

Configuration panel details

Integration configuration

For more information about Alibaba Cloud OSS, see What is Object Storage Service?.

General configurations

  • Get multipart upload credential: If the operation type is Get multipart upload credential, specify the upload folder and access permissions. If you leave the folder empty, the root directory is used by default. If you leave the access permissions empty, the access permissions of the integration bucket are used by default. We recommend that you use multipart upload for large files (larger than 5 GB).

    Important

    To use the Get multipart upload credential operation, you must specify the Role ARN parameter in the integration configuration. Note the folder naming format. Do not start the name with a forward slash/ or a backslash\. Also, do not use consecutive forward slashes/. For more information, see Manage folders.

  • Get form upload credential: If the operation type is Get form upload credential, specify the upload folder and access permissions. If you leave the folder empty, the root directory is used by default. If you leave the access permissions empty, the access permissions of the integration bucket are used by default. We recommend that you use form upload for small files (no larger than 5 GB).

    Important

    Form upload does not support files larger than 5 GB.

  • Get file URL: If the operation type is Get file URL, specify the full path of the file. The full path does not include the bucket name. If the file's access permission is private, a signed URL is returned based on the time-to-live (TTL) parameter. If the TTL is not set, the default value of 300 seconds is used. Otherwise, the public URL of the file is returned. For more information about file permissions, see Object ACL.

  • Note

    You can use the Get multipart upload credential and Get form upload credential OSS integration operations with an upload widget to upload files to Alibaba Cloud OSS.

    Important

    When you use the file upload feature, ensure that your bucket allows cross-domain sources. If you use multipart upload, set Etag in the exposed headers. For more information about cross-domain settings, see Configure cross-origin resource sharing (CORS).

Callback configuration

  • Data transformation: Processes the data returned by the API. The default value is return data, which means the data is returned without any processing.

  • Success callback: Configures the event that is triggered when the API call succeeds.

  • Failure callback: Configures the event that is triggered when the API call fails.

Advanced configuration

  • Debounce: Set a debounce expression to prevent frequent API calls.

  • Disable execution condition: Determines whether to run this integration operation based on a conditional expression.

Manually trigger the integration

Event trigger

  1. In the widget that you want to trigger the integration operation, configure an event handler.

  2. Set the action type to Integration Operation and select the corresponding integration.

  3. Enter the required parameters as an object.

API trigger

If the name of the integration operation is action1, you can use the action1.trigger() method to trigger it anywhere you can run a script. If the integration operation requires parameters, you must pass them as an object.