aws:executeAwsApi— 調用和運行 AWS API操作 - AWS Systems Manager

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

aws:executeAwsApi— 調用和運行 AWS API操作

調用和運行 AWS API操作。雖然並非所有API操作都經過測試,但大多數API操作都受到支持。不支援串流API作GetObject業,例如作業。如果您不確定要使用的API作業是否為串流作業,請檢閱該服務的 Boto3 文件,以判斷是否API需要串流輸入或輸出。我們會定期更新此動作所使用的 Boto3 版本。但在新的 Boto3 版本發布之後,可能需要長達幾週的時間才能在此動作中反映出相關更改。每個 aws:executeAwsApi 動作最多可執行 25 秒。如需有關如何使用此動作的更多範例,請參閱 其他執行手冊範例

輸入

輸入由您選擇的API作業定義。

YAML
action: aws:executeAwsApi inputs: Service: The official namespace of the service Api: The API operation or method name API operation inputs or parameters: A value outputs: # These are user-specified outputs - Name: The name for a user-specified output key Selector: A response object specified by using jsonpath format Type: The data type
JSON
{ "action":"aws:executeAwsApi", "inputs":{ "Service":"The official namespace of the service", "Api":"The API operation or method name", "API operation inputs or parameters":"A value" }, "outputs":[ These are user-specified outputs { "Name":"The name for a user-specified output key", "Selector":"A response object specified by using JSONPath format", "Type":"The data type" } ] }
服務

包含您要執行之API作業的 AWS 服務 命名空間。您可以在的可用服務中檢視支援的 AWS 服務 命名空間清單。 AWS SDK for Python (Boto3)您可以在 Client (用戶端) 區段中找到此命名空間。例如,Systems Manager 的命名空間為 ssm。Amazon 彈性計算雲(AmazonEC2)的命名空間是ec2

類型:字串

必要:是

Api

您要執行之API作業的名稱。您可以在下列「服務參照」頁面的左側導覽中選擇服務,來檢視API作業 (也稱為方法)。在您想要呼叫之服務的 Client (用戶端) 部分選擇一個方法。例如,Amazon 關係數據庫服務(Amazon)的所有API操作(方法RDS)都列在以下頁面上:亞馬遜RDS方法

類型:字串

必要:是

API操作輸入

一個或多個API操作輸入。您可以檢視可用的輸入 (也稱為參數),方式是在以下服務參考頁面的左側導覽中選擇一項服務。在您想要呼叫之服務的 Client (用戶端) 部分選擇一個方法。例如,Amazon 的所有方法RDS都列在以下頁面上:Amazon RDS 方法選擇 describe_db_instance 方法,然後向下捲動以查看可用的參數,例如 DBInstanceIdentifier「名稱」和「值」。

YAML
inputs: Service: The official namespace of the service Api: The API operation name API input 1: A value API Input 2: A value API Input 3: A value
JSON
"inputs":{ "Service":"The official namespace of the service", "Api":"The API operation name", "API input 1":"A value", "API Input 2":"A value", "API Input 3":"A value" }

類型:由選擇的API操作決定

必要:是

輸出

輸出由用戶根據所選API操作的響應指定。

名稱

輸出的名稱。

類型:字串

必要:是

選擇器

響應對象中的特定屬性。JSONPath您可以檢視回應物件,方式是在以下服務參考頁面的左側導覽中選擇一項服務。在您想要呼叫之服務的 Client (用戶端) 部分選擇一個方法。例如,Amazon 的所有方法RDS都列在以下頁面上:Amazon RDS 方法。選擇 describe_db_instances 方法並向下捲動至 Response Structure (回應結構) 區段。DBInstances被列為響應對象。

類型:整數、布林值、字串 StringList、 StringMap、或 MapList

必要:是

Type

回應元素的資料類型。

類型:Varies

必要:是