AWS MediaLive - UnprocessableEntityException:无法读取未定义的 属性 'destination'
AWS MediaLive - UnprocessableEntityException: Cannot read property 'destination' of undefined
我想使用 Go AWS SDK 在 AWS MediaLive 上创建一个频道(尝试使用 v1 和 v2)。
但我收到以下错误:
UnprocessableEntityException: Cannot read property 'destination' of undefined
status code: 422, request id: 5429aaff-fab9-11e7-843e-ed86ee7cfb22
CreateChannel
命令看起来像(这是针对 SDK v1):
req, err := svc.CreateChannel(&medialive.CreateChannelInput{
Destinations: []*medialive.OutputDestination{
&medialive.OutputDestination{
Id: &destinationID,
Settings: []*medialive.OutputDestinationSettings{
{
PasswordParam: ¶m1,
Url: destinationA.HlsIngest.IngestEndpoints[0].Url,
Username: destinationA.HlsIngest.IngestEndpoints[0].Username},
{
PasswordParam: ¶m2,
Url: destinationB.HlsIngest.IngestEndpoints[0].Url,
Username: destinationB.HlsIngest.IngestEndpoints[0].Username,
},
},
},
},
EncoderSettings: &medialive.EncoderSettings{
OutputGroups: []*medialive.OutputGroup{&medialive.OutputGroup{
OutputGroupSettings: &medialive.OutputGroupSettings{
HlsGroupSettings: &medialive.HlsGroupSettings{
HlsCdnSettings: &medialive.HlsCdnSettings{
HlsWebdavSettings: &medialive.HlsWebdavSettings{},
},
},
},
Outputs: []*medialive.Output{&medialive.Output{}},
}},
VideoDescriptions: []*medialive.VideoDescription{&medialive.VideoDescription{
Height: &videoHeight,
Width: &videoWidth,
CodecSettings: &medialive.VideoCodecSettings{
H264Settings: &medialive.H264Settings{
FramerateDenominator: &framerate,
},
},
}},
},
InputAttachments: []*medialive.InputAttachment{&medialive.InputAttachment{InputId: input.Input.Id}},
Name: &channelName,
RoleArn: &arn,
})
显然,代码包含许多变量,这些变量在 initialised/created 之前已经存在,因为 CreateChannel
操作需要输入、输入安全组等。
我的代码中没有任何地方有 属性 destination
。 CreateChannelInput
.
下只有字段Destinations
如果有人能就此错误给出提示,我们将不胜感激。
最后我所做的是从 AWS 控制台创建一个通道,然后使用以下命令将其配置导出到 JSON 文件:
aws medialive describe-channel --channel-id <my_channel_id>
每次我想使用 SDK 创建新频道时,我都会从 JSON 文件加载配置,并根据需要更改一些参数。
我想使用 Go AWS SDK 在 AWS MediaLive 上创建一个频道(尝试使用 v1 和 v2)。
但我收到以下错误:
UnprocessableEntityException: Cannot read property 'destination' of undefined status code: 422, request id: 5429aaff-fab9-11e7-843e-ed86ee7cfb22
CreateChannel
命令看起来像(这是针对 SDK v1):
req, err := svc.CreateChannel(&medialive.CreateChannelInput{
Destinations: []*medialive.OutputDestination{
&medialive.OutputDestination{
Id: &destinationID,
Settings: []*medialive.OutputDestinationSettings{
{
PasswordParam: ¶m1,
Url: destinationA.HlsIngest.IngestEndpoints[0].Url,
Username: destinationA.HlsIngest.IngestEndpoints[0].Username},
{
PasswordParam: ¶m2,
Url: destinationB.HlsIngest.IngestEndpoints[0].Url,
Username: destinationB.HlsIngest.IngestEndpoints[0].Username,
},
},
},
},
EncoderSettings: &medialive.EncoderSettings{
OutputGroups: []*medialive.OutputGroup{&medialive.OutputGroup{
OutputGroupSettings: &medialive.OutputGroupSettings{
HlsGroupSettings: &medialive.HlsGroupSettings{
HlsCdnSettings: &medialive.HlsCdnSettings{
HlsWebdavSettings: &medialive.HlsWebdavSettings{},
},
},
},
Outputs: []*medialive.Output{&medialive.Output{}},
}},
VideoDescriptions: []*medialive.VideoDescription{&medialive.VideoDescription{
Height: &videoHeight,
Width: &videoWidth,
CodecSettings: &medialive.VideoCodecSettings{
H264Settings: &medialive.H264Settings{
FramerateDenominator: &framerate,
},
},
}},
},
InputAttachments: []*medialive.InputAttachment{&medialive.InputAttachment{InputId: input.Input.Id}},
Name: &channelName,
RoleArn: &arn,
})
显然,代码包含许多变量,这些变量在 initialised/created 之前已经存在,因为 CreateChannel
操作需要输入、输入安全组等。
我的代码中没有任何地方有 属性 destination
。 CreateChannelInput
.
Destinations
如果有人能就此错误给出提示,我们将不胜感激。
最后我所做的是从 AWS 控制台创建一个通道,然后使用以下命令将其配置导出到 JSON 文件:
aws medialive describe-channel --channel-id <my_channel_id>
每次我想使用 SDK 创建新频道时,我都会从 JSON 文件加载配置,并根据需要更改一些参数。