|
Download server/providers/aws/lambda_api.md from Vishvam10/cloudenv: direct link, hf CLI and curl.
- Browser
- Download file 12.9 kB
-
https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/server/providers/aws/lambda_api.md
- Command line
-
hf download hf://spaces/Vishvam10/cloudenv/server/providers/aws/lambda_api.md
-
curl -L -o lambda_api.md https://huggingface.co/spaces/Vishvam10/cloudenv/resolve/main/server/providers/aws/lambda_api.md
12.9 kB
| # Lambda Service API | |
| Requests use [`CloudEnvAction`](../../../models.py): `service`, `operation`, and `payload` (boto3 parameters for the operation). | |
| Operations are enforced by IAM as `lambda:<OperationName>` (see adapter). | |
| ## Operations | |
| ### CreateFunction | |
| _Boto3 client method: `create_function`_ | |
| **Other boto3 parameters (optional):** `Architectures, CapacityProviderConfig, CodeSigningConfigArn, DeadLetterConfig, Description, DurableConfig, Environment, EphemeralStorage, FileSystemConfigs, Handler, ImageConfig, KMSKeyArn, Layers, LoggingConfig, MemorySize, PackageType, Publish, PublishTo, Runtime, SnapStart, Tags, TenancyConfig, Timeout, TracingConfig, VpcConfig` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "CreateFunction", | |
| "payload": { | |
| "FunctionName": "example-functionname", | |
| "Role": "example-rolearn", | |
| "Code": {} | |
| } | |
| } | |
| ``` | |
| --- | |
| ### DeleteFunction | |
| _Boto3 client method: `delete_function`_ | |
| **Other boto3 parameters (optional):** `Qualifier` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "DeleteFunction", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### GetFunction | |
| _Boto3 client method: `get_function`_ | |
| **Other boto3 parameters (optional):** `Qualifier` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "GetFunction", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListFunctions | |
| _Boto3 client method: `list_functions`_ | |
| **Other boto3 parameters (optional):** `FunctionVersion, Marker, MasterRegion, MaxItems` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListFunctions", | |
| "payload": {} | |
| } | |
| ``` | |
| --- | |
| ### Invoke | |
| _Boto3 client method: `invoke`_ | |
| **Other boto3 parameters (optional):** `ClientContext, DurableExecutionName, InvocationType, LogType, Payload, Qualifier, TenantId` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "Invoke", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### UpdateFunctionCode | |
| _Boto3 client method: `update_function_code`_ | |
| **Other boto3 parameters (optional):** `Architectures, DryRun, ImageUri, Publish, PublishTo, RevisionId, S3Bucket, S3Key, S3ObjectVersion, SourceKMSKeyArn, ZipFile` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "UpdateFunctionCode", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### UpdateFunctionConfiguration | |
| _Boto3 client method: `update_function_configuration`_ | |
| **Other boto3 parameters (optional):** `CapacityProviderConfig, DeadLetterConfig, Description, DurableConfig, Environment, EphemeralStorage, FileSystemConfigs, Handler, ImageConfig, KMSKeyArn, Layers, LoggingConfig, MemorySize, RevisionId, Role, Runtime, SnapStart, Timeout, TracingConfig, VpcConfig` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "UpdateFunctionConfiguration", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### AddPermission | |
| _Boto3 client method: `add_permission`_ | |
| **Other boto3 parameters (optional):** `EventSourceToken, FunctionUrlAuthType, InvokedViaFunctionUrl, PrincipalOrgID, Qualifier, RevisionId, SourceAccount, SourceArn` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "AddPermission", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname", | |
| "StatementId": "example-statementid", | |
| "Action": "example-action", | |
| "Principal": "example-principal" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### RemovePermission | |
| _Boto3 client method: `remove_permission`_ | |
| **Other boto3 parameters (optional):** `Qualifier, RevisionId` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "RemovePermission", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname", | |
| "StatementId": "example-namespacedstatementid" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListVersionsByFunction | |
| _Boto3 client method: `list_versions_by_function`_ | |
| **Other boto3 parameters (optional):** `Marker, MaxItems` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListVersionsByFunction", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### PublishVersion | |
| _Boto3 client method: `publish_version`_ | |
| **Other boto3 parameters (optional):** `CodeSha256, Description, PublishTo, RevisionId` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "PublishVersion", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### TagResource | |
| _Boto3 client method: `tag_resource`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "TagResource", | |
| "payload": { | |
| "Resource": "example-taggableresource", | |
| "Tags": { | |
| "exampleKey": "example-tagvalue" | |
| } | |
| } | |
| } | |
| ``` | |
| --- | |
| ### UntagResource | |
| _Boto3 client method: `untag_resource`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "UntagResource", | |
| "payload": { | |
| "Resource": "example-taggableresource", | |
| "TagKeys": [ | |
| "example-tagkey" | |
| ] | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListTags | |
| _Boto3 client method: `list_tags`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListTags", | |
| "payload": { | |
| "Resource": "example-taggableresource" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### CreateEventSourceMapping | |
| _Boto3 client method: `create_event_source_mapping`_ | |
| **Other boto3 parameters (optional):** `AmazonManagedKafkaEventSourceConfig, BatchSize, BisectBatchOnFunctionError, DestinationConfig, DocumentDBEventSourceConfig, Enabled, EventSourceArn, FilterCriteria, FunctionResponseTypes, KMSKeyArn, LoggingConfig, MaximumBatchingWindowInSeconds, MaximumRecordAgeInSeconds, MaximumRetryAttempts, MetricsConfig, ParallelizationFactor, ProvisionedPollerConfig, Queues, ScalingConfig, SelfManagedEventSource, SelfManagedKafkaEventSourceConfig, SourceAccessConfigurations, StartingPosition, StartingPositionTimestamp, Tags` (+2 more) | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "CreateEventSourceMapping", | |
| "payload": { | |
| "FunctionName": "example-namespacedfunctionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### DeleteEventSourceMapping | |
| _Boto3 client method: `delete_event_source_mapping`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "DeleteEventSourceMapping", | |
| "payload": { | |
| "UUID": "example-string" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### GetEventSourceMapping | |
| _Boto3 client method: `get_event_source_mapping`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "GetEventSourceMapping", | |
| "payload": { | |
| "UUID": "example-string" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListEventSourceMappings | |
| _Boto3 client method: `list_event_source_mappings`_ | |
| **Other boto3 parameters (optional):** `EventSourceArn, FunctionName, Marker, MaxItems` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListEventSourceMappings", | |
| "payload": {} | |
| } | |
| ``` | |
| --- | |
| ### UpdateEventSourceMapping | |
| _Boto3 client method: `update_event_source_mapping`_ | |
| **Other boto3 parameters (optional):** `AmazonManagedKafkaEventSourceConfig, BatchSize, BisectBatchOnFunctionError, DestinationConfig, DocumentDBEventSourceConfig, Enabled, FilterCriteria, FunctionName, FunctionResponseTypes, KMSKeyArn, LoggingConfig, MaximumBatchingWindowInSeconds, MaximumRecordAgeInSeconds, MaximumRetryAttempts, MetricsConfig, ParallelizationFactor, ProvisionedPollerConfig, ScalingConfig, SelfManagedKafkaEventSourceConfig, SourceAccessConfigurations, TumblingWindowInSeconds` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "UpdateEventSourceMapping", | |
| "payload": { | |
| "UUID": "example-string" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### CreateFunctionUrlConfig | |
| _Boto3 client method: `create_function_url_config`_ | |
| **Other boto3 parameters (optional):** `Cors, InvokeMode, Qualifier` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "CreateFunctionUrlConfig", | |
| "payload": { | |
| "FunctionName": "example-functionname", | |
| "AuthType": "NONE" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### GetFunctionUrlConfig | |
| _Boto3 client method: `get_function_url_config`_ | |
| **Other boto3 parameters (optional):** `Qualifier` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "GetFunctionUrlConfig", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### UpdateFunctionUrlConfig | |
| _Boto3 client method: `update_function_url_config`_ | |
| **Other boto3 parameters (optional):** `AuthType, Cors, InvokeMode, Qualifier` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "UpdateFunctionUrlConfig", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### DeleteFunctionUrlConfig | |
| _Boto3 client method: `delete_function_url_config`_ | |
| **Other boto3 parameters (optional):** `Qualifier` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "DeleteFunctionUrlConfig", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListFunctionUrlConfigs | |
| _Boto3 client method: `list_function_url_configs`_ | |
| **Other boto3 parameters (optional):** `Marker, MaxItems` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListFunctionUrlConfigs", | |
| "payload": { | |
| "FunctionName": "example-functionname" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### PublishLayerVersion | |
| _Boto3 client method: `publish_layer_version`_ | |
| **Other boto3 parameters (optional):** `CompatibleArchitectures, CompatibleRuntimes, Description, LicenseInfo` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "PublishLayerVersion", | |
| "payload": { | |
| "LayerName": "example-layername", | |
| "Content": {} | |
| } | |
| } | |
| ``` | |
| --- | |
| ### GetLayerVersion | |
| _Boto3 client method: `get_layer_version`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "GetLayerVersion", | |
| "payload": { | |
| "LayerName": "example-layername", | |
| "VersionNumber": 0 | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListLayerVersions | |
| _Boto3 client method: `list_layer_versions`_ | |
| **Other boto3 parameters (optional):** `CompatibleArchitecture, CompatibleRuntime, Marker, MaxItems` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListLayerVersions", | |
| "payload": { | |
| "LayerName": "example-layername" | |
| } | |
| } | |
| ``` | |
| --- | |
| ### DeleteLayerVersion | |
| _Boto3 client method: `delete_layer_version`_ | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "DeleteLayerVersion", | |
| "payload": { | |
| "LayerName": "example-layername", | |
| "VersionNumber": 0 | |
| } | |
| } | |
| ``` | |
| --- | |
| ### ListLayers | |
| _Boto3 client method: `list_layers`_ | |
| **Other boto3 parameters (optional):** `CompatibleArchitecture, CompatibleRuntime, Marker, MaxItems` | |
| ```bash | |
| curl -X POST http://localhost:8000/step \ | |
| -H "Content-Type: application/json" \ | |
| -d @- <<'EOF' | |
| { | |
| "service": "lambda", | |
| "operation": "ListLayers", | |
| "payload": {} | |
| } | |
| ``` | |
| --- | |