github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/cts/v3/tracker/Update.go (about) 1 package tracker 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 ) 7 8 type UpdateOpts struct { 9 // Tracker type. The value can be system (management tracker). 10 TrackerType string `json:"tracker_type" required:"true"` 11 // Tracker name. When tracker_type is set to system, the default value system is used. 12 TrackerName string `json:"tracker_name" required:"true"` 13 // Configurations of an OBS bucket to which traces will be transferred. 14 ObsInfo ObsInfo `json:"obs_info,omitempty"` 15 // Indicates whether to enable trace analysis. 16 IsLtsEnabled *bool `json:"is_lts_enabled,omitempty"` 17 // Status of a tracker. The value can be enabled or disabled. 18 // If you change the value to disabled, the tracker stops recording traces. 19 Status string `json:"status,omitempty"` 20 } 21 22 func Update(client *golangsdk.ServiceClient, opts UpdateOpts) (*Tracker, error) { 23 b, err := build.RequestBody(opts, "") 24 if err != nil { 25 return nil, err 26 } 27 28 // PUT /3/{project_id}/tracker 29 raw, err := client.Put(client.ServiceURL("tracker"), b, nil, &golangsdk.RequestOpts{ 30 OkCodes: []int{200}, 31 }) 32 return extra(err, raw) 33 }