github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dis/v2/apps/GetApp.go (about)

     1  package apps
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func GetApp(client *golangsdk.ServiceClient, appName string) (*GetAppResponse, error) {
     9  	// GET /v2/{project_id}/apps/{app_name}
    10  	raw, err := client.Get(client.ServiceURL("apps", appName), nil, nil)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  
    15  	var res GetAppResponse
    16  	err = extract.Into(raw.Body, &res)
    17  	return &res, err
    18  }
    19  
    20  type GetAppResponse struct {
    21  	// Name of the app.
    22  	AppName string `json:"app_name,omitempty"`
    23  	// Unique identifier of the app.
    24  	AppId string `json:"app_id,omitempty"`
    25  	// Time when the app is created, in milliseconds.
    26  	CreateTime *int64 `json:"create_time,omitempty"`
    27  	// List of associated streams.
    28  	CommitCheckPointStreamNames []string `json:"commit_checkpoint_stream_names,omitempty"`
    29  }