github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/networking/v2/extensions/vpnaas/ikepolicies/doc.go (about) 1 /* 2 Package ikepolicies allows management and retrieval of IKE policies in the 3 OpenStack Networking Service. 4 5 6 Example to Create an IKE policy 7 8 createOpts := ikepolicies.CreateOpts{ 9 Name: "ikepolicy1", 10 Description: "Description of ikepolicy1", 11 EncryptionAlgorithm: ikepolicies.EncryptionAlgorithm3DES, 12 PFS: ikepolicies.PFSGroup5, 13 } 14 15 policy, err := ikepolicies.Create(networkClient, createOpts).Extract() 16 if err != nil { 17 panic(err) 18 } 19 20 Example to Show the details of a specific IKE policy by ID 21 22 policy, err := ikepolicies.Get(client, "f2b08c1e-aa81-4668-8ae1-1401bcb0576c").Extract() 23 if err != nil { 24 panic(err) 25 } 26 27 28 Example to Delete a Policy 29 30 err := ikepolicies.Delete(client, "5291b189-fd84-46e5-84bd-78f40c05d69c").ExtractErr() 31 if err != nil { 32 panic(err) 33 34 Example to Update an IKE policy 35 36 name := "updatedname" 37 description := "updated policy" 38 updateOpts := ikepolicies.UpdateOpts{ 39 Name: &name, 40 Description: &description, 41 Lifetime: &ikepolicies.LifetimeUpdateOpts{ 42 Value: 7000, 43 }, 44 } 45 updatedPolicy, err := ikepolicies.Update(client, "5c561d9d-eaea-45f6-ae3e-08d1a7080828", updateOpts).Extract() 46 if err != nil { 47 panic(err) 48 } 49 50 51 Example to List IKE policies 52 53 allPages, err := ikepolicies.List(client, nil).AllPages() 54 if err != nil { 55 panic(err) 56 } 57 58 allPolicies, err := ikepolicies.ExtractPolicies(allPages) 59 if err != nil { 60 panic(err) 61 } 62 63 */ 64 package ikepolicies