github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/koogallery/v1/assets/results.go (about) 1 package assets 2 3 import ( 4 "github.com/chnsz/golangsdk" 5 ) 6 7 type commonResult struct { 8 golangsdk.Result 9 } 10 11 type ListAssetsResult struct { 12 commonResult 13 } 14 15 func (r ListAssetsResult) Extract() ([]Data, error) { 16 var s ListAssetsResponse 17 err := r.ExtractInto(&s) 18 if err != nil { 19 return nil, err 20 } 21 return s.Data, nil 22 } 23 24 type ListAssetsResponse struct { 25 // Error Code 26 ErrCode string `json:"error_code"` 27 // Error Message 28 ErrMsg string `json:"error_msg"` 29 // List of datas 30 Data []Data `json:"data"` 31 } 32 33 type Data struct { 34 // Asset ID 35 AssetId string `json:"asset_id"` 36 // Deployed Type 37 DeployedType string `json:"deployed_type"` 38 // Version 39 Version string `json:"version"` 40 // Version ID 41 VersionId string `json:"version_id"` 42 // Region 43 Region string `json:"region"` 44 // Image Deployed Object 45 ImgDeployedObj ImageDeployedObj `json:"image_deployed_object"` 46 // Software Pkg Deployed Object 47 SwPkgDeployedObj SoftwarePkgDeployedObj `json:"software_pkg_deployed_object"` 48 } 49 50 type ImageDeployedObj struct { 51 // Image ID 52 ImageId string `json:"image_id"` 53 // Image Name 54 ImageName string `json:"image_name"` 55 // OS Type 56 OsType string `json:"os_type"` 57 // Create Time 58 CreateTime string `json:"create_time"` 59 // Architecture 60 Architecture string `json:"architecture"` 61 } 62 63 type SoftwarePkgDeployedObj struct { 64 // Package Name 65 PackageName string `json:"package_name"` 66 // Internal Path 67 InternalPath string `json:"internal_path"` 68 // Checksum 69 Checksum string `json:"checksum"` 70 }