github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/networking/v2/extensions/vpnaas/siteconnections/doc.go (about) 1 /* 2 Package siteconnections allows management and retrieval of IPSec site connections in the 3 OpenStack Networking Service. 4 5 6 Example to create an IPSec site connection 7 8 createOpts := siteconnections.CreateOpts{ 9 Name: "Connection1", 10 PSK: "secret", 11 Initiator: siteconnections.InitiatorBiDirectional, 12 AdminStateUp: golangsdk.Enabled, 13 IPSecPolicyID: "4ab0a72e-64ef-4809-be43-c3f7e0e5239b", 14 PeerEPGroupID: "5f5801b1-b383-4cf0-bf61-9e85d4044b2d", 15 IKEPolicyID: "47a880f9-1da9-468c-b289-219c9eca78f0", 16 VPNServiceID: "692c1ec8-a7cd-44d9-972b-8ed3fe4cc476", 17 LocalEPGroupID: "498bb96a-1517-47ea-b1eb-c4a53db46a16", 18 PeerAddress: "172.24.4.233", 19 PeerID: "172.24.4.233", 20 MTU: 1500, 21 } 22 connection, err := siteconnections.Create(client, createOpts).Extract() 23 if err != nil { 24 panic(err) 25 } 26 27 Example to Show the details of a specific IPSec site connection by ID 28 29 conn, err := siteconnections.Get(client, "f2b08c1e-aa81-4668-8ae1-1401bcb0576c").Extract() 30 if err != nil { 31 panic(err) 32 } 33 34 Example to Delete a site connection 35 36 connID := "38aee955-6283-4279-b091-8b9c828000ec" 37 err := siteconnections.Delete(networkClient, connID).ExtractErr() 38 if err != nil { 39 panic(err) 40 } 41 42 Example to List site connections 43 44 allPages, err := siteconnections.List(client, nil).AllPages() 45 if err != nil { 46 panic(err) 47 } 48 49 allConnections, err := siteconnections.ExtractConnections(allPages) 50 if err != nil { 51 panic(err) 52 } 53 54 Example to Update an IPSec site connection 55 56 description := "updated connection" 57 name := "updatedname" 58 updateOpts := siteconnections.UpdateOpts{ 59 Name: &name, 60 Description: &description, 61 } 62 updatedConnection, err := siteconnections.Update(client, "5c561d9d-eaea-45f6-ae3e-08d1a7080828", updateOpts).Extract() 63 if err != nil { 64 panic(err) 65 } 66 67 */ 68 package siteconnections