Skip to content

update sdk #4

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

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
venv
__pycache__
__pycache__
dist
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Python Source Plugin Template

This is the plugin documentation that will get published to Hub. Read more about publishing at [CloudQuery Docs](https://docs.cloudquery.io/docs/developers/publishing-a-plugin-to-the-hub)
10 changes: 7 additions & 3 deletions plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@

PLUGIN_NAME = "example"
PLUGIN_VERSION = "1.0.0" # {x-release-please-version}
TEAM_NAME = "cloudquery"
PLUGIN_KIND = "source"


class ExamplePlugin(plugin.Plugin):
def __init__(self) -> None:
super().__init__(PLUGIN_NAME, PLUGIN_VERSION)
super().__init__(
PLUGIN_NAME, PLUGIN_VERSION, plugin.plugin.Options(team=TEAM_NAME, kind=PLUGIN_KIND)
)
self._spec_json = None
self._spec = None
self._scheduler = None
Expand All @@ -26,10 +30,10 @@ def __init__(self) -> None:
def set_logger(self, logger) -> None:
self._logger = logger

def init(self, spec_bytes, no_connection: bool = False):
def init(self, spec, no_connection: bool = False):
if no_connection:
return
self._spec_json = json.loads(spec_bytes)
self._spec_json = json.loads(spec)
self._spec = Spec(**self._spec_json)
self._spec.validate()
self._scheduler = Scheduler(
Expand Down
Loading