我正在使用Softlayer java API购买虚拟机时实现Vlan Selection。 下面的代码是我测试的列出特定数据中心中可用的vlan的代码。它返回的可用vlan列表比" control.softlayer.com"更多。确实。 如果您有任何疑问,请在下面找到我的测试代码并告诉我。
由于
com.softlayer.api.service.Account.Service svc =
com.softlayer.api.service.Account.service(client);
com.softlayer.api.service.network.Vlan.Mask networkVlansMask = new com.softlayer.api.service.network.Vlan.Mask();
// Router
networkVlansMask.attachedNetworkGatewayVlan().bypassFlag();
networkVlansMask.attachedNetworkGatewayFlag();
networkVlansMask.networkSpace();
networkVlansMask.primaryRouter().datacenter().id();
networkVlansMask.primaryRouter().datacenter().name();
networkVlansMask.subnets().id();
networkVlansMask.subnets().subnetType();
networkVlansMask.subnets().networkIdentifier();
networkVlansMask.subnets().cidr();
networkVlansMask.subnets().totalIpAddresses();
networkVlansMask.subnets().usableIpAddressCount();
networkVlansMask.subnets().ipAddresses().ipAddress();
networkVlansMask.subnets().ipAddresses().isReserved();
networkVlansMask.subnets().ipAddresses().virtualGuest();
networkVlansMask.subnets().ipAddresses().hardware();
svc.setMask(networkVlansMask);
Filter filter = new Filter();
filter.addFilter("networkVlans").
addFilter("primaryRouter").
addFilter("datacenter").
addProperty("id", Long.toString(3l));
svc.addFilter(filter);
List<Vlan> vlans = svc.getNetworkVlans(); // All
答案 0 :(得分:1)
以下示例可以帮助您在订购时"((collection:Concept) AND ((species:(*)) AND ( - species:(Homo sapiens))))"
这是一个Rest示例:
VLANS