示例#1
0
def get_market_client(enterpriseID, enterpriseToken, host=None):
    configuration = Configuration()
    configuration.host = host if host else os.environ.get(
        'APP_CLOUD_API', 'http://api.goodrain.com:80')
    configuration.api_key['X_ENTERPRISE_TOKEN'] = enterpriseToken
    configuration.api_key['X_ENTERPRISE_ID'] = enterpriseID
    # create an instance of the API class
    return market_client.AppsApi(market_client.ApiClient(configuration))
示例#2
0
 def testMarket(self):
     """Test Market"""
     # FIXME: construct object with mandatory attributes with example values
     # model = market_client.models.market.Market()  # noqa: E501
     configuration = Configuration()
     configuration.host = "http://localhost:9000"
     configuration.api_key['X_ENTERPRISE_TOKEN'] = "96dd084231efb23bf9ef162875f627f0"
     configuration.api_key['X_ENTERPRISE_ID'] = "0e62be2210054eb5aae00637a2b301ed"
     # create an instance of the API class
     client = market_client.AppsApi(market_client.ApiClient(configuration))
     data = {
         "app_id":"app_id",
         "":""
     }
     # resp = client.create_app("113139ca6c2b4377b9066574aac7dcd5", data=data)
     resp = client.create_app_version("113139ca6c2b4377b9066574aac7dcd5", "app_id", data=data)
     print(resp)
示例#3
0
def get_default_market_client():
    configuration = Configuration()
    configuration.host = os.environ.get('APP_CLOUD_API',
                                        'http://api.goodrain.com:80')
    # create an instance of the API class
    return market_client.AppsApi(market_client.ApiClient(configuration))
示例#4
0
 def setUp(self):
     conf = market_client.Configuration()
     conf.host = "http://market.goodrain.com"
     client = market_client.ApiClient(configuration=conf)
     self.api = market_client.api.apps_api.AppsApi(
         api_client=client)  # noqa: E501