본문으로 건너뛰기
Reincubate

ricloud-py client implementation

게시일: 2019년 6월 27일· 업데이트: 2020년 5월 13일

Cover image for: ricloud-py client implementation

The ricloud-py client is a straightforward implementation of the ricloud v3 API interface. It also includes some sample implementations of common use-cases, and some basic implementations of data retrieval from 3rd party storage buckets (AWS S3 and Google Cloud Storage).

Installation

The simplest way to get the client is to install it from PyPi.

pip install ricloud==3.0.0

You can also get the code from the GitHub repo.

Configuration

An key_token is required to authenticate against the API. If you are an existing customer, contact enterprise support to get a trial key for the ricloud v3 API.

ricloud-py can be configured in two ways:

  • Via the token attribute on an imported ricloud module.
import ricloud

ricloud.token = '<your key_token>'
  • Create a .ricloud.ini file in your home directory with the following content.
[api]
token = <you key_token>

See the .ricloud.ini file reference for more details.

Usage

The client exposes a class for each API resource and a set of methods to interact with them.

>>> import ricloud

>>> org = ricloud.Organisation.retrieve()

>>> print(org.name)
My Organisation

>>> org.update(name='Changed Organisation')

>>> print(org.name)
Changed Organisation

Sample implementations

The client includes sample implementations for a number of common interactions.

These can be accessed through the samples command

iCloud

The iCloud sample implementation offers a quick way to retrieve data from an iCloud account through the command line.

Reincubate Relay

The Reincubate Relay service sample implements a set of commands needed to create a session, setup a subscription, and manually trigger polls.

Webhook endpoint

The client includes a simple webhook endpoint implementation that listens for incoming API event notifications and prints information to the console.

It is recommended to use a utility such as ngrok to safely expose your local endpoint to the internet. By default, the webhook endpoint is bound to port 8080 on your machine.

ngrok http -bind-tls=true 8080

You can see the address of your publicly exposed ngrok endpoint in the Forwarding row, like https://abcd1234.ngrok.io.

Then you can start up the listener by running the ricloud event listen command. If your client is configured correctly, it will automatically create a webhook config using the URL specified in the command and set it as the currently in-use key's default webhook config.

ricloud event listen --webhook-url https://abcd1234.ngrok.io

.ricloud.ini file reference

Section: api

token

The token used to authenticate against the API's endpoints.

url

The base url for the API. Default: https://ricloud-api.reincubate.com.

max_retries

How many times to retry a request if it fails due to a server or connection error. Default: 3

await_for

Adds the Ricloud-Await header with the specified value to enable to the await response mechanism. Default: 0

Section: webhooks

secret

The webhook config secret to use when verifying incoming event notification payloads. This is set automatically if using the --webhook-url option to the ricloud event listen command.

delta

The variance allowed between when the event was sent and when it was received, in seconds. Default: 600

Section: logging

log_level

Section: samples

output_directory

The default output directory for any results downloaded as part of a sample script. If the directory path is relative it will be created relative to the current working directory.

user_identifier

The client will create a User resource when executing sample scripts. The default value for this user's identifier is ricloud-py, but can be easily customised via this option.

This can be useful to distinguish usage between different developers within the same organisation, for example.

[api]
token = <your key_token>
url = https://ricloud-api.reincubate.com
max_retries = 1

[logging]
log_directory = logs
log_level = WARNING

[samples]
output_directory = output
user_identifier = ricloud-py

관련 문서

도움이 필요하신가요?

모든 문의에 영업일 기준 1일 이내에 답변드리도록 노력하고 있습니다.

support@reincubate.com
King's Award for Enterprise 로고

King's Award for Enterprise: Reincubate는 영국 최고의 공식 비즈니스 영예를 네 차례 수상했으며, 가장 최근에는 지난 3년간의 뛰어난 성장을 인정받았습니다.

사용자 및 파트너와의 관계는 우리의 가치와 우리가 만드는 제품의 핵심입니다. 리뷰을(를) 통해 그들의 이야기를 들어보세요.

Centre for Assessment의 ISO 27001 인증, UKAS 공인

© 2008-2026 Reincubate Ltd. 모든 권리 보유. 잉글랜드 및 웨일스 등록 번호 5189175, VAT 번호 GB151788978. Camo®, Streamlight® 및 Reincubate®는 등록 상표입니다. 특허 출원 중.

도움말