aboutsummaryrefslogtreecommitdiffstats
path: root/api
AgeCommit message (Collapse)AuthorFilesLines
2016-12-28Record test case names when run a task using APIchenjiankun7-66/+85
JIRA: YARDSTICK-509 Currently we use influxdb as database and will not record test case name when run a test case. So if we must offer test case name if we want to get result from API. Regarding future requirement, I create sqlite database and alchemy orm framework. And record test case name when run a test case. So we needn't offer test case any more when call for get result API. Change-Id: I7d7dc24543a33918546267591f7bdcd0742928cb Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-28Merge "Use ConfigParser to write yardstick.conf"Jing Lu1-22/+12
2016-12-26Use ConfigParser to write yardstick.confchenjiankun1-22/+12
JIRA: YARDSTICK-474 Currently, I use file.write() method to write config in yardstick.conf. But it is not recommended. So I change to use ConfigParser to write config in yardstick.conf Change-Id: Ia789cf09296afd5d1507bcf99f165378bf87c591 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-24Add sqlite and SQLAlchemy support for APIchenjiankun3-0/+63
JIRA: YARDSTICK-505 Now yardstick API need a database to store API data. And for future the yardstick GUI also need a self database. So I choose a light-weight database sqlite. And use SQLAlchemy to do ORM. Change-Id: I1edc350ec6f57ad67785de549c2135c86ea60a4a Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-24Merge "Bugfix: the load_image.sh script will load a image with the same name"Jing Lu1-0/+10
2016-12-24Merge "Move uwsgi.log and yardstick.sock to proper location"Jing Lu3-3/+9
2016-12-22Bugfix: the load_image.sh script will load a image with the same namechenjiankun1-0/+10
JIRA: YARDSTICK-471 Currently, if we execute the load_image.sh and the openstack already have this image in the cloud,this script will load another image with the same name. This will make yardstick run error. So I clean this related images before loading. Change-Id: If5b985ef9b2e890aa10453810fac36867d320a06 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-22Yardstick API refactorchenjiankun8-46/+72
JIRA: YARDSTICK-503 Now in api/views.py there are many redundant code. So I do some refactoring and make it to be a lightweight framework. Change-Id: Id7cecc95e60f5403b2d26239a3ef41d01bbb542a Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-21Move uwsgi.log and yardstick.sock to proper locationchenjiankun3-3/+9
JIRA: YARDSTICK-504 Now yardstick.sock and uwsgi.log is in yardstick/api directory. But it is not standard for they should not be put in the code path. So I move yardstick.sock to /var/run/yardstick.sock and move uwsgi.log to /var/log/yardstick/uwsgi.log Change-Id: I526ab011c0222255dfbae037f494edb5d8a88add Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-07env: convert file open to context managerRoss Brattain1-1/+2
always use context managers to open file Change-Id: I2c894ea87a94789edbed4a4da1fa906b28556664 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2016-12-06Bugfix: create stack failed due to not export EXTERNAL_NETWORK environment ↵chenjiankun1-0/+3
viarable JIRA: YARDSTICK-449 Now if we run prepare env, we will not source the EXTERNAL_NETWORK. I will source the EXTERNAL_NETWORK after I get it. Change-Id: I917fcecae2cac13b7511667c0687d10eccfac751 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-05Merge "Making nginx and uwsgi service start when run docker by using supervisor"Rex Lee1-6/+18
2016-12-05Merge "Bugfix: debug should be default off"Jing Lu1-1/+1
2016-12-04Add API and command support for yardstick env preparechenjiankun1-2/+95
JIRA: YARDSTICK-406 Change-Id: Icf837a6f34a22158203566a43a6446fc269c096f Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-03Making nginx and uwsgi service start when run docker by using supervisorchenjiankun1-6/+18
JIRA: YARDSTICK-444 We need web service start when docker run. But now we add command in bashrc, so the web service start only if we login in docker container. So I use supervisor to make the web service start when docker run. Change-Id: Ic77eb0e130ae7dbd82039c312649fed76b128513 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-02Add API to create Grafana containerchenjiankun1-12/+89
JIRA: YARDSTICK-441 Change-Id: Ia848c4af072915ef252e8e03100dd7a4e4a6c3c2 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-02Add support for sample testcase to get test resultchenjiankun1-3/+5
JIRA: YARDSTICK-440 Change-Id: I15234e833353a33b063993b96f1f787ddf649720 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-01Add swagger support for Rest APIchenjiankun6-0/+160
JIRA: YARDSTICK-439 Change-Id: I36ad0663455c51d635c4329f5cbb9da25d8042e1 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-01Add API to run test case under samples directorychenjiankun4-0/+53
JIRA: YARDSTICK-432 Change-Id: I8ca6409449e2b960ac9f48c8eb8a6ae9959a4fc8 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-12-01Merge "Modify url mapping to make API more Restful"Jing Lu2-4/+4
2016-12-01Merge "Use flask jsonify method to return json result"Jing Lu2-15/+6
2016-11-30Bugfix: debug should be default offrexlee87761-1/+1
JIRA: YARDSTICK-398 Change-Id: I8b2f776a9cf6d577150633999354db762fcb93ae Signed-off-by: rexlee8776 <limingjiang@huawei.com>
2016-11-30Modify url mapping to make API more Restfulchenjiankun2-4/+4
JIRA: YARDSTICK-435 Change-Id: Ief767ceca2979494ec0b4ea4d197fd399352b856 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-30Use flask jsonify method to return json resultchenjiankun2-15/+6
JIRA: YARDSTICK-433 Python json lib is very hard to parse when transport via network. Flask jsonfiy is more easier to use. Change-Id: I2afd5238d65bc474170c57d2f9307dc881ea4990 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-29centralize logging into root loggerRoss Brattain1-0/+3
If we setup root logger correctly and have each module logger propogate we shouldn't need individual logger configuration updates: lower paramiko to WARN level dispatcher/file.py was missing logging.handlers import purge all existing handlers and add our own handlers move everything back into yardstick/__init__.py so API can use it make _LOG_STREAM_HDLR global, so we can set loglevel on it whenever added api/server.py call to _init_logging removed old LOG_FORMATTER from cli.py only setLevel on yardstick logger Change-Id: If000799590379d3407655a7d54378481a96ea3d4 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2016-11-30Merge "Bugfix: the API to get result do not work due to can't parse $"Jing Lu2-8/+14
2016-11-30Merge "Create API and command to create a influxDB container"Jing Lu4-32/+109
2016-11-30Bugfix: the API to get result do not work due to can't parse $chenjiankun2-8/+14
JIRA: YARDSTICK-429 The API to get result use $ to prevent sql injection. But it doesn't work. Change-Id: I130a847297f209fe26062317261f884c5665f5df Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-30Create API and command to create a influxDB containerchenjiankun4-32/+109
JIRA: YARDSTICK-425 This API is used to create a influxDB Container Add command line to create a influxDB Container, too Change-Id: If9c2d04b779924d492a5d5ea91f7968fa959570e Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-29Bugfix: dict don't have startwith method error when use API to run test casechenjiankun1-1/+1
JIRA: YARDSTICK-431 When use API to run test case and set the task-args args, it will encounter a error of dict object do not have startwith method. The reason is yardstick will only accept the str type. So we need to change the dict to str. Change-Id: I26aac35c477842ab9cd692bdacd401e68673b01d Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-28Merge "Create API to get test case result"Rex Lee9-13/+169
2016-11-24Create API to get test case resultchenjiankun9-13/+169
JIRA: YARDSTICK-416 Change-Id: I722566bb0e5bc5288cd6302559e56a3f92ebbeca Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-24Fix the conflict in yardstick.conf between API and CIchenjiankun1-1/+1
JIRA: YARDSTICK-421 In the Docker image, the default dispatcher value in yardstick.conf is local influxDB. But the CI will set another. It will cause a conflict. So I '>' to cover yardstick.conf file. Change-Id: I7088682e952ee7bb84f6872a49a24296d676a9cb Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-24Merge "Deployment for API"Jing Lu3-0/+75
2016-11-23Deployment for APIchenjiankun3-0/+75
JIRA: YARDSTICK-418 Set yardstick.conf in /etc/yardstick/ to config yardstick output way Set nginx config file Set nginx service and uwsgi service start when boot Change-Id: I5749042ae1b05feaf895cb0abffed7f9194b9cee Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
2016-11-22influx: use urlsplit.hostname instead of netlocRoss Brattain1-1/+1
turns out urlsplit supports .hostname so we don't have to split netloc Change-Id: I09614812296a216a369559bf55d66d94380feb94 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
2016-11-21Create API to run test caseschenjiankun11-0/+244
JIRA: YARDSTICK-413 Change-Id: Ibf58b50b568fae3f2eea985b25ee33be0a3666b7 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>