Skip to content

Latest commit

 

History

History
268 lines (187 loc) · 16.1 KB

File metadata and controls

268 lines (187 loc) · 16.1 KB

Workspaces

Overview

Operations related to Workspaces

Available Operations

  • create - Create a Workspace in the specified Organization
  • list - List all Workspaces for the specified Organization
  • update - Update a Workspace
  • delete - Delete a Workspace
  • get - Get a Workspace

create

Create a new Workspace in the specified Organization.

Example Usage

from cribl_mgmt_plane import CriblMgmtPlane, models
import os


with CriblMgmtPlane(
    security=models.Security(
        client_oauth=models.SchemeClientOauth(
            client_id=os.getenv("CRIBLMGMTPLANE_CLIENT_ID", ""),
            client_secret=os.getenv("CRIBLMGMTPLANE_CLIENT_SECRET", ""),
            token_url=os.getenv("CRIBLMGMTPLANE_TOKEN_URL", ""),
            audience="https://api.cribl.cloud",
        ),
    ),
) as cmp_client:

    res = cmp_client.workspaces.create(organization_id="<id>", workspace_id="main", alias="Production Environment", description="Main production workspace for customer data processing", tags=[
        "production",
        "customer-data",
    ])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
organization_id str ✔️ The id of the Organization where you want to create the Workspace.
workspace_id str ✔️ Unique identifier for the Workspace. main
alias Optional[str] User-friendly alias for the Workspace. Production Environment
description Optional[str] Brief description of the Workspace. Main production Workspace for customer data processing
tags List[str] Tags associated with the Workspace. [
"production",
"customer-data"
]
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V1WorkspacesCreateWorkspaceResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

list

Get a list of all Workspaces for the specified Organization.

Example Usage

from cribl_mgmt_plane import CriblMgmtPlane, models
import os


with CriblMgmtPlane(
    security=models.Security(
        client_oauth=models.SchemeClientOauth(
            client_id=os.getenv("CRIBLMGMTPLANE_CLIENT_ID", ""),
            client_secret=os.getenv("CRIBLMGMTPLANE_CLIENT_SECRET", ""),
            token_url=os.getenv("CRIBLMGMTPLANE_TOKEN_URL", ""),
            audience="https://api.cribl.cloud",
        ),
    ),
) as cmp_client:

    res = cmp_client.workspaces.list(organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
organization_id str ✔️ The id of the Organization that contains the Workspaces.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V1WorkspacesListWorkspacesResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

update

Update the specified Workspace.

Example Usage

from cribl_mgmt_plane import CriblMgmtPlane, models
import os


with CriblMgmtPlane(
    security=models.Security(
        client_oauth=models.SchemeClientOauth(
            client_id=os.getenv("CRIBLMGMTPLANE_CLIENT_ID", ""),
            client_secret=os.getenv("CRIBLMGMTPLANE_CLIENT_SECRET", ""),
            token_url=os.getenv("CRIBLMGMTPLANE_TOKEN_URL", ""),
            audience="https://api.cribl.cloud",
        ),
    ),
) as cmp_client:

    res = cmp_client.workspaces.update(organization_id="<id>", workspace_id="<id>", alias="Production Environment", description="Main production workspace for customer data processing", tags=[
        "production",
        "customer-data",
    ])

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
organization_id str ✔️ The id of the Organization that contains the Workspace.
workspace_id str ✔️ The id of the Workspace to update.
alias Optional[str] User-friendly alias for the Workspace. Production Environment
description Optional[str] Brief description of the Workspace. Main production Workspace for customer data processing
tags List[str] Tags associated with the Workspace. [
"production",
"customer-data"
]
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DefaultErrorDTO

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

delete

Delete the specified Workspace in the specified Organization.

Example Usage

from cribl_mgmt_plane import CriblMgmtPlane, models
import os


with CriblMgmtPlane(
    security=models.Security(
        client_oauth=models.SchemeClientOauth(
            client_id=os.getenv("CRIBLMGMTPLANE_CLIENT_ID", ""),
            client_secret=os.getenv("CRIBLMGMTPLANE_CLIENT_SECRET", ""),
            token_url=os.getenv("CRIBLMGMTPLANE_TOKEN_URL", ""),
            audience="https://api.cribl.cloud",
        ),
    ),
) as cmp_client:

    res = cmp_client.workspaces.delete(organization_id="<id>", workspace_id="<id>")

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
organization_id str ✔️ The id of the Organization that contains the Workspace.
workspace_id str ✔️ The id of the Workspace to delete.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DefaultErrorDTO

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

get

Get the specified Workspace.

Example Usage

from cribl_mgmt_plane import CriblMgmtPlane, models
import os


with CriblMgmtPlane(
    security=models.Security(
        client_oauth=models.SchemeClientOauth(
            client_id=os.getenv("CRIBLMGMTPLANE_CLIENT_ID", ""),
            client_secret=os.getenv("CRIBLMGMTPLANE_CLIENT_SECRET", ""),
            token_url=os.getenv("CRIBLMGMTPLANE_TOKEN_URL", ""),
            audience="https://api.cribl.cloud",
        ),
    ),
) as cmp_client:

    res = cmp_client.workspaces.get(organization_id="<id>", workspace_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
organization_id str ✔️ The id of the Organization that contains the Workspace.
workspace_id str ✔️ The id of the Workspace to get.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V1WorkspacesGetWorkspaceResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*