github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/swr/v2/repositories/Get.go (about)

     1  package repositories
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     6  )
     7  
     8  func Get(client *golangsdk.ServiceClient, organization, repository string) (*ImageRepository, error) {
     9  	// GET /v2/manage/namespaces/{namespace}/repos/{repository}
    10  	raw, err := client.Get(client.ServiceURL("manage", "namespaces", organization, "repos", repository), nil, nil)
    11  	if err != nil {
    12  		return nil, err
    13  	}
    14  
    15  	var res ImageRepository
    16  	err = extract.IntoStructPtr(raw.Body, &res, "")
    17  	return &res, err
    18  }
    19  
    20  type ImageRepository struct {
    21  	// Image repository ID.
    22  	ID int `json:"id"`
    23  	// Organization ID.
    24  	OrganizationID int `json:"ns_id"`
    25  	// Image repository name.
    26  	Name string `json:"name"`
    27  	// Image repository type. The value can be app_server, linux, framework_app, database, lang, other, windows, or arm.
    28  	Category string `json:"category"`
    29  	// Brief description of the image repository.
    30  	Description string `json:"description"`
    31  	// Image repository creator ID.
    32  	CreatorID string `json:"creator_id"`
    33  	// Image repository creator.
    34  	CreatorName string `json:"creator_name"`
    35  	// Image repository size.
    36  	Size int `json:"size"`
    37  	// Whether the image repository is a public repository. The value can be true or false.
    38  	IsPublic bool `json:"is_public"`
    39  	// Number of images in an image repository.
    40  	NumImages int `json:"num_images"`
    41  	// Download times of an image repository.
    42  	NumDownloads int `json:"num_downloads"`
    43  	// URL of the image repository logo image. This field has been discarded and is left empty by default.
    44  	URL string `json:"url"`
    45  	// External image pull address. The format is {Repository address}/{Namespace name}/{Repository name}.
    46  	Path string `json:"path"`
    47  	// Internal image pull address. The format is {Repository address}/{Namespace name}/{Repository name}.
    48  	InternalPath string `json:"internal_path"`
    49  	// Time when an image repository is created. It is the UTC standard time.
    50  	Created string `json:"created"`
    51  	// Time when an image repository is updated. It is the UTC standard time.
    52  	Updated string `json:"updated"`
    53  	// Account ID.
    54  	DomainID string `json:"domain_id"`
    55  	// Image sorting priority.
    56  	Priority int `json:"priority"`
    57  }