Geely GBOP Client
Project description
Geely GBOP Client
request demo:
from pygbop import GbopApiClient, Method, BasicAuth
auth = BasicAuth(access_key='xxxxxxxxxxxxxxxxx', secret_key='xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')
client = GbopApiClient(auth, base_url='hello.api-dev.test.xxxxx.com')
print('=============GET=============')
params = {
'params1': '123',
'params3': ['s', 'w', 'k'],
'params2': '321',
}
res = client.execute(Method.GET, '/api/v1/hello', params)
print(res.decode('utf-8'))
print('=============POST=============')
data = {'params3': 'testA', 'params4': 'testB'}
res = client.execute(Method.POST, '/api/v1/demo', data=data)
print(res.decode('utf-8'))
print('=============POST2=============')
params = {'params3': 'testA', 'params4': 'testB'}
res = client.execute(Method.POST, '/api/v1/demo', params=params, data=data)
print(res.decode('utf-8'))
cloud event push demo:
from pygbop import CloudEventBasicAuth, EventPushClient
auth = CloudEventBasicAuth(producer_group='xxxxxxx',
subject='persistent://Information_Technology/xxxx/XXXX_EVENT',
secret_token='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
event_push_client = EventPushClient(auth=auth, base_url='http://gbopems.dev.xxxxx.com/eventmesh/publish')
data = {
"message": "hello 喵啪斯"
}
response = event_push_client.push_message(data=data,
source='xx.cmdb',
type_='xx:cmdb:InstanceChanged')
print(response.decode('utf-8'))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pygbop-0.2.0.2.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file pygbop-0.2.0.2.tar.gz
.
File metadata
- Download URL: pygbop-0.2.0.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62dc93cf3c00750a05c2509c0c530576184c1a63b6eed8b51fee6631612d9944 |
|
MD5 | 86971587636d528891bd31c1c01411da |
|
BLAKE2b-256 | 47b28f982db2da0bc5820819841a2a8d16c01a24592d736b17f57f8c86e761f0 |
File details
Details for the file pygbop-0.2.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: pygbop-0.2.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d164604abd9aa4c39379f051f26394f450e863ea1a9e62b31baddedc34d086cf |
|
MD5 | 461e15b99d449cb97ef5bf8e22ede635 |
|
BLAKE2b-256 | 350a1c3b2d666a87204ca781ad1148ca749f75d81348f7f9ae8095bb51575142 |