github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/waf-premium/v1/instances/Get.go (about) 1 package instances 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 6 ) 7 8 func Get(client *golangsdk.ServiceClient, id string) (*Instance, error) { 9 // GET /v1/{project_id}/premium-waf/instance 10 raw, err := client.Get(client.ServiceURL("premium-waf", "instance", id), nil, nil) 11 if err != nil { 12 return nil, err 13 } 14 15 var res Instance 16 return &res, extract.Into(raw.Body, &res) 17 } 18 19 type Instance struct { 20 // ID of the dedicated WAF engine. 21 ID string `json:"id"` 22 // Name of the dedicated WAF engine. 23 Name string `json:"instance_name"` 24 // Region where a dedicated engine is to be created. Its value is EU-DE. 25 Region string `json:"region"` 26 // Az ID. 27 AvailabilityZone string `json:"zone"` 28 // CPU architecture. 29 Architecture string `json:"arch"` 30 // ECS specification ID. 31 Flavor string `json:"cpu_flavor"` 32 // ID of the VPC where the dedicated engine is located. 33 VpcID string `json:"vpc_id"` 34 // Subnet ID of the VPC where the dedicated engine is located. 35 SubnetId string `json:"subnet_id"` 36 // Service plane IP address of the dedicated engine. 37 ServiceIp string `json:"service_ip"` 38 // IPv6 address of the service plane of the dedicated engine. 39 ServiceIpv6 string `json:"service_ipv6"` 40 // Security groups bound to the dedicated engine ECS. 41 SecurityGroups []string `json:"security_group_ids"` 42 // Billing status of dedicated WAF engine. The value can be 0, 1, or 2. 43 // 0: The billing is normal. 44 // 1: The billing account is frozen. Resources 45 // and data will be retained, but the cloud 46 // services cannot be used by the account. 47 // 2: The billing is terminated. Resources and data will be cleared. 48 BillingStatus int `json:"status"` 49 // Running status of the dedicated engine. The value can be: 50 // 0 (creating) 51 // 1 (running) 52 // 2 (deleting) 53 // 3 (deleted) 54 // 4 (creation failed) 55 // 5 (frozen) 56 // 6 (abnormal) 57 // 7 (updating) 58 // 8 (update failed). 59 Status int `json:"run_status"` 60 // Access status of the dedicated engine. The value can be 0 or 1. 61 // 0: the dedicated engine is not connected. 62 // 1: the dedicated engine is connected. 63 AccessStatus int `json:"access_status"` 64 // Whether the dedicated engine can be upgraded. 65 // The value can be 0 for no or 1 for yes. 66 Upgradable int `json:"upgradable"` 67 // Dedicated engine ECS specification for example, 68 // 8 vCPUs | 16 GB. 69 Specification string `json:"specification"` 70 // Domain name protected by the dedicated engine. 71 Hosts []HostEntry `json:"hosts"` 72 // ID of the ECS hosting the dedicated engine. 73 ServerId string `json:"server_id"` 74 // Timestamp when the dedicated WAF engine was created. 75 CreatedAt int `json:"create_time"` 76 // Resource specifications code. 77 // This code is used to identify the resource specifications the dedicated engine uses. 78 ResourceSpecification string `json:"resourceSpecCode"` 79 } 80 81 type HostEntry struct { 82 // ID of the protected domain name. This is a 83 // unique ID automatically generated by the system. 84 ID string `json:"id"` 85 // Protected domain name 86 Hostname string `json:"hostname"` 87 }