uwsgi.it api库
uwsgiit-p的Python项目详细描述
#一个用于uwsgi.it的python客户端库。
<<<
`` bash
pip install-uwsgiit py
```
“戴莫斯”“http://foobar.com/api”)
````
``获取最新消息
`` bash
`` bash
``简单用法
```简单用法
curl https://kratos:deimos@foobbar.com/api/news/
``````
``` python
````` python
`` client.news()
```
`
` ` ` `
` ` ` ` ` ` ` `
` ` `列出你的数据http://kratos:deimos@foobar.com/api/me/
````
``` python
``` python
````````````
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` api/me/
````
```python
client.update\u me({company':'战神4年鉴)
````
)
``
``列出你的容器
`` bash
``简单用法
curlhttps://kratos:deimos17@foobar.com/api/me/containers/
```
```python
client.containers()
```
#### Show a single container
```bash
# Plain Usage
curl https://kratos:deimos17@foobar.com/api/containers/30009
```
```python
client.container(30009)
```
#### List
`` bash
`` bash
`` bash
`` bash
`` bash
普通用法
curl https://kratos:deimos17@foobbar.com/api/api/distros/
```
`` python
`` python
`` client.distros()
` ````````
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `-d'{“发行版”:2}https://kratos:deimos17@foobar.com/api/containers/30009
````
```python
``client.container\u set\u发行版(300092)
```
``` bash
``简单用法
curl-x post-d'{“ssh-keys”:[“ssh-rsa………”]}https://kratos:deimos17@foobar.com/api/containers/30009
`````
`` python
`` client.container` set`密钥(30009,“ssh-rsrsa…………”)
````
`` bash `` bash `` bash
`` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `
curhttps://kratos:deimos17@foobar.com/api/domains `
``````
```````
```````````````````` py `` py `` http ````添加domain
`` bash
`简单用法
curl-X POST-d'{“name”:“mynewdomain.org”}https://kratos:deimos17@foobar.com/api/domains/
````
``python
``client.addôdomain(“mynewdomain.org”)
````
``bash
`curl-X Delete-d'{“name”:“mynewdomain.org”}https://kratos:deimos17@foobar.com/api/domains/
````
```python
``client.delete_domain(“mynewdomain.org”)
````
属性:
*uerror:一个布尔值,用于指示是否发生HTTP错误
*umessage:纯文本格式的错误消息
<<<
`` bash
pip install-uwsgiit py
```
“戴莫斯”“http://foobar.com/api”)
````
``获取最新消息
`` bash
`` bash
``简单用法
```简单用法
curl https://kratos:deimos@foobbar.com/api/news/
``````
``` python
````` python
`` client.news()
```
`
` ` ` `
` ` ` ` ` ` ` `
` ` `列出你的数据http://kratos:deimos@foobar.com/api/me/
````
``` python
``` python
````````````
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` api/me/
````
```python
client.update\u me({company':'战神4年鉴)
````
)
``
``列出你的容器
`` bash
``简单用法
curlhttps://kratos:deimos17@foobar.com/api/me/containers/
```
```python
client.containers()
```
#### Show a single container
```bash
# Plain Usage
curl https://kratos:deimos17@foobar.com/api/containers/30009
```
```python
client.container(30009)
```
#### List
`` bash
`` bash
`` bash
`` bash
`` bash
普通用法
curl https://kratos:deimos17@foobbar.com/api/api/distros/
```
`` python
`` python
`` client.distros()
` ````````
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `-d'{“发行版”:2}https://kratos:deimos17@foobar.com/api/containers/30009
````
```python
``client.container\u set\u发行版(300092)
```
``` bash
``简单用法
curl-x post-d'{“ssh-keys”:[“ssh-rsa………”]}https://kratos:deimos17@foobar.com/api/containers/30009
`````
`` python
`` client.container` set`密钥(30009,“ssh-rsrsa…………”)
````
`` bash `` bash `` bash
`` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `` bash `
curhttps://kratos:deimos17@foobar.com/api/domains `
``````
```````
```````````````````` py `` py `` http ````添加domain
`` bash
`简单用法
curl-X POST-d'{“name”:“mynewdomain.org”}https://kratos:deimos17@foobar.com/api/domains/
````
``python
``client.addôdomain(“mynewdomain.org”)
````
``bash
`curl-X Delete-d'{“name”:“mynewdomain.org”}https://kratos:deimos17@foobar.com/api/domains/
````
```python
``client.delete_domain(“mynewdomain.org”)
````
属性:
*uerror:一个布尔值,用于指示是否发生HTTP错误
*umessage:纯文本格式的错误消息