execute_saved_storage_policy_action
const url = 'https://example.com/api/v1/admin/policies/1/action';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"action_id":"example","values":{"additionalProperty":true}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/admin/policies/1/action";
let payload = json!({ "action_id": "example", "values": json!({"additionalProperty": true}) });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://example.com/api/v1/admin/policies/1/action \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "action_id": "example", "values": { "additionalProperty": true } }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Policy ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
Examplegenerated
{ "action_id": "example", "values": { "additionalProperty": true }}Responses
Section titled “Responses”Storage policy action executed
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
object
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.
Example
{ "code": "success", "data": { "diagnostic": { "api_code": "success" } }}Action rejected
Unauthorized
Forbidden
Policy not found