Sitreps Python API。
项目描述
sitreps-python-api
未提供描述(由Openapi Generator生成 https://github.com/openapitools/openapi-generator)
此Python包是由OpenAPI Generator项目自动生成的
- API版本:0.1.0
- 包版本:1.2.1
- 构建包:org.openapitools.codegen.languages.PythonClientCodegen
需求。
Python >=3.6
安装 & 使用
pip install
如果Python包托管在存储库中,您可以直接使用以下方法安装
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(可能需要以root权限运行pip
: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
然后导入包
import sitreps_python_api
Setuptools
通过Setuptools安装。
python setup.py install --user
(或使用sudo python setup.py install
为所有用户安装包)
然后导入包
import sitreps_python_api
入门
请按照安装说明进行操作,然后运行以下命令
import time
import sitreps_python_api
from pprint import pprint
from sitreps_python_api.api import code_coverage_api
from sitreps_python_api.model.code_coverage_create import CodeCoverageCreate
from sitreps_python_api.model.http_validation_error import HTTPValidationError
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = sitreps_python_api.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with sitreps_python_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = code_coverage_api.CodeCoverageApi(api_client)
code_coverage_create = CodeCoverageCreate(
time=dateutil_parser('1970-01-01T00:00:00.00Z'),
coverage=3.14,
repository_id=1,
) # CodeCoverageCreate |
try:
# Create Code Coverage
api_response = api_instance.create_code_coverage(code_coverage_create)
pprint(api_response)
except sitreps_python_api.ApiException as e:
print("Exception when calling CodeCoverageApi->create_code_coverage: %s\n" % e)
API端点文档
所有URI相对于http://localhost
类 | 方法 | HTTP请求 | 描述 |
---|---|---|---|
CodeCoverageApi | create_code_coverage | POST /api/v1/coverage/ | 创建代码覆盖率 |
CodeCoverageApi | read_code_coverage | GET /api/v1/coverage/ | 读取代码覆盖率 |
CountLineOfCodeApi | create_cloc | POST /api/v1/cloc/ | 创建 Cloc |
CountLineOfCodeApi | read_cloc | GET /api/v1/cloc/ | 读取 Cloc |
IntegrationTestsApi | create_integration_test | POST /api/v1/integrationtest/ | 创建集成测试 |
IntegrationTestsApi | read_integration_test | GET /api/v1/integrationtest/ | 读取集成测试 |
JiraApi | create_jira | POST /api/v1/jira/ | 创建 Jira |
JiraApi | read_jira | GET /api/v1/jira/ | 读取 Jira |
ProjectGroupsApi | create_project_group | POST /api/v1/projectgroups/ | 创建项目组 |
ProjectGroupsApi | delete_project_group | DELETE /api/v1/projectgroups/{id} | 删除项目组 |
ProjectGroupsApi | read_project_group | GET /api/v1/projectgroups/{id} | 读取项目组 |
ProjectGroupsApi | read_project_groups | GET /api/v1/projectgroups/ | 读取项目组列表 |
ProjectGroupsApi | update_project_group | PUT /api/v1/projectgroups/{id} | 更新项目组 |
ProjectsApi | create_project | POST /api/v1/projects/ | 创建项目 |
ProjectsApi | delete_project | DELETE /api/v1/projects/{id} | 删除项目 |
ProjectsApi | read_project | GET /api/v1/projects/ | 读取项目 |
ProjectsApi | read_project_id | GET /api/v1/projects/{id} | 读取项目 ID |
ProjectsApi | update_project | PUT /api/v1/projects/{id} | 更新项目 |
RepositoriesApi | create_repository | POST /api/v1/repositories/ | 创建仓库 |
RepositoriesApi | delete_repository | DELETE /api/v1/repositories/{id} | 删除仓库 |
RepositoriesApi | read_repository | GET /api/v1/repositories/ | 读取仓库 |
RepositoriesApi | read_repository_id | GET /api/v1/repositories/{id} | 读取仓库 ID |
RepositoriesApi | update_repository | PUT /api/v1/repositories/{id} | 更新仓库 |
SonarQubeApi | create_sonarqube | POST /api/v1/sonarqube/ | 创建 Sonarqube |
SonarQubeApi | read_sonarqube | GET /api/v1/sonarqube/ | 读取 Sonarqube |
UnitTestsApi | create_unittests | POST /api/v1/unittests/ | 创建单元测试 |
UnitTestsApi | read_unittests | GET /api/v1/unittests/ | 读取单元测试 |
DefaultApi | dump_data | POST /api/v1/ | 导出数据 |
DefaultApi | get_status | GET /api/v1/ | 获取状态 |
模型文档说明
- CLOCCreate
- CodeCoverageCreate
- Data
- HTTPValidationError
- IntegrationTestCreate
- JiraCreate
- LocationInner
- ProjectCreate
- ProjectGroupCreate
- ProjectGroupUpdate
- RepositoryCreate
- RepositoryUpdate
- SonarQubeCreate
- UnitTestCreate
- ValidationError
授权文档说明
所有端点都不需要授权。
作者
大型 OpenAPI 文档的说明
如果 OpenAPI 文档很大,sitreps_python_api.apis 和 sitreps_python_api.models 中的导入可能会因 RecursionError(超过最大递归限制)而失败。在这种情况下,有几个解决方案
解决方案 1:为 apis 和 models 使用特定的导入,如
from sitreps_python_api.api.default_api import DefaultApi
from sitreps_python_api.model.pet import Pet
解决方案 2:在导入包之前,调整最大递归限制,如下所示
import sys
sys.setrecursionlimit(1500)
import sitreps_python_api
from sitreps_python_api.apis import *
from sitreps_python_api.models import *
项目详情
关闭
哈希值 for sitreps_python_api-0.0.3-py2.py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ac9240fe49ae46977814f3db82630e2a2643ddc2a889369a04e454e98f17618e |
|
MD5 | f6165beaf36df8fc7a28d975c6ba9e2f |
|
BLAKE2b-256 | 3785bbfe0721cb4e7219ddb43d7931748d361d1cd3fb487763ed972a0e5633e5 |