(securityGroupName string)
| 73 | } |
| 74 | |
| 75 | func (actor Actor) GetSecurityGroup(securityGroupName string) (resources.SecurityGroup, Warnings, error) { |
| 76 | allWarnings := Warnings{} |
| 77 | |
| 78 | securityGroups, warnings, err := actor.CloudControllerClient.GetSecurityGroups( |
| 79 | ccv3.Query{Key: ccv3.NameFilter, Values: []string{securityGroupName}}, |
| 80 | ccv3.Query{Key: ccv3.PerPage, Values: []string{"1"}}, |
| 81 | ccv3.Query{Key: ccv3.Page, Values: []string{"1"}}, |
| 82 | ) |
| 83 | allWarnings = append(allWarnings, warnings...) |
| 84 | |
| 85 | if err != nil { |
| 86 | return resources.SecurityGroup{}, allWarnings, err |
| 87 | } |
| 88 | |
| 89 | if len(securityGroups) == 0 { |
| 90 | return resources.SecurityGroup{}, allWarnings, actionerror.SecurityGroupNotFoundError{Name: securityGroupName} |
| 91 | } |
| 92 | |
| 93 | return securityGroups[0], allWarnings, err |
| 94 | } |
| 95 | |
| 96 | func (actor Actor) GetSecurityGroupSummary(securityGroupName string) (SecurityGroupSummary, Warnings, error) { |
| 97 | allWarnings := Warnings{} |
no test coverage detected