--- openapi: 3.0.3 info: title: Thing microservice written in Golang description: OpenApi Specification for an API to manage Thing contact: name: go-cloud-k8s-thing API Team url: https://goeland.io email: go-cloud-k8s-thing@goeland.io license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: 0.0.7 servers: - url: https://api.goeland.io/ paths: /thing: get: summary: List returns a list of thing description: Returns the thing in an array operationId: List parameters: - name: type in: query description: TypeThing id to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: created_by in: query description: id of the creator to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: inactivated in: query description: inactivated flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: validated in: query description: validation flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: limit in: query description: maximum number of results to return required: false style: form explode: true schema: type: integer format: int32 - name: offset in: query description: offset rows to skip before returning rows required: false style: form explode: true schema: type: integer format: int32 responses: "200": description: get List of thing response content: application/json: schema: type: array items: $ref: '#/components/schemas/ThingList' "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] post: summary: Create will create a new thing description: Creates a new thing operationId: Create requestBody: description: Thing to add content: application/json: schema: $ref: '#/components/schemas/Thing' required: true responses: "201": description: Thing creation response content: application/json: schema: $ref: '#/components/schemas/Thing' "401": description: Access token is missing or invalid default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /thing/geojson: get: summary: List returns a geoJson of things found description: Returns the geoJson of the thing selected by the givven parameters operationId: GeoJson parameters: - name: type in: query description: TypeThing id to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: created_by in: query description: id of the creator to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: inactivated in: query description: inactivated flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: validated in: query description: validation flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: limit in: query description: maximum number of results to return required: false style: form explode: true schema: type: integer format: int32 - name: offset in: query description: offset rows to skip before returning rows required: false style: form explode: true schema: type: integer format: int32 responses: "200": description: get List of thing response content: application/json: schema: type: array items: $ref: '#/components/schemas/FeatureCollection' "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /thing/by-external-id/{externalId}: get: summary: ListByExternalId returns a list of thing filtered by externalId description: Returns the things in an array operationId: ListByExternalId parameters: - name: externalId in: path description: externalId of the things needed required: true style: simple explode: false schema: type: integer format: int32 - name: limit in: query description: maximum number of results to return required: false style: form explode: true schema: type: integer format: int32 - name: offset in: query description: offset rows to skip before returning rows required: false style: form explode: true schema: type: integer format: int32 responses: "200": description: get List of things response content: application/json: schema: type: array items: $ref: '#/components/schemas/ThingList' "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [ ] /thing/search: get: summary: Search returns a list of thing based on search criterias description: Returns the thing in an array operationId: Search parameters: - name: keywords in: query description: text keywords to filter the things to return required: false style: form explode: true schema: type: string - name: type in: query description: TypeThing id to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: created_by in: query description: id of the creator to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: inactivated in: query description: inactivated flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: validated in: query description: validation flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: limit in: query description: maximum number of results to return required: false style: form explode: true schema: type: integer format: int32 - name: offset in: query description: offset rows to skip before returning rows required: false style: form explode: true schema: type: integer format: int32 responses: "200": description: get List of thing response content: application/json: schema: type: array items: $ref: '#/components/schemas/ThingList' "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /thing/count: get: summary: Count returns the number of thing based on search criterias description: Returns the number of things found after filtering with passed criterias operationId: Count parameters: - name: keywords in: query description: text keywords to filter the things to return required: false style: form explode: true schema: type: string - name: type in: query description: TypeThing id to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: created_by in: query description: id of the creator to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: inactivated in: query description: inactivated flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: validated in: query description: validation flag to filter the things to return required: false style: form explode: true schema: type: boolean responses: "200": description: get List of thing response content: application/json: schema: type: integer format: int32 "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /thing/{thingId}: get: summary: Get will retrieve in backend all information about a specific thingId description: Retrieve a specific thing operationId: Get parameters: - name: thingId in: path description: Id of the thing required: true style: simple explode: false schema: type: string format: uuid responses: "200": description: get thing successful response content: application/json: schema: $ref: '#/components/schemas/Thing' "401": description: Access token is missing or invalid "404": description: get things response when thingId was not found default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] put: summary: Update allows to modify information about a specific thingId description: Updates the status of a thing operationId: Update parameters: - name: thingId in: path description: Id of the thing required: true style: simple explode: false schema: type: string format: uuid requestBody: description: informations related to the thing content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Thing' responses: "200": description: put things successful response content: application/json: schema: $ref: '#/components/schemas/Thing' "401": description: Access token is missing or invalid "404": description: put things response when thingId was not found default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] delete: summary: Delete allows to delete a specific thingId description: delete a thing operationId: Delete parameters: - name: thingId in: path description: Id of the thing required: true style: simple explode: false schema: type: string format: uuid responses: "204": description: delete thing successful no content "401": description: Access token is missing or invalid "404": description: delete thing response when thingId was not found default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /types: get: summary: TypeThingList returns a list of types description: Returns the types in an array operationId: TypeThingList parameters: - name: keywords in: query description: text keywords to filter the things to return required: false style: form explode: true schema: type: string - name: created_by in: query description: id of the creator to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: external_id in: query description: id of the external id to filter by the things to return required: false style: form explode: true schema: type: integer format: int32 - name: inactivated in: query description: inactivated flag to filter the things to return required: false style: form explode: true schema: type: boolean - name: limit in: query description: maximum number of results to return required: false style: form explode: true schema: type: integer format: int32 - name: offset in: query description: offset rows to skip before returning rows required: false style: form explode: true schema: type: integer format: int32 responses: "200": description: get List of types response content: application/json: schema: type: array items: $ref: '#/components/schemas/TypeThingList' "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] post: summary: TypeThingCreate will create a new group description: Creates a new group operationId: TypeThingCreate requestBody: description: TypeThing to add content: application/json: schema: $ref: '#/components/schemas/TypeThing' required: true responses: "201": description: TypeThing creation response content: application/json: schema: $ref: '#/components/schemas/TypeThing' "401": description: Access token is missing or invalid default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /types/{typeThingId}: get: summary: TypeThingGet will retrieve in backend all information about a specific typeThingId description: Retrieve a specific typeThing operationId: TypeThingGet parameters: - name: typeThingId in: path description: Id of the typeThing required: true style: simple explode: false schema: type: integer format: int32 responses: "200": description: get typeThing successful response content: application/json: schema: $ref: '#/components/schemas/TypeThing' "401": description: Access token is missing or invalid "404": description: get typeThing response when typeThingId was not found default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] put: summary: TypeThingUpdate allows to modify information about a specific typeThingId description: Updates the information related to a typeThing operationId: TypeThingUpdate parameters: - name: typeThingId in: path description: Id of the typeThing required: true style: simple explode: false schema: type: integer format: int32 requestBody: description: informations related to the typeThing content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/TypeThing' responses: "200": description: put typeThing successful response content: application/json: schema: $ref: '#/components/schemas/TypeThing' "401": description: Access token is missing or invalid "404": description: put typeThing response when userId was not found default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] delete: summary: TypeThingDelete allows to delete a specific typeThingId description: delete a typeThing operationId: TypeThingDelete parameters: - name: typeThingId in: path description: Id of the typeThing required: true style: simple explode: false schema: type: integer format: int32 responses: "204": description: delete typeThing successful no content "401": description: Access token is missing or invalid "404": description: delete typeThing response when typeThingId was not found default: description: unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] /types/count: get: summary: Count returns the number of TypeThing based on search criterias description: Returns the number of TypeThings found after filtering with passed criterias operationId: TypeThingCount parameters: - name: keywords in: query description: text keywords to filter the TypeThing count required: false style: form explode: true schema: type: string - name: created_by in: query description: id of the creator to filter the TypeThing count required: false style: form explode: true schema: type: integer format: int32 - name: inactivated in: query description: inactivated flag to filter the TypeThing count to return required: false style: form explode: true schema: type: boolean responses: "200": description: get Number of TypeThing response content: application/json: schema: type: integer format: int32 "401": description: Access token is missing or invalid default: description: unexpected Error content: application/json: schema: $ref: '#/components/schemas/Error' security: - JWTAuth: [] components: schemas: Thing: required: - id - type_id - name - inactivated - created_by - deleted - pos_x - pos_y type: object properties: id: type: string format: uuid title: "identifiant uuid v4" description: "cet Universally unique identifier (UUID) sera généré automatiquement pour vous " type_id: type: integer format: int32 title: "identifiant du type d'objet" description: "FK sur la clé primaire du TypeThing de cet objet" name: format: text type: string title: "nom de cet objet" description: format: text type: string title: "description" comment: format: text type: string title: "commentaire" external_id: format: int32 type: integer title: "identifiant numérique externe" external_ref: format: text type: string title: "référence externe" build_at: format: date-time type: string title: "date de construction" status: $ref: '#/components/schemas/ThingStatus' contained_by: format: uuid, type: string title: "contenu par" contained_by_old: format: int32 type: integer inactivated: default: false, type: boolean title: "inactivé?" inactivated_time: format: date-time type: string title: "date d'inactivation" inactivated_by: format: int32 type: integer title: "utilisateur ayant désactivé" inactivated_reason: format: text type: string title: "raison de'inactivation" validated: default: false, type: boolean title: "validé?" validated_time: format: date-time type: string title: "date de validation" validated_by: format: int32 type: integer title: "utiliateur ayant validé" managed_by: format: int32 type: integer title: "utilisateur/groupe manager" created_at: format: date-time type: string title: "date création" description: "date de création de cet enregistrement dans la base" created_by: format: int32 type: integer title: "utilisateur ayant créé cet enregistrement" description: "identifiant de l'utilisateur ayant créé cet enregistrement" last_modified_at: format: date-time type: string title: "date modification" description: "date de la dernière modication de cet enregistrement" last_modified_by: format: int32 type: integer title: "utilisateur ayant effectué la modification" description: "utilisateur ayant effectué la dernière modication de cet enregistrement" deleted: default: false, type: boolean title: "effacé?" description: "cet enregisrement a été marqué comme effacé" deleted_at: format: date-time type: string title: "date effacé" description: "date à laquelle cet enregisrement a été marqué comme effacé" deleted_by: format: int32 type: integer title: "utilisateur ayant effacé" description: "utilisateur ayant demandé de marquer cet enregisrement comme effacé" more_data: type: object title: "Informations complémentaires" description: "permet de stocker des attributs complémentaires au format json" pos_x: type: number format: double title: "Coordonnées X de cet objet" pos_y: type: number format: double title: "Coordonnées Y de cet objet" ThingList: required: - id - type_id - name - inactivated - created_by - deleted - pos_x - pos_y type: object properties: id: type: string format: uuid type_id: type: integer format: int32 name: minLength: 2 type: string description: minLength: 2 type: string external_id: type: integer format: int32 inactivated: type: boolean default: false validated: type: boolean default: false status: $ref: '#/components/schemas/ThingStatus' created_by: type: integer format: int32 created_at: type: string format: date-time pos_x: type: number format: double pos_y: type: number format: double TypeThing: required: - id - name - icon_path - inactivated - deleted - created_by type: object properties: id: format: int32 type: integer name: format: text type: string description: format: text type: string comment: format: text type: string external_id: format: int32 type: integer table_name: format: text type: string geometry_type: format: text, type: string inactivated: default: false, type: boolean inactivated_time: format: date-time type: string inactivated_by: format: int32 type: integer inactivated_reason: format: text type: string managed_by: format: int32 type: integer icon_path: format: text type: string created_at: format: date-time type: string created_by: format: int32 type: integer last_modified_at: format: date-time type: string last_modified_by: format: int32 type: integer deleted: default: false, type: boolean deleted_at: format: date-time type: string deleted_by: format: int32 type: integer more_data_schema: type: object TypeThingList: required: - id - name - icon_path - inactivated - created_at type: object properties: id: type: integer format: int32 name: minLength: 2 type: string external_id: format: int32 type: integer icon_path: format: text type: string created_at: format: date-time type: string table_name: format: text type: string geometry_type: format: text, type: string inactivated: type: boolean default: false ThingStatus: type: string enum: - "Planifié" - "En Construction" - "Utilisé" - "Abandonné" - "Démoli" format: "public.thing_status_type" Geometry: type: object description: GeoJSon geometry required: - type externalDocs: url: http://geojson.org/geojson-spec.html#geometry-objects properties: type: oneOf: - $ref: '#/components/schemas/Point' - $ref: '#/components/schemas/LineString' - $ref: '#/components/schemas/Polygon' - $ref: '#/components/schemas/LineString' - $ref: '#/components/schemas/MultiPoint' - $ref: '#/components/schemas/MultiLineString' - $ref: '#/components/schemas/MultiPolygon' description: the geometry type Point3D: type: array description: Point in 3D space externalDocs: url: http://geojson.org/geojson-spec.html#id2 minItems: 2 maxItems: 3 items: type: number Point: type: object description: GeoJSon geometry externalDocs: url: http://geojson.org/geojson-spec.html#id2 allOf: - $ref: "#/components/schemas/Geometry" - properties: coordinates: $ref: '#/components/schemas/Point3D' LineString: type: object description: GeoJSon geometry externalDocs: url: http://geojson.org/geojson-spec.html#id3 allOf: - $ref: "#/components/schemas/Geometry" - properties: coordinates: type: array items: $ref: '#/components/schemas/Point3D' Polygon: type: object description: GeoJSon geometry externalDocs: url: http://geojson.org/geojson-spec.html#id4 allOf: - $ref: "#/components/schemas/Geometry" - properties: coordinates: type: array items: type: array items: $ref: '#/components/schemas/Point3D' MultiPoint: type: object description: GeoJSon geometry externalDocs: url: http://geojson.org/geojson-spec.html#id5 allOf: - $ref: "#/components/schemas/Geometry" - properties: coordinates: type: array items: $ref: '#/components/schemas/Point3D' MultiLineString: type: object description: GeoJSon geometry externalDocs: url: http://geojson.org/geojson-spec.html#id6 allOf: - $ref: "#/components/schemas/Geometry" - properties: coordinates: type: array items: type: array items: $ref: '#/components/schemas/Point3D' MultiPolygon: type: object description: GeoJSon geometry externalDocs: url: http://geojson.org/geojson-spec.html#id6 allOf: - $ref: "#/components/schemas/Geometry" - properties: coordinates: type: array items: type: array items: type: array items: $ref: '#/components/schemas/Point3D' GeometryCollection: type: object description: GeoJSon geometry collection required: - type - geometries externalDocs: url: http://geojson.org/geojson-spec.html#geometrycollection properties: type: type: string enum: - GeometryCollection geometries: type: array items: $ref: '#/components/schemas/Geometry' Feature: type: object description: GeoJSon Feature required: - type - geometry externalDocs: url: https://tools.ietf.org/html/rfc7946#section-3.2 properties: type: type: string enum: - Feature id: anyOf: - type: integer - type: string geometry: $ref: '#/components/schemas/GeometryCollection' properties: type: object FeatureCollection: type: object description: GeoJSon Feature collection required: - type - features externalDocs: url: https://tools.ietf.org/html/rfc7946#section-3.3 properties: type: type: string enum: - FeatureCollection features: type: array items: $ref: '#/components/schemas/Feature' Error: required: - code - message type: object properties: code: type: integer format: int32 message: type: string JsonWebToken: required: - token type: object properties: token: type: string responses: UnauthorizedError: description: "Access token is missing or invalid" securitySchemes: JWTAuth: type: http scheme: bearer bearerFormat: JWT