github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/cts/v3/tracker/results.go (about)

     1  package tracker
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     7  )
     8  
     9  type Tracker struct {
    10  	// Unique tracker ID.
    11  	Id string `json:"id"`
    12  	// Timestamp when the tracker was created.
    13  	CreateTime int64 `json:"create_time"`
    14  	// Trace analysis
    15  	Lts Lts `json:"lts"`
    16  	// Tracker type
    17  	TrackerType string `json:"tracker_type"`
    18  	// Account ID
    19  	DomainId string `json:"domain_id"`
    20  	// Project id
    21  	ProjectId string `json:"project_id"`
    22  	// Tracker name
    23  	TrackerName string `json:"tracker_name"`
    24  	// Tracker status
    25  	Status string `json:"status"`
    26  	// This parameter is returned only when the tracker status is error.
    27  	Detail string `json:"detail"`
    28  	// Tracker type
    29  	ObsInfo ObsInfo `json:"obs_info"`
    30  }
    31  
    32  type Lts struct {
    33  	// Whether trace analysis is enabled.
    34  	IsLtsEnabled bool `json:"is_lts_enabled"`
    35  	// Name of the Log Tank Service (LTS) log group.
    36  	LogGroupName string `json:"log_group_name"`
    37  	// Name of the LTS log stream.
    38  	LogTopicName string `json:"log_topic_name"`
    39  }
    40  
    41  func extra(err error, raw *http.Response) (*Tracker, error) {
    42  	if err != nil {
    43  		return nil, err
    44  	}
    45  
    46  	var res Tracker
    47  	err = extract.Into(raw.Body, &res)
    48  	return &res, err
    49  }
    50  
    51  func extraStruct(err error, raw *http.Response) ([]Tracker, error) {
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	var res []Tracker
    56  
    57  	err = extract.IntoSlicePtr(raw.Body, &res, "trackers")
    58  	return res, err
    59  }