github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/vpcep/v1/endpoints/testing/fixtures.go (about) 1 package testing 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud/openstack/common/tags" 5 "github.com/opentelekomcloud/gophertelekomcloud/openstack/vpcep/v1/endpoints" 6 "github.com/opentelekomcloud/gophertelekomcloud/openstack/vpcep/v1/services" 7 ) 8 9 const ( 10 createRequest = ` 11 { 12 "subnet_id": "68bfbcc1-dff2-47e4-a9d4-332b9bc1b8de", 13 "vpc_id": "84758cf5-9c62-43ae-a778-3dbd8370c0a4", 14 "tags": [ 15 { 16 "key": "test1", 17 "value": "test1" 18 } 19 ], 20 "endpoint_service_id": "e0c748b7-d982-47df-ba06-b9c8c7650c1a", 21 "enable_dns": true 22 } 23 ` 24 createResponse = ` 25 { 26 "id": "4189d3c2-8882-4871-a3c2-d380272eed83", 27 "service_type": "interface", 28 "marker_id": 322312312312, 29 "status": "creating", 30 "vpc_id": "84758cf5-9c62-43ae-a778-3dbd8370c0a4", 31 "enable_dns": true, 32 "endpoint_service_name": "test123", 33 "endpoint_service_id": "e0c748b7-d982-47df-ba06-b9c8c7650c1a", 34 "project_id": "6e9dfd51d1124e8d8498dce894923a0d", 35 "created_at": "2018-01-30T07:42:01.174", 36 "updated_at": "2018-01-30T07:42:01.174", 37 "tags": [ 38 { 39 "key": "test1", 40 "value": "test1" 41 } 42 ] 43 } 44 ` 45 46 listResponse = ` 47 { 48 "endpoints": [ 49 { 50 "id": "03184a04-95d5-4555-86c4-e767a371ff99", 51 "status": "accepted", 52 "ip": "192.168.0.232", 53 "marker_id": 16777337, 54 "active_status": [ 55 "active" 56 ], 57 "vpc_id": "84758cf5-9c62-43ae-a778-3dbd8370c0a4", 58 "service_type": "interface", 59 "project_id": "295dacf46a4842fcbf7844dc2dc2489d", 60 "subnet_id": "68bfbcc1-dff2-47e4-a9d4-332b9bc1b8de", 61 "enable_dns": true, 62 "dns_name": "test123", 63 "created_at": "2018-10-18T06:49:46Z", 64 "updated_at": "2018-10-18T06:49:50Z", 65 "endpoint_service_id": "5133655d-0e28-4090-b669-13f87b355c78", 66 "endpoint_service_name": "test123", 67 "whitelist": [ 68 "127.0.0.1" 69 ], 70 "enable_whitelist": true, 71 "tags": [ 72 { 73 "key": "test1", 74 "value": "test1" 75 } 76 ] 77 }, 78 { 79 "id": "43b0e3b0-eec9-49da-866b-6687b75f9fe5", 80 "status": "accepted", 81 "ip": "192.168.0.115", 82 "marker_id": 16777322, 83 "active_status": [ 84 "active" 85 ], 86 "vpc_id": "84758cf5-9c62-43ae-a778-3dbd8370c0a4", 87 "service_type": "interface", 88 "project_id": "295dacf46a4842fcbf7844dc2dc2489d", 89 "subnet_id": "65528a22-59a1-4972-ba64-88984b3207cd", 90 "enable_dns": true, 91 "dns_name": "test123", 92 "created_at": "2018-10-18T06:36:20Z", 93 "updated_at": "2018-10-18T06:36:24Z", 94 "endpoint_service_id": "5133655d-0e28-4090-b669-13f87b355c78", 95 "endpoint_service_name": "test123", 96 "whitelist": [ 97 "127.0.0.1" 98 ], 99 "enable_whitelist": true, 100 "tags": [ 101 { 102 "key": "test1", 103 "value": "test1" 104 } 105 ] 106 } 107 ], 108 "total_count": 17 109 } 110 ` 111 ) 112 113 var expected = &endpoints.Endpoint{ 114 ID: "4189d3c2-8882-4871-a3c2-d380272eed83", 115 ServiceType: services.ServiceTypeInterface, 116 MarkerID: 322312312312, 117 Status: endpoints.StatusCreating, 118 RouterID: "84758cf5-9c62-43ae-a778-3dbd8370c0a4", 119 EnableDNS: true, 120 ServiceName: "test123", 121 ServiceID: "e0c748b7-d982-47df-ba06-b9c8c7650c1a", 122 ProjectID: "6e9dfd51d1124e8d8498dce894923a0d", 123 CreatedAt: "2018-01-30T07:42:01.174", 124 UpdatedAt: "2018-01-30T07:42:01.174", 125 Tags: []tags.ResourceTag{{Key: "test1", Value: "test1"}}, 126 }