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

Make docs useful again #519

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
56 changes: 56 additions & 0 deletions docs/account/access_control.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
``a.access_control``: Account Access Control
============================================
.. currentmodule:: databricks.sdk.service.iam

.. py:class:: AccountAccessControlAPI

These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A
grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is
called a rule set.

.. py:method:: get_assignable_roles_for_resource(resource: str) -> GetAssignableRolesForResourceResponse

Get assignable roles for a resource.

Gets all the roles that can be granted on an account level resource. A role is grantable if the rule
set on the resource can contain an access rule of the role.

:param resource: str
The resource name for which assignable roles will be listed.

:returns: :class:`GetAssignableRolesForResourceResponse`


.. py:method:: get_rule_set(name: str, etag: str) -> RuleSetResponse

Get a rule set.

Get a rule set by its name. A rule set is always attached to a resource and contains a list of access
rules on the said resource. Currently only a default rule set for each resource is supported.

:param name: str
The ruleset name associated with the request.
:param etag: str
Etag used for versioning. The response is at least as fresh as the eTag provided. Etag is used for
optimistic concurrency control as a way to help prevent simultaneous updates of a rule set from
overwriting each other. It is strongly suggested that systems make use of the etag in the read ->
modify -> write pattern to perform rule set updates in order to avoid race conditions that is get an
etag from a GET rule set request, and pass it with the PUT update request to identify the rule set
version you are updating.

:returns: :class:`RuleSetResponse`


.. py:method:: update_rule_set(name: str, rule_set: RuleSetUpdateRequest) -> RuleSetResponse

Update a rule set.

Replace the rules of a rule set. First, use get to read the current version of the rule set before
modifying it. This pattern helps prevent conflicts between concurrent updates.

:param name: str
Name of the rule set.
:param rule_set: :class:`RuleSetUpdateRequest`

:returns: :class:`RuleSetResponse`

12 changes: 12 additions & 0 deletions docs/account/account-billing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Billing
=======

Configure different aspects of Databricks billing and usage.

.. toctree::
:maxdepth: 1

billable_usage
budgets
log_delivery
12 changes: 12 additions & 0 deletions docs/account/account-catalog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Unity Catalog
=============

Configure data governance with Unity Catalog for metastores, catalogs, schemas, tables, external locations, and storage credentials

.. toctree::
:maxdepth: 1

metastore_assignments
metastores
storage_credentials
14 changes: 14 additions & 0 deletions docs/account/account-iam.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

Identity and Access Management
==============================

Manage users, service principals, groups and their permissions in Accounts and Workspaces

.. toctree::
:maxdepth: 1

access_control
groups
service_principals
users
workspace_assignment
13 changes: 13 additions & 0 deletions docs/account/account-oauth2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

OAuth
=====

Configure OAuth 2.0 application registrations for Databricks

.. toctree::
:maxdepth: 1

custom_app_integration
o_auth_published_apps
published_app_integration
service_principal_secrets
16 changes: 16 additions & 0 deletions docs/account/account-provisioning.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Provisioning
============

Resource management for secure Databricks Workspace deployment, cross-account IAM roles, storage, encryption, networking and private access.

.. toctree::
:maxdepth: 1

credentials
encryption_keys
networks
private_access
storage
vpc_endpoints
workspaces
12 changes: 12 additions & 0 deletions docs/account/account-settings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Settings
========

Manage security settings for Accounts and Workspaces

.. toctree::
:maxdepth: 1

ip_access_lists
network_connectivity
settings
44 changes: 44 additions & 0 deletions docs/account/billable_usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
``a.billable_usage``: Billable usage download
=============================================
.. currentmodule:: databricks.sdk.service.billing

.. py:class:: BillableUsageAPI

This API allows you to download billable usage logs for the specified account and date range. This feature
works with all account types.

.. py:method:: download(start_month: str, end_month: str [, personal_data: Optional[bool]]) -> DownloadResponse


Usage:

.. code-block::

from databricks.sdk import AccountClient

a = AccountClient()

resp = a.billable_usage.download(start_month="2023-01", end_month="2023-02")

Return billable usage logs.

Returns billable usage logs in CSV format for the specified account and date range. For the data
schema, see [CSV file schema]. Note that this method might take multiple minutes to complete.

