Replacing a1-python with a1-go implementation
[ric-plt/a1.git] / pkg / restapi / embedded_spec.go
diff --git a/pkg/restapi/embedded_spec.go b/pkg/restapi/embedded_spec.go
new file mode 100644 (file)
index 0000000..067d41d
--- /dev/null
@@ -0,0 +1,868 @@
+/*
+==================================================================================
+  Copyright (c) 2021 Samsung
+
+   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.
+
+   This source code is part of the near-RT RIC (RAN Intelligent Controller)
+   platform project (RICP).
+==================================================================================
+*/
+// Code generated by go-swagger; DO NOT EDIT.
+
+package restapi
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+       "encoding/json"
+)
+
+var (
+       // SwaggerJSON embedded version of the swagger document used at generation time
+       SwaggerJSON json.RawMessage
+       // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
+       FlatSwaggerJSON json.RawMessage
+)
+
+func init() {
+       SwaggerJSON = json.RawMessage([]byte(`{
+  "swagger": "2.0",
+  "info": {
+    "title": "RIC A1",
+    "version": "2.1.0"
+  },
+  "paths": {
+    "/a1-p/healthcheck": {
+      "get": {
+        "description": "Perform a healthcheck on a1\n",
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_healthcheck",
+        "responses": {
+          "200": {
+            "description": "A1 is healthy. Anything other than a 200 should be considered a1 as failing\n"
+          }
+        }
+      }
+    },
+    "/a1-p/policytypes": {
+      "get": {
+        "description": "Get a list of all registered policy type ids",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_all_policy_types",
+        "responses": {
+          "200": {
+            "description": "list of all registered policy type ids",
+            "schema": {
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/policy_type_id"
+              }
+            },
+            "examples": {
+              "application/json": [
+                20000,
+                20020
+              ]
+            }
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      }
+    },
+    "/a1-p/policytypes/{policy_type_id}": {
+      "get": {
+        "description": "Get this policy type\n",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_policy_type",
+        "responses": {
+          "200": {
+            "description": "policy type successfully found",
+            "schema": {
+              "$ref": "#/definitions/policy_type_schema"
+            }
+          },
+          "404": {
+            "description": "policy type not found\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "put": {
+        "description": "Create a new policy type . Replace is not currently allowed; to replace, for now do a DELETE and then a PUT again.\n",
+        "consumes": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.create_policy_type",
+        "parameters": [
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "$ref": "#/definitions/policy_type_schema"
+            }
+          }
+        ],
+        "responses": {
+          "201": {
+            "description": "policy type successfully created"
+          },
+          "400": {
+            "description": "illegal ID, or object already existed"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "delete": {
+        "description": "Delete this policy type. Can only be performed if there are no instances of this type\n",
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.delete_policy_type",
+        "responses": {
+          "204": {
+            "description": "policy type successfully deleted\n"
+          },
+          "400": {
+            "description": "Policy type cannot be deleted because there are instances All instances must be removed before a policy type can be deleted\n"
+          },
+          "404": {
+            "description": "policy type not found\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/a1-p/policytypes/{policy_type_id}/policies": {
+      "get": {
+        "description": "get a list of all policy instance ids for this policy type id",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_all_instances_for_type",
+        "responses": {
+          "200": {
+            "description": "list of all policy instance ids for this policy type id",
+            "schema": {
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/policy_instance_id"
+              }
+            },
+            "examples": {
+              "application/json": [
+                "3d2157af-6a8f-4a7c-810f-38c2f824bf12",
+                "06911bfc-c127-444a-8eb1-1bffad27cc3d"
+              ]
+            }
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}": {
+      "get": {
+        "description": "Retrieve the policy instance\n",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_policy_instance",
+        "responses": {
+          "200": {
+            "description": "The policy instance. the schema of this object is defined by the create_schema field of the policy type\n",
+            "schema": {
+              "type": "object"
+            }
+          },
+          "404": {
+            "description": "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "put": {
+        "description": "Create or replace a policy instance of type policy_type_id. The schema of the PUT body is defined by the create_schema field of the policy type.\n",
+        "consumes": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.create_or_replace_policy_instance",
+        "parameters": [
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "description": "the schema of this object is defined by the create_schema field of the policy type\n",
+              "type": "object"
+            }
+          }
+        ],
+        "responses": {
+          "202": {
+            "description": "Policy instance creation initiated\n"
+          },
+          "400": {
+            "description": "Bad PUT body for this policy instance\n"
+          },
+          "404": {
+            "description": "There is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "delete": {
+        "description": "Delete this policy instance\n",
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.delete_policy_instance",
+        "responses": {
+          "202": {
+            "description": "policy instance deletion initiated\n"
+          },
+          "404": {
+            "description": "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        },
+        {
+          "type": "string",
+          "description": "represents a policy instance identifier. UUIDs are advisable but can be any string\n",
+          "name": "policy_instance_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}/status": {
+      "get": {
+        "description": "Retrieve the policy instance status across all handlers of the policy If this endpoint returns successfully (200), it is either IN EFFECT or NOT IN EFFECT. IN EFFECT is returned if at least one policy handler in the RIC is implementing the policy NOT IN EFFECT is returned otherwise If a policy instance is successfully deleted, this endpoint will return a 404 (not a 200)\n",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_policy_instance_status",
+        "responses": {
+          "200": {
+            "description": "successfully retrieved the status\n",
+            "schema": {
+              "type": "object",
+              "properties": {
+                "created_at": {
+                  "type": "string",
+                  "format": "date-time"
+                },
+                "has_been_deleted": {
+                  "type": "boolean"
+                },
+                "instance_status": {
+                  "type": "string",
+                  "enum": [
+                    "IN EFFECT",
+                    "NOT IN EFFECT"
+                  ]
+                }
+              }
+            }
+          },
+          "404": {
+            "description": "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        },
+        {
+          "type": "string",
+          "description": "represents a policy instance identifier. UUIDs are advisable but can be any string\n",
+          "name": "policy_instance_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/data-delivery": {
+      "post": {
+        "description": "Deliver data produced by data producer.\n",
+        "consumes": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 EI Data Delivery"
+        ],
+        "operationId": "a1.controller.data_delivery",
+        "parameters": [
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "description": "object to represent data object\n",
+              "type": "object"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "successfully delivered data from data producer\n"
+          },
+          "404": {
+            "description": "no job id defined for this data delivery\n"
+          }
+        }
+      }
+    }
+  },
+  "definitions": {
+    "policy_instance_id": {
+      "description": "represents a policy instance identifier. UUIDs are advisable but can be any string\n",
+      "type": "string",
+      "example": "3d2157af-6a8f-4a7c-810f-38c2f824bf12"
+    },
+    "policy_type_id": {
+      "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+      "type": "integer",
+      "maximum": 2147483647,
+      "minimum": 1
+    },
+    "policy_type_schema": {
+      "type": "object",
+      "required": [
+        "name",
+        "description",
+        "policy_type_id",
+        "create_schema"
+      ],
+      "properties": {
+        "create_schema": {
+          "description": "jsonschema (following http://json-schema.org/draft-07/schema) of the CREATE payload to be sent to handlers of this policy\n",
+          "type": "object"
+        },
+        "description": {
+          "description": "description of the policy type",
+          "type": "string"
+        },
+        "name": {
+          "description": "name of the policy type",
+          "type": "string"
+        },
+        "policy_type_id": {
+          "description": "the integer of the policy type",
+          "type": "integer"
+        }
+      },
+      "additionalProperties": false
+    }
+  },
+  "x-components": {}
+}`))
+       FlatSwaggerJSON = json.RawMessage([]byte(`{
+  "swagger": "2.0",
+  "info": {
+    "title": "RIC A1",
+    "version": "2.1.0"
+  },
+  "paths": {
+    "/a1-p/healthcheck": {
+      "get": {
+        "description": "Perform a healthcheck on a1\n",
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_healthcheck",
+        "responses": {
+          "200": {
+            "description": "A1 is healthy. Anything other than a 200 should be considered a1 as failing\n"
+          }
+        }
+      }
+    },
+    "/a1-p/policytypes": {
+      "get": {
+        "description": "Get a list of all registered policy type ids",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_all_policy_types",
+        "responses": {
+          "200": {
+            "description": "list of all registered policy type ids",
+            "schema": {
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/policy_type_id"
+              }
+            },
+            "examples": {
+              "application/json": [
+                20000,
+                20020
+              ]
+            }
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      }
+    },
+    "/a1-p/policytypes/{policy_type_id}": {
+      "get": {
+        "description": "Get this policy type\n",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_policy_type",
+        "responses": {
+          "200": {
+            "description": "policy type successfully found",
+            "schema": {
+              "$ref": "#/definitions/policy_type_schema"
+            }
+          },
+          "404": {
+            "description": "policy type not found\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "put": {
+        "description": "Create a new policy type . Replace is not currently allowed; to replace, for now do a DELETE and then a PUT again.\n",
+        "consumes": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.create_policy_type",
+        "parameters": [
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "$ref": "#/definitions/policy_type_schema"
+            }
+          }
+        ],
+        "responses": {
+          "201": {
+            "description": "policy type successfully created"
+          },
+          "400": {
+            "description": "illegal ID, or object already existed"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "delete": {
+        "description": "Delete this policy type. Can only be performed if there are no instances of this type\n",
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.delete_policy_type",
+        "responses": {
+          "204": {
+            "description": "policy type successfully deleted\n"
+          },
+          "400": {
+            "description": "Policy type cannot be deleted because there are instances All instances must be removed before a policy type can be deleted\n"
+          },
+          "404": {
+            "description": "policy type not found\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/a1-p/policytypes/{policy_type_id}/policies": {
+      "get": {
+        "description": "get a list of all policy instance ids for this policy type id",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_all_instances_for_type",
+        "responses": {
+          "200": {
+            "description": "list of all policy instance ids for this policy type id",
+            "schema": {
+              "type": "array",
+              "items": {
+                "$ref": "#/definitions/policy_instance_id"
+              }
+            },
+            "examples": {
+              "application/json": [
+                "3d2157af-6a8f-4a7c-810f-38c2f824bf12",
+                "06911bfc-c127-444a-8eb1-1bffad27cc3d"
+              ]
+            }
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}": {
+      "get": {
+        "description": "Retrieve the policy instance\n",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_policy_instance",
+        "responses": {
+          "200": {
+            "description": "The policy instance. the schema of this object is defined by the create_schema field of the policy type\n",
+            "schema": {
+              "type": "object"
+            }
+          },
+          "404": {
+            "description": "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "put": {
+        "description": "Create or replace a policy instance of type policy_type_id. The schema of the PUT body is defined by the create_schema field of the policy type.\n",
+        "consumes": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.create_or_replace_policy_instance",
+        "parameters": [
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "description": "the schema of this object is defined by the create_schema field of the policy type\n",
+              "type": "object"
+            }
+          }
+        ],
+        "responses": {
+          "202": {
+            "description": "Policy instance creation initiated\n"
+          },
+          "400": {
+            "description": "Bad PUT body for this policy instance\n"
+          },
+          "404": {
+            "description": "There is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "delete": {
+        "description": "Delete this policy instance\n",
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.delete_policy_instance",
+        "responses": {
+          "202": {
+            "description": "policy instance deletion initiated\n"
+          },
+          "404": {
+            "description": "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        },
+        {
+          "type": "string",
+          "description": "represents a policy instance identifier. UUIDs are advisable but can be any string\n",
+          "name": "policy_instance_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}/status": {
+      "get": {
+        "description": "Retrieve the policy instance status across all handlers of the policy If this endpoint returns successfully (200), it is either IN EFFECT or NOT IN EFFECT. IN EFFECT is returned if at least one policy handler in the RIC is implementing the policy NOT IN EFFECT is returned otherwise If a policy instance is successfully deleted, this endpoint will return a 404 (not a 200)\n",
+        "produces": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 Mediator"
+        ],
+        "operationId": "a1.controller.get_policy_instance_status",
+        "responses": {
+          "200": {
+            "description": "successfully retrieved the status\n",
+            "schema": {
+              "type": "object",
+              "properties": {
+                "created_at": {
+                  "type": "string",
+                  "format": "date-time"
+                },
+                "has_been_deleted": {
+                  "type": "boolean"
+                },
+                "instance_status": {
+                  "type": "string",
+                  "enum": [
+                    "IN EFFECT",
+                    "NOT IN EFFECT"
+                  ]
+                }
+              }
+            }
+          },
+          "404": {
+            "description": "there is no policy instance with this policy_instance_id or there is no policy type with this policy_type_id\n"
+          },
+          "503": {
+            "description": "Potentially transient backend database error. Client should attempt to retry later."
+          }
+        }
+      },
+      "parameters": [
+        {
+          "maximum": 2147483647,
+          "minimum": 1,
+          "type": "integer",
+          "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+          "name": "policy_type_id",
+          "in": "path",
+          "required": true
+        },
+        {
+          "type": "string",
+          "description": "represents a policy instance identifier. UUIDs are advisable but can be any string\n",
+          "name": "policy_instance_id",
+          "in": "path",
+          "required": true
+        }
+      ]
+    },
+    "/data-delivery": {
+      "post": {
+        "description": "Deliver data produced by data producer.\n",
+        "consumes": [
+          "application/json"
+        ],
+        "tags": [
+          "A1 EI Data Delivery"
+        ],
+        "operationId": "a1.controller.data_delivery",
+        "parameters": [
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "description": "object to represent data object\n",
+              "type": "object"
+            }
+          }
+        ],
+        "responses": {
+          "200": {
+            "description": "successfully delivered data from data producer\n"
+          },
+          "404": {
+            "description": "no job id defined for this data delivery\n"
+          }
+        }
+      }
+    }
+  },
+  "definitions": {
+    "policy_instance_id": {
+      "description": "represents a policy instance identifier. UUIDs are advisable but can be any string\n",
+      "type": "string",
+      "example": "3d2157af-6a8f-4a7c-810f-38c2f824bf12"
+    },
+    "policy_type_id": {
+      "description": "represents a policy type identifier. Currently this is restricted to an integer range.\n",
+      "type": "integer",
+      "maximum": 2147483647,
+      "minimum": 1
+    },
+    "policy_type_schema": {
+      "type": "object",
+      "required": [
+        "name",
+        "description",
+        "policy_type_id",
+        "create_schema"
+      ],
+      "properties": {
+        "create_schema": {
+          "description": "jsonschema (following http://json-schema.org/draft-07/schema) of the CREATE payload to be sent to handlers of this policy\n",
+          "type": "object"
+        },
+        "description": {
+          "description": "description of the policy type",
+          "type": "string"
+        },
+        "name": {
+          "description": "name of the policy type",
+          "type": "string"
+        },
+        "policy_type_id": {
+          "description": "the integer of the policy type",
+          "type": "integer"
+        }
+      },
+      "additionalProperties": false
+    }
+  },
+  "x-components": {}
+}`))
+}