github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/cts/v1/tracker/doc.go (about) 1 /* 2 Package tracker provides operation records for cloud service resources. 3 4 Example to List Tracker 5 listTracker := tracker.ListOpts{} 6 allTracker, err := tracker.List(client,listTracker) 7 if err != nil { 8 panic(err) 9 } 10 fmt.Println(allTracker) 11 12 13 14 Example to Create a Tracker 15 createTracker:=tracker.CreateOpts{ 16 BucketName: "obs-e51d", 17 FilePrefixName: "mytracker", 18 SimpleMessageNotification:tracker.SimpleMessageNotification{ 19 IsSupportSMN: true, 20 TopicID: "urn:smn:eu-de:626ce20e52a346c090b09cffc3e038e5:c2c-topic", 21 IsSendAllKeyOperation: false, 22 Operations: []string{"login"}, 23 NeedNotifyUserList: []string{"user1","user2"}, 24 }} 25 out,err:=tracker.Create(client, createTracker).Extract() 26 fmt.Println(out) 27 fmt.Println(err) 28 29 30 Example to Update a Tracker 31 updateTracker:=tracker.UpdateOpts{ 32 BucketName : "ciros-img", 33 FilePrefixName : "mytracker", 34 Status : "disabled", 35 SimpleMessageNotification:tracker.SimpleMessageNotification{ 36 IsSupportSMN: false, 37 TopicID: "urn:smn:eu-de:626ce20e52a346c090b09cffc3e038e5:c2c-topic", 38 IsSendAllKeyOperation:false, 39 Operations: []string{"delete","create","login"}, 40 NeedNotifyUserList:[]string{"user1","user2"}, 41 }, 42 } 43 out,err:=tracker.Update(client, updateTracker).Extract() 44 fmt.Println(out) 45 46 47 Example to Delete a Tracker 48 out:= tracker.Delete(client).ExtractErr() 49 fmt.Println(out) 50 51 52 */ 53 package tracker