|
|
|
|
@ -175,68 +175,3 @@ func buildOSCOMIFilters(input map[string]string) osc.FiltersImage {
|
|
|
|
|
}
|
|
|
|
|
return filters
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func buildSecurityGroupFilters(input map[string]string) oapi.FiltersSecurityGroup {
|
|
|
|
|
var filters oapi.FiltersSecurityGroup
|
|
|
|
|
for k, v := range input {
|
|
|
|
|
filterValue := []string{v}
|
|
|
|
|
|
|
|
|
|
switch name := k; name {
|
|
|
|
|
case "account-ids":
|
|
|
|
|
filters.AccountIds = filterValue
|
|
|
|
|
case "descriptions":
|
|
|
|
|
filters.Descriptions = filterValue
|
|
|
|
|
case "inbound-rule-account-ids":
|
|
|
|
|
filters.InboundRuleAccountIds = filterValue
|
|
|
|
|
case "inbound-rule-from-port-ranges":
|
|
|
|
|
if val, err := strconv.Atoi(v); err == nil {
|
|
|
|
|
filters.InboundRuleFromPortRanges = []int64{int64(val)}
|
|
|
|
|
}
|
|
|
|
|
case "inbound-rule-ip-ranges":
|
|
|
|
|
filters.InboundRuleIpRanges = filterValue
|
|
|
|
|
case "inbound-rule-protocols":
|
|
|
|
|
filters.InboundRuleProtocols = filterValue
|
|
|
|
|
case "inbound-rule-security-group-ids":
|
|
|
|
|
filters.InboundRuleSecurityGroupIds = filterValue
|
|
|
|
|
case "inbound-rule-security-group-names":
|
|
|
|
|
filters.InboundRuleSecurityGroupNames = filterValue
|
|
|
|
|
case "inbound-rule-to-port-ranges":
|
|
|
|
|
if val, err := strconv.Atoi(v); err == nil {
|
|
|
|
|
filters.InboundRuleToPortRanges = []int64{int64(val)}
|
|
|
|
|
}
|
|
|
|
|
case "net-ids":
|
|
|
|
|
filters.NetIds = filterValue
|
|
|
|
|
|
|
|
|
|
case "outbound-rule-account-ids":
|
|
|
|
|
filters.OutboundRuleAccountIds = filterValue
|
|
|
|
|
case "outbound-rule-from-port-ranges":
|
|
|
|
|
if val, err := strconv.Atoi(v); err == nil {
|
|
|
|
|
filters.OutboundRuleFromPortRanges = []int64{int64(val)}
|
|
|
|
|
}
|
|
|
|
|
case "outbound-rule-ip-ranges":
|
|
|
|
|
filters.OutboundRuleIpRanges = filterValue
|
|
|
|
|
case "outbound-rule-protocols":
|
|
|
|
|
filters.OutboundRuleProtocols = filterValue
|
|
|
|
|
case "outbound-rule-security-group-ids":
|
|
|
|
|
filters.OutboundRuleSecurityGroupIds = filterValue
|
|
|
|
|
case "outbound-rule-security-group-names":
|
|
|
|
|
filters.OutboundRuleSecurityGroupNames = filterValue
|
|
|
|
|
case "outbound-rule-to-port-ranges":
|
|
|
|
|
if val, err := strconv.Atoi(v); err == nil {
|
|
|
|
|
filters.OutboundRuleToPortRanges = []int64{int64(val)}
|
|
|
|
|
}
|
|
|
|
|
case "security-group-ids":
|
|
|
|
|
filters.SecurityGroupIds = filterValue
|
|
|
|
|
case "security-group-names":
|
|
|
|
|
filters.SecurityGroupNames = filterValue
|
|
|
|
|
case "tags-keys":
|
|
|
|
|
filters.TagKeys = filterValue
|
|
|
|
|
case "tags-values":
|
|
|
|
|
filters.TagValues = filterValue
|
|
|
|
|
//Some params are missing.
|
|
|
|
|
default:
|
|
|
|
|
log.Printf("[Debug] Unknown Filter Name: %s.", name)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return filters
|
|
|
|
|
}
|
|
|
|
|
|