Ghanshyam | 2af64af | 2014-03-24 11:45:42 +0900 | [diff] [blame] | 1 | # Copyright 2014 NEC Corporation. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # 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, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
Ghanshyam | 44f74a4 | 2014-03-24 19:22:40 +0900 | [diff] [blame] | 15 | from tempest.api_schema.compute import keypairs |
| 16 | |
Ghanshyam | 2af64af | 2014-03-24 11:45:42 +0900 | [diff] [blame] | 17 | get_keypair = { |
| 18 | 'status_code': [200], |
| 19 | 'response_body': { |
| 20 | 'type': 'object', |
| 21 | 'properties': { |
| 22 | 'keypair': { |
| 23 | 'type': 'object', |
| 24 | 'properties': { |
| 25 | 'public_key': {'type': 'string'}, |
| 26 | 'name': {'type': 'string'}, |
| 27 | 'fingerprint': {'type': 'string'}, |
| 28 | # NOTE: Now the type of 'user_id' is integer, but here |
| 29 | # allows 'string' also because we will be able to change |
| 30 | # it to 'uuid' in the future. |
| 31 | 'user_id': {'type': ['integer', 'string']}, |
| 32 | 'deleted': {'type': 'boolean'}, |
| 33 | 'created_at': {'type': 'string'}, |
| 34 | 'updated_at': {'type': ['string', 'null']}, |
| 35 | 'deleted_at': {'type': ['string', 'null']}, |
| 36 | 'id': {'type': 'integer'} |
| 37 | |
| 38 | }, |
| 39 | # When we run the get keypair API, response body includes |
| 40 | # all the above mentioned attributes. |
| 41 | # But in Nova API sample file, response body includes only |
| 42 | # 'public_key', 'name' & 'fingerprint'. So only 'public_key', |
| 43 | # 'name' & 'fingerprint' are defined as 'required'. |
| 44 | 'required': ['public_key', 'name', 'fingerprint'] |
| 45 | } |
| 46 | }, |
| 47 | 'required': ['keypair'] |
| 48 | } |
| 49 | } |
Ghanshyam | 44f74a4 | 2014-03-24 19:22:40 +0900 | [diff] [blame] | 50 | |
| 51 | create_keypair = { |
| 52 | 'status_code': [200], |
| 53 | 'response_body': keypairs.create_keypair |
| 54 | } |
| 55 | |
| 56 | delete_keypair = { |
| 57 | 'status_code': [202], |
| 58 | } |