跳转到内容
AsterDrive Developer Docs开发者

execute_draft_storage_policy_action

POST
/api/v1/admin/policies/action
curl --request POST \
--url https://example.com/api/v1/admin/policies/action \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "action_id": "example", "connection": { "behavior": { "storage_native_media_metadata_enabled": true, "storage_native_media_metadata_extensions": [ "example" ], "storage_native_thumbnail_enabled": true, "storage_native_thumbnail_extensions": [ "example" ] }, "connector_config": { "connector_id": "example", "format_version": 1, "schema_version": 1, "values": { "additionalProperty": true } }, "credential": { "mode": "none" } }, "policy_id": 1, "values": { "additionalProperty": true } }'
Media typeapplication/json
object
action_id
required

Stable action identity owned by one connector.

The descriptor carries the action’s fields and execution contract. This newtype only prevents action IDs from being mixed with connector IDs and arbitrary field names while crossing registry, API, and audit boundaries.

string
connection
required
object
behavior
required

Core-owned, per-policy storage-native processing preferences.

These switches only add provider-native candidates ahead of the global media-processing registry. Disabling them does not disable thumbnail or metadata processing for files on the policy; it makes those files continue through the ordinary global processor chain. Extension vectors are retained as dormant configuration while their corresponding switch is off.

object
storage_native_media_metadata_enabled

Prefer the storage provider’s native media-metadata implementation for matching files. false leaves the global metadata processors enabled.

boolean
storage_native_media_metadata_extensions

File extensions eligible for provider-native media metadata. An empty list matches no files even when enabled. Retained as dormant configuration while the corresponding switch is false.

Array<string>
storage_native_thumbnail_enabled

Prefer the storage provider’s native thumbnail implementation for matching files. false leaves the global thumbnail processors enabled.

boolean
storage_native_thumbnail_extensions

File extensions eligible for provider-native thumbnails. An empty list matches no files even when enabled. Retained as dormant configuration while storage_native_thumbnail_enabled is false.

Array<string>
connector_config
required

Persisted configuration for exactly one connector.

A storage policy currently has one active connector, so a map of historical namespaces would only create ambiguous ownership. If the connector is temporarily unavailable, this entire envelope is preserved byte-for-byte.

object
connector_id
required

Stable connector/plugin identifier.

Built-in connectors use reverse-DNS-style identifiers such as asterdrive.storage.local. Dynamically loaded plugins use the same type and registry path, so core code never needs a built-in connector enum.

string
format_version
required
integer format: int32
schema_version
required
integer format: int32
values
required
object
key
additional properties
One of:
boolean
credential
required
One of:
object
mode
required
string
Allowed values: none
policy_id
integer | null format: int64
values
object
key
additional properties
One of:
boolean

Storage policy action executed

Media typeapplication/json

统一 API 响应格式

成功: { "code": "success", "msg": "", "data": {...} } 失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }

object
code
required
string
Allowed values: success bad_request not_found internal_server_error database.error config.error endpoint.not_found rate_limited operation.resource_limit_exceeded mail.not_configured mail.delivery_failed conflict config.public_site_url_required config.public_site_url_invalid auth.failed auth.token_expired auth.token_invalid forbidden auth.pending_activation auth.contact_verification_invalid auth.contact_verification_expired auth.token_missing auth.credentials_failed auth.mfa_failed auth.refresh_token_stale auth.refresh_token_reuse_detected file.not_found file.too_large file.type_not_allowed file.upload_failed upload.session_not_found upload.session_expired upload.chunk_failed upload.assembly_failed thumbnail.failed resource.locked precondition_failed upload.assembling storage.policy_not_found storage.driver_error storage.quota_exceeded storage.unsupported_driver storage.auth_failed storage.permission_denied storage.misconfigured storage.object_not_found storage.rate_limited storage.transient_failure storage.precondition_failed storage.operation_unsupported folder.not_found share.not_found share.expired share.password_required share.download_limit_reached archive_preview.disabled archive_preview.user_disabled archive_preview.share_disabled archive_preview.source_too_large archive_preview.invalid_archive archive_preview.manifest_too_large archive_preview.unsupported_type archive_preview.rejected archive_preview.source_size_mismatch archive_compress.disabled archive_download.user_disabled archive_download.share_disabled auth.username_exists auth.email_exists auth.identifier_exists auth.admin_required auth.account_disabled auth.request_source_untrusted auth.request_origin_untrusted auth.request_referer_untrusted auth.request_source_missing auth.session_user_mismatch auth.csrf_cookie_missing auth.csrf_header_missing auth.csrf_token_invalid auth.passkey_login_disabled auth.registration_disabled auth.email_blocked auth.email_not_allowlisted auth.mfa_flow_invalid auth.mfa_flow_expired auth.mfa_code_invalid auth.mfa_attempts_exceeded auth.mfa_factor_required auth.mfa_factor_already_exists auth.mfa_recovery_code_used auth.mfa_email_code_required auth.mfa_email_code_expired auth.invitation_invalid auth.invitation_expired auth.invitation_revoked auth.invitation_accepted auth.password_change_required avatar.file_required avatar.upload_read_failed avatar.processor_unavailable avatar.empty_image avatar.render_failed avatar.output_invalid file.name_conflict file.etag_mismatch file.modified_during_write folder.name_conflict lock.not_owner share.scope_denied managed_ingress.binding_mismatch managed_ingress.default_delete_requires_replacement managed_ingress.default_error managed_ingress.default_missing managed_ingress.default_not_applied managed_ingress.default_update_requires_replacement managed_ingress.driver_unsupported managed_ingress.local_path_invalid managed_ingress.required managed_ingress.single_primary_required remote_storage_target.not_found master_binding.disabled passkey.name_invalid passkey.name_too_long passkey.not_discoverable team.not_member team.owner_required team.admin_or_owner_required policy.upload_sessions_exist policy.storage_access_key_required policy.storage_secret_key_required policy.storage_bucket_required policy.storage_endpoint_invalid policy.remote_node_required policy.remote_node_unexpected policy.remote_storage_target_required policy.remote_node_disabled policy.remote_node_base_url_required policy.remote_node_transfer_strategy_unsupported policy.onedrive_options_unsupported policy.sftp_options_unsupported policy.onedrive_account_mode_required policy.onedrive_personal_china_cloud_unsupported policy.onedrive_sharepoint_site_required policy.onedrive_group_required policy.native_thumbnail_unsupported policy.native_media_metadata_unsupported policy.action_unsupported policy.action_parameter_required policy.action_parameter_invalid policy.promotion_source_unsupported policy.promotion_source_config_unsupported policy.promotion_target_unsupported workspace.scope_denied external_auth.provider_disabled external_auth.policy_denied external_auth.callback_redirect_uri_required offline_download.aria2_rpc_auth_failed offline_download.aria2_rpc_probe_failed remote_node.disabled remote_node.enrollment_required remote_node.unique_conflict storage.auth storage.not_found storage.permission storage.precondition storage.transient storage.unsupported storage.unknown task.lease_lost task.lease_renewal_timed_out task.worker_shutdown_requested task.retry_status_conflict task.retry_not_allowed team.member_exists thumbnail.format_guess_failed thumbnail.decode_failed thumbnail.encode_failed thumbnail.source_open_failed thumbnail.source_stream_failed thumbnail.task_panicked thumbnail.source_too_large thumbnail.processor_unavailable thumbnail.render_failed thumbnail.output_invalid thumbnail.source_temp_create_failed thumbnail.source_temp_flush_failed thumbnail.source_temp_copy_failed wopi.public_site_url_required wopi.app_disabled wopi.request_origin_untrusted wopi.request_referer_untrusted upload.temp_dir_create_failed upload.temp_file_create_failed upload.temp_file_write_failed upload.temp_file_flush_failed upload.request_body_read_failed upload.request_body_size_overflow upload.request_size_mismatch upload.hash_temp_open_failed upload.hash_temp_read_failed upload.field_read_failed upload.local_staging_path_resolve_failed upload.local_staging_dir_create_failed upload.local_staging_file_create_failed upload.local_staging_write_failed upload.local_staging_flush_failed upload.direct_relay_write_failed upload.direct_relay_shutdown_failed upload.direct_relay_task_failed upload.body_size_overflow upload.declared_size_invalid upload.empty_file upload.chunk_persist_failed upload.chunk_relay_failed upload.chunk_pending upload.chunk_transport_mismatch upload.chunk_session_invalid upload.chunk_number_out_of_range upload.chunk_size_mismatch upload.chunk_too_large upload.chunk_size_overflow upload.status_conflict upload.completed_file_missing upload.previous_failure upload.parts_required upload.incomplete_chunks upload.incomplete_parts upload.missing_part upload.temp_object_missing upload.temp_object_size_mismatch upload.final_object_size_mismatch upload.session_corrupted upload.part_numbers_empty upload.part_numbers_too_many upload.part_number_out_of_range upload.assembly_io_failed upload.assembly_size_overflow webdav.username_exists wopi.max_expected_size_exceeded validation.request_origin_invalid validation.request_referer_invalid validation.request_host_invalid validation.request_scheme_invalid validation.request_header_value_invalid validation.system_already_initialized validation.system_not_initialized search.query_empty search.type_invalid search.tag_match_invalid search.size_range_invalid search.file_filter_type_conflict search.mime_type_empty search.category_invalid search.extensions_invalid search.tag_ids_invalid search.date_invalid search.date_range_invalid internal_storage.range_length_invalid internal_storage.range_empty_object internal_storage.range_offset_out_of_bounds internal_storage.range_header_invalid internal_storage.range_multiple_unsupported internal_storage.range_bounds_invalid internal_storage.content_length_required internal_storage.content_length_invalid internal_storage.compose_parts_required internal_storage.compose_expected_size_invalid
data
object
action_id
required

Stable action identity owned by one connector.

The descriptor carries the action’s fields and execution contract. This newtype only prevents action IDs from being mixed with connector IDs and arbitrary field names while crossing registry, API, and audit boundaries.

string
diagnostic
One of:
null
ok
required
boolean
output
One of:
null
error
One of:
null
msg
required
string
Example
{
"code": "success",
"data": {
"diagnostic": {
"api_code": "success"
}
}
}

Action rejected

Unauthorized

Forbidden