Skip to content

Commit

Permalink
OpenAPI: Add endpoint field to CatalogConfig (#10928)
Browse files Browse the repository at this point in the history
  • Loading branch information
nastra authored Aug 23, 2024
1 parent 2424e2c commit e0596fb
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
11 changes: 11 additions & 0 deletions open-api/rest-catalog-open-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ class CatalogConfig(BaseModel):
...,
description='Properties that should be used as default configuration; applied before client configuration.',
)
endpoints: Optional[List[str]] = Field(
None,
description='A list of endpoints that the server supports. The format of each endpoint must be "<HTTP verb> <resource path from OpenAPI REST spec>". The HTTP verb and the resource path must be separated by a space character.',
example=[
'GET /v1/{prefix}/namespaces/{namespace}',
'GET /v1/{prefix}/namespaces',
'POST /v1/{prefix}/namespaces',
'GET /v1/{prefix}/namespaces/{namespace}/tables/{table}',
'GET /v1/{prefix}/namespaces/{namespace}/views/{view}',
],
)


class UpdateNamespacePropertiesRequest(BaseModel):
Expand Down
54 changes: 53 additions & 1 deletion open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,38 @@ paths:
Common catalog configuration settings are documented at
https://iceberg.apache.org/docs/latest/configuration/#catalog-properties
The catalog configuration also holds an optional `endpoints` field that contains information about the endpoints
supported by the server. If a server does not send the `endpoints` field, a default set of endpoints is assumed:
- GET /v1/{prefix}/namespaces
- POST /v1/{prefix}/namespaces
- GET /v1/{prefix}/namespaces/{namespace}
- DELETE /v1/{prefix}/namespaces/{namespace}
- POST /v1/{prefix}/namespaces/{namespace}/properties
- GET /v1/{prefix}/namespaces/{namespace}/tables
- POST /v1/{prefix}/namespaces/{namespace}/tables
- GET /v1/{prefix}/namespaces/{namespace}/tables/{table}
- POST /v1/{prefix}/namespaces/{namespace}/tables/{table}
- DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}
- POST /v1/{prefix}/namespaces/{namespace}/register
- POST /v1/{prefix}/namespaces/{namespace}/tables/{table}/metrics
- POST /v1/{prefix}/tables/rename
- POST /v1/{prefix}/transactions/commit
"
responses:
200:
Expand All @@ -114,7 +146,14 @@ paths:
},
"defaults": {
"clients": "4"
}
},
"endpoints": [
"GET /v1/{prefix}/namespaces/{namespace}",
"GET /v1/{prefix}/namespaces",
"POST /v1/{prefix}/namespaces",
"GET /v1/{prefix}/namespaces/{namespace}/tables/{table}",
"GET /v1/{prefix}/namespaces/{namespace}/views/{view}"
]
}
400:
$ref: '#/components/responses/BadRequestErrorResponse'
Expand Down Expand Up @@ -1583,6 +1622,19 @@ components:
type: string
description:
Properties that should be used as default configuration; applied before client configuration.
endpoints:
type: array
items:
type: string
description: A list of endpoints that the server supports. The format of each endpoint must be "<HTTP verb> <resource path from OpenAPI REST spec>".
The HTTP verb and the resource path must be separated by a space character.
example: [
"GET /v1/{prefix}/namespaces/{namespace}",
"GET /v1/{prefix}/namespaces",
"POST /v1/{prefix}/namespaces",
"GET /v1/{prefix}/namespaces/{namespace}/tables/{table}",
"GET /v1/{prefix}/namespaces/{namespace}/views/{view}"
]

CreateNamespaceRequest:
type: object
Expand Down

0 comments on commit e0596fb

Please sign in to comment.