コード例 #1
0
def _get_sm_client():
    return SubscriptionManagerClient.create(
        host=current_app.config['SUBSCRIPTION-MANAGER-API']['host'],
        https=current_app.config['SUBSCRIPTION-MANAGER-API']['https'],
        timeout=current_app.config['SUBSCRIPTION-MANAGER-API']['timeout'],
        verify=current_app.config['SUBSCRIPTION-MANAGER-API']['verify'],
        username=current_app.config['SUBSCRIPTION-MANAGER-API']['username'],
        password=current_app.config['SUBSCRIPTION-MANAGER-API']['password'])
コード例 #2
0
    def _create_sm_client(config: ConfigDict, username: str, password: str) -> SubscriptionManagerClient:
        """
        Create a SubscriptionManagerClient but first make a check whether the given credentials a valid.
        :param config:
        :param username:
        :param password:
        :return:
        """
        sm_client: SubscriptionManagerClient = SubscriptionManagerClient.create(
            host=config['host'],
            https=config['https'],
            timeout=config['timeout'],
            verify=config['verify'],
            username=username,
            password=password
        )

        return sm_client