예제 #1
0
    def setup(self, config_file):
        # Configure OAuth2 access token for authorization: OauthSecurity
        auth_token = self.get_access_token(config_file)

        configuration = openapi_client.Configuration()
        if auth_token:
            configuration.access_token = auth_token

        if os.getenv('REMOTE_HOST_URL'):
            configuration.host = "http://localhost:8080/v1"

        self.es_api_instance = openapi_client.EventSetApi(
            openapi_client.ApiClient(configuration))
        self.location_api_instance = openapi_client.LocationApi(
            openapi_client.ApiClient(configuration))
        self.se_api_instance = openapi_client.SamplingEventApi(
            openapi_client.ApiClient(configuration))
        self.os_api_instance = openapi_client.OriginalSampleApi(
            openapi_client.ApiClient(configuration))
        self.ds_api_instance = openapi_client.DerivativeSampleApi(
            openapi_client.ApiClient(configuration))
        self.ad_api_instance = openapi_client.AssayDataApi(
            openapi_client.ApiClient(configuration))
        self.metadata_api_instance = openapi_client.MetadataApi(
            openapi_client.ApiClient(configuration))
        self.study_api_instance = openapi_client.StudyApi(
            openapi_client.ApiClient(configuration))
        self.i_api_instance = openapi_client.IndividualApi(
            openapi_client.ApiClient(configuration))
예제 #2
0
def example_api_get_project():
    #  Set the configuration
    configuration = openapi_client.Configuration(
        host=example_host,
    )
    configuration.verify_ssl = False
    configuration.ssl_ca_cert = None
    configuration.assert_hostname = False
    configuration.cert_file = None

    #  Get an access token and add it to the configuration
    with openapi_client.ApiClient(configuration) as api_client:
        api_instance_auth = openapi_client.AuthenticationApi(api_client)
        body_login = openapi_client.ApiCredentials(password=example_password, username=example_username)
        api_response = api_instance_auth.login(body_login)
        configuration.access_token = api_response.token

        # Create a ProjectApi instance to make API storage commands
        api_instance = openapi_client.ProjectApi(api_client)

        print("# Get a single project")
        try:
            api_response = api_instance.get_project(project_name="Example-Archive-Project")
            pprint(api_response)
        except ApiException as e:
            print("Exception when calling ProjectApi->get_project (example GET single project): %s\n" % e)

        print("# Get ALL projects")
        try:
            api_response = api_instance.list_projects()
            pprint(api_response)
        except ApiException as e:
            print("Exception when calling ProjectApi->list_projects (example GET list of projects): %s\n" % e)
예제 #3
0
    def create_connection(self):
        '''
        Connects to deribit api and prescribes access token to bot
        ROBOT SHOULD BE CONFIGURED BEFORE CALLING THIS FUNCTION!
        '''
        assert not self.__client_id == 'not configured',     "Client ID is not configured!"
        assert not self.__client_secret == 'not configured', "Client Secret is not configured!" 
        assert not self.__host          == 'not configured', "Host is not configured!" 
        
        configuration = openapi_client.Configuration()
        configuration.host = self.__host
        configuration.access_token = self.__client_id

        auth_api_instance = openapi_client.AuthenticationApi(openapi_client.ApiClient(configuration))
       
        grant_type = 'client_credentials' 
        client_id = self.__client_id 
        client_secret = self.__client_secret
        scope = 'trade:read_write'
        
        try:
            api_response = auth_api_instance.public_auth_get(grant_type, '', '', client_id, client_secret, '', '', '',  scope=scope)
            
        except ApiException as e:
            print("Exception when calling AuthenticationApi->public_auth_get: %s\n" % e)

        self.__access_token = api_response['result']['access_token']
예제 #4
0
    def get_orders(self):
        '''
        Gets historical orders data 
        ROBOT SHOULD BE CONFIGURED BEFORE CALLING THIS FUNCTION!
        
        '''        
        self.create_connection()
        
        configuration = openapi_client.Configuration()
        configuration.access_token = self.__access_token
        configuration.host = self.__host

        api_instance = openapi_client.PrivateApi(openapi_client.ApiClient(configuration))
        instrument_name = 'BTC-PERPETUAL' 
        count = 100
        offset = 0 
        include_old = 'true'
        include_unfilled = 'true'

        try:
            # Retrieves list of user's open orders within given Instrument.
            api_response = api_instance.private_get_order_history_by_instrument_get(instrument_name, count=count, offset=offset, include_old=include_old, include_unfilled=include_unfilled)
        except ApiException as e:
            print("Exception when calling PrivateApi->private_get_open_orders_by_instrument_get: %s\n" % e)
        
        self.__orders = api_response['result']
