ApplyDataFlowAutoRefresh

更新时间:
复制 MD 格式

Configures automatic updates for a specified data flow.

Operation description

  • This operation applies only to Cloud Parallel File Storage (CPFS) file systems.

  • Only CPFS 2.2.0 and later support data flows. You can view the version information on the file system details page in the console.

  • You can add auto-refresh configurations only for data flows in the Running state.

  • You can add up to five auto-refresh configurations for a data flow.

  • It takes 2 to 5 minutes to create an auto-refresh configuration. You can call DescribeDataFlows to query the data flow status.

  • Auto-refresh relies on EventBridge to collect object modification events from the source OSS storage. Activate EventBridge before you proceed.

    Note

    The event buses and event rules that CPFS creates in EventBridge contain the description Create for cpfs auto refresh. Do not modify or delete these event buses or event rules. Otherwise, auto-refresh cannot work properly.

  • Auto-refresh targets a prefix specified by the RefreshPath parameter. When you configure auto-refresh for a prefix in a CPFS data flow, an event bus is created on the user side, and an event rule is created for the prefix of the source OSS bucket. When objects within the prefix of the source OSS bucket are modified, OSS events are generated in EventBridge and processed by the CPFS data flow.

  • After you configure auto-refresh (AutoRefresh), when data changes in the source storage, the changed metadata is automatically synchronized to the CPFS file system. The changed data is loaded on demand when a user accesses the file, or loaded by starting a data flow node to load data.

  • The auto-refresh interval (AutoRefreshInterval) specifies the interval at which CPFS checks whether data updates exist in the prefix of the source OSS bucket. If data updates exist, an auto-refresh node is started. When the frequency of object modification events in the source OSS bucket exceeds the processing capacity of the CPFS data flow, automatic synchronization nodes accumulate, metadata updates are delayed, and the data stream status changes to Misconfigured. To resolve this issue, upgrade the data stream specifications or reduce the modification frequency in OSS.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nas:ApplyDataFlowAutoRefresh

update

*DataFlow

acs:nas:{#regionId}:{#accountId}:filesystem/{#fileSystemId}

None None

Request parameters

Parameter

Type

Required

Description

Example

FileSystemId

string

Yes

The ID of the file system.

cpfs-099394bd928c****

DataFlowId

string

Yes

The ID of the data flow.

df-194433a5be31****

AutoRefreshs

array<object>

Yes

The collection of auto-refresh configurations.

object

No

RefreshPath

string

Yes

The auto-refresh directory. CPFS automatically checks whether data in this directory on the source has been updated and imports the updated data.

Limits:

  • The path must be 2 to 1,024 characters in length.

  • The path must be encoded in UTF-8.

  • The path must start and end with a forward slash (/).

Note

The directory must already exist in CPFS and must be in a fileset that has data flow enabled.

/prefix1/prefix2/

AutoRefreshPolicy

string

No

The auto-refresh policy. This policy determines how data updates from the source are imported to CPFS. Valid values:

  • None: Data updates from the source are not automatically imported to CPFS. You can use a data flow task to import data updates from the source.

  • ImportChanged: Data updates from the source are automatically imported to CPFS.

Valid values:

  • ImportChanged :

    data updates from the source are automatically imported to CPFS.

  • None :

    data updates from the source are not automatically imported to CPFS.

None

AutoRefreshInterval

integer

No

The auto-refresh interval. CPFS checks the directory for data updates at this interval. If data updates exist, an auto-refresh task is started. Unit: minutes.

Valid values: 10 to 525600. Default value: 10.

10

DryRun

boolean

No

Specifies whether to perform a dry run for this request.

A dry run checks parameter validity and resource availability without actually creating an instance or incurring charges.

Valid values:

  • true: Sends a dry run request without creating an instance. The check items include required parameters, request format, business limits, and NAS inventory. If the check fails, the corresponding error is returned. If the check succeeds, HTTP status code 200 is returned, but FileSystemId is empty.

  • false (default): Sends a normal request. After the check succeeds, the instance is created.

false

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests.

The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId may differ for each API request.

123e4567-e89b-12d3-a456-42665544****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

98696EF0-1607-4E9D-B01D-F20930B6****

Examples

Success response

JSON format

{
  "RequestId": "98696EF0-1607-4E9D-B01D-F20930B6****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalCharacters The parameter contains illegal characters. The parameter contains illegal characters.
400 MissingFileSystemId FileSystemId is mandatory for this action.
400 MissingDataFlowId DataFlowId is mandatory for this action.
403 OperationDenied.InvalidState The operation is not permitted when the status is processing. The operation is not permitted when the status is processing.
403 InvalidFileSystem.AlreadyExisted The specified file system already exists. The specified file system already exists.
403 OperationDenied.DependencyViolation The operation is denied due to dependancy violation.
403 OperationDenied.NestedDir The operation is denied due to nested directory.
403 OperationDenied.ConflictOperation The operation is denied due to a conflict with an ongoing operation.
403 OperationDenied.DataFlowNotSupported The operation is not supported.
404 InvalidFileSystem.NotFound The specified file system does not exist. The specified file system does not exist.
404 InvalidDataFlow.NotFound The specified data flow does not exist.
404 InvalidRefreshPath.InvalidParameter Refresh path is invalid.
404 InvalidRefreshPath.NotFound Refresh path does not exist.
404 InvalidRefreshPolicy.InvalidParameter Refresh policy is invalid.
404 InvalidRefreshInterval.OutOfBounds Refresh interval is out of bounds.
404 InvalidRefreshPath.AlreadyExist The refresh path already exists.
404 InvalidRefreshPath.TooManyPaths The number of refresh paths exceeds the limit.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.