github.com/gophercloud/gophercloud@v1.11.0/openstack/networking/v2/extensions/quotas/testing/fixtures_test.go (about) 1 package testing 2 3 import ( 4 "github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/quotas" 5 ) 6 7 const GetResponseRaw = ` 8 { 9 "quota": { 10 "floatingip": 15, 11 "network": 20, 12 "port": 25, 13 "rbac_policy": -1, 14 "router": 30, 15 "security_group": 35, 16 "security_group_rule": 40, 17 "subnet": 45, 18 "subnetpool": -1, 19 "trunk": 50 20 } 21 } 22 ` 23 24 // GetDetailedResponseRaw is a sample response to a Get call with the detailed option. 25 // 26 // One "reserved" property is returned as a string to reflect a buggy behaviour 27 // of Neutron. 28 // 29 // cf. https://bugs.launchpad.net/neutron/+bug/1918565 30 const GetDetailedResponseRaw = ` 31 { 32 "quota" : { 33 "floatingip" : { 34 "used": 0, 35 "limit": 15, 36 "reserved": 0 37 }, 38 "network" : { 39 "used": 0, 40 "limit": 20, 41 "reserved": 0 42 }, 43 "port" : { 44 "used": 0, 45 "limit": 25, 46 "reserved": "0" 47 }, 48 "rbac_policy" : { 49 "used": 0, 50 "limit": -1, 51 "reserved": 0 52 }, 53 "router" : { 54 "used": 0, 55 "limit": 30, 56 "reserved": 0 57 }, 58 "security_group" : { 59 "used": 0, 60 "limit": 35, 61 "reserved": 0 62 }, 63 "security_group_rule" : { 64 "used": 0, 65 "limit": 40, 66 "reserved": 0 67 }, 68 "subnet" : { 69 "used": 0, 70 "limit": 45, 71 "reserved": 0 72 }, 73 "subnetpool" : { 74 "used": 0, 75 "limit": -1, 76 "reserved": 0 77 }, 78 "trunk" : { 79 "used": 0, 80 "limit": 50, 81 "reserved": 0 82 } 83 } 84 } 85 ` 86 87 var GetResponse = quotas.Quota{ 88 FloatingIP: 15, 89 Network: 20, 90 Port: 25, 91 RBACPolicy: -1, 92 Router: 30, 93 SecurityGroup: 35, 94 SecurityGroupRule: 40, 95 Subnet: 45, 96 SubnetPool: -1, 97 Trunk: 50, 98 } 99 100 // GetDetailResponse is the first result in ListOutput. 101 var GetDetailResponse = quotas.QuotaDetailSet{ 102 FloatingIP: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 15}, 103 Network: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 20}, 104 Port: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 25}, 105 RBACPolicy: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: -1}, 106 Router: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 30}, 107 SecurityGroup: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 35}, 108 SecurityGroupRule: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 40}, 109 Subnet: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 45}, 110 SubnetPool: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: -1}, 111 Trunk: quotas.QuotaDetail{Used: 0, Reserved: 0, Limit: 50}, 112 } 113 114 const UpdateRequestResponseRaw = ` 115 { 116 "quota": { 117 "floatingip": 0, 118 "network": -1, 119 "port": 5, 120 "rbac_policy": 10, 121 "router": 15, 122 "security_group": 20, 123 "security_group_rule": -1, 124 "subnet": 25, 125 "subnetpool": 0, 126 "trunk": 5 127 } 128 } 129 ` 130 131 var UpdateResponse = quotas.Quota{ 132 FloatingIP: 0, 133 Network: -1, 134 Port: 5, 135 RBACPolicy: 10, 136 Router: 15, 137 SecurityGroup: 20, 138 SecurityGroupRule: -1, 139 Subnet: 25, 140 SubnetPool: 0, 141 Trunk: 5, 142 }