All Products
Search
Document Center

CloudOps Orchestration Service:ACS::FC::ExecuteScript

Last Updated:Oct 09, 2024

Description

Runs a Python script.

Syntax

Action: ACS::FC::ExecuteScript
Properties:
 runtime: String
 handler: String
 inputPayload: Json
 script: String
 role: String

Attributes

Attribute

Description

Type

Required

Default value

Limit

runtime

The runtime environment of the function.

String

No

python3.10

handler

The name of the function.

String

No

index.handler

inputPayload

The input parameter.

Json

No

""

script

The code of the Python script.

String

No

import datetime
import os
import sys
def _now(format="%Y-%m-%d %H:%M:%S"):
return datetime.datetime.now().strftime(format)
def job_start():
return ("[%s][%s] job_start" % (_now(), os.getpid()))
def handler(event, context):
return job_start()

role

The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role that is used to grant required permissions to Function Compute.

String

No

""

Output

Output item

Description

Type

Result

String

References

For more information, see ACS::FC::ExecuteScript.yml at GitHub.