Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot link data to bundle with data does not exist error #3

Open
alexiswl opened this issue Oct 6, 2023 · 0 comments
Open

Cannot link data to bundle with data does not exist error #3

alexiswl opened this issue Oct 6, 2023 · 0 comments

Comments

@alexiswl
Copy link

alexiswl commented Oct 6, 2023

Hello,

I am trying to use the icasdk to link a data id to a bundle.

Here is my python script (I have used the same file as in #2

Details
#!/usr/bin/env python3

"""
Test link bundle in icasdk
"""

# Standard Imports
from os import environ
import logging
import json

# ICASDK Imports
import icasdk
from icasdk import Configuration, ApiClient, ApiException
from icasdk.apis.tags.bundle_data_api import BundleDataApi

# Set Globals
BUNDLE_ID = "46dc94fe-f4a8-47e5-b6fc-074481e0e7e0"
DATA_ID = "fil.09fd831171954940ece408db581818a8"

# Set logging
logging.basicConfig(level=logging.DEBUG)

# Set configuration
logging.info("Set ICAv2 Configuration Construct")
configuration = Configuration(
    host=environ["ICAV2_BASE_URL"],  # https://ica.illumina.com/ica/rest
    access_token=environ["ICAV2_ACCESS_TOKEN"]  # icav2 tenants enter umccr-test
)

logging.info("Create api instance context for linking to bundle")
with ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = BundleDataApi(api_client)

try:
    # Link data to this bundle.
    api_response = api_instance.link_data_to_bundle(
        path_params={
            "bundleId": BUNDLE_ID,
            "dataId": DATA_ID
        }
    )
except ApiException as e:
    logging.error("Exception when calling BundleDataApi->link_data_to_bundle: %s\n" % e)
    raise ApiException

Where I get the following error (The data does not exist?)

INFO:root:Set ICAv2 Configuration Construct
INFO:root:Create api instance context for linking to bundle
ERROR:root:Exception when calling BundleDataApi->link_data_to_bundle: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Fri, 06 Oct 2023 04:22:55 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '508', 'Connection': 'keep-alive', 'Set-Cookie': 'INGRESSCOOKIE=1949008a2ee59bdcdb33c1b155451c18|82b2b547c6ffaa8346869fdb96dccf96; Max-Age=43200; Path=/ica/rest/api; HttpOnly', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization', 'Access-Control-Max-Age': '7200'})
HTTP response body: b'{"id":"10e1625c-9b7e-42cb-ba36-1f4357e2562d","type":"about:blank","title":"ICA_GNRC_001","status":404,"detail":"Could not find data with ID [fil.09fd831171954940ece408db581818a8]","instance":"http://ica.illumina.com/ica/rest/api/bundles/46dc94fe-f4a8-47e5-b6fc-074481e0e7e0/data/fil.09fd831171954940ece408db581818a8","parameters":{},"timestamp":"2023-10-06T04:22:55Z","method":"POST","userId":"c98710a2-5087-361b-8bfc-4b1ca914cdba","tenantName":"umccr-test","tenantId":"91e1f42c-0afa-47ef-b529-17821ce8bf58"}'


Traceback (most recent call last):
  File "/home/alexiswl/PycharmProjects/UMCCR/ica-sdk-python-testing/test_link_bundle.py", line 38, in <module>
    api_response = api_instance.link_data_to_bundle(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alexiswl/miniforge3/envs/ica-sdk-python-testing/lib/python3.12/site-packages/icasdk/paths/api_bundles_bundle_id_data_data_id/post.py", line 267, in link_data_to_bundle
    return self._link_data_to_bundle_oapg(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alexiswl/miniforge3/envs/ica-sdk-python-testing/lib/python3.12/site-packages/icasdk/paths/api_bundles_bundle_id_data_data_id/post.py", line 214, in _link_data_to_bundle_oapg
    raise exceptions.ApiException(api_response=api_response)
icasdk.exceptions.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Fri, 06 Oct 2023 04:22:55 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '508', 'Connection': 'keep-alive', 'Set-Cookie': 'INGRESSCOOKIE=1949008a2ee59bdcdb33c1b155451c18|82b2b547c6ffaa8346869fdb96dccf96; Max-Age=43200; Path=/ica/rest/api; HttpOnly', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization', 'Access-Control-Max-Age': '7200'})
HTTP response body: b'{"id":"10e1625c-9b7e-42cb-ba36-1f4357e2562d","type":"about:blank","title":"ICA_GNRC_001","status":404,"detail":"Could not find data with ID [fil.09fd831171954940ece408db581818a8]","instance":"http://ica.illumina.com/ica/rest/api/bundles/46dc94fe-f4a8-47e5-b6fc-074481e0e7e0/data/fil.09fd831171954940ece408db581818a8","parameters":{},"timestamp":"2023-10-06T04:22:55Z","method":"POST","userId":"c98710a2-5087-361b-8bfc-4b1ca914cdba","tenantName":"umccr-test","tenantId":"91e1f42c-0afa-47ef-b529-17821ce8bf58"}'


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/alexiswl/PycharmProjects/UMCCR/ica-sdk-python-testing/test_link_bundle.py", line 46, in <module>
    raise ApiException
icasdk.exceptions.ApiException: (None)
Reason: None
@alexiswl alexiswl changed the title Cannot link data to bundle with Cannot link data to bundle with data does not exist error Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant