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
Log on to the Mobi platform and go to the console.
In the navigation pane, choose Resources > Integration. Then, click Create Integration.
Select Alibaba Cloud OSS and enter a name and description for the integration.
Configure the Alibaba Cloud OSS integration details for different environments. This includes the
Region,Bucket Name, andAccessKey.Click OK to create the Alibaba Cloud OSS integration.
Step 2: Create an integration operation within an application
Open the Code panel. Click the + icon in the relevant scope and select Integration Operation.
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.
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?.
Region: The region where the Alibaba Cloud OSS bucket stores data. For more information about bucket regions, see Bucket regions.
Bucket Name: The name of the Alibaba Cloud OSS bucket. For more information about bucket names, see Bucket naming conventions.
AccessKey: The AccessKey pair used to make OpenAPI requests. For more information about AccessKey pairs, see Create an AccessKey pair.
Role ARN: The Alibaba Cloud Resource Name (ARN) of the target RAM role. This parameter is required for multipart uploads. For more information about how to create a role, see Create a RAM role for a trusted Alibaba Cloud account. For more information about how to view a role ARN, see View the information about a RAM role.
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).ImportantTo use the
Get multipart upload credentialoperation, you must specify theRole ARNparameter 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).ImportantForm 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 credentialandGet form upload credentialOSS integration operations with an upload widget to upload files to Alibaba Cloud OSS.ImportantWhen you use the file upload feature, ensure that your bucket allows cross-domain sources. If you use multipart upload, set
Etagin 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
In the widget that you want to trigger the integration operation, configure an event handler.
Set the action type to Integration Operation and select the corresponding integration.
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.