Skip to main content

Chino.io Scriba SDK Python

Project description

Chino.io :: Scriba Documentation: the Application Programming Interface

This Python package is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

Install the generated package (see on top here or):

pip install chinoscriba

Getting Started

import chinoscriba
from chinoscriba.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: Basic
configuration = chinoscriba.Configuration()
configuration.username = 'customer_id'
configuration.password = 'customer_key'

# create an instance of the API classes
logs_api = chinoscriba.LogsApi(chinoscriba.ApiClient(configuration))
stats_api = chinoscriba.StatsApi(chinoscriba.ApiClient(configuration))
blocks_api = chinoscriba.BlocksApi(chinoscriba.ApiClient(configuration))

limit = 56 # int | Number of results to return per page
offset = 0 # int | The initial index from which to return the results


# # Audit logs # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

# Create a new Log
body = chinoscriba.AuditLog() # AuditLog | 
try:
    api_response = logs_api.logs_create(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_create: %s\n" % e)


# Create multiple Logs (bulk)
body = [chinoscriba.AuditLog()] # list[AuditLog] | 
try:
    api_response = logs_api.logs_multiple(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_multiple: %s\n" % e)

try:
    # List all Logs
    api_response = logs_api.logs_list(limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_list: %s\n" % e)

try:
    # Search by query
    api_response = logs_api.logs_search(body, limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->logs_search: %s\n" % e)

# # Stats # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

try:
    # Retrieve customer statistics
    api_response = stats_api.stats_read()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->stats_read: %s\n" % e)


# # Exporter # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

try:
    # List exportable Blocks
    api_response = blocks_api.exported_list(limit=limit, offset=offset)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->exported_list: %s\n" % e)


# Export a Block
block_id = "" # string | ID of the Block to download
try:
    # NOTE: due to an issue in a third-party library, this only works with 
    #  '_preload_content' disabled. This will bypass the malfunctioning code
    #  and return directly the HTTPResponse, which contains the zip file bytes
    #  in the 'data' attribute.
    res = blocks_api.exported_read(block_id, _preload_content=False)
    zip_bytes = res.data  # You can read this using python library 'zipfile'.
except ApiException as e:
    print("Exception when calling BlocksApi->exported_read: %s\n" % e)

Changelog

[2.1.1] - 2023-11-29

  • added support for new endpoint: "Validate downloaded Block" (/validate/)
  • fixed events' tests

[2.0.0] - 2021-01-22

  • CHANGELOG.md (this file)
  • added support for new events endpoints
  • removed unique class DefaultApi in favour of specific classes based on endpoint semantic groups: LogApi, BlockApi, EventsApi, StatsApi

[1.0.1] - 2021-01-15

  • DefaultApi class which manages logs (create, list, search) and block downloads

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chinoscriba-2.1.1.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

chinoscriba-2.1.1-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

Details for the file chinoscriba-2.1.1.tar.gz.

File metadata

  • Download URL: chinoscriba-2.1.1.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for chinoscriba-2.1.1.tar.gz
Algorithm Hash digest
SHA256 4f1c36b59f4a6b9cdb2e31bb40519f9da2ab9c2f58ef32d81972f20a49c046ee
MD5 4b3eb11f85cc0b47b71ca09f1b4ff9ac
BLAKE2b-256 7b4701db316d811b51b405f2923a2c0e3b0a3684ed65ab15abd2332b3517ca0d

See more details on using hashes here.

File details

Details for the file chinoscriba-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: chinoscriba-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 55.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for chinoscriba-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6c0c490a816c29fc5001b861aa9f4bc14b5e1182ed2fa03e597aabe4b2e6174
MD5 c69fa970fccf5f4034d59f9e4792523a
BLAKE2b-256 41b9c07ba9e4f76e5cf599bcfddeb0d040a55506a125cdb7f87644f6cf6ccaa7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page