**Warning**: Depending on the queried date range, the number of workspaces in the account, the size of
the response and the internet speed of the caller, this API may hit a timeout after a few minutes. If
you experience this, try to mitigate by calling the API with narrower date ranges.

[CSV file schema]: https://docs.databricks.com/administration-guide/account-settings/usage-analysis.html#schema

:param start_month: str
Format: `YYYY-MM`. First month to return billable usage logs for. This field is required.
:param end_month: str
Format: `YYYY-MM`. Last month to return billable usage logs for. This field is required.
:param personal_data: bool (optional)
Specify whether to include personally identifiable information in the billable usage logs, for
example the email addresses of cluster creators. Handle this information with care. Defaults to
false.

:returns: :class:`DownloadResponse`

162 changes: 162 additions & 0 deletions docs/account/budgets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
``a.budgets``: Budgets
======================
.. currentmodule:: databricks.sdk.service.billing

.. py:class:: BudgetsAPI

These APIs manage budget configuration including notifications for exceeding a budget for a period. They
can also retrieve the status of each budget.

.. py:method:: create(budget: Budget) -> WrappedBudgetWithStatus


Usage:

.. code-block::

import time

from databricks.sdk import AccountClient
from databricks.sdk.service import billing

a = AccountClient()

created = a.budgets.create(budget=billing.Budget(
name=f'sdk-{time.time_ns()}',
filter="tag.tagName = 'all'",
period="1 month",
start_date="2022-01-01",
target_amount="100",
alerts=[billing.BudgetAlert(email_notifications=["admin@example.com"], min_percentage=50)]))

# cleanup
a.budgets.delete(budget_id=created.budget.budget_id)

Create a new budget.

Creates a new budget in the specified account.

:param budget: :class:`Budget`
Budget configuration to be created.

:returns: :class:`WrappedBudgetWithStatus`


.. py:method:: delete(budget_id: str)

Delete budget.

Deletes the budget specified by its UUID.

:param budget_id: str
Budget ID




.. py:method:: get(budget_id: str) -> WrappedBudgetWithStatus


Usage:

.. code-block::

import time

from databricks.sdk import AccountClient
from databricks.sdk.service import billing

a = AccountClient()

created = a.budgets.create(budget=billing.Budget(
name=f'sdk-{time.time_ns()}',
filter="tag.tagName = 'all'",
period="1 month",
start_date="2022-01-01",
target_amount="100",
alerts=[billing.BudgetAlert(email_notifications=["admin@example.com"], min_percentage=50)]))

by_id = a.budgets.get(budget_id=created.budget.budget_id)

# cleanup
a.budgets.delete(budget_id=created.budget.budget_id)

Get budget and its status.

Gets the budget specified by its UUID, including noncumulative status for each day that the budget is
configured to include.

:param budget_id: str
Budget ID

:returns: :class:`WrappedBudgetWithStatus`


.. py:method:: list() -> Iterator[BudgetWithStatus]


Usage:

.. code-block::

from databricks.sdk import AccountClient

a = AccountClient()

all = a.budgets.list()

Get all budgets.

Gets all budgets associated with this account, including noncumulative status for each day that the
budget is configured to include.

:returns: Iterator over :class:`BudgetWithStatus`


.. py:method:: update(budget_id: str, budget: Budget)


Usage:

.. code-block::

import time

from databricks.sdk import AccountClient
from databricks.sdk.service import billing

a = AccountClient()

created = a.budgets.create(budget=billing.Budget(
name=f'sdk-{time.time_ns()}',
filter="tag.tagName = 'all'",
period="1 month",
start_date="2022-01-01",
target_amount="100",
alerts=[billing.BudgetAlert(email_notifications=["admin@example.com"], min_percentage=50)]))

a.budgets.update(budget_id=created.budget.budget_id,
budget=billing.Budget(name=f'sdk-{time.time_ns()}',
filter="tag.tagName = 'all'",
period="1 month",
start_date="2022-01-01",
target_amount="100",
alerts=[
billing.BudgetAlert(email_notifications=["admin@example.com"],
min_percentage=70)
]))

# cleanup
a.budgets.delete(budget_id=created.budget.budget_id)

Modify budget.

Modifies a budget in this account. Budget properties are completely overwritten.

:param budget_id: str
Budget ID
:param budget: :class:`Budget`
Budget configuration to be created.



Loading
Loading