예제 #5
0
    def get_price(self):
       
        '''
        Shows current mark price 
        ROBOT SHOULD BE CONFIGURED BEFORE CALLING THIS FUNCTION!
        
        Return value: float
        Current mark price
        
        '''
        self.create_connection()
        
        configuration = openapi_client.Configuration()
        configuration.access_token = self.__access_token
        configuration.host = self.__host


        api_instance = openapi_client.PublicApi(openapi_client.ApiClient(configuration))
        instrument_name = 'BTC-PERPETUAL'
        depth = 1 

        try:
            # Retrieves the order book, along with other market values for a given instrument.
            api_response = api_instance.public_get_order_book_get(instrument_name, depth=depth)
            return api_response['result']['mark_price']
        except ApiException as e:
            print("Exception when calling PublicApi->public_get_order_book_get: %s\n" % e)
예제 #6
0
 def setUp(self):
     configuration = openapi_client.Configuration()
     configuration.debug = False
     api_client = openapi_client.ApiClient(configuration)
     self.cluster = openapi_client.api.cluster_api.ClusterApi(api_client)
     self.daemon = openapi_client.api.daemon_api.DaemonApi(api_client)
     self.models = openapi_client.models
예제 #7
0
    def are_orders_closed(self):
        '''
        Shows if all the orders are closed
        ROBOT SHOULD BE CONFIGURED BEFORE CALLING THIS FUNCTION!
        
        Return value: bool
        True if all orders are closed
        False else
        '''
            
        self.create_connection()
        
        configuration = openapi_client.Configuration()
        configuration.access_token = self.__access_token
        configuration.host = self.__host

        api_instance = openapi_client.PrivateApi(openapi_client.ApiClient(configuration))
        instrument_name = 'BTC-PERPETUAL' # str | Instrument name
        type = 'all' # str | Order type, default - `all` (optional)

        try:
            # Retrieves list of user's open orders within given Instrument.
            api_response = api_instance.private_get_open_orders_by_instrument_get(instrument_name, type=type)
        except ApiException as e:
            print("Exception when calling PrivateApi->private_get_open_orders_by_instrument_get: %s\n" % e)
        
        return len(api_response['result']) == 0
예제 #8
0
def main(server: str, imagefolder: str, authToken:str):

    configuration = openapi_client.Configuration(host=server)
    configuration.api_key["tokenAuth"] = authToken
    configuration.api_key_prefix["tokenAuth"] = "Token"

    with openapi_client.ApiClient(configuration) as api_client:
        submissions_api_instance = SubmissionsApi(api_client)
        fetch_api_instance = FetchsApi(api_client)

    submissions: List[Submission] = find_submissions(submissions_api_instance)
    for submission in submissions:
        print(submission.status, submission.target_url, submission.title)
        if hasattr(submission, "fetch"):
            print(f"  - retrieving {submission.fetch}")
            fetchobj: Fetch = fetch_api_instance.fetchs_retrieve(submission.id)
            if hasattr(fetchobj, "generated_thumbnail"):
                previous = fetchobj.generated_thumbnail
            else:
                previous = None
            print(f"  - generating {submission.id} to save in {imagefolder}")
            new_image = generate_thumbnail(imagefolder, fetchobj)
            patchedfetch: PatchedFetch = PatchedFetch(generated_thumbnail=new_image)
            if previous != new_image:
                print(f"  - saving {submission.id} with {patchedfetch.generated_thumbnail}")
                fetch_api_instance.fetchs_partial_update(submission.id, patched_fetch=patchedfetch)
예제 #9
0
    def getApiClient(self):
        auth_token = None
        configuration = openapi_client.Configuration()

        if os.getenv('TOKEN_URL') and not os.getenv('BB_NOAUTH'):
            try:
                with open(self._config_file) as json_file:
                    args = json.load(json_file)
                    r = requests.get(os.getenv('TOKEN_URL'),
                                     args,
                                     headers={'service': 'http://localhost/'})
                    at = r.text.split('=')
                    token = at[1].split('&')[0]
                    auth_token = token
                configuration.access_token = auth_token
            except FileNotFoundError as fnfe:
                print('No config file found: {}'.format(TestBase._config_file))
                pass

        if os.getenv('REMOTE_HOST_URL'):
            configuration.host = "http://localhost:8080/v1"

        api_client = openapi_client.ApiClient(configuration)

        return api_client
