1.本项目采用Python Flask框架开发提供(应用管理,实例管理,Ansible管理,LDAP管理等相关功能)

Overview

op-devops-api

1.本项目采用Python Flask框架开发提供(应用管理,实例管理,Ansible管理,LDAP管理等相关功能) 后端项目配套前端项目为:op-devops-ui

jenkinsManager

一.插件python-jenkins bug修复

(1).插件版本 python-jenkins==1.5.0

二.接口文档;

1.基础环境介绍;

软件版本信息 系统/内核信息 项目目录功能介绍
Python 3.6.8 Centos 7.2 tools jekins jobs相关xml配置
Flask1.0.2 3.10.0-862.6.3.el7.x86_64 boot.py flask 程序启动入口文件
python-jekins1.5.0 python jenkins sdk 插件

2.项目系统依赖包安装;
(1).centos 7x系统安装支持包;
yum -y install python36 mysql-devel libxml2* mysql initscripts python36-devel python36-pip python36-setuptools mysql-devel libxml2* mysql initscripts psmisc

(2).安装项目依赖包pip3方式;
/usr/local/bin/pip3.6 install --upgrade pip
/usr/local/bin/pip3.6 install --upgrade setuptools
/usr/local/bin/pip3.6 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

3.修改项目配置文件 (MYSQL文件) cat config.py #新建数据库并且授权应用程序访问 (如下:op-cicd-api-v2) SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:[email protected]:3306/op-cicd-api-v2'

4.初始化数据库表结构设置授权管理员账号权限 操作流程:初始化数据库表---> 创建管理员账户---> 输入账号密码 $ python3.7 manage.py
usage: manage.py command: init_db -- 初始化数据库 create_admin -- 创建管理员账户 enable_admin -- 启用管理员账户,用于登录失败次数过多账户被禁用时使用

5.登录获取应用token参数如下: token-api 接口文档:

  • 输入用户密码登录获取token

请求URL:

  • http://devops-bmc-api.com/account/users/login/

请求方式:

  • POST

格式:

  • JSON

参数:

参数 必填 类型 说明
username str 系统授权用户名
password str 系统授权用户名
type str 类型分为: standard 系统设置用户 ldap 用户

请求示例

http://devops-bmc-api.com/account/users/login/
{
"username":"admin",
"password":"[email protected]",
"type":"standard"
}

返回参数

http://devops-bmc-api.com/account/users/login/
{
    "data": {
        "is_supper": true,
        "nickname": "管理员",
        "permissions": [],
        "token": "3df9a449d44f4183a45ba9a43cc61fbc"  #Token 有过期时间每一次请求需要带token
    },
    "message": ""
}

6.获取应用信息实例接口 请求URL:

  • http://devops-bmc-api.com/account/users/login/

请求方式:

  • GET

格式:

  • JSON

参数:

header带Token --header

http://127.0.0.1:9000/app/api/v1?appname=op-nginx-api

参数 必填 类型 说明
group str 分组
appname str 应用名称
port str 应用端口
business str 业务线
page int 当前页面
page_size int 每页显示数据多少条

请求示例

curl --location --request GET 'http://127.0.0.1:9000/app/api/v1?appname=op-nginx-api' \
--header 'X-TOKEN: 3df9a449d44f4183a45ba9a43cc61fbc'

响应

{
   "code": 0,
   "total": 1,
   "data": [
       {
           "id": 1,
           "business": "op",
           "group": "op",
           "appname": "op-nginx-api",
           "apptype": "python",
           "giturl": "http://127.0.0.1:9000/ansible/host/v1",
           "owner": "lijx",
           "port": "2222",
           "level": "低",
           "used": "nginx运维测试",
           "createtime": "2021-11-04 16:32:33"
       }
   ],
   "msg": "success",
   "columns": [
       {
           "name": "group",
           "alias": "小组名称"
       },
       {
           "name": "appname",
           "alias": "应用名称"
       },
       {
           "name": "level",
           "alias": "应用级别"
       },
       {
           "name": "apptype",
           "alias": "应用类型"
       },
       {
           "name": "business",
           "alias": "业务线"
       },
       {
           "name": "giturl",
           "alias": "git地址"
       },
       {
           "name": "owner",
           "alias": "应用负责人"
       },
       {
           "name": "port",
           "alias": "服务端口"
       },
       {
           "name": "used",
           "alias": "用途"
       },
       {
           "name": "createtime",
           "alias": "创建时间"
       }
   ]
}
Python library for the DeepL language translation API.

