Skip to content

Commit ea3e9d4

Browse files
committed
Additional file updates
1 parent 8ff054d commit ea3e9d4

File tree

1,440 files changed

+116142
-152297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,440 files changed

+116142
-152297
lines changed

api_emulator/redfish/AccelerationFunction0_api.py

Lines changed: 189 additions & 259 deletions
Large diffs are not rendered by default.

api_emulator/redfish/AccelerationFunction1_api.py

Lines changed: 189 additions & 263 deletions
Large diffs are not rendered by default.

api_emulator/redfish/AccelerationFunction2_api.py

Lines changed: 189 additions & 259 deletions
Large diffs are not rendered by default.

api_emulator/redfish/AccelerationFunction3_api.py

Lines changed: 187 additions & 261 deletions
Large diffs are not rendered by default.

api_emulator/redfish/AccelerationFunction4_api.py

Lines changed: 189 additions & 259 deletions
Large diffs are not rendered by default.

api_emulator/redfish/AccountService0_api.py

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,56 @@
3333
import g
3434
import json, os
3535
import traceback
36-
import logging, random, requests, string, jwt
36+
import logging
3737

38-
from flask import Flask, request, session
38+
from flask import Flask, request
3939
from flask_restful import Resource
4040
from .constants import *
41-
from api_emulator.utils import check_authentication, create_path, get_json_data, create_and_patch_object, delete_object, patch_object, put_object, delete_collection, create_collection, send_event
41+
from api_emulator.utils import check_authentication, create_path, get_json_data, create_and_patch_object, delete_object, patch_object, put_object, delete_collection, create_collection
4242

4343
config = {}
4444

45-
members = []
46-
member_ids = []
4745
INTERNAL_ERROR = 500
4846

4947
# AccountService0 does not have a Collection API
5048

5149

5250
# AccountService0 API
5351
class AccountService0API(Resource):
54-
def __init__(self, **kwargs):
55-
logging.info('AccountService0 init called')
56-
self.root = PATHS['Root']
57-
self.auth = kwargs['auth']
58-
59-
# HTTP GET
60-
def get(self):
61-
logging.info('AccountService0 get called')
62-
msg, code = check_authentication(self.auth)
63-
64-
if code == 200:
65-
path = create_path(self.root, 'index.json')
66-
return get_json_data (path)
67-
else:
68-
return msg, code
69-
70-
# HTTP POST
71-
def post(self):
72-
logging.info('AccountService0 post called')
73-
return 'POST is not a supported command for AccountService0API', 405
74-
75-
# HTTP PUT
76-
def put(self):
77-
logging.info('AccountService0 put called')
78-
return 'PUT is not a supported command for AccountService0API', 405
79-
80-
# HTTP PATCH
81-
def patch(self):
82-
logging.info('AccountService0 patch called')
83-
return 'PATCH is not a supported command for AccountService0API', 405
84-
85-
# HTTP DELETE
86-
def delete(self):
87-
logging.info('AccountService0 delete called')
88-
return 'DELETE is not a supported command for AccountService0API', 405
52+
def __init__(self, **kwargs):
53+
logging.info('AccountService0 init called')
54+
self.root = PATHS['Root']
55+
self.auth = kwargs['auth']
56+
57+
# HTTP GET
58+
def get(self):
59+
logging.info('AccountService0 get called')
60+
msg, code = check_authentication(self.auth)
61+
62+
if code == 200:
63+
path = os.path.join(self.root, 'index.json')
64+
return get_json_data (path)
65+
else:
66+
return msg, code
67+
68+
# HTTP POST
69+
def post(self):
70+
logging.info('AccountService0 post called')
71+
return 'POST is not a supported command for AccountService0API', 405
72+
73+
# HTTP PUT
74+
def put(self):
75+
logging.info('AccountService0 put called')
76+
return 'PUT is not a supported command for AccountService0API', 405
77+
78+
# HTTP PATCH
79+
def patch(self):
80+
logging.info('AccountService0 patch called')
81+
return 'PATCH is not a supported command for AccountService0API', 405
82+
83+
# HTTP DELETE
84+
def delete(self):
85+
logging.info('AccountService0 delete called')
86+
return 'DELETE is not a supported command for AccountService0API', 405
8987

9088

api_emulator/redfish/AccountService1_api.py

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,58 +33,56 @@
3333
import g
3434
import json, os
3535
import traceback
36-
import logging, random, requests, string, jwt
36+
import logging
3737

38-
from flask import Flask, request, session
38+
from flask import Flask, request
3939
from flask_restful import Resource
4040
from .constants import *
41-
from api_emulator.utils import check_authentication, create_path, get_json_data, create_and_patch_object, delete_object, patch_object, put_object, delete_collection, create_collection, send_event
41+
from api_emulator.utils import check_authentication, create_path, get_json_data, create_and_patch_object, delete_object, patch_object, put_object, delete_collection, create_collection
4242

4343
config = {}
4444

45-
members = []
46-
member_ids = []
4745
INTERNAL_ERROR = 500
4846

4947
# AccountService1 does not have a Collection API
5048

5149

5250
# AccountService1 API
5351
class AccountService1API(Resource):
54-
def __init__(self, **kwargs):
55-
logging.info('AccountService1 init called')
56-
self.root = PATHS['Root']
57-
self.auth = kwargs['auth']
58-
59-
# HTTP GET
60-
def get(self, ManagerId):
61-
logging.info('AccountService1 get called')
62-
msg, code = check_authentication(self.auth)
63-
64-
if code == 200:
65-
path = create_path(self.root, 'Managers/{0}/RemoteAccountService', 'index.json').format(ManagerId)
66-
return get_json_data (path)
67-
else:
68-
return msg, code
69-
70-
# HTTP POST
71-
def post(self, ManagerId):
72-
logging.info('AccountService1 post called')
73-
return 'POST is not a supported command for AccountService1API', 405
74-
75-
# HTTP PUT
76-
def put(self, ManagerId):
77-
logging.info('AccountService1 put called')
78-
return 'PUT is not a supported command for AccountService1API', 405
79-
80-
# HTTP PATCH
81-
def patch(self, ManagerId):
82-
logging.info('AccountService1 patch called')
83-
return 'PATCH is not a supported command for AccountService1API', 405
84-
85-
# HTTP DELETE
86-
def delete(self, ManagerId):
87-
logging.info('AccountService1 delete called')
88-
return 'DELETE is not a supported command for AccountService1API', 405
52+
def __init__(self, **kwargs):
53+
logging.info('AccountService1 init called')
54+
self.root = PATHS['Root']
55+
self.auth = kwargs['auth']
56+
57+
# HTTP GET
58+
def get(self, ManagerId):
59+
logging.info('AccountService1 get called')
60+
msg, code = check_authentication(self.auth)
61+
62+
if code == 200:
63+
path = create_path(self.root, 'Managers/{0}/RemoteAccountService', 'index.json').format(ManagerId)
64+
return get_json_data (path)
65+
else:
66+
return msg, code
67+
68+
# HTTP POST
69+
def post(self, ManagerId):
70+
logging.info('AccountService1 post called')
71+
return 'POST is not a supported command for AccountService1API', 405
72+
73+
# HTTP PUT
74+
def put(self, ManagerId):
75+
logging.info('AccountService1 put called')
76+
return 'PUT is not a supported command for AccountService1API', 405
77+
78+
# HTTP PATCH
79+
def patch(self, ManagerId):
80+
logging.info('AccountService1 patch called')
81+
return 'PATCH is not a supported command for AccountService1API', 405
82+
83+
# HTTP DELETE
84+
def delete(self, ManagerId):
85+
logging.info('AccountService1 delete called')
86+
return 'DELETE is not a supported command for AccountService1API', 405
8987

9088

0 commit comments

Comments
 (0)