예제 #10
0
def api_factory(request, user, auths, method):

    configuration = openapi_client.Configuration()

    # Not allowed to be None
    configuration.access_token = 'abcd'
    if not auths or 'editor' in auths:
        if os.getenv('TOKEN_URL') and not os.getenv('LOCAL_TEST'):
            # Could be str(auths) if want separate tokens
            cache_key = 'cache_key'
            if cache_key in access_token_cache:
                configuration.access_token = access_token_cache[cache_key]
            else:
                with open('../upload/config_dev.json') as json_file:
                    args = json.load(json_file)
                    token_request = requests.get(
                        os.getenv('TOKEN_URL'),
                        args,
                        headers={'service': 'http://localhost/'})
                    token_response = token_request.text.split('=')
                    token = token_response[1].split('&')[0]
                    configuration.access_token = token
                    access_token_cache[cache_key] = token

    configuration.host = "http://localhost:8080/v1"

    api_client = openapi_client.ApiClient(configuration)

    yield ApiFactory(user, auths, method, api_client)
예제 #11
0
    def test_add_n_get_all(self):
        uid = 1
        description = "basic description"
        expected = [{"description": description, "id": uid}]
        # Enter a context with an instance of the API client
        with openapi_client.ApiClient(configuration) as api_client:
            # Create an instance of the API class
            api_instance = openapi_client.BasicApi(api_client)
            # Basic | Basic object that needs to be added to the basic stuff (optional)
            body = openapi_client.Basic(id=uid, description=description)
            try:
                # Add a basic stuff
                ans = api_instance.src_basic_ctrl_basic_add_basic(body=body)
            except ApiException as e:
                pass
                print(
                    "Exception when calling BasicApi->src_basic_ctrl_basic_add_basic: %s\n"
                    % e)

            ret = api_instance.src_basic_ctrl_basic_get_all()
            print("ret:" + str(ret))
            print("expected:" + str(expected))
            assert isinstance(ret, list)
            assert isinstance(ret[0], dict)
            assert ret == expected
예제 #12
0
def post_articles(server: str, token: str, submissions: List[Submission]):
    configuration = openapi_client.Configuration(host=server)
    configuration.api_key['tokenAuth'] = token
    configuration.api_key_prefix['tokenAuth'] = 'Token'

    for submission in submissions:
        with openapi_client.ApiClient(configuration) as api_client:
            api_instance = submissions_api.SubmissionsApi(api_client)

        try:
            print(f'Sending {submission.target_url}')
            api_response = api_instance.submissions_create(submission)
            # pprint(api_response)
            print('    ok')
        except openapi_client.ApiException as e:
            if e.status in [401, 403]:
                print('    %d error code - failed to login' % (e.status))
                print(e.headers)
                print('    make sure the provided token is valid')
                sys.exit(1)
            elif e.status in [400, 500]:
                if 'already exists' in e.body or 'already exists' in e.reason:
                    print('    already exists, ignored')
                    continue
                print('    %d critical error received' % e.status)
                print('    ERROR --->', e.body)
                sys.exit(1)
            else:
                print(
                    "Exception when calling SubmissionsApi->submissions_create: %s\n"
                    % e)
        except urllib3.exceptions.MaxRetryError:
            print("ERROR: Cannot connect to server - after retrying.")
            sys.exit(1)
