CreateApplication - Amazon Managed Servics for Apache Flink(前身为 Amazon Kinesis Data Analytics for Apache Flink)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

CreateApplication

创建 Apache Flink 托管服务应用程序。有关创建 Apache Flink 托管服务应用程序的信息,请参阅 Creating an Application

请求语法

{ "ApplicationConfiguration": { "ApplicationCodeConfiguration": { "CodeContent": { "S3ContentLocation": { "BucketARN": "string", "FileKey": "string", "ObjectVersion": "string" }, "TextContent": "string", "ZipFileContent": blob }, "CodeContentType": "string" }, "ApplicationSnapshotConfiguration": { "SnapshotsEnabled": boolean }, "ApplicationSystemRollbackConfiguration": { "RollbackEnabled": boolean }, "EnvironmentProperties": { "PropertyGroups": [ { "PropertyGroupId": "string", "PropertyMap": { "string" : "string" } } ] }, "FlinkApplicationConfiguration": { "CheckpointConfiguration": { "CheckpointingEnabled": boolean, "CheckpointInterval": number, "ConfigurationType": "string", "MinPauseBetweenCheckpoints": number }, "MonitoringConfiguration": { "ConfigurationType": "string", "LogLevel": "string", "MetricsLevel": "string" }, "ParallelismConfiguration": { "AutoScalingEnabled": boolean, "ConfigurationType": "string", "Parallelism": number, "ParallelismPerKPU": number } }, "SqlApplicationConfiguration": { "Inputs": [ { "InputParallelism": { "Count": number }, "InputProcessingConfiguration": { "InputLambdaProcessor": { "ResourceARN": "string" } }, "InputSchema": { "RecordColumns": [ { "Mapping": "string", "Name": "string", "SqlType": "string" } ], "RecordEncoding": "string", "RecordFormat": { "MappingParameters": { "CSVMappingParameters": { "RecordColumnDelimiter": "string", "RecordRowDelimiter": "string" }, "JSONMappingParameters": { "RecordRowPath": "string" } }, "RecordFormatType": "string" } }, "KinesisFirehoseInput": { "ResourceARN": "string" }, "KinesisStreamsInput": { "ResourceARN": "string" }, "NamePrefix": "string" } ], "Outputs": [ { "DestinationSchema": { "RecordFormatType": "string" }, "KinesisFirehoseOutput": { "ResourceARN": "string" }, "KinesisStreamsOutput": { "ResourceARN": "string" }, "LambdaOutput": { "ResourceARN": "string" }, "Name": "string" } ], "ReferenceDataSources": [ { "ReferenceSchema": { "RecordColumns": [ { "Mapping": "string", "Name": "string", "SqlType": "string" } ], "RecordEncoding": "string", "RecordFormat": { "MappingParameters": { "CSVMappingParameters": { "RecordColumnDelimiter": "string", "RecordRowDelimiter": "string" }, "JSONMappingParameters": { "RecordRowPath": "string" } }, "RecordFormatType": "string" } }, "S3ReferenceDataSource": { "BucketARN": "string", "FileKey": "string" }, "TableName": "string" } ] }, "VpcConfigurations": [ { "SecurityGroupIds": [ "string" ], "SubnetIds": [ "string" ] } ], "ZeppelinApplicationConfiguration": { "CatalogConfiguration": { "GlueDataCatalogConfiguration": { "DatabaseARN": "string" } }, "CustomArtifactsConfiguration": [ { "ArtifactType": "string", "MavenReference": { "ArtifactId": "string", "GroupId": "string", "Version": "string" }, "S3ContentLocation": { "BucketARN": "string", "FileKey": "string", "ObjectVersion": "string" } } ], "DeployAsApplicationConfiguration": { "S3ContentLocation": { "BasePath": "string", "BucketARN": "string" } }, "MonitoringConfiguration": { "LogLevel": "string" } } }, "ApplicationDescription": "string", "ApplicationMode": "string", "ApplicationName": "string", "CloudWatchLoggingOptions": [ { "LogStreamARN": "string" } ], "RuntimeEnvironment": "string", "ServiceExecutionRole": "string", "Tags": [ { "Key": "string", "Value": "string" } ] }

请求参数

请求接受采用 JSON 格式的以下数据。

ApplicationConfiguration

使用该参数可配置应用程序。

类型:ApplicationConfiguration 对象

必需:否

ApplicationDescription

应用程序的摘要描述。

