diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 1aaf0b015..37ced3df5 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1389,8 +1389,8 @@ }, { "ImportPath": "github.com/xanzy/go-cloudstack/cloudstack", - "Comment": "2.0.0-2-gcfbfb48", - "Rev": "cfbfb481e04c131cb89df1c6141b082f2714bc29" + "Comment": "2.0.0-6-g5686bcd", + "Rev": "5686bcde5af20565d8c7a3f66b5441430ac54186" }, { "ImportPath": "github.com/xanzy/ssh-agent", diff --git a/builtin/providers/cloudstack/resource_cloudstack_network_acl.go b/builtin/providers/cloudstack/resource_cloudstack_network_acl.go index c39c695d9..15569d09f 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_network_acl.go +++ b/builtin/providers/cloudstack/resource_cloudstack_network_acl.go @@ -90,8 +90,22 @@ func resourceCloudStackNetworkACLCreate(d *schema.ResourceData, meta interface{} func resourceCloudStackNetworkACLRead(d *schema.ResourceData, meta interface{}) error { cs := meta.(*cloudstack.CloudStackClient) + vpc, ok := d.GetOk("vpc_id") + if !ok { + vpc, ok = d.GetOk("vpc") + } + if !ok { + return errors.New("Either `vpc_id` or [deprecated] `vpc` must be provided.") + } + + // Retrieve the vpc ID + vpcid, e := retrieveID(cs, "vpc", vpc.(string)) + if e != nil { + return e.Error() + } + // Get the network ACL list details - f, count, err := cs.NetworkACL.GetNetworkACLListByID(d.Id()) + f, count, err := cs.NetworkACL.GetNetworkACLListByID(d.Id(), cloudstack.WithVPCID(vpcid)) if err != nil { if count == 0 { log.Printf( diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go index c70cf5fb5..06263a324 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/LoadBalancerService.go @@ -2008,12 +2008,12 @@ func (s *LoadBalancerService) ListLoadBalancerRuleInstances(p *ListLoadBalancerR type ListLoadBalancerRuleInstancesResponse struct { Count int `json:"count"` - LoadBalancerRuleInstances []*LoadBalancerRuleInstance `json:"loadbalancerruleinstance"` + LoadBalancerRuleInstances []*LoadBalancerRuleInstance `json:"lbrulevmidip"` } type LoadBalancerRuleInstance struct { - Lbvmipaddresses []string `json:"lbvmipaddresses,omitempty"` - Loadbalancerruleinstance string `json:"loadbalancerruleinstance,omitempty"` + Lbvmipaddresses []string `json:"lbvmipaddresses,omitempty"` + Loadbalancerruleinstance *VirtualMachine `json:"loadbalancerruleinstance,omitempty"` } type UpdateLoadBalancerRuleParams struct { diff --git a/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go b/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go index 53e38bfed..f52cd3463 100644 --- a/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go +++ b/vendor/github.com/xanzy/go-cloudstack/cloudstack/cloudstack.go @@ -411,6 +411,26 @@ func WithProject(project string) OptionFunc { } } +// VPCIDSetter is an interface that every type that can set a vpc ID must implement +type VPCIDSetter interface { + SetVpcid(string) +} + +// WithVPCID takes a vpc ID and sets the `vpcid` parameter +func WithVPCID(id string) OptionFunc { + return func(cs *CloudStackClient, p interface{}) error { + vs, ok := p.(VPCIDSetter) + + if !ok || id == "" { + return nil + } + + vs.SetVpcid(id) + + return nil + } +} + type APIDiscoveryService struct { cs *CloudStackClient }