예제 #13
0
    def __init__(self, logger_name):
        ServiceBase.__init__(self, logger_name)

        # servie id used for control
        # self.sid = 'sid002'

        # SUB data
        self.deribitmsgclient = self.ctx.socket(zmq.SUB)
        self.deribitmsgclient.connect('tcp://localhost:9000')
        self.deribitmsgclient.setsockopt_string(zmq.SUBSCRIBE, '')

        self.okexmsgclient = self.ctx.socket(zmq.SUB)
        self.okexmsgclient.connect('tcp://localhost:9100')
        self.okexmsgclient.setsockopt_string(zmq.SUBSCRIBE, '')

        self.okexclient = OptionAPI('3b43d558-c6e6-4460-b8dd-1e542bc8c6c1',
                                    '90EB8F53AABAE20C67FB7E3B0EFBB318',
                                    'mogu198812', True)

        self.deribitauth = openapi_client.AuthenticationApi()
        res = self.deribitauth.public_auth_get(grant_type='client_credentials',
                                               username='',
                                               password='',
                                               client_id=deribit_apikey,
                                               client_secret=deribit_apisecret,
                                               refresh_token='',
                                               timestamp='',
                                               signature='')
        self.deribitconfig = openapi_client.Configuration()
        self.deribitconfig.access_token = res['result']['access_token']
        self.deribitconfig.refresh_token = res['result']['refresh_token']
        self.deribittradingapi = openapi_client.TradingApi(
            openapi_client.ApiClient(self.deribitconfig))
예제 #14
0
    def write(self, transactions: List[TransactionBase]):
        with openapi_client.ApiClient(self.configuration) as api_client:
            # Create an instance of the API class
            transaction_api = openapi_client.TransactionsApi(api_client)
            account_api = openapi_client.AccountsApi(api_client)
            try:
                accounts = account_api.get_accounts("last-used")
                accounts = accounts.data.accounts
                account: Account = list(
                    filter(
                        lambda account: account.name == 'Robinhood Unlinked',
                        accounts))[0]
                transactions = [
                    SaveTransaction(
                        account_id=account.id,
                        date=transaction.transaction_date.isoformat(),
                        amount=transaction.amount,
                        memo=transaction.category,
                        payee_name=transaction.payee)
                    for transaction in transactions
                ]
                data = SaveTransactionsWrapper(transactions=transactions)
                transaction_api.create_transaction('last-used', data)

            except ApiException as e:
                print(
                    "Exception when calling AccountsApi->get_account_by_id: %s\n"
                    % e)
예제 #15
0
    def setUp(self):
        configuration = openapi_client.Configuration()
        configuration.debug = False
        api_client = openapi_client.ApiClient(configuration)

        self.sort = openapi_client.api.sort_api.SortApi(api_client)
        self.bucket = openapi_client.api.bucket_api.BucketApi(api_client)
        self.object = openapi_client.api.object_api.ObjectApi(api_client)
        self.models = openapi_client.models

        # Create local bucket
        input_params = self.models.InputParameters(
            self.models.Actions.CREATELB)
        self.bucket.perform_operation(self.BUCKET_NAME, input_params)

        # Create and send tars
        for i in range(0, self.SHARDS):
            out = io.BytesIO()
            object_name = "%s%d.tar" % (self.PREFIX, i)
            with tarfile.open(mode="w", fileobj=out) as tar:
                for j in range(0, 100):
                    b = "Hello world!".encode("ascii")
                    t = tarfile.TarInfo("%d.txt" % j)
                    t.size = len(b)
                    tar.addfile(t, io.BytesIO(b))

            self.object.put(self.BUCKET_NAME, object_name, body=out.getvalue())
예제 #16
0
    def setUp(self):
        surpressResourceWarning()

        configuration = openapi_client.Configuration()
        configuration.debug = False
        api_client = openapi_client.ApiClient(configuration)
        self.daemon = openapi_client.api.daemon_api.DaemonApi(api_client)
        self.models = openapi_client.models
예제 #17
0
 def setUp(self):
     self.log = Logger.getLoggerObj()
     self.log.info("")
     self.log.info("Setting up the host/api url for test execution")
     configuration = openapi_client.Configuration(
         host="http://localhost:5000")
     api_client = openapi_client.ApiClient(configuration)
     self.api = openapi_client.AquaApiApi(api_client)
예제 #18
0
def get_market_client(access_key, host=None):
    configuration = storeConfiguration()
    configuration.client_side_validation = False
    configuration.host = host if host else os.environ.get(
        'APP_CLOUD_API', 'http://api.goodrain.com:80')
    if access_key:
        configuration.api_key['Authorization'] = access_key
    return store_client.MarketOpenapiApi(store_client.ApiClient(configuration))
