github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/ims/v2/members/GetMember.go (about) 1 package members 2 3 import ( 4 "time" 5 6 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 7 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 8 ) 9 10 type GetMemberOpts struct { 11 ImageId string `json:"-" required:"true"` 12 MemberId string `json:"-" required:"true"` 13 } 14 15 func GetMember(client *golangsdk.ServiceClient, opts GetMemberOpts) (*Member, error) { 16 // GET /v2/images/{image_id}/members/{member_id} 17 raw, err := client.Get(client.ServiceURL("images", opts.ImageId, "members", opts.MemberId), nil, nil) 18 if err != nil { 19 return nil, err 20 } 21 22 var res Member 23 err = extract.Into(raw.Body, &res) 24 return &res, err 25 } 26 27 type Member struct { 28 // Specifies the image sharing status. 29 Status string `json:"status"` 30 // Specifies the time when a shared image was created. The value is in UTC format. 31 CreatedAt time.Time `json:"created_at"` 32 // Specifies the time when a shared image was updated. The value is in UTC format. 33 UpdatedAt time.Time `json:"updated_at"` 34 // Specifies the image ID. 35 ImageId string `json:"image_id"` 36 // Specifies the member ID. 37 MemberId string `json:"member_id"` 38 // Specifies the sharing schema. 39 Schema string `json:"schema"` 40 }