类型:字符串

长度约束:最小长度为 0。最大长度为 1024。

必需:否

ApplicationMode

使用 STREAMING 模式创建 Apache Flink 托管服务应用程序。要为 Apache Flink Studio 笔记本创建托管服务,请使用 INTERACTIVE 模式。

类型:字符串

有效值:STREAMING | INTERACTIVE

必需:否

ApplicationName

应用程序的名称(例如,sample-app)。

类型:字符串

长度限制:长度下限为 1。长度上限为 128。

模式:[a-zA-Z0-9_.-]+

必需:是

CloudWatchLoggingOptions

使用此参数配置 Amazon CloudWatch 日志流以监控应用程序配置错误。

类型:CloudWatchLoggingOption 对象数组

必需:否

RuntimeEnvironment

应用程序的运行时环境。

类型:字符串

有效值:SQL-1_0 | FLINK-1_6 | FLINK-1_8 | ZEPPELIN-FLINK-1_0 | FLINK-1_11 | FLINK-1_13 | ZEPPELIN-FLINK-2_0 | FLINK-1_15 | ZEPPELIN-FLINK-3_0 | FLINK-1_18 | FLINK-1_19

必需:是

ServiceExecutionRole

应用程序用于访问 Kinesis 数据流、Kinesis Data Firehose 传输流、Amazon S3 对象和其他外部资源的 IAM 角色。

类型:字符串

长度限制:最小长度为 0。最大长度为 2048。

模式:arn:.*

必需:是

Tags

分配给应用程序的一个或多个标签的列表。标签是用于标识应用程序的键/值对。请注意,应用程序标签的最大数量包括系统标签。用户定义的应用程序标签的最大数量为 50。有关更多信息,请参阅使用标签

类型:Tag 对象数组

数组成员:最少 1 个物品。最多 200 项。

必需:否

响应语法

