diff --git a/compress/api_restreamer.go b/compress/api_restreamer.go index a29a5e4..22fdfd5 100644 --- a/compress/api_restreamer.go +++ b/compress/api_restreamer.go @@ -47,7 +47,7 @@ func (o *compress) GetRestreamers(startFrom int, amount int) ([]Restreamer, erro * @param {number} amount * @returns restreamer list */ -func (o *compress) GetRestreamersOttAll(startFrom int, amount int) ([]Restreamer, error) { +func (o *compress) GetRestreamersOttAll(startFrom int, amount int) ([]RestreamersOTTResponse, error) { //requestBody := BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey} requestBody := &findRestreamersRequest{ BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey}, @@ -67,7 +67,7 @@ func (o *compress) GetRestreamersOttAll(startFrom int, amount int) ([]Restreamer if resp.IsError() { return nil, fmt.Errorf("restreamers error") } - var obj []Restreamer + var obj []RestreamersOTTResponse if err := json.Unmarshal(resp.Body(), &obj); err != nil { return nil, err } diff --git a/compress/compress.go b/compress/compress.go index 44f18c5..6946e25 100644 --- a/compress/compress.go +++ b/compress/compress.go @@ -23,7 +23,7 @@ type ICompress interface { GetCategories() ([]Category, error) CreateCategory(name string) (*Category, error) GetRestreamers(startFrom int, amount int) ([]Restreamer, error) // startFrom int, amount int - GetRestreamersOttAll(startFrom int, amount int) ([]Restreamer, error) // startFrom int, amount int + GetRestreamersOttAll(startFrom int, amount int) ([]RestreamersOTTResponse, error) // startFrom int, amount int GetSingleRestreamer(instanceName string) (*Restreamer, error) ScaleRestreamer(instanceName string, scale int) (*ResponseServer, error) CreateEventsBulk(request []InstancesEventCreate) (*ResponseServer, error) diff --git a/compress/model_restreamer.go b/compress/model_restreamer.go index b07bb0e..2ad945c 100644 --- a/compress/model_restreamer.go +++ b/compress/model_restreamer.go @@ -39,6 +39,49 @@ type Restreamer struct { } +type RestreamersOTTResponse struct { + Instances []RestreamerOTT `json:"instances"` +} + +type RestreamerOTT struct { + ID int64 `json:"id"` + Enabled int64 `json:"enabled"` + Name string `json:"name"` + CustomerID int64 `json:"customer_id"` + Dnsname string `json:"dnsname"` + MarathonURL string `json:"marathon_url"` + NpmURL string `json:"npm_url"` + ExternalRtmp string `json:"external_rtmp"` + LoopbackRtmp LoopbackRtmp `json:"loopback_rtmp"` + Md5Generator interface{} `json:"md5_generator"` + MarathonPath MarathonPath `json:"marathon_path"` + Token string `json:"token"` + DockerTemplate string `json:"docker_template"` + Status int64 `json:"status"` + Owner string `json:"owner"` + Title string `json:"title"` + Description string `json:"description"` + OwnerID int64 `json:"owner_id"` + CDNPath string `json:"cdn_path"` + ExtendedData string `json:"extended_data"` + LatestEvent string `json:"latest_event"` + Label string `json:"label"` + Dedicated string `json:"dedicated"` + StaticIP string `json:"static_ip"` + NvidiaVisibleDevices string `json:"nvidia_visible_devices"` + Transcode int64 `json:"transcode"` + UpdateAt time.Time `json:"update_at"` + PassiveToken string `json:"passive_token"` + Zone string `json:"zone"` + Protocol string `json:"protocol"` + AwsURL string `json:"aws_url"` + DRMHLSURL string `json:"drm_hls_url"` + DRMDashURL string `json:"drm_dash_url"` + Settings RestreamerSettings `json:"settings"` + Srt *RestreamerSrt `json:"srt"` +} + + type RestreamerSettings struct { Id int `json:"id" ` EnableEncoding int `json:"enable_encoding" `