opentelekomcloud / gophertelekomcloud

GopherTelekomCloud is an OpenTelekomCloud clouds Go SDK
Apache License 2.0
20 stars 10 forks source link

[NAT] snat rules refactoring #710

Closed anton-sidelnikov closed 1 month ago

anton-sidelnikov commented 1 month ago

Refactoring and adding missing endpoints

What this PR does / why we need it

Which issue this PR fixes

Special notes for your reviewer

Accepance tests:

=== RUN   TestSnatRuleLifeCycle
    natgateways_test.go:46: Attempting to create Nat Gateway
    natgateways_test.go:67: Created Nat Gateway: 626745d6-10f7-4194-8b0e-fe7f0c4cd49f
    helpers.go:17: Attempting to create eip/bandwidth
    helpers.go:33: Waiting for eip 17c9bac1-8670-4796-9643-2029f7551747 to be active
    helpers.go:40: Created eip/bandwidth: 17c9bac1-8670-4796-9643-2029f7551747
    snatrules_test.go:21: Attempting to create SNAT rule
    snatrules_test.go:30: Created SNAT rule: 3d767d90-c9b1-4598-9255-6522aac834d5
    snatrules_test.go:39: Attempting to Obtain SNAT rule: 3d767d90-c9b1-4598-9255-6522aac834d5
    snatrules_test.go:44: Attempting to Obtain SNAT rules in NAT Gateway: 626745d6-10f7-4194-8b0e-fe7f0c4cd49f
    snatrules_test.go:33: Attempting to delete SNAT rule: 3d767d90-c9b1-4598-9255-6522aac834d5
    snatrules_test.go:36: Deleted SNAT rule: 3d767d90-c9b1-4598-9255-6522aac834d5
    helpers.go:49: Attempting to delete eip/bandwidth: 17c9bac1-8670-4796-9643-2029f7551747
    helpers.go:55: Waitting for eip 17c9bac1-8670-4796-9643-2029f7551747 to be deleted
    helpers.go:60: Deleted eip/bandwidth: 17c9bac1-8670-4796-9643-2029f7551747
    natgateways_test.go:73: Attempting to delete Nat Gateway: 626745d6-10f7-4194-8b0e-fe7f0c4cd49f
    natgateways_test.go:78: Nat Gateway is deleted: 626745d6-10f7-4194-8b0e-fe7f0c4cd49f
--- PASS: TestSnatRuleLifeCycle (16.84s)
PASS

Process finished with the exit code 0

=== RUN   TestDnatRuleLifeCycle
    natgateways_test.go:46: Attempting to create Nat Gateway
    natgateways_test.go:67: Created Nat Gateway: 082dde76-33df-4f14-9cc7-460db6a390c1
    helpers.go:17: Attempting to create eip/bandwidth
    helpers.go:33: Waiting for eip 5f52b4b1-07cb-4520-81de-edd081766e16 to be active
    helpers.go:40: Created eip/bandwidth: 5f52b4b1-07cb-4520-81de-edd081766e16
    dnatrulest_test.go:31: Attempting to create DNAT rule, Direct Connect scenario
    dnatrulest_test.go:43: Created DNAT DC rule: 46059c5f-361e-41dd-8ef3-86b9f19b15d2
    dnatrulest_test.go:106: Attempting to get DNAT rule: 46059c5f-361e-41dd-8ef3-86b9f19b15d2
    dnatrulest_test.go:111: Attempting to list DNAT rules
    dnatrulest_test.go:46: Attempting to delete DC DNAT rule: 46059c5f-361e-41dd-8ef3-86b9f19b15d2
    dnatrulest_test.go:49: Deleted DC DNAT rule: 46059c5f-361e-41dd-8ef3-86b9f19b15d2
    helpers.go:49: Attempting to delete eip/bandwidth: 5f52b4b1-07cb-4520-81de-edd081766e16
    helpers.go:55: Waitting for eip 5f52b4b1-07cb-4520-81de-edd081766e16 to be deleted
    helpers.go:60: Deleted eip/bandwidth: 5f52b4b1-07cb-4520-81de-edd081766e16
    natgateways_test.go:73: Attempting to delete Nat Gateway: 082dde76-33df-4f14-9cc7-460db6a390c1
    natgateways_test.go:78: Nat Gateway is deleted: 082dde76-33df-4f14-9cc7-460db6a390c1
--- PASS: TestDnatRuleLifeCycle (25.77s)
PASS

Process finished with the exit code 0