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

Add support for cluster export jobs #449

Merged
merged 1 commit into from
Jul 18, 2023
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
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Unreleased
This is done by specifying a ``--org-id`` and ``--region``, at which point
the project will be created on-the-fly.

- Added new resource ``clusters export-jobs`` and subcommands that allow
organization admins to manage export jobs.

- Added new subcommand ``get`` for the resource ``organizations files`` that
returns a single file by its ID.

1.4.0 - 2023/06/22
==================

Expand Down
92 changes: 92 additions & 0 deletions croud/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
clusters_snapshots_list,
clusters_snapshots_restore,
clusters_upgrade,
export_jobs_create,
export_jobs_delete,
export_jobs_list,
import_jobs_create_from_file,
import_jobs_create_from_url,
import_jobs_delete,
Expand All @@ -67,6 +70,7 @@
from croud.organizations.commands import (
org_files_create,
org_files_delete,
org_files_get,
org_files_list,
organizations_create,
organizations_delete,
Expand Down Expand Up @@ -762,6 +766,78 @@
},
},
},
"export-jobs": {
"help": "Manage data export jobs.",
"commands": {
"delete": {
"help": "Cancels an already running data export job that has "
"not finished yet. "
"If the job has already finished it deletes it from "
"the job history.",
"extra_args": [
Argument(
"--cluster-id", type=str, required=True,
help="The cluster the job belongs to."
),
Argument(
"--export-job-id", type=str,
required=True,
help="The ID of the export job."
),
],
"resolver": export_jobs_delete,
},
"list": {
"help": "Lists data export jobs that belong to a specific "
"cluster.",
"extra_args": [
Argument(
"--cluster-id", type=str, required=True,
help="The cluster the export jobs belong to."
),
],
"resolver": export_jobs_list,
},
"create": {
"help": "Create a data export job for the specified cluster.",
"extra_args": [
Argument(
"--cluster-id", type=str, required=True,
help="The cluster the data will be exported from."
),
Argument(
"--table",
type=str,
required=True,
help="The table the data will be exported from.",
),
Argument(
tomach marked this conversation as resolved.
Show resolved Hide resolved
"--file-format",
type=str,
required=True,
choices=["csv", "json", "parquet"],
help="The format of the data in the file.",
),
Argument(
"--compression",
type=str,
required=False,
choices=["gzip"],
help="The compression method of the exported file.",
),
Argument(
"--save-as",
type=str,
required=False,
help="The file on your local filesystem the data will "
"be exported to. If not specified, you will "
"receive the URL to download the file.",
),
],
"resolver": export_jobs_create,
},
},
},
},
},
"products": {
Expand Down Expand Up @@ -924,6 +1000,22 @@
"files": {
"help": "Manage organization's files.",
"commands": {
"get": {
"help": (
"Get a file by its ID."
),
"extra_args": [
Argument(
"--org-id", type=str, required=True,
help="The organization ID to use.",
),
Argument(
"--file-id", type=str, required=True,
help="The ID of the file.",
),
],
"resolver": org_files_get,
},
"list": {
"help": "List all files uploaded to this organization.",
"extra_args": [
Expand Down
Loading
Loading