<commit_before>swagger: "2.0"
info:
  version: "0.0.1"
  title: BaiXiaoSheng - A mointor for DevOps
# during dev, should point to your local machine
host: localhost:10010
# basePath prefixes all resource paths
basePath: /api
schemes:
  # tip: remove http to make production-grade
  - http
  - https
consumes:
  - application/json
produces:
  - application/json
  - text/plain
  - text/html
paths:
  /links:
    x-swagger-router-controller: links
    get:
      description: Return all the links under monitor
      operationId: getLinks
      responses:
        default:
          description: Return all the links
          schema:
            type: string
    post:
      description: Create a new Link to be monitored
      operationId: create
      parameters:
        - name: link
          in: body
          schema:
            $ref: "#/definitions/Link"
      responses:
        201:
          description: Success
          schema:
            $ref: "#/definitions/Link"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /links/{id}:
    x-swagger-router-controller: links
    delete:
      operationId: del
      parameters:
        - name: id
          required: true
          type: string
          in: path
      responses:
        default:
          description: Array of links left
          schema:
            type: string
  /vmhosts:
    x-swagger-router-controller: vmhosts
    get:
      description: Return all the vmm hosts and vm hosts
      operationId: getVmHosts
      responses:
        200:
          description: Return all the vmm hosts and vm hosts
          schema:
            $ref: "#/definitions/VmHosts"
  /vm_search:
    x-swagger-router-controller: vmhosts
    get:
      description: Return all the vmm hosts and vm hosts that matched by the word
      operationId: search
      parameters:
        - name: q
          in: query
          description: The word that would like to search
          required: true
          type: string
      responses:
        default:
          description: Return all the vmm hosts and vm hosts that matched by the word
          schema:
            $ref: "#/definitions/VmHosts"
  /benchs:
    x-swagger-router-controller: benchs
    get:
      description: Return all the benchs
      operationId: benchs
      responses:
        200:
          description: Return all the benchs
          schema:
            $ref: "#/definitions/Benchs"
    put:
      description: Mark host has problem
      operationId: create
      parameters:
        - name: bench
          in: body
          schema:
            $ref: "#/definitions/Benchs"
      responses:
        201:
          description: Success
          schema:
            $ref: "#/definitions/Benchs"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    delete:
      description: Release host who has been marked
      operationId: del
      parameters:
        - name: bench
          in: body
          schema:
            $ref: "#/definitions/Benchs"
      responses:
        default:
          description: Array of benchs left
          schema:
            $ref: "#/definitions/Benchs"
    
# complex objects have schema definitions
definitions:
  Link:
    required:
      - url
    properties:
      url:
        type: string
      proxy:
        type: string
      satus:
        type: integer
      lastResTime:
        type: integer
      avgResTime:
        type: integer
      description:
        type: string
  ErrorResponse:
    required:<commit_msg>To validate field 'url' when creating a link<commit_after>swagger: "2.0"
info:
  version: "0.0.1"
  title: BaiXiaoSheng - A mointor for DevOps
# during dev, should point to your local machine
host: localhost:10010
# basePath prefixes all resource paths
basePath: /api
schemes:
  # tip: remove http to make production-grade
  - http
  - https
consumes:
  - application/json
produces:
  - application/json
  - text/plain
  - text/html
paths:
  /links:
    x-swagger-router-controller: links
    get:
      description: Return all the links under monitor
      operationId: getLinks
      responses:
        default:
          description: Return all the links
          schema:
            type: string
    post:
      description: Create a new Link to be monitored
      operationId: create
      parameters:
        - name: link
          in: body
          schema:
            $ref: "#/definitions/Link"
      responses:
        201:
          description: Success
          schema:
            $ref: "#/definitions/Link"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
  /links/{id}:
    x-swagger-router-controller: links
    delete:
      operationId: del
      parameters:
        - name: id
          required: true
          type: string
          in: path
      responses:
        default:
          description: Array of links left
          schema:
            type: string
  /vmhosts:
    x-swagger-router-controller: vmhosts
    get:
      description: Return all the vmm hosts and vm hosts
      operationId: getVmHosts
      responses:
        200:
          description: Return all the vmm hosts and vm hosts
          schema:
            $ref: "#/definitions/VmHosts"
  /vm_search:
    x-swagger-router-controller: vmhosts
    get:
      description: Return all the vmm hosts and vm hosts that matched by the word
      operationId: search
      parameters:
        - name: q
          in: query
          description: The word that would like to search
          required: true
          type: string
      responses:
        default:
          description: Return all the vmm hosts and vm hosts that matched by the word
          schema:
            $ref: "#/definitions/VmHosts"
  /benchs:
    x-swagger-router-controller: benchs
    get:
      description: Return all the benchs
      operationId: benchs
      responses:
        200:
          description: Return all the benchs
          schema:
            $ref: "#/definitions/Benchs"
    put:
      description: Mark host has problem
      operationId: create
      parameters:
        - name: bench
          in: body
          schema:
            $ref: "#/definitions/Benchs"
      responses:
        201:
          description: Success
          schema:
            $ref: "#/definitions/Benchs"
        default:
          description: Error
          schema:
            $ref: "#/definitions/ErrorResponse"
    delete:
      description: Release host who has been marked
      operationId: del
      parameters:
        - name: bench
          in: body
          schema:
            $ref: "#/definitions/Benchs"
      responses:
        default:
          description: Array of benchs left
          schema:
            $ref: "#/definitions/Benchs"

# complex objects have schema definitions
definitions:
  Link:
    required:
      - url
    properties:
      url:
        type: string
        pattern: "https?:\/\/.+"
      proxy:
        type: string
      satus:
        type: integer
      lastResTime:
        type: integer
      avgResTime:
        type: integer
      description:
        type: string
  ErrorResponse:
    required:
{'fraction_non_alphanumeric': 0.072973713033954, 'fraction_numerical': 0.006024096385542169, 'mean_word_length': 1.6612021857923498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5414409', 'n_tokens_mistral': 1988, 'n_tokens_neox': 1977, 'n_words': 642}