82d417b9e6
Fresh start for the StarlingX automation framework. Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
27 lines
621 B
Python
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
|
|
|
|
|
|
|
|
|