MCPcopy Create free account
hub / github.com/cloudfoundry/cli / GetSecurityGroup

Method GetSecurityGroup

actor/v7action/security_group.go:75–94  ·  view source on GitHub ↗
(securityGroupName string)

Source from the content-addressed store, hash-verified

73}
74
75func (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
96func (actor Actor) GetSecurityGroupSummary(securityGroupName string) (SecurityGroupSummary, Warnings, error) {
97 allWarnings := Warnings{}

Callers 3

UnbindSecurityGroupMethod · 0.95
DeleteSecurityGroupMethod · 0.95

Implementers 1

FakeActorcommand/v7/v7fakes/fake_actor.go

Calls 1

GetSecurityGroupsMethod · 0.65

Tested by

no test coverage detected