Browse Source

fix typo & code clean

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ruiyi.jiang 1 year ago
parent
commit
20c36cbea3

+ 4 - 4
server/src/collections/collections.controller.ts

@@ -84,8 +84,8 @@ export class CollectionController {
     );
     );
 
 
     // segments
     // segments
-    this.router.get('/:name/psegments', this.getPSegement.bind(this));
-    this.router.get('/:name/qsegments', this.getQSegement.bind(this));
+    this.router.get('/:name/psegments', this.getPSegment.bind(this));
+    this.router.get('/:name/qsegments', this.getQSegment.bind(this));
 
 
     this.router.put('/:name/compact', this.compact.bind(this));
     this.router.put('/:name/compact', this.compact.bind(this));
     return this.router;
     return this.router;
@@ -335,7 +335,7 @@ export class CollectionController {
     }
     }
   }
   }
 
 
-  async getPSegement(req: Request, res: Response, next: NextFunction) {
+  async getPSegment(req: Request, res: Response, next: NextFunction) {
     const name = req.params?.name;
     const name = req.params?.name;
     try {
     try {
       const result = await this.collectionsService.getPersistentSegmentInfo({
       const result = await this.collectionsService.getPersistentSegmentInfo({
@@ -347,7 +347,7 @@ export class CollectionController {
     }
     }
   }
   }
 
 
-  async getQSegement(req: Request, res: Response, next: NextFunction) {
+  async getQSegment(req: Request, res: Response, next: NextFunction) {
     const name = req.params?.name;
     const name = req.params?.name;
     try {
     try {
       const result = await this.collectionsService.getQuerySegmentInfo({
       const result = await this.collectionsService.getQuerySegmentInfo({

+ 0 - 247
server/src/collections/swagger.yml

@@ -1,247 +0,0 @@
-paths:
-  /collections:
-    get:
-      tags: 
-        - Collection
-      description: Get all or loaded collection
-      parameters:
-        - in: query
-          name: type
-          type: number
-          description: If type is 1 return loaded collections, otherwise return all collections.
-      responses:
-        200:
-          description: CollectionList
-          schema:
-            type: object
-    post:
-      tags: 
-        - Collection
-      description: Create collection in milvus
-      requestBody:
-        description: Create collection request body
-        required: true
-        content:
-          application/json:
-            schema:
-              $ref: '#/definitions/CreateCollection'
-         
-      responses:
-        200:
-          schema:
-            type: object
-  /collections/statistics:
-    get:
-      tags: 
-        - Collection
-      description: Get all collections statistics like row count
-      responses:
-        200:
-          schema:
-            type: object
-
-  /collections/{name}/statistics:
-    get:
-      tags: 
-        - Collection
-      description: Get single collection statistics like row count
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-
-      responses:
-        200:
-          schema:
-            type: object
-  /collections/indexes/status:
-    get:
-      tags: 
-        - Collection
-      description: Get all collections index status
-
-      responses:
-        200:
-          schema:
-            type: object
-
-  /collections/{name}:
-    delete:
-      tags: 
-        - Collection
-      description: Delete collection by name
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
-    get:
-      tags: 
-        - Collection
-      description: Get single collection informations like schema, name, id
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
-  /collections/{name}/load:
-    put:
-      tags: 
-        - Collection
-      description: Load data to cache
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
-  /collections/{name}/release:
-    put:
-      tags: 
-        - Collection
-      description: Release data from cache
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
-  /collections/{name}/insert:
-    post:
-      tags: 
-        - Collection
-      description: Insert data into collection
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      requestBody:
-        description: Insert data into collection
-        required: true
-        content:
-          application/json:
-            schema:
-              $ref: '#/definitions/Insert'
-      responses:
-        200:
-          schema:
-            type: object
-            
-  /collections/{name}/search:
-    post:
-      tags: 
-        - Collection
-      description: Vector search 
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      requestBody:
-        description: Do vector search
-        required: true
-        content:
-          application/json:
-            schema:
-              $ref: '#/definitions/Search'
-      responses:
-        200:
-          schema:
-            type: object
-
-  /collections/{name}/query:
-    post:
-      tags: 
-        - Collection
-      description: query data
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      requestBody:
-        description: query data body
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - "expr"
-              properties:
-                expr:
-                  type: string
-                  example: id in [1]
-      responses:
-        200:
-          schema:
-            type: object      
-
-/collections/{name}/alias:
-    post:
-      tags: 
-        - Collection
-      description: Create alias for collection
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      requestBody:
-        description: alias name
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - "alias"
-              properties:
-                alias:
-                  type: string
-                  example: collection_alias
-      responses:
-        200:
-          schema:
-            type: object                   
-
-
-definitions:
-  CollectionName:
-    in: path
-    name: name
-    type: string
-    description: Collection name
-  CreateCollection:
-    type: object
-    required:
-      - "collection_name"
-      - "fields"
-    properties:
-      collection_name:
-        type: string
-        example: collection_01
-      fields:
-        type: array
-        example: []
-  Insert:
-    type: object
-    required:
-      - "fields_data"
-    properties:
-      partition_name:
-        type: string
-        example: _default
-      fields_data:
-        type: array
-        example: []
-      hash_keys:
-        type: array
-        example: []
-  Search:
-    type: object
-    required:
-      - "vectors"
-      - "vector_type"
-      - "search_params"
-    properties:
-      vectors:
-        type: array
-        example: []
-        
-      vector_type:
-        description: BinaryVector - 100 , FloatVector - 101
-        type: number
-        example: 100 
-      search_params:
-        type: object
-        example: {"anns_field":"","topk":10,"metric_type":"L2","params":""}

+ 0 - 28
server/src/crons/swagger.yml

@@ -1,28 +0,0 @@
-paths:
-  /crons:
-    put:
-      tags: 
-        - Crons
-      description: Toggle cronjob status
-      requestBody:
-        description: Cron job name, status(start->0, stop->1)
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - "name"
-              properties:
-                name:
-                  type: string
-                  example: COLLECTION
-                type:
-                  type: number
-                  example: 0
-      responses:
-        200:
-          schema:
-            type: object
-
- 

+ 0 - 80
server/src/milvus/swagger.yml

@@ -1,80 +0,0 @@
-paths:
-  /milvus/connect:
-    post:
-      tags:
-        - Milvus
-      description: Connect to milvus server
-      requestBody:
-        description: Milvus address
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - 'address'
-              properties:
-                address:
-                  type: string
-                  example: 127.0.0.1:19530
-      responses:
-        200:
-          schema:
-            type: object
-
-  /milvus/disconnect:
-    post:
-      tags:
-        - Milvus
-      description: Disconnect to milvus server
-      responses:
-        200:
-          schema:
-            type: object
-
-  /milvus/check:
-    get:
-      tags:
-        - Milvus
-      description: Check milvus alive or not.
-      parameters:
-        - in: query
-          name: address
-          description: Milvus address
-      responses:
-        200:
-          schema:
-            type: object
-
-  /milvus/metrics:
-    get:
-      tags:
-        - Milvus
-      description: Get milvus metrics
-      responses:
-        200:
-          schema:
-            type: object
-
-  /milvus/flush:
-    post:
-      tags:
-        - Milvus
-      description: Flush data in milvus
-      requestBody:
-        description: The collection names you want to flush
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - 'collection_names'
-              properties:
-                collection_names:
-                  type: array
-                  example: [collectionName]
-      responses:
-        200:
-          schema:
-            type: object

+ 0 - 97
server/src/partitions/swagger.yml

@@ -1,97 +0,0 @@
-paths:
-  /partitions:
-    get:
-      tags: 
-        - Partition
-      description: Get all partitions information
-      parameters:
-        - in: query
-          name: collection_name
-          type: string
-          description: Collection name
-      responses:
-        200:
-          schema:
-            type: object
-  
-    post:
-      tags: 
-        - Partition
-      description: Create or delete partition excepte _default
-      requestBody:
-        description: Manage partition req body
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - type
-                - collection_name
-                - partition_name
-              properties:
-                type:
-                  type: string
-                  example: create
-                collection_name:
-                  type: string
-                  example: ''
-                partition_name:
-                  type: string
-                  example: ''
-      responses:
-        200:
-          schema:
-            type: object
-
-  /partitions/load:
-    put:
-      tags: 
-        - Partition
-      description: Load partition to cache
-      requestBody:
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - collection_name
-                - partition_name
-              properties:
-                collection_name:
-                  type: string
-                  example: ''
-                partition_names:
-                  type: array
-                  example: []
-      responses:
-        200:
-          schema:
-            type: object
-  /partitions/release:
-    put:
-      tags: 
-        - Partition
-      description: Release partition from cache
-      requestBody:
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - collection_name
-                - partition_name
-              properties:
-                collection_name:
-                  type: string
-                  example: ''
-                partition_names:
-                  type: array
-                  example: []
-      responses:
-        200:
-          schema:
-            type: object
- 

+ 0 - 78
server/src/schema/swagger.yml

@@ -1,78 +0,0 @@
-paths:
-  /schema/index:
-    get:
-      tags: 
-        - Schema
-      description: Get index information
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
-  
-    post:
-      tags: 
-        - Schema
-      description: Create or delete index in collection
-      requestBody:
-        description: Only type is create need extra_params
-        required: true
-        content:
-          application/json:
-            schema:
-              type: object
-              required:
-                - type
-                - collection_name
-                - field_name
-              properties:
-                type:
-                  type: string
-                  example: create
-                collection_name:
-                  type: string
-                  example: ''
-                field_name:
-                  type: string
-                  example: 'vector field'
-                extra_params:
-                  type: object
-                  example: {"index_type":"","metric_type":"","params":""}
-      responses:
-        200:
-          schema:
-            type: object
-
-  /schema/index/progress:
-    get:
-      tags: 
-        - Schema
-      description: Get index building progress percentage
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
-
-  /schema/index/state:
-    get:
-      tags: 
-        - Schema
-      description: Get index state 
-      parameters:
-        - $ref: '#/definitions/CollectionName'
-      responses:
-        200:
-          schema:
-            type: object
- 
-
-
-definitions:
-  CollectionName:
-    in: query
-    name: collection_name
-    type: string
-    description: Collection name