class ApiProxyBundleBuilder:
    def __init__(self, proxy_name, api_team, description, base_path,
                 api_proxy_base_path):
        self._proxy_bundle = ApiProxyBundle(proxy_name, api_team, description,
                                            base_path, api_proxy_base_path)

    def proxy_for_ctportal(self, swagger_json, api_proxy_tag):
        self._proxy_bundle.add_quota_trial()
        self._proxy_bundle.add_proxy_health("proxy-health", api_proxy_tag)
        self._proxy_bundle.add_authentication()
        self._proxy_bundle.import_swagger(swagger_json)
        return self._proxy_bundle

    def microgateway_aware(self, prefix, api_url, api_base_path):
        self._proxy_bundle.set_microgateway_prefix("edgemicro_" + prefix)
        self._proxy_bundle.define_url_in_target(api_url, api_base_path)
        return self._proxy_bundle
 def __init__(self, proxy_name, api_team, description, base_path,
              api_proxy_base_path):
     self._proxy_bundle = ApiProxyBundle(proxy_name, api_team, description,
                                         base_path, api_proxy_base_path)
Exemple #3
0
 def test_class_instance(self):
     proxy = ApiProxyBundle('test_api_name', 'apim', 'test description',
                            '/api', '/api')
     self.assertIsInstance(proxy, ApiProxyBundle)
Exemple #4
0
 def test_none_data(self):
     proxy = ApiProxyBundle('', '', '', '', '')
     self.assertIsInstance(proxy, ApiProxyBundle)
Exemple #5
0
 def test_none_base_path(self):
     proxy = ApiProxyBundle('test_api_name', 'apim', 'test description', '',
                            '')
     self.assertIsInstance(proxy, ApiProxyBundle)
Exemple #6
0
 def test_none_description(self):
     proxy = ApiProxyBundle('test_api_name', 'apim', '', '/api', '/api')
     self.assertIsInstance(proxy, ApiProxyBundle)