Skip to content

Commit

Permalink
docs(clickhousegrant): add clickhouse grant docs to API reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rriski committed Jun 23, 2024
1 parent 411158c commit 0315975
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/docs/api-reference/clickhousegrant.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
40 changes: 40 additions & 0 deletions docs/docs/api-reference/examples/clickhousegrant.yaml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0315975

Please sign in to comment.