{ "ApplicationDetail": { "ApplicationARN": "string", "ApplicationConfigurationDescription": { "ApplicationCodeConfigurationDescription": { "CodeContentDescription": { "CodeMD5": "string", "CodeSize": number, "S3ApplicationCodeLocationDescription": { "BucketARN": "string", "FileKey": "string", "ObjectVersion": "string" }, "TextContent": "string" }, "CodeContentType": "string" }, "ApplicationSnapshotConfigurationDescription": { "SnapshotsEnabled": boolean }, "ApplicationSystemRollbackConfigurationDescription": { "RollbackEnabled": boolean }, "EnvironmentPropertyDescriptions": { "PropertyGroupDescriptions": [ { "PropertyGroupId": "string", "PropertyMap": { "string" : "string" } } ] }, "FlinkApplicationConfigurationDescription": { "CheckpointConfigurationDescription": { "CheckpointingEnabled": boolean, "CheckpointInterval": number, "ConfigurationType": "string", "MinPauseBetweenCheckpoints": number }, "JobPlanDescription": "string", "MonitoringConfigurationDescription": { "ConfigurationType": "string", "LogLevel": "string", "MetricsLevel": "string" }, "ParallelismConfigurationDescription": { "AutoScalingEnabled": boolean, "ConfigurationType": "string", "CurrentParallelism": number, "Parallelism": number, "ParallelismPerKPU": number } }, "RunConfigurationDescription": { "ApplicationRestoreConfigurationDescription": { "ApplicationRestoreType": "string", "SnapshotName": "string" }, "FlinkRunConfigurationDescription": { "AllowNonRestoredState": boolean } }, "SqlApplicationConfigurationDescription": { "InputDescriptions": [ { "InAppStreamNames": [ "string" ], "InputId": "string", "InputParallelism": { "Count": number }, "InputProcessingConfigurationDescription": { "InputLambdaProcessorDescription": { "ResourceARN": "string", "RoleARN": "string" } }, "InputSchema": { "RecordColumns": [ { "Mapping": "string", "Name": "string", "SqlType": "string" } ], "RecordEncoding": "string", "RecordFormat": { "MappingParameters": { "CSVMappingParameters": { "RecordColumnDelimiter": "string", "RecordRowDelimiter": "string" }, "JSONMappingParameters": { "RecordRowPath": "string" } }, "RecordFormatType": "string" } }, "InputStartingPositionConfiguration": { "InputStartingPosition": "string" }, "KinesisFirehoseInputDescription": { "ResourceARN": "string", "RoleARN": "string" }, "KinesisStreamsInputDescription": { "ResourceARN": "string", "RoleARN": "string" }, "NamePrefix": "string" } ], "OutputDescriptions": [ { "DestinationSchema": { "RecordFormatType": "string" }, "KinesisFirehoseOutputDescription": { "ResourceARN": "string", "RoleARN": "string" }, "KinesisStreamsOutputDescription": { "ResourceARN": "string", "RoleARN": "string" }, "LambdaOutputDescription": { "ResourceARN": "string", "RoleARN": "string" }, "Name": "string", "OutputId": "string" } ], "ReferenceDataSourceDescriptions": [ { "ReferenceId": "string", "ReferenceSchema": { "RecordColumns": [ { "Mapping": "string", "Name": "string", "SqlType": "string" } ], "RecordEncoding": "string", "RecordFormat": { "MappingParameters": { "CSVMappingParameters": { "RecordColumnDelimiter": "string", "RecordRowDelimiter": "string" }, "JSONMappingParameters": { "RecordRowPath": "string" } }, "RecordFormatType": "string" } }, "S3ReferenceDataSourceDescription": { "BucketARN": "string", "FileKey": "string", "ReferenceRoleARN": "string" }, "TableName": "string" } ] }, "VpcConfigurationDescriptions": [ { "SecurityGroupIds": [ "string" ], "SubnetIds": [ "string" ], "VpcConfigurationId": "string", "VpcId": "string" } ], "ZeppelinApplicationConfigurationDescription": { "CatalogConfigurationDescription": { "GlueDataCatalogConfigurationDescription": { "DatabaseARN": "string" } }, "CustomArtifactsConfigurationDescription": [ { "ArtifactType": "string", "MavenReferenceDescription": { "ArtifactId": "string", "GroupId": "string", "Version": "string" }, "S3ContentLocationDescription": { "BucketARN": "string", "FileKey": "string", "ObjectVersion": "string" } } ], "DeployAsApplicationConfigurationDescription": { "S3ContentLocationDescription": { "BasePath": "string", "BucketARN": "string" } }, "MonitoringConfigurationDescription": { "LogLevel": "string" } } }, "ApplicationDescription": "string", "ApplicationMaintenanceConfigurationDescription": { "ApplicationMaintenanceWindowEndTime": "string", "ApplicationMaintenanceWindowStartTime": "string" }, "ApplicationMode": "string", "ApplicationName": "string", "ApplicationStatus": "string", "ApplicationVersionCreateTimestamp": number, "ApplicationVersionId": number, "ApplicationVersionRolledBackFrom": number, "ApplicationVersionRolledBackTo": number, "ApplicationVersionUpdatedFrom": number, "CloudWatchLoggingOptionDescriptions": [ { "CloudWatchLoggingOptionId": "string", "LogStreamARN": "string", "RoleARN": "string" } ], "ConditionalToken": "string", "CreateTimestamp": number, "LastUpdateTimestamp": number, "RuntimeEnvironment": "string", "ServiceExecutionRole": "string" } }

响应元素

如果此操作成功,则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

ApplicationDetail

为了响应您的 CreateApplication 请求,Apache Flink 托管服务会返回一个响应,其中包含其创建的应用程序的详细信息。

类型:ApplicationDetail 对象

错误

CodeValidationException

用户提供的应用程序代码(查询)无效。这可能是简单的语法错误。

HTTP 状态代码:400

ConcurrentModificationException

由于对应用程序进行并发修改而引发的异常。此错误可能是由于在未使用当前应用程序 ID 的情况下尝试修改应用程序所致。

HTTP 状态代码:400

InvalidArgumentException

指定的输入参数值无效。

HTTP 状态代码:400

InvalidRequestException

操作的请求 JSON 无效。

HTTP 状态代码:400

LimitExceededException

超出允许的资源数量。

HTTP 状态代码:400

ResourceInUseException

该应用程序不可用于此操作。

HTTP 状态代码:400

TooManyTagsException

创建的应用程序具有太多标签,或者向应用程序添加过多的标签。请注意,应用程序标签的最大数量包括系统标签。用户定义的应用程序标签的最大数量为 50。

HTTP 状态代码:400

UnsupportedOperationException

由于不支持指定的参数或指定的资源对此操作无效,请求被拒绝。

HTTP 状态代码:400

另请参阅

有关在特定语言的 AWS SDK 中使用此 API 的更多信息,请参阅以下内容: