Skip to content

Commit

Permalink
Add REST index page
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Jun 7, 2024
1 parent 42dac02 commit bdeaf8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions IM/REST.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,7 @@ def RESTIndex():
rest_path = os.path.dirname(os.path.abspath(__file__))
abs_file_path = os.path.join(rest_path, 'swagger_api.yaml')
api_docs = yaml.safe_load(open(abs_file_path, 'r'))
api_docs['servers'][0]['url'] = flask.request.url_root
return flask.make_response(json.dumps(api_docs), 200, {'Content-Type': 'application/json'})


Expand Down
1 change: 1 addition & 0 deletions test/unit/REST.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ def test_GeVersion(self):
def test_Index(self):
res = self.client.get('/')
self.assertEqual(res.json['openapi'], '3.0.0')
self.assertEqual(res.json['servers'][0]['url'], 'http://localhost/')

@patch("IM.InfrastructureManager.InfrastructureManager.CreateDiskSnapshot")
def test_CreateDiskSnapshot(self, CreateDiskSnapshot):
Expand Down

0 comments on commit bdeaf8a

Please sign in to comment.