The DeepL API is a language translation API that allows other computer programs to send texts and documents to DeepL's servers and receive high-quality translations. This opens a whole universe of op

DeepL 535 Jan 04, 2023
Python SDK for 42DI

42di Python SDK Install pip install git+https://github.com/42di/python-sdk import import di #42di import pandas_datareader as pdr Init SDK project =

42DI 2 Nov 03, 2021
PyDottie is a version of Dottie.js written in Python 3.

PyDottie is a version of Dottie.js written in Python 3.

Jose Noriega 2 Nov 21, 2021
Практическая работа 6 - Документирование кода

Практическая работа №6 ПСП – правильная скобочная последовательность – последовательность из открывающих «(« и закрывающих «)» круглых скобок. Програм

0 Apr 14, 2022
Telegram bot for searching videos in your PDisk account by @AbirHasan2005

PDisk-Videos-Search A Telegram bot for searching videos in your PDisk account by @AbirHasan2005. Configs API_ID - Get from @TeleORG_Bot API_HASH - Get

Abir Hasan 39 Oct 21, 2022
Example of Telegram local API and aiogram 3.x

Telegram Local Full example of Telegram local application. Contains Telegram Bot API Local Telegram Bot API server based on aiogram Bot API Server ima

Oleg A. 9 Sep 16, 2022
A Discord/Xenforo bot!

telathbot A Discord/Xenforo bot! Pre-requisites pyenv (via installer) poetry Docker (with Go version of docker compose enabled) Local development Crea

Telath 4 Mar 09, 2022
A simple Discord bot written in Python

Acolyte A small and simple little Discord bot written in Python that utilizes the discord.py library. Dependencies The bot depends on Python 3.9 and u

0 Jul 17, 2021
Code to help me strengthen my bot army

discord-bot-manager an api to help you manage your other bots auth lazy: using the browser dev tools, capture a post call and view the Authorization h

Riley Snyder 2 Mar 18, 2022
SystemSix is an e-Ink "desk accessory" running on a Raspberry Pi. It is a bit of nostalgia that can function as a calendar, display the weather

SystemSix is an e-Ink "desk accessory" running on a Raspberry Pi. It is a bit of nostalgia that can function as a calendar, display the weather, the c

John Calhoun 372 Jan 02, 2023
An open source API to validate the EU Covid Certificates / Green Certificates

Open Covid Certificate Validator This an open source API to validate EU Digital COVID Certificates. It receives a COVID certificate and validates it u

Merlin Schumacher 47 May 30, 2022
A secure and customizable bot for controlling cross-server announcements and interactions within Discord

DiscordBot A secure and customizable bot for controlling cross-server announcements and interactions within Discord. Within the code of the bot, you c

Jacob Dorfmeister 1 Jan 22, 2022
Discord Rpc With Python And 2 Buttons

Discord-RPC-With-Python- Discord Rpc With Python And 2 Buttons Packages pypresence time Required Programs Python Latest Version Random IDE Discord :P

Kaz 4 Dec 12, 2021
New discord token grabber, password and general information

New discord token grabber, password and general information

Monstered 6 Nov 09, 2022
Collect links to profiles by username through search engines

Marple Summary Collect links to profiles by username through search engines (currently Google and DuckDuckGo). Quick Start ./marple.py soxoj Results:

125 Dec 19, 2022
Bot playing "mathbattle" game from Telegram messenger

mathbattlebot Bot playing mathbattle game from Telegram messenger Installing: run in command line pip3 install -r requirements.txt Running: Example c

Egor 1 May 30, 2022
This Discord bot is to give timely notifications to Students in the Lakehead CS 2021 Guild

Discord-Bot Goal of Project The purpose of this Discord bot is to give timely notifications to Students in the Lakehead CS 2021 Guild. How can I contr

8 Jan 30, 2022
PS3API - PS3 API for TMAPI and CCAPI in python.

PS3API PS3 API for TMAPI and CCAPI in python. Examples Connecting and Attaching from ps3api import PS3API PS3 = PS3API(PS3API.API_TMAPI) if PS3.Conn

Adam 9 Sep 01, 2022
A casino discord bot written in Python

Casino Bot Casino bot is a gambling discord bot I made for my friends. It is able to play blackjack, slots, flip a coin, and roll dice. It stores ever

Connor Swislow 27 Dec 30, 2022
Clash of Clans v6.253 private server written in python

cocps Clash of Clans v6.253 private server written in python how2play download server files download Patched APK run Main.py and play Authors Patched

5 Aug 28, 2022