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 use list workspaces #57

Open
alfredopalhares opened this issue Feb 1, 2024 · 0 comments
Open

Cannot use list workspaces #57

alfredopalhares opened this issue Feb 1, 2024 · 0 comments

Comments

@alfredopalhares
Copy link

alfredopalhares commented Feb 1, 2024

Hello,

Thank you so much for providing this toolset to interact with Airbyte, I am building a Pulumi provider so we can automate this via Pulumi.
But while writing some test code, I have found that some examples do not work, the case was with List Workspaces, here is an example snippet:

import airbyte
import dateutil.parser
from airbyte.models import operations, shared

source_conn = airbyte.Airbyte(
    server_url="http://127.0.0.1:8000/api/v1",
    security=shared.Security(
        basic_auth=shared.SchemeBasicAuth(
            username="airbyte",
            password="password"
        )
    )
)

request = operations.ListWorkspacesRequest()
result = source_conn.workspaces.list_workspaces(request)
print(result)

This gives the following error:

-> % ./examples/create_source.py
ListWorkspacesRequest(include_deleted=False, limit=20, offset=0, workspace_ids=None)
Traceback (most recent call last):
  File "/path/to/my/repo/pulumi-airbyte/./examples/create_source.py", line 23, in <module>
    result = source_conn.workspaces.list_workspaces(request)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/my/repo/venv/lib/python3.11/site-packages/airbyte/workspaces.py", line 176, in list_workspaces
    raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
airbyte.models.errors.sdkerror.SDKError: API error occurred: Status 404
Object not found.

So I did some research and inpection to try and find some error or mishuse on my side. Using wireshark to fetch the request this is what I get:

GET /api/v1/workspaces?includeDeleted=false&limit=20&offset=0 HTTP/1.1
Host: 127.0.0.1:8000
user-agent: speakeasy-sdk/python 0.44.3 2.237.2 1.0.0 airbyte-api
Accept-Encoding: gzip, deflate
Accept: application/json
Connection: keep-alive
Authorization: Basic YWlyYnl0ZTpwYXNzd29yZA==

HTTP/1.1 404 Not Found
Server: nginx/1.25.3
Date: Thu, 01 Feb 2024 13:15:56 GMT
Content-Type: application/json
Content-Length: 17
Connection: keep-alive

Object not found.

I have replicated the request with insomnia and indeed I get the same response. Looking at your OpenAPI Docs The only request that exists is a POST /v1/workspaces/list and inspecting the source it looks like that is not the case.

Version information:

  • Airbyte Version: 0.50.45
  • Airbyte SDK Version: 0.44.3

I noticed that you are using https://speakeasyapi.dev for the code generation, maybe needs to be re run against the API? Or am I using it wrong ?

Regards,
Alfredo Palhares

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