예제 #19
0
 def __init__(self, host, access_token, userid, consumer_key, ip, app_id, proxy_url='',\
             proxy_user='', proxy_pass=''):
     self.host = host
     self.userid = userid
     self.consumer_key = consumer_key
     self.ip = ip
     self.app_id = app_id
     self.access_token = access_token
     configuration = self.get_config(proxy_url, proxy_user, proxy_pass)
     self.api_client = openapi_client.ApiClient(configuration)
     session_init = openapi_client.SessionApi(self.api_client).session_init(self.userid, \
                           self.consumer_key, self.ip, self.app_id)
     if self.host != session_init.redirect.host:
         self.host = session_init.redirect.host
         configuration = self.get_config(proxy_url, proxy_user, proxy_pass)
         self.api_client = openapi_client.ApiClient(configuration)
         session_init = openapi_client.SessionApi(self.api_client).session_init(self.userid, \
                           self.consumer_key, self.ip, self.app_id)
 def setUp(self):
     c = openapi_client.Configuration()
     c.host = BASE_PATH
     self.cli = openapi_client.ApiClient(c)
     ## Add OAuth1.0a interceptor
     add_signer_layer(self.cli, P12, KEY_PASSWORD, CONSUMER_KEY)
     ## Add Field Level Encryption interceptor
     config_file = os.path.join(os.path.dirname(__file__), FLE_CONFIG_PATH)
     add_encryption_layer(self.cli, config_file)
예제 #21
0
파일: simulation.py 프로젝트: nens/fews-3di
 def __init__(self,
              settings: utils.Settings,
              allow_missing_saved_state: bool = False):
     """Set up a 3di API connection."""
     self.settings = settings
     self.allow_missing_saved_state = allow_missing_saved_state
     self.configuration = openapi_client.Configuration(host=API_HOST)
     self.api_client = openapi_client.ApiClient(self.configuration)
     self.api_client.user_agent = USER_AGENT  # Let's be neat.
     self.output_dir = self.settings.base_dir / "output"
     self.output_dir.mkdir(exist_ok=True)
예제 #22
0
 def setUp(self):
     configuration = openapi_client.Configuration()
     configuration.debug = False
     api_client = openapi_client.ApiClient(configuration)
     self.object = openapi_client.api.object_api.ObjectApi(api_client)
     self.bucket = openapi_client.api.bucket_api.BucketApi(api_client)
     self.models = openapi_client.models
     self.BUCKET_NAME = os.environ["BUCKET"]
     self.assertTrue(self.BUCKET_NAME,
                     "Environment variable 'BUCKET' not set.")
     self.FILE_SIZE = 128
     self.created_objects = []
     self.created_buckets = []
예제 #23
0
 def setUp(self):
     configuration = openapi_client.Configuration()
     configuration.debug = False
     api_client = openapi_client.ApiClient(configuration)
     self.bucket = openapi_client.api.bucket_api.BucketApi(api_client)
     self.object = openapi_client.api.object_api.ObjectApi(api_client)
     self.models = openapi_client.models
     self.BUCKET_NAME = os.environ["BUCKET"]
     self.NEXT_TIER_URL = "http://foo.com"
     self.FILE_SIZE = 128
     self.SLEEP_LONG_SECONDS = 15
     self.created_objects = []
     self.created_buckets = []
예제 #24
0
        def createAisApiClients(daemonlist):
            """ Create openapi client API handles for a list of daemons (does not initiate connection yet). """

            for d in daemonlist:
                if d['pod'].status.pod_ip is None:
                    d['aisClientApi'] = None
                    continue

                config = openapi_client.Configuration()
                config.debug = False
                config.host = "http://%s:%s/v1/" % (
                    d['pod'].status.pod_ip,
                    d['pod'].spec.containers[0].ports[0].container_port)
                d['aisClientApi'] = openapi_client.ApiClient(config)
