From 6d42ce17e248012d57615fc13aa468db58059d1b Mon Sep 17 00:00:00 2001 From: Timo Riski Date: Mon, 17 Jun 2024 13:48:10 +0300 Subject: [PATCH] docs(clickhousegrant): add clickhouse grant docs to API reference --- docs/docs/api-reference/clickhousegrant.md | 44 +++++++++++++++++++ .../examples/clickhousegrant.yaml | 40 +++++++++++++++++ docs/mkdocs.yml | 1 + 3 files changed, 85 insertions(+) create mode 100644 docs/docs/api-reference/examples/clickhousegrant.yaml diff --git a/docs/docs/api-reference/clickhousegrant.md b/docs/docs/api-reference/clickhousegrant.md index 3c918bc1..72546a0c 100644 --- a/docs/docs/api-reference/clickhousegrant.md +++ b/docs/docs/api-reference/clickhousegrant.md @@ -2,6 +2,50 @@ title: "ClickhouseGrant" --- +## Usage example + +??? example + ```yaml + apiVersion: aiven.io/v1alpha1 + kind: ClickhouseGrant + metadata: + name: demo-ch-grant + spec: + authSecretRef: + name: aiven-token + key: token + + project: my-aiven-project + serviceName: my-clickhouse + + privilegeGrants: + - grantees: + - user: user1 + - user: my-clickhouse-user-🦄 + privileges: + - SELECT + - INSERT + database: my-db + # If table is not specified, the privileges are granted on all tables in the database + # If columns is not specified, the privileges are granted on all columns in the table + - grantees: + - role: my-role + privileges: + - SELECT + database: my-db + table: my-table + columns: + - col1 + - col2 + + roleGrants: + - roles: + - other-role + grantees: + - user: my-user + - role: my-role + ``` + ## ClickhouseGrant {: #ClickhouseGrant } ClickhouseGrant is the Schema for the ClickhouseGrants API. diff --git a/docs/docs/api-reference/examples/clickhousegrant.yaml b/docs/docs/api-reference/examples/clickhousegrant.yaml new file mode 100644 index 00000000..47f59b55 --- /dev/null +++ b/docs/docs/api-reference/examples/clickhousegrant.yaml @@ -0,0 +1,40 @@ + +apiVersion: aiven.io/v1alpha1 +kind: ClickhouseGrant +metadata: + name: demo-ch-grant +spec: + authSecretRef: + name: aiven-token + key: token + + project: my-aiven-project + serviceName: my-clickhouse + + privilegeGrants: + - grantees: + - user: user1 + - user: my-clickhouse-user-🦄 + privileges: + - SELECT + - INSERT + database: my-db + # If table is not specified, the privileges are granted on all tables in the database + # If columns is not specified, the privileges are granted on all columns in the table + - grantees: + - role: my-role + privileges: + - SELECT + database: my-db + table: my-table + columns: + - col1 + - col2 + + roleGrants: + - roles: + - other-role + grantees: + - user: my-user + - role: my-role + diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 6da64676..d9bd0f36 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -92,6 +92,7 @@ nav: - api-reference/clickhousedatabase.md - api-reference/clickhouserole.md - api-reference/clickhouseuser.md + - api-reference/clickhousegrant.md - api-reference/connectionpool.md - api-reference/database.md - api-reference/grafana.md