Browse Source

maj apikaz

master
fabrice.regnier 2 weeks ago
parent
commit
39440e7ea8
  1. 3
      dockers/apikaz/source/Dockerfile
  2. 55
      dockers/apikaz/source/app.py

3
dockers/apikaz/source/Dockerfile

@ -6,11 +6,12 @@ RUN apt-get -y autoremove
#RUN apt-get install -y golang-go make curl git python3.11 pip
RUN apt-get install -y curl python3.11 pip
#installer mmctl
# installer mmctl
RUN mkdir -p /mm/ && cd /mm/ && \
curl -vfsSL -O https://releases.mattermost.com/mmctl/v9.7.1/linux_amd64.tar && \
tar -xf linux_amd64.tar
# installer l'api flask'
RUN mkdir /usr/src/app/
COPY . /usr/src/app/
WORKDIR /usr/src/app/

55
dockers/apikaz/source/app.py

@ -44,31 +44,31 @@ def silence():
#*************************************************
#DANGER si on touche à l'indentation pour swagger, c'est cuit!
# class Username(Resource):
# def get(self, username):
# """
# This examples uses FlaskRESTful Resource
# It works also with swag_from, schemas and spec_dict
# ---
# parameters:
# - in: path
# name: username
# type: string
# required: true
# responses:
# 200:
# description: A single user item
# schema:
# id: User
# properties:
# username:
# type: string
# description: The name of the user
# default: Steven Wilson
# """
# return {'username': username}, 200
#
# api.add_resource(Username, '/username/<username>')
class Username(Resource):
def get(self, username):
"""
This examples uses FlaskRESTful Resource
It works also with swag_from, schemas and spec_dict
---
parameters:
- in: path
name: username
type: string
required: true
responses:
200:
description: A single user item
schema:
id: User
properties:
username:
type: string
description: The name of the user
default: Steven Wilson
"""
return {'username': username}, 200
api.add_resource(Username, '/username/<username>')
#*************************************************
@ -193,8 +193,9 @@ api.add_resource(Paheko_user, '/paheko/user/<numero>')
# #*************************************************
#variables globales
ident_paheko='hfdd76cxza_ro'
pass_paheko='LQBOyfuYaYnhhYTwVPpGNg'
# TODO: accéder aux mdp pour éviter de les stocker
ident_paheko='5zgz7x5gje_ro'
pass_paheko='K4Mk19irsOZ03YuRKXIg'
url_paheko='https://kaz-paheko.kazkouil.fr'
#*************************************************

Loading…
Cancel
Save