forked from gophercloud/gophercloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LBaaS v2 l7 policy support - part 2: list l7policy
For gophercloud#832 Neutron-LBaaS l7 policy list API implementation: https://github.com/openstack/neutron-lbaas/blob/8e8a6c47c7d38fa7b61850ff9ea2cf130718ded3/neutron_lbaas/services/loadbalancer/plugin.py#L967 Octavia l7 policy list API implementation: https://github.com/openstack/octavia/blob/54a4cf00cf304b108013ca4487c138c13f30983d/octavia/api/v2/controllers/l7policy.py#L61
- Loading branch information
1 parent
54a8a6b
commit 4b59796
Showing
6 changed files
with
245 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// +build acceptance networking loadbalancer l7policies | ||
|
||
package v2 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/gophercloud/gophercloud/acceptance/clients" | ||
"github.com/gophercloud/gophercloud/acceptance/tools" | ||
"github.com/gophercloud/gophercloud/openstack/loadbalancer/v2/l7policies" | ||
) | ||
|
||
func TestL7PoliciesList(t *testing.T) { | ||
client, err := clients.NewLoadBalancerV2Client() | ||
if err != nil { | ||
t.Fatalf("Unable to create a network client: %v", err) | ||
} | ||
|
||
allPages, err := l7policies.List(client, nil).AllPages() | ||
if err != nil { | ||
t.Fatalf("Unable to list l7policies: %v", err) | ||
} | ||
|
||
allL7Policies, err := l7policies.ExtractL7Policies(allPages) | ||
if err != nil { | ||
t.Fatalf("Unable to extract l7policies: %v", err) | ||
} | ||
|
||
for _, policy := range allL7Policies { | ||
tools.PrintResource(t, policy) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters