Commit db9ccc0f authored by Simon Pastor's avatar Simon Pastor
Browse files

replay api and backend

parent a45dee9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 0.0.1
- Build date: 2020-01-06T22:50:01.559-05:00
- Build date: 2020-02-14T15:27:15.778-05:00


### Running the server
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 0.0.1
- Build date: 2020-01-06T22:50:03.001-05:00
- Build date: 2020-02-14T15:27:17.871-05:00


### Running the server
+260 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ basePath: "/v1"
tags:
- name: "Scenario Configuration"
- name: "Scenario Execution"
- name: "Event Replay"
- name: "Pod States"
schemes:
- "http"
@@ -99,7 +100,7 @@ paths:
        x-exportParamName: "Name"
      - in: "body"
        name: "scenario"
        description: "Scenario to add to MEEP store"
        description: "Scenario"
        required: true
        schema:
          $ref: "#/definitions/Scenario"
@@ -287,6 +288,202 @@ paths:
          description: "OK"
        400:
          description: "Bad request"
  /replay:
    get:
      tags:
      - "Event Replay"
      summary: "Get all replay file names"
      description: "Returns a list of all replay files names present in the platform\
        \ store"
      operationId: "getReplayFileList"
      produces:
      - "application/json"
      parameters: []
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/ReplayFileList"
        404:
          description: "Not found"
    delete:
      tags:
      - "Event Replay"
      summary: "Delete all replay files"
      description: "Delete all replay files present in the platform store"
      operationId: "deleteReplayFileList"
      produces:
      - "application/json"
      parameters: []
      responses:
        200:
          description: "OK"
        404:
          description: "Not found"
  /replay/{name}:
    get:
      tags:
      - "Event Replay"
      summary: "Get a specific replay file"
      description: "Get a replay file by name from the platform store"
      operationId: "getReplayFile"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "Replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      responses:
        200:
          description: "OK"
          schema:
            $ref: "#/definitions/Replay"
        404:
          description: "Not found"
    post:
      tags:
      - "Event Replay"
      summary: "Add a replay file"
      description: "Add a replay file to the platform store"
      operationId: "createReplayFile"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "Replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      - in: "body"
        name: "replay-file"
        description: "Replay-file"
        required: true
        schema:
          $ref: "#/definitions/Replay"
        x-exportParamName: "ReplayFile"
      responses:
        200:
          description: "OK"
        404:
          description: "Not found"
    delete:
      tags:
      - "Event Replay"
      summary: "Delete a replay file"
      description: "Delete a replay file by name from the platform store"
      operationId: "deleteReplayFile"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      responses:
        200:
          description: "OK"
        404:
          description: "Not found"
  /replay/{name}/generate:
    post:
      tags:
      - "Event Replay"
      summary: "Generate a replay file from scenario execution events"
      description: "Generate a replay file using events from the latest execution\
        \ of a scenario"
      operationId: "createReplayFileFromScenarioExec"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "Replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      - in: "body"
        name: "scenarioName"
        description: "Scenario name"
        required: true
        schema:
          $ref: "#/definitions/ScenarioName"
        x-exportParamName: "ScenarioName"
      responses:
        200:
          description: "OK"
        400:
          description: "Bad request"
        404:
          description: "Not found"
  /replay/{name}/play:
    post:
      tags:
      - "Event Replay"
      summary: "Execute a replay file present in the platform store"
      description: "Execute a replay file present in the platform store"
      operationId: "playReplayFile"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "Replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      responses:
        200:
          description: "OK"
        404:
          description: "Not found"
  /replay/{name}/loop:
    post:
      tags:
      - "Event Replay"
      summary: "Loop-Execute a replay file present in the platform store"
      description: "Loop-Execute a replay file present in the platform store"
      operationId: "loopReplay"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "Replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      responses:
        200:
          description: "OK"
        404:
          description: "Not found"
  /replay/{name}/stop:
    post:
      tags:
      - "Event Replay"
      summary: "Stop execution of a replay file"
      description: "Stop execution a replay file"
      operationId: "stopReplayFile"
      produces:
      - "application/json"
      parameters:
      - name: "name"
        in: "path"
        description: "Replay file name"
        required: true
        type: "string"
        x-exportParamName: "Name"
      responses:
        200:
          description: "OK"
        404:
          description: "Not found"
  /states:
    get:
      tags:
@@ -344,7 +541,7 @@ definitions:
        type: "array"
        items:
          $ref: "#/definitions/Scenario"
    description: "Scenario list object"
    description: "Scenario list"
    example: {}
  Scenario:
    type: "object"
@@ -352,6 +549,9 @@ definitions:
      version:
        type: "string"
        description: "Scenario version"
      id:
        type: "string"
        description: "Unique scenario ID"
      name:
        type: "string"
        description: "Unique scenario name"
@@ -941,6 +1141,43 @@ definitions:
    description: "Other Event object"
    example:
      event: "event"
  ReplayFileList:
    type: "object"
    properties:
      replay-files:
        type: "array"
        items:
          type: "string"
    description: "Replay-file list"
    example: {}
  Replay:
    type: "object"
    properties:
      events:
        type: "array"
        items:
          $ref: "#/definitions/ReplayEvent"
    description: "ReplayEvents from the Replay-file"
    example: {}
  ReplayEvent:
    type: "object"
    properties:
      index:
        type: "integer"
        description: "Event index"
        readOnly: true
      time:
        type: "integer"
        description: "Relative time (ms) an event happened since the begining of a\
          \ replay sequence"
      event:
        $ref: "#/definitions/Event"
    description: "Replay event object"
    example: {}
  ScenarioName:
    type: "string"
    description: "Scenario name"
    example: {}
  PodsStatus:
    type: "object"
    properties:
@@ -1029,6 +1266,27 @@ parameters:
    required: true
    type: "string"
    x-exportParamName: "Name"
  ScenarioName:
    in: "body"
    name: "name"
    description: "Scenario name"
    required: true
    schema:
      $ref: "http://localhost:8291/meep-model.yaml#/definitions/ScenarioName"
    x-exportParamName: "ScenarioName"
  Replay:
    name: "replay"
    in: "path"
    description: "Scenario events execution sequence"
    required: true
    x-exportParamName: "Replay"
  ReplayFileName:
    name: "replayFileName"
    in: "path"
    description: "Scenario events execution file name"
    required: true
    type: "string"
    x-exportParamName: "ReplayFileName"
  Scenario:
    in: "body"
    name: "scenario"
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 1.0.0
- Build date: 2020-01-06T22:49:51.404-05:00
- Build date: 2020-02-14T15:26:58.695-05:00


### Running the server
+65 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2019  InterDigital Communications, Inc
 *
 * Licensed under the Apache License, Version 2.0 (the \"License\");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an \"AS IS\" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * AdvantEDGE Platform Controller REST API
 *
 * This API is the main platform API and mainly used by the AdvantEDGE frontend to interact with scenarios <p>**Micro-service**<br>[meep-ctrl-engine](https://github.com/InterDigitalInc/AdvantEDGE/tree/master/go-apps/meep-ctrl-engine) <p>**Type & Usage**<br>Platform main interface used by controller software that want to interact with the AdvantEDGE platform <p>**Details**<br>API details available at _your-AdvantEDGE-ip-address:30000/api_ <p>**Default Port**<br>`30000`
 *
 * API version: 1.0.0
 * Contact: AdvantEDGE@InterDigital.com
 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
 */

package server

import (
	"net/http"
)

func CreateReplayFile(w http.ResponseWriter, r *http.Request) {
	ceCreateReplayFile(w, r)
}

func CreateReplayFileFromScenarioExec(w http.ResponseWriter, r *http.Request) {
	ceCreateReplayFileFromScenarioExec(w, r)
}

func DeleteReplayFile(w http.ResponseWriter, r *http.Request) {
	ceDeleteReplayFile(w, r)
}

func DeleteReplayFileList(w http.ResponseWriter, r *http.Request) {
	ceDeleteReplayFileList(w, r)
}

func GetReplayFile(w http.ResponseWriter, r *http.Request) {
	ceGetReplayFile(w, r)
}

func GetReplayFileList(w http.ResponseWriter, r *http.Request) {
	ceGetReplayFileList(w, r)
}

func StopReplayFile(w http.ResponseWriter, r *http.Request) {
	ceStopReplayFile(w, r)
}

func LoopReplay(w http.ResponseWriter, r *http.Request) {
	ceLoopReplay(w, r)
}

func PlayReplayFile(w http.ResponseWriter, r *http.Request) {
	cePlayReplayFile(w, r)
}
Loading