github.com/gophercloud/gophercloud@v1.11.0/openstack/networking/v2/ports/testing/fixtures.go (about) 1 package testing 2 3 const ListResponse = ` 4 { 5 "ports": [ 6 { 7 "status": "ACTIVE", 8 "binding:host_id": "devstack", 9 "name": "", 10 "admin_state_up": true, 11 "network_id": "70c1db1f-b701-45bd-96e0-a313ee3430b3", 12 "tenant_id": "", 13 "device_owner": "network:router_gateway", 14 "mac_address": "fa:16:3e:58:42:ed", 15 "binding:vnic_type": "normal", 16 "fixed_ips": [ 17 { 18 "subnet_id": "008ba151-0b8c-4a67-98b5-0d2b87666062", 19 "ip_address": "172.24.4.2" 20 } 21 ], 22 "id": "d80b1a3b-4fc1-49f3-952e-1e2ab7081d8b", 23 "security_groups": [], 24 "dns_name": "test-port", 25 "dns_assignment": [ 26 { 27 "hostname": "test-port", 28 "ip_address": "172.24.4.2", 29 "fqdn": "test-port.openstack.local." 30 } 31 ], 32 "device_id": "9ae135f4-b6e0-4dad-9e91-3c223e385824", 33 "port_security_enabled": false, 34 "created_at": "2019-06-30T04:15:37", 35 "updated_at": "2019-06-30T05:18:49" 36 } 37 ] 38 } 39 ` 40 41 const GetResponse = ` 42 { 43 "port": { 44 "status": "ACTIVE", 45 "binding:host_id": "devstack", 46 "name": "", 47 "allowed_address_pairs": [], 48 "admin_state_up": true, 49 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 50 "tenant_id": "7e02058126cc4950b75f9970368ba177", 51 "extra_dhcp_opts": [], 52 "binding:vif_details": { 53 "port_filter": true, 54 "ovs_hybrid_plug": true 55 }, 56 "binding:vif_type": "ovs", 57 "device_owner": "network:router_interface", 58 "port_security_enabled": false, 59 "mac_address": "fa:16:3e:23:fd:d7", 60 "binding:profile": {}, 61 "binding:vnic_type": "normal", 62 "fixed_ips": [ 63 { 64 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 65 "ip_address": "10.0.0.1" 66 } 67 ], 68 "id": "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2", 69 "security_groups": [], 70 "dns_name": "test-port", 71 "dns_assignment": [ 72 { 73 "hostname": "test-port", 74 "ip_address": "172.24.4.2", 75 "fqdn": "test-port.openstack.local." 76 } 77 ], 78 "device_id": "5e3898d7-11be-483e-9732-b2f5eccd2b2e", 79 "created_at": "2019-06-30T04:15:37Z", 80 "updated_at": "2019-06-30T05:18:49Z" 81 } 82 } 83 ` 84 85 const CreateRequest = ` 86 { 87 "port": { 88 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 89 "name": "private-port", 90 "admin_state_up": true, 91 "fixed_ips": [ 92 { 93 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 94 "ip_address": "10.0.0.2" 95 } 96 ], 97 "security_groups": ["foo"], 98 "allowed_address_pairs": [ 99 { 100 "ip_address": "10.0.0.4", 101 "mac_address": "fa:16:3e:c9:cb:f0" 102 } 103 ] 104 } 105 } 106 ` 107 108 const CreateResponse = ` 109 { 110 "port": { 111 "status": "DOWN", 112 "name": "private-port", 113 "admin_state_up": true, 114 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 115 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 116 "device_owner": "", 117 "mac_address": "fa:16:3e:c9:cb:f0", 118 "fixed_ips": [ 119 { 120 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 121 "ip_address": "10.0.0.2" 122 } 123 ], 124 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 125 "security_groups": [ 126 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 127 ], 128 "allowed_address_pairs": [ 129 { 130 "ip_address": "10.0.0.4", 131 "mac_address": "fa:16:3e:c9:cb:f0" 132 } 133 ], 134 "device_id": "" 135 } 136 } 137 ` 138 139 const CreateOmitSecurityGroupsRequest = ` 140 { 141 "port": { 142 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 143 "name": "private-port", 144 "admin_state_up": true, 145 "fixed_ips": [ 146 { 147 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 148 "ip_address": "10.0.0.2" 149 } 150 ], 151 "allowed_address_pairs": [ 152 { 153 "ip_address": "10.0.0.4", 154 "mac_address": "fa:16:3e:c9:cb:f0" 155 } 156 ] 157 } 158 } 159 ` 160 161 const CreateWithNoSecurityGroupsRequest = ` 162 { 163 "port": { 164 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 165 "name": "private-port", 166 "admin_state_up": true, 167 "fixed_ips": [ 168 { 169 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 170 "ip_address": "10.0.0.2" 171 } 172 ], 173 "security_groups": [], 174 "allowed_address_pairs": [ 175 { 176 "ip_address": "10.0.0.4", 177 "mac_address": "fa:16:3e:c9:cb:f0" 178 } 179 ] 180 } 181 } 182 ` 183 184 const CreateWithNoSecurityGroupsResponse = ` 185 { 186 "port": { 187 "status": "DOWN", 188 "name": "private-port", 189 "admin_state_up": true, 190 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 191 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 192 "device_owner": "", 193 "mac_address": "fa:16:3e:c9:cb:f0", 194 "fixed_ips": [ 195 { 196 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 197 "ip_address": "10.0.0.2" 198 } 199 ], 200 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 201 "allowed_address_pairs": [ 202 { 203 "ip_address": "10.0.0.4", 204 "mac_address": "fa:16:3e:c9:cb:f0" 205 } 206 ], 207 "device_id": "" 208 } 209 } 210 ` 211 212 const CreateOmitSecurityGroupsResponse = ` 213 { 214 "port": { 215 "status": "DOWN", 216 "name": "private-port", 217 "admin_state_up": true, 218 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 219 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 220 "device_owner": "", 221 "mac_address": "fa:16:3e:c9:cb:f0", 222 "fixed_ips": [ 223 { 224 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 225 "ip_address": "10.0.0.2" 226 } 227 ], 228 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 229 "security_groups": [ 230 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 231 ], 232 "allowed_address_pairs": [ 233 { 234 "ip_address": "10.0.0.4", 235 "mac_address": "fa:16:3e:c9:cb:f0" 236 } 237 ], 238 "device_id": "" 239 } 240 } 241 ` 242 243 const CreatePropagateUplinkStatusRequest = ` 244 { 245 "port": { 246 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 247 "name": "private-port", 248 "admin_state_up": true, 249 "fixed_ips": [ 250 { 251 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 252 "ip_address": "10.0.0.2" 253 } 254 ], 255 "propagate_uplink_status": true 256 } 257 } 258 ` 259 260 const CreatePropagateUplinkStatusResponse = ` 261 { 262 "port": { 263 "status": "DOWN", 264 "name": "private-port", 265 "admin_state_up": true, 266 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 267 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 268 "device_owner": "", 269 "mac_address": "fa:16:3e:c9:cb:f0", 270 "fixed_ips": [ 271 { 272 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 273 "ip_address": "10.0.0.2" 274 } 275 ], 276 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 277 "propagate_uplink_status": true, 278 "device_id": "" 279 } 280 } 281 ` 282 283 const CreateValueSpecRequest = ` 284 { 285 "port": { 286 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 287 "name": "private-port", 288 "admin_state_up": true, 289 "fixed_ips": [ 290 { 291 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 292 "ip_address": "10.0.0.2" 293 } 294 ], 295 "security_groups": ["foo"], 296 "allowed_address_pairs": [ 297 { 298 "ip_address": "10.0.0.4", 299 "mac_address": "fa:16:3e:c9:cb:f0" 300 } 301 ], 302 "value_specs": { 303 "key": "value" 304 } 305 } 306 } 307 ` 308 309 const CreateValueSpecResponse = ` 310 { 311 "port": { 312 "status": "DOWN", 313 "name": "private-port", 314 "admin_state_up": true, 315 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 316 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 317 "device_owner": "", 318 "mac_address": "fa:16:3e:c9:cb:f0", 319 "fixed_ips": [ 320 { 321 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 322 "ip_address": "10.0.0.2" 323 } 324 ], 325 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 326 "security_groups": [ 327 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 328 ], 329 "allowed_address_pairs": [ 330 { 331 "ip_address": "10.0.0.4", 332 "mac_address": "fa:16:3e:c9:cb:f0" 333 } 334 ], 335 "value_specs": { 336 "key": "value" 337 }, 338 "device_id": "" 339 } 340 } 341 ` 342 343 const CreatePortSecurityRequest = ` 344 { 345 "port": { 346 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 347 "name": "private-port", 348 "admin_state_up": true, 349 "fixed_ips": [ 350 { 351 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 352 "ip_address": "10.0.0.2" 353 } 354 ], 355 "security_groups": ["foo"], 356 "allowed_address_pairs": [ 357 { 358 "ip_address": "10.0.0.4", 359 "mac_address": "fa:16:3e:c9:cb:f0" 360 } 361 ], 362 "port_security_enabled": false 363 } 364 } 365 ` 366 367 const CreatePortSecurityResponse = ` 368 { 369 "port": { 370 "status": "DOWN", 371 "name": "private-port", 372 "admin_state_up": true, 373 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 374 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 375 "device_owner": "", 376 "mac_address": "fa:16:3e:c9:cb:f0", 377 "fixed_ips": [ 378 { 379 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 380 "ip_address": "10.0.0.2" 381 } 382 ], 383 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 384 "security_groups": [ 385 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 386 ], 387 "allowed_address_pairs": [ 388 { 389 "ip_address": "10.0.0.4", 390 "mac_address": "fa:16:3e:c9:cb:f0" 391 } 392 ], 393 "device_id": "", 394 "port_security_enabled": false 395 } 396 } 397 ` 398 399 const UpdateRequest = ` 400 { 401 "port": { 402 "name": "new_port_name", 403 "fixed_ips": [ 404 { 405 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 406 "ip_address": "10.0.0.3" 407 } 408 ], 409 "allowed_address_pairs": [ 410 { 411 "ip_address": "10.0.0.4", 412 "mac_address": "fa:16:3e:c9:cb:f0" 413 } 414 ], 415 "security_groups": [ 416 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 417 ] 418 } 419 } 420 ` 421 422 const UpdateResponse = ` 423 { 424 "port": { 425 "status": "DOWN", 426 "name": "new_port_name", 427 "admin_state_up": true, 428 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 429 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 430 "device_owner": "", 431 "mac_address": "fa:16:3e:c9:cb:f0", 432 "fixed_ips": [ 433 { 434 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 435 "ip_address": "10.0.0.3" 436 } 437 ], 438 "allowed_address_pairs": [ 439 { 440 "ip_address": "10.0.0.4", 441 "mac_address": "fa:16:3e:c9:cb:f0" 442 } 443 ], 444 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 445 "security_groups": [ 446 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 447 ], 448 "device_id": "" 449 } 450 } 451 ` 452 453 const UpdateOmitSecurityGroupsRequest = ` 454 { 455 "port": { 456 "name": "new_port_name", 457 "fixed_ips": [ 458 { 459 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 460 "ip_address": "10.0.0.3" 461 } 462 ], 463 "allowed_address_pairs": [ 464 { 465 "ip_address": "10.0.0.4", 466 "mac_address": "fa:16:3e:c9:cb:f0" 467 } 468 ] 469 } 470 } 471 ` 472 473 const UpdateOmitSecurityGroupsResponse = ` 474 { 475 "port": { 476 "status": "DOWN", 477 "name": "new_port_name", 478 "admin_state_up": true, 479 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 480 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 481 "device_owner": "", 482 "mac_address": "fa:16:3e:c9:cb:f0", 483 "fixed_ips": [ 484 { 485 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 486 "ip_address": "10.0.0.3" 487 } 488 ], 489 "allowed_address_pairs": [ 490 { 491 "ip_address": "10.0.0.4", 492 "mac_address": "fa:16:3e:c9:cb:f0" 493 } 494 ], 495 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 496 "security_groups": [ 497 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 498 ], 499 "device_id": "" 500 } 501 } 502 ` 503 504 const UpdatePropagateUplinkStatusRequest = ` 505 { 506 "port": { 507 "propagate_uplink_status": true 508 } 509 } 510 ` 511 512 const UpdatePropagateUplinkStatusResponse = ` 513 { 514 "port": { 515 "status": "DOWN", 516 "name": "new_port_name", 517 "admin_state_up": true, 518 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 519 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 520 "device_owner": "", 521 "mac_address": "fa:16:3e:c9:cb:f0", 522 "fixed_ips": [ 523 { 524 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 525 "ip_address": "10.0.0.3" 526 } 527 ], 528 "allowed_address_pairs": [ 529 { 530 "ip_address": "10.0.0.4", 531 "mac_address": "fa:16:3e:c9:cb:f0" 532 } 533 ], 534 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 535 "security_groups": [ 536 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 537 ], 538 "propagate_uplink_status": true, 539 "device_id": "" 540 } 541 } 542 ` 543 544 const UpdateValueSpecsRequest = ` 545 { 546 "port": { 547 "value_specs": { 548 "key": "value" 549 } 550 } 551 } 552 ` 553 554 const UpdateValueSpecsResponse = ` 555 { 556 "port": { 557 "status": "DOWN", 558 "name": "new_port_name", 559 "admin_state_up": true, 560 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 561 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 562 "device_owner": "", 563 "mac_address": "fa:16:3e:c9:cb:f0", 564 "fixed_ips": [ 565 { 566 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 567 "ip_address": "10.0.0.3" 568 } 569 ], 570 "allowed_address_pairs": [ 571 { 572 "ip_address": "10.0.0.4", 573 "mac_address": "fa:16:3e:c9:cb:f0" 574 } 575 ], 576 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 577 "security_groups": [ 578 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 579 ], 580 "value_specs": { 581 "key": "value" 582 }, 583 "device_id": "" 584 } 585 } 586 ` 587 588 const UpdatePortSecurityRequest = ` 589 { 590 "port": { 591 "port_security_enabled": false 592 } 593 } 594 ` 595 596 const UpdatePortSecurityResponse = ` 597 { 598 "port": { 599 "status": "DOWN", 600 "name": "private-port", 601 "admin_state_up": true, 602 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 603 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 604 "device_owner": "", 605 "mac_address": "fa:16:3e:c9:cb:f0", 606 "fixed_ips": [ 607 { 608 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 609 "ip_address": "10.0.0.2" 610 } 611 ], 612 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 613 "security_groups": [ 614 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 615 ], 616 "allowed_address_pairs": [ 617 { 618 "ip_address": "10.0.0.4", 619 "mac_address": "fa:16:3e:c9:cb:f0" 620 } 621 ], 622 "device_id": "", 623 "port_security_enabled": false 624 } 625 } 626 ` 627 628 const RemoveSecurityGroupRequest = ` 629 { 630 "port": { 631 "name": "new_port_name", 632 "fixed_ips": [ 633 { 634 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 635 "ip_address": "10.0.0.3" 636 } 637 ], 638 "allowed_address_pairs": [ 639 { 640 "ip_address": "10.0.0.4", 641 "mac_address": "fa:16:3e:c9:cb:f0" 642 } 643 ], 644 "security_groups": [] 645 } 646 } 647 ` 648 649 const RemoveSecurityGroupResponse = ` 650 { 651 "port": { 652 "status": "DOWN", 653 "name": "new_port_name", 654 "admin_state_up": true, 655 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 656 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 657 "device_owner": "", 658 "mac_address": "fa:16:3e:c9:cb:f0", 659 "fixed_ips": [ 660 { 661 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 662 "ip_address": "10.0.0.3" 663 } 664 ], 665 "allowed_address_pairs": [ 666 { 667 "ip_address": "10.0.0.4", 668 "mac_address": "fa:16:3e:c9:cb:f0" 669 } 670 ], 671 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 672 "device_id": "" 673 } 674 } 675 ` 676 677 const RemoveAllowedAddressPairsRequest = ` 678 { 679 "port": { 680 "name": "new_port_name", 681 "fixed_ips": [ 682 { 683 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 684 "ip_address": "10.0.0.3" 685 } 686 ], 687 "allowed_address_pairs": [], 688 "security_groups": [ 689 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 690 ] 691 } 692 } 693 ` 694 695 const RemoveAllowedAddressPairsResponse = ` 696 { 697 "port": { 698 "status": "DOWN", 699 "name": "new_port_name", 700 "admin_state_up": true, 701 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 702 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 703 "device_owner": "", 704 "mac_address": "fa:16:3e:c9:cb:f0", 705 "fixed_ips": [ 706 { 707 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 708 "ip_address": "10.0.0.3" 709 } 710 ], 711 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 712 "security_groups": [ 713 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 714 ], 715 "device_id": "" 716 } 717 } 718 ` 719 720 const DontUpdateAllowedAddressPairsRequest = ` 721 { 722 "port": { 723 "name": "new_port_name", 724 "fixed_ips": [ 725 { 726 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 727 "ip_address": "10.0.0.3" 728 } 729 ], 730 "security_groups": [ 731 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 732 ] 733 } 734 } 735 ` 736 737 const DontUpdateAllowedAddressPairsResponse = ` 738 { 739 "port": { 740 "status": "DOWN", 741 "name": "new_port_name", 742 "admin_state_up": true, 743 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 744 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 745 "device_owner": "", 746 "mac_address": "fa:16:3e:c9:cb:f0", 747 "fixed_ips": [ 748 { 749 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 750 "ip_address": "10.0.0.3" 751 } 752 ], 753 "allowed_address_pairs": [ 754 { 755 "ip_address": "10.0.0.4", 756 "mac_address": "fa:16:3e:c9:cb:f0" 757 } 758 ], 759 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 760 "security_groups": [ 761 "f0ac4394-7e4a-4409-9701-ba8be283dbc3" 762 ], 763 "device_id": "" 764 } 765 } 766 ` 767 768 // GetWithExtraDHCPOptsResponse represents a raw port response with extra 769 // DHCP options. 770 const GetWithExtraDHCPOptsResponse = ` 771 { 772 "port": { 773 "status": "ACTIVE", 774 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 775 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 776 "extra_dhcp_opts": [ 777 { 778 "opt_name": "option1", 779 "opt_value": "value1", 780 "ip_version": 4 781 }, 782 { 783 "opt_name": "option2", 784 "opt_value": "value2", 785 "ip_version": 4 786 } 787 ], 788 "admin_state_up": true, 789 "name": "port-with-extra-dhcp-opts", 790 "device_owner": "", 791 "mac_address": "fa:16:3e:c9:cb:f0", 792 "fixed_ips": [ 793 { 794 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 795 "ip_address": "10.0.0.4" 796 } 797 ], 798 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 799 "device_id": "" 800 } 801 } 802 ` 803 804 // CreateWithExtraDHCPOptsRequest represents a raw port creation request 805 // with extra DHCP options. 806 const CreateWithExtraDHCPOptsRequest = ` 807 { 808 "port": { 809 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 810 "name": "port-with-extra-dhcp-opts", 811 "admin_state_up": true, 812 "fixed_ips": [ 813 { 814 "ip_address": "10.0.0.2", 815 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2" 816 } 817 ], 818 "extra_dhcp_opts": [ 819 { 820 "opt_name": "option1", 821 "opt_value": "value1" 822 } 823 ] 824 } 825 } 826 ` 827 828 // CreateWithExtraDHCPOptsResponse represents a raw port creation response 829 // with extra DHCP options. 830 const CreateWithExtraDHCPOptsResponse = ` 831 { 832 "port": { 833 "status": "DOWN", 834 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 835 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 836 "extra_dhcp_opts": [ 837 { 838 "opt_name": "option1", 839 "opt_value": "value1", 840 "ip_version": 4 841 } 842 ], 843 "admin_state_up": true, 844 "name": "port-with-extra-dhcp-opts", 845 "device_owner": "", 846 "mac_address": "fa:16:3e:c9:cb:f0", 847 "fixed_ips": [ 848 { 849 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 850 "ip_address": "10.0.0.2" 851 } 852 ], 853 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 854 "device_id": "" 855 } 856 } 857 ` 858 859 // UpdateWithExtraDHCPOptsRequest represents a raw port update request with 860 // extra DHCP options. 861 const UpdateWithExtraDHCPOptsRequest = ` 862 { 863 "port": { 864 "name": "updated-port-with-dhcp-opts", 865 "fixed_ips": [ 866 { 867 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 868 "ip_address": "10.0.0.3" 869 } 870 ], 871 "extra_dhcp_opts": [ 872 { 873 "opt_name": "option1", 874 "opt_value": null 875 }, 876 { 877 "opt_name": "option2", 878 "opt_value": "value2" 879 } 880 ] 881 } 882 } 883 ` 884 885 // UpdateWithExtraDHCPOptsResponse represents a raw port update response with 886 // extra DHCP options. 887 const UpdateWithExtraDHCPOptsResponse = ` 888 { 889 "port": { 890 "status": "DOWN", 891 "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7", 892 "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa", 893 "extra_dhcp_opts": [ 894 { 895 "opt_name": "option2", 896 "opt_value": "value2", 897 "ip_version": 4 898 } 899 ], 900 "admin_state_up": true, 901 "name": "updated-port-with-dhcp-opts", 902 "device_owner": "", 903 "mac_address": "fa:16:3e:c9:cb:f0", 904 "fixed_ips": [ 905 { 906 "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2", 907 "ip_address": "10.0.0.3" 908 } 909 ], 910 "id": "65c0ee9f-d634-4522-8954-51021b570b0d", 911 "device_id": "" 912 } 913 } 914 `