github.com/mmatczuk/gohan@v0.0.0-20170206152520-30e45d9bdb69/cloud/keystone_test_utils.go (about) 1 // Copyright (C) 2015 NTT Innovation Institute, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 // implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 16 package cloud 17 18 func getV2TokensResponse() interface{} { 19 return map[string]interface{}{ 20 "access": map[string]interface{}{ 21 "token": map[string]interface{}{ 22 "expires": "2014-01-31T15:30:58Z", 23 "id": "admin_token", 24 "issued_at": "2014-01-30T15:30:58.819584", 25 "tenant": map[string]interface{}{ 26 "description": nil, 27 "enabled": true, 28 "id": "1234", 29 "name": "admin", 30 }, 31 }, 32 }, 33 } 34 } 35 36 func getV3TokensResponse() interface{} { 37 return map[string]interface{}{ 38 "token": map[string]interface{}{ 39 "expires_at": "2013-02-27T18:30:59.999999Z", 40 "issued_at": "2013-02-27T16:30:59.999999Z", 41 "methods": []string{ 42 "password", 43 }, 44 "user": map[string]interface{}{ 45 "domain": map[string]interface{}{ 46 "id": "111", 47 "name": "domain", 48 }, 49 "id": "1234", 50 "name": "admin", 51 }, 52 }, 53 } 54 } 55 56 func getV2TenantsResponse() interface{} { 57 return map[string]interface{}{ 58 "tenants": []interface{}{ 59 map[string]interface{}{ 60 "id": "1234", 61 "name": "admin", 62 "description": "admin description", 63 "enabled": true, 64 }, 65 map[string]interface{}{ 66 "id": "3456", 67 "name": "demo", 68 "description": "demo description", 69 "enabled": true, 70 }, 71 }, 72 } 73 } 74 75 func getV3TenantsResponse() interface{} { 76 return map[string]interface{}{ 77 "projects": []interface{}{ 78 map[string]interface{}{ 79 "id": "1234", 80 "name": "admin", 81 "description": "admin description", 82 "enabled": true, 83 }, 84 map[string]interface{}{ 85 "id": "3456", 86 "name": "demo", 87 "description": "demo description", 88 "enabled": true, 89 }, 90 }, 91 } 92 }