Skip to content
Permalink
Browse files
Generate cloudstack43 services including latest updates
  • Loading branch information
benjvi committed May 29, 2015
1 parent 37df923 commit 9ef5dc0031ce53f0dcbb48106e524e3d930720ed
Showing 21 changed files with 510 additions and 0 deletions.
@@ -565,6 +565,21 @@ func (s *AddressService) GetPublicIpAddressByID(id string) (*PublicIpAddress, in
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListPublicIpAddresses(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -1784,6 +1784,21 @@ func (s *AutoScaleService) GetAutoScaleVmProfileByID(id string) (*AutoScaleVmPro
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListAutoScaleVmProfiles(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -2012,6 +2027,21 @@ func (s *AutoScaleService) GetAutoScaleVmGroupByID(id string) (*AutoScaleVmGroup
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListAutoScaleVmGroups(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -232,6 +232,21 @@ func (s *EventService) GetEventByID(id string) (*Event, int, error) {
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListEvents(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -202,6 +202,21 @@ func (s *FirewallService) GetPortForwardingRuleByID(id string) (*PortForwardingR
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListPortForwardingRules(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -1131,6 +1146,21 @@ func (s *FirewallService) GetFirewallRuleByID(id string) (*FirewallRule, int, er
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListFirewallRules(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -1617,6 +1647,21 @@ func (s *FirewallService) GetEgressFirewallRuleByID(id string) (*EgressFirewallR
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListEgressFirewallRules(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -740,6 +740,21 @@ func (s *ISOService) GetIsoByID(id string) (*Iso, int, error) {
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListIsos(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -877,6 +877,21 @@ func (s *InternalLBService) GetInternalLoadBalancerVMByID(id string) (*InternalL
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListInternalLoadBalancerVMs(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -961,6 +961,21 @@ func (s *LoadBalancerService) GetLoadBalancerRuleByID(id string) (*LoadBalancerR
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListLoadBalancerRules(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -3742,6 +3757,21 @@ func (s *LoadBalancerService) GetGlobalLoadBalancerRuleByID(id string) (*GlobalL
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListGlobalLoadBalancerRules(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -4457,6 +4487,21 @@ func (s *LoadBalancerService) GetLoadBalancerByID(id string) (*LoadBalancer, int
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListLoadBalancers(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -500,6 +500,21 @@ func (s *NATService) GetIpForwardingRuleByID(id string) (*IpForwardingRule, int,
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListIpForwardingRules(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -717,6 +717,21 @@ func (s *NetworkACLService) GetNetworkACLByID(id string) (*NetworkACL, int, erro
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListNetworkACLs(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -1249,6 +1264,21 @@ func (s *NetworkACLService) GetNetworkACLListByID(id string) (*NetworkACLList, i
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListNetworkACLLists(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -984,6 +984,21 @@ func (s *NetworkService) GetNetworkByID(id string) (*Network, int, error) {
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListNetworks(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -1124,6 +1124,21 @@ func (s *ProjectService) GetProjectInvitationByID(id string) (*ProjectInvitation
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListProjectInvitations(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}
@@ -980,6 +980,21 @@ func (s *RouterService) GetRouterByID(id string) (*Router, int, error) {
return nil, -1, err
}

if l.Count == 0 {
// If no matches, search all projects
p.p["projectid"] = "-1"

l, err = s.ListRouters(p)
if err != nil {
if strings.Contains(err.Error(), fmt.Sprintf(
"Invalid parameter id value=%s due to incorrect long value format, "+
"or entity does not exist", id)) {
return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
}
return nil, -1, err
}
}

if l.Count == 0 {
return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
}

0 comments on commit 9ef5dc0

Please sign in to comment.