test/keywords/cloud_platform/rest/cloud_rest_client.py
croy 82d417b9e6 New StarlingX Automation Framework
Fresh start for the StarlingX automation framework.

Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
2024-11-29 16:01:57 -05:00

27 lines
621 B
Python

from framework.rest.rest_client import RestClient
from keywords.cloud_platform.rest.get_auth_token_keywords import GetAuthTokenKeywords
class CloudRestClient:
"""
Class for Cloud Rest Client.
"""
def __init__(self):
self.auth_token = GetAuthTokenKeywords().get_token()
def get(self, url: str):
"""
Runs a get on the url
Args:
url: the url for the get request
Returns: the response
"""
headers = {'X-Auth-Token': self.auth_token}
rest_response = RestClient().get(url, headers)
return rest_response