|
1 | 1 | package testing |
2 | 2 |
|
| 3 | +import ( |
| 4 | + "time" |
| 5 | + |
| 6 | + "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/qos/policies" |
| 7 | +) |
| 8 | + |
3 | 9 | const GetPortResponse = ` |
4 | 10 | { |
5 | 11 | "port": { |
@@ -132,3 +138,80 @@ const UpdateNetworkWithoutPolicyResponse = ` |
132 | 138 | } |
133 | 139 | } |
134 | 140 | ` |
| 141 | + |
| 142 | +const ListPoliciesResponse = ` |
| 143 | +{ |
| 144 | + "policies": [ |
| 145 | + { |
| 146 | + "name": "bw-limiter", |
| 147 | + "tags": [], |
| 148 | + "rules": [ |
| 149 | + { |
| 150 | + "max_kbps": 3000, |
| 151 | + "direction": "egress", |
| 152 | + "qos_policy_id": "d6ae28ce-fcb5-4180-aa62-d260a27e09ae", |
| 153 | + "type": "bandwidth_limit", |
| 154 | + "id": "30a57f4a-336b-4382-8275-d708babd2241", |
| 155 | + "max_burst_kbps": 300 |
| 156 | + } |
| 157 | + ], |
| 158 | + "tenant_id": "a77cbe0998374aed9a6798ad6c61677e", |
| 159 | + "created_at": "2019-05-19T11:17:50Z", |
| 160 | + "updated_at": "2019-05-19T11:17:57Z", |
| 161 | + "is_default": false, |
| 162 | + "revision_number": 1, |
| 163 | + "shared": false, |
| 164 | + "project_id": "a77cbe0998374aed9a6798ad6c61677e", |
| 165 | + "id": "d6ae28ce-fcb5-4180-aa62-d260a27e09ae", |
| 166 | + "description": "" |
| 167 | + }, |
| 168 | + { |
| 169 | + "name": "no-rules", |
| 170 | + "tags": [], |
| 171 | + "rules": [], |
| 172 | + "tenant_id": "a77cbe0998374aed9a6798ad6c61677e", |
| 173 | + "created_at": "2019-06-01T10:38:58Z", |
| 174 | + "updated_at": "2019-06-01T10:38:58Z", |
| 175 | + "is_default": false, |
| 176 | + "revision_number": 0, |
| 177 | + "shared": false, |
| 178 | + "project_id": "a77cbe0998374aed9a6798ad6c61677e", |
| 179 | + "id": "d6e7c2fe-24dc-43be-a088-24b47d4f8f88", |
| 180 | + "description": "" |
| 181 | + } |
| 182 | + ] |
| 183 | +} |
| 184 | +` |
| 185 | + |
| 186 | +var Policy1 = policies.Policy{ |
| 187 | + Name: "bw-limiter", |
| 188 | + Rules: []map[string]interface{}{ |
| 189 | + { |
| 190 | + "type": "bandwidth_limit", |
| 191 | + "max_kbps": float64(3000), |
| 192 | + "direction": "egress", |
| 193 | + "qos_policy_id": "d6ae28ce-fcb5-4180-aa62-d260a27e09ae", |
| 194 | + "max_burst_kbps": float64(300), |
| 195 | + "id": "30a57f4a-336b-4382-8275-d708babd2241", |
| 196 | + }, |
| 197 | + }, |
| 198 | + Tags: []string{}, |
| 199 | + TenantID: "a77cbe0998374aed9a6798ad6c61677e", |
| 200 | + CreatedAt: time.Date(2019, 5, 19, 11, 17, 50, 0, time.UTC), |
| 201 | + UpdatedAt: time.Date(2019, 5, 19, 11, 17, 57, 0, time.UTC), |
| 202 | + RevisionNumber: 1, |
| 203 | + ProjectID: "a77cbe0998374aed9a6798ad6c61677e", |
| 204 | + ID: "d6ae28ce-fcb5-4180-aa62-d260a27e09ae", |
| 205 | +} |
| 206 | + |
| 207 | +var Policy2 = policies.Policy{ |
| 208 | + Name: "no-rules", |
| 209 | + Tags: []string{}, |
| 210 | + Rules: []map[string]interface{}{}, |
| 211 | + TenantID: "a77cbe0998374aed9a6798ad6c61677e", |
| 212 | + CreatedAt: time.Date(2019, 6, 1, 10, 38, 58, 0, time.UTC), |
| 213 | + UpdatedAt: time.Date(2019, 6, 1, 10, 38, 58, 0, time.UTC), |
| 214 | + RevisionNumber: 0, |
| 215 | + ProjectID: "a77cbe0998374aed9a6798ad6c61677e", |
| 216 | + ID: "d6e7c2fe-24dc-43be-a088-24b47d4f8f88", |
| 217 | +} |
0 commit comments