aliyun/aliyun-cli

ALB: AssociateAclsWithListener/DissociateAclsFromListener InvalidAclIds error

lxwzy opened this issue · 1 comments

lxwzy commented

I want to request ALB's AssociateAclsWithListener & DissociateAclsFromListener with aliyun-cli.

However, there are some problems with AclIds parameter. Request only successful with --AclIds.1 'acl-***' --force.

  • Command Format:
aliyun version
3.0.116
  • Execution Command:
# use --AclIds '["acl-***"]'
aliyun alb DissociateAclsFromListener --endpoint alb.cn-hangzhou.aliyuncs.com --region cn-hangzhou --AclType White --ListenerId 'lsn-***' --AclIds '["acl-***"]'

# use --AclIds 'acl-***'
aliyun alb DissociateAclsFromListener --endpoint alb.cn-hangzhou.aliyuncs.com --region cn-hangzhou --AclType White --ListenerId 'lsn-***' --AclIds '["acl-***"]' --force

# use --AclIds.1 'acl-***'
aliyun alb AssociateAclsWithListener --endpoint alb.cn-hangzhou.aliyuncs.com --region cn-hangzhou --AclType White --ListenerId 'lsn-***' --AclIds.1 'acl-***'

# use --AclIds.1 'acl-***' with --force
aliyun alb AssociateAclsWithListener --endpoint alb.cn-hangzhou.aliyuncs.com --region cn-hangzhou --AclType White --ListenerId 'lsn-***' --AclIds.1 'acl-***' --force
  • Output:
# use --AclIds '["acl-***"]'
ERROR: SDK.ServerError
ErrorCode: InvalidAclIds; Illegal parameter serialization format. Flat format is required.
Recommend: https://troubleshoot.api.aliyun.com?q=InvalidAclIds; Illegal parameter serialization format. Flat format is required.&product=Alb
RequestId: ***
Message: Specified parameter AclIds; Illegal parameter serialization format. Flat format is required. is not valid.
RespHeaders: map[Access-Control-Allow-Headers:[X-Requested-With, X-Sequence, _aop_secret, _aop_signature, x-acs-action, x-acs-version, x-acs-date, Content-Type] Access-Control-Allow-Methods:[POST, GET, OPTIONS, PUT, DELETE] Access-Control-Allow-Origin:[*] Access-Control-Max-Age:[172800] Connection:[keep-alive] Content-Length:[444] Content-Type:[application/json;charset=utf-8] Date:[Mon, 11 Apr 2022 07:25:21 GMT] X-Acs-Request-Id:[***] X-Acs-Trace-Id:[***]]

# use --AclIds 'acl-***'
ERROR: SDK.ServerError
ErrorCode: InvalidAclIds; Illegal parameter serialization format. Flat format is required.
Recommend: https://troubleshoot.api.aliyun.com?q=InvalidAclIds; Illegal parameter serialization format. Flat format is required.&product=Alb
RequestId: ***
Message: Specified parameter AclIds; Illegal parameter serialization format. Flat format is required. is not valid.
RespHeaders: map[Access-Control-Allow-Headers:[X-Requested-With, X-Sequence, _aop_secret, _aop_signature, x-acs-action, x-acs-version, x-acs-date, Content-Type] Access-Control-Allow-Methods:[POST, GET, OPTIONS, PUT, DELETE] Access-Control-Allow-Origin:[*] Access-Control-Max-Age:[172800] Connection:[keep-alive] Content-Length:[444] Content-Type:[application/json;charset=utf-8] Date:[Mon, 11 Apr 2022 07:25:21 GMT] X-Acs-Request-Id:[***] X-Acs-Trace-Id:[***]]

# use --AclIds.1 'acl-***'
ERROR: '--AclIds.1' is not a valid parameter or flag. See `aliyun help alb AssociateAclsWithListener`.

Did you mean:
  AclIds

# use --AclIds.1 'acl-***' with --force
{
	"JobId": "***",
	"RequestId": "***"
}

暂时只能以 --AclIds.1 'acl-***' --force 的形式来使用这种数组型参数。CLI 需要升级一个较大的版本才能解决该问题。