def info_service(self): versionapi = api.VersionsApi(api_client=self.api) supported_versions = versionapi.v2_list_supported_openshift_versions() print("supported openshift versions:") for version in supported_versions: print(version) operatorsapi = api.OperatorsApi(api_client=self.api) supported_operators = operatorsapi.v2_list_supported_operators() print("supported operators:") for operator in sorted(supported_operators): print(operator)
def __init__(self, inventory_url, offline_token, pull_secret): self.inventory_url = inventory_url configs = Configuration() configs.host = self.inventory_url + "/api/assisted-install/v1" configs.verify_ssl = False self.set_config_auth(configs, offline_token) self._set_x_secret_key(configs, pull_secret) self.api = ApiClient(configuration=configs) self.client = api.InstallerApi(api_client=self.api) self.events = api.EventsApi(api_client=self.api) self.versions = api.VersionsApi(api_client=self.api) self.domains = api.ManagedDomainsApi(api_client=self.api) self.operators = api.OperatorsApi(api_client=self.api)
def __init__(self, inventory_url: str, offline_token: Optional[str], pull_secret: str): self.inventory_url = inventory_url configs = Configuration() configs.host = self.get_host(configs) configs.verify_ssl = False self.set_config_auth(configs, offline_token) self._set_x_secret_key(configs, pull_secret) self.api = ApiClient(configuration=configs) self.client = api.InstallerApi(api_client=self.api) self.events = api.EventsApi(api_client=self.api) self.versions = api.VersionsApi(api_client=self.api) self.domains = api.ManagedDomainsApi(api_client=self.api) self.operators = api.OperatorsApi(api_client=self.api) fmt = CaseFormatKeys(case_name="cluster_id", severity_key="severity", case_timestamp="event_time") self._events_junit_exporter = JsonJunitExporter(fmt)
def set_olm_operators(self, olm_operators_data): operatorsapi = api.OperatorsApi(api_client=self.api) supported_operators = operatorsapi.v2_list_supported_operators() olm_operators = [] for operator in olm_operators_data: if isinstance(operator, str): operator_name = operator elif isinstance(operator, dict) and 'name' in operator: operator_name = operator['name'] else: error(f"Invalid entry for olm_operator {operator}") sys.exit(1) if operator_name not in supported_operators: error(f"Incorrect olm_operator {operator_name}. Should be one of {supported_operators}") sys.exit(1) olm_operators.append({'name': operator_name}) return olm_operators