github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/dayu/v1/instances/results.go (about) 1 package instances 2 3 import ( 4 "github.com/chnsz/golangsdk" 5 ) 6 7 // CreateResult represents the result of a Create operation. 8 // Call its Extract method to get the response body. 9 type CreateResult struct { 10 golangsdk.Result 11 } 12 13 // Extract is a function that accepts a result and extracts the response body. 14 func (r CreateResult) Extract() (OrderInfo, error) { 15 var resp OrderInfo 16 err := r.ExtractInto(&resp) 17 return resp, err 18 } 19 20 // OrderInfo is the response body of a Create operation. 21 type OrderInfo struct { 22 ID string `json:"resource_id"` 23 OrderID string `json:"order_id"` 24 } 25 26 // Instance represents a DataArts Studio instance. 27 type Instance struct { 28 ID string `json:"resource_id"` 29 Name string `json:"resource_name"` 30 Type string `json:"resource_type"` 31 SpecCode string `json:"resource_spec_code"` 32 ProductID string `json:"product_id"` 33 VpcID string `json:"vpc_id"` 34 SubnetID string `json:"net_id"` 35 SecurityGroupID string `json:"security_group_id"` 36 WorkspaceMode string `json:"work_space_mode"` 37 Status int `json:"status"` 38 39 OrderID string `json:"order_id"` 40 OrderType string `json:"order_type"` 41 ChargeType string `json:"charge_type"` 42 43 EffectiveTime int64 `json:"effective_time"` 44 ExpireTime int64 `json:"expire_time"` 45 ExpireDays string `json:"expire_days"` 46 CreateUser string `json:"create_user"` 47 CreateTime int64 `json:"create_time"` 48 49 IsTrialOrder int `json:"is_trial_order"` 50 IsAutoRenew int `json:"is_auto_renew"` 51 52 Region string `json:"region_id"` 53 AvailabilityZone string `json:"availability_zone"` 54 ProjectID string `json:"project_id"` 55 DomainID string `json:"domain_id"` 56 EnterpriseProjectID string `json:"eps_id"` 57 }