pip install git+https://github.com/epilot-dev/sdk-python.git#subdirectory=organizationimport epilot
s = epilot.Epilot(
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.organization.get_organization(org_id='739224')
if res.organization is not None:
# handle response
pass- get_organization - getOrganization
- update_organization - updateOrganization
- delete_settings_value - deleteSettingsValue
- get_settings - getSettings
- put_settings_value - putSettingsValue
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type.
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
import epilot
from epilot.models import errors
s = epilot.Epilot(
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = None
try:
res = s.organization.get_organization(org_id='739224')
except errors.SDKError as e:
# handle exception
raise(e)
if res.organization is not None:
# handle response
passYou can override the default server globally by passing a server index to the server_idx: int optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
| # | Server | Variables |
|---|---|---|
| 0 | https://organization-v2.sls.epilot.io |
None |
import epilot
s = epilot.Epilot(
server_idx=0,
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.organization.get_organization(org_id='739224')
if res.organization is not None:
# handle response
passThe default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:
import epilot
s = epilot.Epilot(
server_url="https://organization-v2.sls.epilot.io",
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.organization.get_organization(org_id='739224')
if res.organization is not None:
# handle response
passThe Python SDK makes API calls using the requests HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom requests.Session object.
For example, you could specify a header for every request that this sdk makes as follows:
import epilot
import requests
http_client = requests.Session()
http_client.headers.update({'x-custom-header': 'someValue'})
s = epilot.Epilot(client=http_client)This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
epilot_auth |
http | HTTP Bearer |
To authenticate with the API the epilot_auth parameter must be set when initializing the SDK client instance. For example:
import epilot
s = epilot.Epilot(
epilot_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.organization.get_organization(org_id='739224')
if res.organization is not None:
# handle response
pass