github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/cts/v1/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  	// OBS bucket name. The value contains 3 to 63 characters and must start with a digit or lowercase letter.
    10  	// Only lowercase letters, digits, hyphens (-), and periods (.) are allowed.
    11  	BucketName string `json:"bucket_name" required:"true"`
    12  	// Prefix of trace files that need to be stored in OBS buckets. The value can contain 0 to 64 characters,
    13  	// including letters, digits, hyphens (-), underscores (_), and periods (.).
    14  	FilePrefixName string `json:"file_prefix_name,omitempty"`
    15  	// Status of a tracker. The value can be enabled or disabled.
    16  	// If you change the value to disabled, the tracker stops recording traces.
    17  	Status string `json:"status,omitempty"`
    18  	// Whether trace analysis is enabled.
    19  	// When you enable trace analysis, a log group named CTS and a log stream named system-trace are created in LTS.
    20  	Lts CreateLts `json:"lts,omitempty"`
    21  }
    22  
    23  func Update(client *golangsdk.ServiceClient, opts UpdateOpts, trackerName string) (*Tracker, error) {
    24  	b, err := build.RequestBody(opts, "")
    25  	if err != nil {
    26  		return nil, err
    27  	}
    28  
    29  	raw, err := client.Put(client.ServiceURL("tracker", trackerName), b, nil, &golangsdk.RequestOpts{
    30  		OkCodes: []int{200},
    31  	})
    32  	return extra(err, raw)
    33  }