Skip to content

Commit

Permalink
Merge pull request #148 from tigrisdata/main
Browse files Browse the repository at this point in the history
Beta release
  • Loading branch information
efirs authored Oct 18, 2022
2 parents bd0c855 + 4f3d4e6 commit b6291ba
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@v3
- uses: actions/setup-go@v3
with:
go-version: '1.17.6'
go-version: '1.19.2'
- name: Install dependencies
run: /bin/bash scripts/install_build_deps.sh
- name: Check OpenAPI generated
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: release
Expand Down
7 changes: 0 additions & 7 deletions scripts/fix_openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ main() {
# so fixing it here
yq_cmd '.paths."/v1/health".get.security=[]'

yq_del_namespace_name CreateNamespaceRequest

# Fix the types of filter and document fields to be object on HTTP wire.
# The original format in proto file is "bytes", which allows to skip
# unmarshalling in GRPC, we also implement custom unmarshalling for HTTP
Expand Down Expand Up @@ -99,11 +97,6 @@ yq_cmd() {
yq -I 4 -i "$1" "$IN_FILE"
}

# Delete name attribute from body
yq_del_namespace_name() {
yq_cmd "del(.components.schemas.$1.properties.name)"
}

# Change type of documents, filters, fields, schema to be JSON object
# instead of bytes.
# It's defined as bytes in proto to implement custom unmarshalling.
Expand Down
30 changes: 18 additions & 12 deletions server/v1/management.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,31 @@ import "openapiv3/annotations.proto";
option go_package = "github.com/tigrisdata/tigris/api";
option java_package = "com.tigrisdata.db.api.v1.grpc";

message CreateNamespaceRequest{
// A unique namespace id.
int32 id = 1;
// A namespace name.
string name = 2;
message CreateNamespaceRequest {
// Optional: unique id
uint32 code = 1;
// Optional: unique string id
string id = 2;
// Required: The display name for namespace.
string name = 3;
}

message CreateNamespaceResponse{
message CreateNamespaceResponse {
// A detailed response message.
string message = 1;
// An enum with value set as "created".
string status = 2;
// The created namespace
NamespaceInfo namespace = 3;
}

message NamespaceInfo{
// A unique namespace id.
int32 id = 1;
// A namespace name.
string name = 2;
message NamespaceInfo {
// The unique namespace code.
int32 code = 1;
// The namespace unique id.
string id = 2;
// The namespace display name.
string name = 3;
}

message ListNamespacesRequest {
Expand Down Expand Up @@ -180,7 +186,7 @@ service Management {
rpc CreateNamespace(CreateNamespaceRequest) returns
(CreateNamespaceResponse) {
option (google.api.http) = {
post : "/v1/management/namespaces/{name}/create"
post : "/v1/management/namespaces/create"
body : "*"
};
option(openapi.v3.operation) = {
Expand Down
62 changes: 33 additions & 29 deletions server/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -902,53 +902,46 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/management/namespaces/list:
/v1/management/namespaces/create:
post:
tags:
- Namespaces
summary: Lists all Namespaces
description: List all namespace
operationId: Management_ListNamespaces
summary: Creates a Namespace
description: Creates a new namespace, if it does not exist
operationId: Management_CreateNamespace
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateNamespaceRequest'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListNamespacesResponse'
$ref: '#/components/schemas/CreateNamespaceResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/management/namespaces/{name}/create:
/v1/management/namespaces/list:
post:
tags:
- Namespaces
summary: Creates a Namespace
description: Creates a new namespace, if it does not exist
operationId: Management_CreateNamespace
parameters:
- name: name
in: path
description: A namespace name.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateNamespaceRequest'
required: true
summary: Lists all Namespaces
description: List all namespace
operationId: Management_ListNamespaces
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateNamespaceResponse'
$ref: '#/components/schemas/ListNamespacesResponse'
default:
description: Default error response
content:
Expand Down Expand Up @@ -1278,10 +1271,16 @@ components:
CreateNamespaceRequest:
type: object
properties:
id:
code:
type: integer
description: A unique namespace id.
format: int32
description: 'Optional: unique id'
format: uint32
id:
type: string
description: 'Optional: unique string id'
name:
type: string
description: 'Required: The display name for namespace.'
CreateNamespaceResponse:
type: object
properties:
Expand All @@ -1291,6 +1290,8 @@ components:
status:
type: string
description: An enum with value set as "created".
namespace:
$ref: '#/components/schemas/NamespaceInfo'
CreateOrUpdateCollectionRequest:
type: object
properties:
Expand Down Expand Up @@ -1717,13 +1718,16 @@ components:
NamespaceInfo:
type: object
properties:
id:
code:
type: integer
description: A unique namespace id.
description: The unique namespace code.
format: int32
id:
type: string
description: The namespace unique id.
name:
type: string
description: A namespace name.
description: The namespace display name.
Page:
type: object
properties:
Expand Down

0 comments on commit b6291ba

Please sign in to comment.