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": "创建时间"
       }
   ]
}
Disqus API bindings for Python

disqus-python Let's start with installing the API: pip install disqus-python Use the API by instantiating it, and then calling the method through dott

DISQUS 163 Oct 14, 2022
Simple Craigslist wrapper

python-craigslist A simple Craigslist wrapper. License: MIT-Zero. Disclaimer I don't work for or have any affiliation with Craigslist. This module was

Julio M. Alegria 370 Dec 22, 2022
Git Plan - a better workflow for git

git plan A better workflow for git. Git plan inverts the git workflow so that you can write your commit message first, before you start writing code.

Rory Byrne 178 Dec 11, 2022
Código que Utiliza Programação Dinâmica para resolver o problema da Moeda

Programação Dinâmica: Modelo baseado em recursão Utiliza a técnica de Memorização Não pode ser aplicada quando existe dependência entre as respostas G

Hemili Beatriz 1 Jan 08, 2022
A fork of discord.py meant to replace it

Texus A modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Modern Pythonic API using async and

Texus 1 Nov 18, 2021
Solcast rooftop api for HA

Solcast Solar Home Assistant(https://www.home-assistant.io/) Component This custom component integrates the Solcast API into Home Assistant. Modified

Greg 1 Oct 11, 2021
Oussama has taken his first dose of vaccine D days ago

Oussama has taken his first dose of vaccine D days ago. He may take the second dose no less than L days and no more than R days since his first dose. Determine if Oussama is too early, too late, or i

INDIA - ENSAM Rabat 2 Feb 01, 2022
Requests based multi-threaded script for increasing followers on Spotify

Proxyless Spotify Follow Bot Requests based multi-threaded script for increasing followers on Spotify. Click here to report bugs. Usage Download ZIP h

397 Jan 03, 2023
iCloudPy is a simple iCloud webservices wrapper library written in Python

iCloudPy 🤟 Please star this repository if you end up using the library. It will help me continue supporting this product. 🙏 iCloudPy is a simple iCl

Mandar Patil 49 Dec 26, 2022
Wrapper for Between - 비트윈을 위한 파이썬 라이브러리

PyBetween Wrapper for Between - 비트윈을 위한 파이썬 라이브러리 Legal Disclaimer 오직 교육적 목적으로만 사용할수 있으며, 비트윈은 VCNC의 자산입니다. 악의적 공격에 이용할시 처벌 받을수 있습니다. 사용에 따른 책임은 사용자가

1 Mar 15, 2022
The most annoying bot on Discord

FBot The most annoying bot on discord Features Lots of fun stuff Message responses, sort of our main feature, no big deal. FBot can respond to a wide

Jude 33 Jun 25, 2022
Gathers data and displays metrics related to climate change and resource depletion on a PowerBI report.

Apocalypse Status Dashboard Purpose Climate change and resource depletion are grave long-term dangers. The code in this repository will pull data from

Summer Is Here 1 Nov 12, 2021
Discord Bot for Genshin Impact Wish Simulating

Genshin Inpact Wish Simulation Discord Bot Bot Links Invite Reddit Official Discord Features Discord embed reaction menu for wishes Simple code scalin

Jeffrey Shum 2 Jan 04, 2023
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Jan 15, 2022
Fastest Tiktok Username checker on site.

Tiktok Username Checker Fastest Tiktok Username checker on site

sql 3 Jun 19, 2021
A simple google translator telegram bot

Translator-Bot A simple google translator telegram bot Please fork this repository don't import code Made with Python3 (C) @FayasNoushad Copyright per

Fayas Noushad 14 Nov 12, 2022
GG Dorking is a tool to generate GitHub and Google dorking for pentesters and bug bounty hunters.

GG-Dorking GG Dorking is a python tool to generate GitHub and Google dorking links for pentesters and bug bounty hunters. It will help you to find imp

Eslam Akl 80 Nov 24, 2022
This is a Python package to create a snowflake identifier similar to Discord's or Twitter's.

snowflake2 Based on falcondai and fenhl's Python snowflake tool, but with documentation and simliarities to Discord. Installation instructions Install

Learnloot 2 Mar 19, 2022
ESOLinuxAddonManager - Very simple addon manager for Elder Scrolls Online running on Linux.

ESOLinuxAddonManager Very simple addon manager for Elder Scrolls Online running on Linux. Well, more a downloader for now. Currently it's quite ugly b

Akseli 25 Aug 28, 2022
Spodcast is a caching Spotify podcast to RSS proxy

Spodcast Spodcast is a caching Spotify podcast to RSS proxy. Using Spodcast you can follow Spotify-hosted netcasts/podcasts using any player which sup

Frank de Lange 260 Jan 01, 2023