Я могу предложить вам использовать primaryRouter.hostname вместо podName, фильтр выглядит примерно так:
package main
/*
GetPrivateSubnets
Retrieve all private subnets associated with an account.
Important manual pages:
https://softlayer.github.io/reference/services/SoftLayer_Account/
https://softlayer.github.io/reference/services/SoftLayer_Account/getPrivateSubnets/
License: http://sldn.softlayer.com/article/License
Author: SoftLayer Technologies, Inc. <sldn@softlayer.com>
*/
import (
"fmt"
"github.com/softlayer/softlayer-go/services"
"github.com/softlayer/softlayer-go/session"
"encoding/json"
"github.com/softlayer/softlayer-go/filter"
)
func main() {
// SoftLayer API username and key
username := "set me"
apikey := "set me"
mask := "mask[podName,datacenter[name],networkVlan]"
filter := filter.Build( filter.Path("privateSubnets.datacenter.name").Eq("dal09"),
filter.Path("privateSubnets.networkVlan.primaryRouter.hostname").Contains("bcr06"),
)
// Create a session
sess := session.New(username, apikey)
// Get SoftLayer_Account service
service := services.GetAccountService(sess)
result, err := service.Mask(mask).Filter(filter).GetPrivateSubnets()
if err != nil {
fmt.Printf("\n Unable to retrieve the private subnets:\n - %s\n", err)
return
}
// Following helps to print the result in json format.
jsonFormat, jsonErr := json.MarshalIndent(result,""," ")
if jsonErr != nil {
fmt.Println(jsonErr)
return
}
fmt.Println(string(jsonFormat))
}
bcr06 означает, что подсеть имеет соединение через внутреннюю сеть (частную) pod06.
Ответ выглядит примерно так:
"datacenter": {
"name": "dal09"
},
"networkVlan": {
"id": 111333322,
"modifyDate": "2016-09-14T13:24:10-04:00",
"primarySubnetId": 1225544,
"vlanNumber": 111,
"primaryRouter": {
"domain": "softlayer.com",
"fullyQualifiedDomainName": "bcr06a.dal09.softlayer.com",
"hostname": "bcr06a.dal09",
}
},
"podName": "dal09.pod06"