11 angular.module('yardStickGui2App')
12 .factory('mainFactory', ['$resource','$rootScope','$http', '$location',function($resource, $rootScope,$http,$location) {
14 Base_URL = 'http://' + $location.host() + ':' + $location.port();
15 Grafana_URL = 'http://' + $location.host();
19 postEnvironmentVariable: function() {
20 return $resource(Base_URL + '/api/v2/yardstick/openrcs', {}, {
26 uploadOpenrc: function() {
27 return $resource(Base_URL + '/ap/v2/yardstick/openrcs', {}, {
33 getEnvironmentList: function() {
34 return $resource(Base_URL+ '/api/v2/yardstick/environments', {}, {
40 getEnvironmentDetail: function() {
41 return $resource(Base_URL + '/api/v2/yardstick/openrcs/:openrc_id', { openrc_id: "@openrc_id" }, {
47 addEnvName: function() {
48 return $resource(Base_URL + '/api/v2/yardstick/environments', {}, {
54 ItemDetail: function() {
55 return $resource(Base_URL + '/api/v2/yardstick/environments/:envId', { envId: "@envId" }, {
61 ImageDetail: function() {
62 return $resource(Base_URL + '/api/v2/yardstick/images/:image_id', { image_id: "@image_id" }, {
68 podDeatil: function() {
69 return $resource(Base_URL + '/api/v2/yardstick/pods/:podId', { podId: "@podId" }, {
75 containerDetail: function() {
76 return $resource(Base_URL + '/api/v2/yardstick/containers/:containerId', { containerId: "@containerId" }, {
82 ImageList: function() {
83 return $resource(Base_URL + '/api/v2/yardstick/images', {}, {
89 uploadImage: function() {
90 return $resource(Base_URL + '/api/v2/yardstick/images', {}, {
96 getPodDetail: function() {
97 return $resource(Base_URL + '/api/v2/yardstick/pods/:podId', { podId: "@podId" }, {
103 runAcontainer: function() {
104 return $resource(Base_URL + '/api/v2/yardstick/containers', { podId: "@podId" }, {
110 getTestcaselist: function() {
111 return $resource(Base_URL + '/api/v2/yardstick/testcases', {}, {
117 getTestcaseDetail: function() {
118 return $resource(Base_URL + '/api/v2/yardstick/testcases/:testcasename', { testcasename: "@testcasename" }, {
124 suiteList: function() {
125 return $resource(Base_URL + '/api/v2/yardstick/testsuites', {}, {
131 suiteDetail: function() {
132 return $resource(Base_URL + '/api/v2/yardstick/testsuites/:suiteName', { suiteName: "@suiteName" }, {
138 suiteCreate: function() {
139 return $resource(Base_URL + '/api/v2/yardstick/testsuites', {}, {
145 projectList: function() {
146 return $resource(Base_URL + '/api/v2/yardstick/projects', {}, {
152 createProjectName: function() {
153 return $resource(Base_URL + '/api/v2/yardstick/projects', {}, {
159 getProjectDetail: function() {
160 return $resource(Base_URL + '/api/v2/yardstick/projects/:project_id', { project_id: "@project_id" }, {
166 createTask: function() {
167 return $resource(Base_URL + '/api/v2/yardstick/tasks', {}, {
173 getTaskDetail: function() {
174 return $resource(Base_URL + '/api/v2/yardstick/tasks/:taskId', { taskId: "@taskId" }, {
181 getTaskLog: function(){
182 return $resource(Base_URL + '/api/v2/yardstick/tasks/:taskId/log?index=:index', { taskId: "@taskId", index: "@index" }, {
189 taskAddEnv: function() {
190 return $resource(Base_URL + '/api/v2/yardstick/tasks/:taskId', { taskId: "@taskId" }, {
197 deleteEnv: function() {
198 return $resource(Base_URL + '/api/v2/yardstick/environments/:env_id', { env_id: '@env_id' }, {
204 deleteOpenrc: function() {
205 return $resource(Base_URL + '/api/v2/yardstick/openrcs/:openrc', { openrc: '@openrc' }, {
211 deletePod: function() {
212 return $resource(Base_URL + '/api/v2/yardstick/pods/:podId', { podId: '@podId' }, {
218 deleteContainer: function() {
219 return $resource(Base_URL + '/api/v2/yardstick/containers/:containerId', { containerId: '@containerId' }, {
225 deleteTestCase: function() {
226 return $resource(Base_URL + '/api/v2/yardstick/testcases/:caseName', { caseName: '@caseName' }, {
232 deleteTestSuite: function() {
233 return $resource(Base_URL + '/api/v2/yardstick/testsuites/:suite_name', { suite_name: '@suite_name' }, {
239 deleteProject: function() {
240 return $resource(Base_URL + '/api/v2/yardstick/projects/:project_id', { project_id: '@project_id' }, {
246 deleteTask: function() {
247 return $resource(Base_URL + '/api/v2/yardstick/tasks/:task_id', { task_id: '@task_id' }, {