예제 #25
0
    def main(self):
        self._args = docopt(__doc__)
        logging.basicConfig(level=-10 * self._args["-v"] + 30)

        if not (self._args["--monitor-room-schedule"]
                or self._args["--record-now"]):
            self._log.error("Please provide an operation option")
            exit(1)

        self._cam = PiCamInterface()
        self._api_conf = openapi_client.Configuration(
            host=self._args["--api-url"])
        self._api_conf.verify_ssl = False if self._args[
            "--no-verify-certs"] else True
        self._api_client = openapi_client.ApiClient(
            configuration=self._api_conf)
        self._auth_api = openapi_client.AuthenticationApi(self._api_client)
        self._schedule_api = openapi_client.ScheduleApi(self._api_client)
        self._video_upload_api = openapi_client.VideostreamApi(
            self._api_client)
        self._recorder = RecordHandler(ul_api=self._video_upload_api,
                                       video_intf=self._cam,
                                       audio_intf=None,
                                       buffer_size=int(
                                           self._args["--mem-buffer-size"]))

        auth_token = self._get_jwt_token(self._args["<vc_username>"],
                                         self._args["<vc_password>"])
        if auth_token:
            self._api_conf.access_token = auth_token
            self._log.debug("Authorized as %s with JWT token %s" %
                            (self._args["<vc_username>"], auth_token))
        else:
            self._log.error("Unable to authenticate as %s. Exiting.." %
                            self._args["<vc_username>"])
            exit(1)

        if self._args["--record-now"]:
            self._start_recording_now(int(self._args["--record-now"]))

        if self._args["--monitor-room-schedule"]:
            self._log.info(
                "Recording sessions upcoming in room %s indefinitely. Ctrl-C to terminate",
                self._args["--monitor-room-schedule"])
            if self._update_schedule_jobs():
                schedule.every().day.at("06:00").do(self._update_schedule_jobs)

                while True:
                    schedule.run_pending()
                    sleep(5)
def callback(ch, method, properties, body):
    print(" [x] %r:%r" % (method.routing_key, body))
    data = json.loads(body)

    with openapi_client.ApiClient(configuration) as api_client:
        # Create an instance of the API class
        api_instance = default_api.DefaultApi(api_client)

        try:
            # Create User
            api_response = api_instance.delete_user_users_user_id_delete(data["user_id"])
            pprint(api_response)
        except openapi_client.ApiException as e:
            print("Exception when calling DefaultApi->create_user_users_post: %s\n" % e)
예제 #27
0
    def test_authenticate(self):
        with openapi_client.ApiClient(self.config) as api_client:
            api_instance = openapi_client.AuthnApi(api_client)
            account = os.environ['CONJUR_ACCOUNT']
            login = os.environ['CONJUR_AUTHN_LOGIN']
            body = os.environ['CONJUR_AUTHN_API_KEY']

            api_response = api_instance.authenticate(account, login,
                                                     body).replace("\'", "\"")
            api_response_json = json.loads(api_response)
            api_response_keys = api_response_json.keys()

            self.assertIn("protected", api_response_keys)
            self.assertIn("payload", api_response_keys)
            self.assertIn("signature", api_response_keys)
예제 #28
0
 async def refresh_token(self):
     while True:
         await asyncio.sleep(800)
         res = self.deribitauth.public_auth_get(
             grant_type='refresh_token',
             username='',
             password='',
             client_id='',
             client_secret='',
             refresh_token=self.deribitconfig.refresh_token,
             timestamp='',
             signature='')
         self.deribitconfig.access_token = res['result']['access_token']
         self.deribitconfig.refresh_token = res['result']['refresh_token']
         self.deribittradingapi = openapi_client.TradingApi(
             openapi_client.ApiClient(self.deribitconfig))
예제 #29
0
def example_api_login():
    #  Set the configuration
    configuration = openapi_client.Configuration(
        host=example_host,
    )
    configuration.verify_ssl = False
    configuration.ssl_ca_cert = None
    configuration.assert_hostname = False
    configuration.cert_file = None

    print("# Get an access token")
    with openapi_client.ApiClient(configuration) as api_client:
        api_instance_auth = openapi_client.AuthenticationApi(api_client)
        body_login = openapi_client.ApiCredentials(password=example_password, username=example_username)
        api_response = api_instance_auth.login(body_login)
        pprint(api_response)
예제 #30
0
    def cancel_orders(self):
        '''
        Cancels all opened orders
        ROBOT SHOULD BE CONFIGURED BEFORE CALLING THIS FUNCTION!

        '''
        self.create_connection()
        
        configuration = openapi_client.Configuration()
        configuration.access_token = self.__access_token
        configuration.host = self.__host
        
        api_instance = openapi_client.PrivateApi(openapi_client.ApiClient(configuration))

        try:
            api_response = api_instance.private_cancel_all_get()
        except ApiException as e:
            print("Exception when calling PrivateApi->private_cancel_all_get: %s\n" % e)