我想使用 Go AWS SDK 在 AWS MediaLive 上创建一个频道(尝试使用 v1 和 v2)。
但我收到以下错误:
UnprocessableEntityException:无法读取未定义状态代码的属性“目标”:422,请求 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,
})
显然,代码包含许多变量,这些变量已经在之前初始化/创建,因为CreateChannel
操作需要输入、输入安全组等。
在我的代码中没有任何地方有属性destination
。Destinations
下只有字段CreateChannelInput
。
如果有人可以提供有关此错误的提示,我们将不胜感激。