Updated on 2025-08-15 GMT+08:00

Connecting MinIO for Object and Asset Storage

MinIO, an object storage API pre-configured in the system, can be directly used and customized. To store object or widget assets, you can connect your applications to MinIO.

Prerequisites

  • You have obtained the access key ID and access key for MinIO.
  • A bucket has been created on MinIO for storing objects.

Creating a MinIO Connector

  1. Log in to the application designer by referring to Logging In to the Application Designer.
  2. In the navigation pane, choose Integrations.
  3. Click Connector Instance under Connector.
  4. In the navigation pane, choose Storage > MINIO.
  5. In the right pane, click + and set the parameters.

    Figure 1 Setting basic information
    Table 1 Parameters for creating a MinIO connector

    Parameter

    Description

    Name

    Name of the new connector. The naming rules are as follows:

    • The value cannot exceed 64 characters, including the prefix namespace.

      To prevent duplicate data names among different tenants in Huawei Cloud Astro Zero, each tenant must define a unique namespace when first creating an application. A tenant can create only one namespace. After being created, the namespace cannot be modified.

    • Start with a letter and can contain only letters, digits, and underscores (_). Do not end with an underscore (_).

    Access Key

    Access key ID of MinIO, which needs to be obtained in advance.

    Secret Key

    Access key of MinIO, which needs to be obtained in advance.

    CDN

    Address of the CDN server. After you configure this parameter, you can access uploaded static resources through CDN without logging in to MinIO.

    Description

    Description of the connector.

    Package Current Configuration

    If this parameter is selected, the connector will be packed together with applications. For example, if an application package is released to the runtime environment, the current configuration is synchronized to the runtime environment by default. If this option is not selected, the connector will not be packaged and released to the runtime environment. In this case, you need to create the corresponding connector by referring to Managing Connectors in Applications.

    This parameter is selected by default. You are advised not to select this option in information-sensitive scenarios.

    Open Operation Log

    If this parameter is selected, operation logs are recorded when users use connectors to upload, download, and view files.

    Check Content Type

    If this parameter is selected, the system checks whether the file content matches the file name extension type. Currently, only .bmp, .gif, .png, .jpg, .ico, .txt, .xml, and .html are supported.

    Bucket

    Set the region and name of the bucket. You can add multiple buckets. Specify File Types and File Size (B).

    • Region: Enter the region where the bucket resides.
    • Bucket Name: name of the bucket to be created.
    • File Types: Multiple file types can be configured. Use commas (,) to separate multiple file types, for example, txt,png. If this parameter is not set, all types are supported.
    • File Size (B): If this parameter is set to 0 or left blank, the size of the file to be uploaded is not limited. The maximum value is 9007199254740991, in bytes.

  6. (Optional) Test whether objects can be stored in the bucket.

    Only objects smaller than 1 MB can be uploaded.
    1. On the connector details page, click in the row containing the bucket.
    2. Upload a file.
      Figure 2 Selecting objects
    3. Click the name of the uploaded file to download it.
    4. Open the downloaded file and check whether it is the same as the file you uploaded.

Calling a Connector Using a Flow

After the MinIO connector is created, it can be called by flows to connect to MinIO. You can also call the connector in a script to connect to MinIO.

  1. Create an empty flow by referring to Creating a Blank Flow.
  2. On the flow design page, choose Connectors > Storage, and drag the minio diagram element to the canvas.

    The minio diagram element is a storage API preset in the system for connecting to MinIO.

    Figure 3 Dragging the minio diagram element to the canvas

  3. Click the diagram element, click , and set basic information.

    Figure 4 Setting basic information
    Table 2 Parameters

    Parameter

    Description

    Label

    Label of the diagram element, which is displayed on pages.

    Name

    Unique ID of the diagram element in the system. The ID cannot be the same as that of other diagram elements. The naming requirements are as follows:

    • Enter up to 80 characters.
    • Start with a letter and can contain only letters, digits, and underscores (_). It cannot end with an underscore (_).

    Description

    Enter the description of the diagram element in the text box.

    Connector

    Select the target connector from the drop-down list, that is, the connector created in Creating a MinIO Connector.

  4. Click and set parameters for calling MinIO.

    Figure 5 Configuring parameters
    Table 3 Action parameters

    Parameter

    Description

    Action

    Action preset by the system for the connector. Select an action based on service requirements.
    • view_object_minio: Check the storage objects.
    • put_object_minio: Store objects in the system to MinIO buckets. This example shows how to store an object.
    • get_endpoint_minio: used to obtain the prefix of the object storage address. The prefix plus the path of the uploaded object is the full path of the accessed object.

    Input Parameters

    Customized parameters set when the connector is defined.
    • If Target is set to object, set the object name in Source.
    • If Target is set to data, configure object data in Source.
    • If Target is set to bucket, configure the bucket in Source. In the connector list, click the connector name to go to the details page and view the bucket information.
    • If Target is set to acl, configure the access control permission for the object file in Source. For example, private, public-read, public-read-write, and default (same as the bucket permission).

    Output Parameters

    Set Source to result and Target to receive the payment result. You must define a structure variable of an empty instance to receive the payment result.

  5. Connect the start diagram element to the minio diagram element.

    Figure 6 Connecting diagram elements

  6. Click the blank area of the flow designer, select , and set the flow output parameters.

    Use the output parameters of the minio diagram element as the output parameters of the entire flow.

    Figure 7 Setting output parameters

  7. Click to save the flow.
  8. Click to activate the flow.
  9. On MinIO, view the list of objects stored in the bucket. You can see that the objects are stored.