Redis Enterprise Python language client for the control plane REST API, generated from Swagger
Project description
swagger-client
REST API Specifications¶
Key Concepts¶
Clusters¶
Redis Labs clusters are a set of nodes, typically two or more, providing database services. Clusters are inherently multi-tenant, and a single cluster can manage multiple databases accessed through individual endpoints.
Protocol and Headers¶
JSON Requests and Responses¶
The Redis Labs REST API uses the JavaScript Object Notation (JSON) for requests and responses. Some responses may have an empty body, but indicate the response with standard HTTP codes. For more information, see RFC 4627 (http://www.ietf.org/rfc/rfc4627.txt) and www.json.org. Both requests and responses may include zero or more objects. In case the request is for a single entity, the response shall return a single JSON object, or none. In case the request if for a list of entities, the response shall return a single JSON array with 0 or more elements. Requests may be delivered with some JSON object fields missing. In this case, these fields will be assigned default values (often indicating they are not in use).
Request Headers¶
The Redis Labs REST API supports the following HTTP headers:
Header | Supported/Required Values |
---|---|
Accept | application/json |
Content-Length | Length (in bytes) of request message. |
Content-Type | application/json |
Response Headers¶
The Redis Labs REST API supports the following HTTP headers:
Header | Supported/Required Values |
---|---|
Content-Type | application/json |
Content-Length | Length (in bytes) of request message. |
API Versions¶
All RLEC API operations are versioned, in order to minimize the impact of backwards-incompatible API changes and to coordinate between different versions operating in parallel.
Authentication¶
Authentication to RLEC API occurs via Basic Auth. Provide your RLEC username and password as the basic auth credentials. All calls must be made over SSL, to port 9443. Example Request:
curl -u "demo@redislabs.com:password" https://localhost:9443/v1/bdbs
Common Responses¶
The following are common responses which may be returned in some cases regardless of any specific request.
Response | Condition / Required handling |
---|---|
503 (Service Unavailable) | Contacted node is currently not a member of any active cluster. |
505 (HTTP Version Not Supported) | An unsupported X-API-Version was used, see API Versions above. |
This Python package is automatically generated by the Swagger Codegen project:
- API version: 6.2.4-55
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
Then import the package:
import swagger_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import swagger_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str |
try:
# Get optimized shards placement for the given database.
api_response = api_instance.get_v1_bdbs_uid_actions_optimize_shards_placement(uid)
pprint(api_response)
except ApiException as e:
print("Exception when calling ActionsApi->get_v1_bdbs_uid_actions_optimize_shards_placement: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database to recover.
try:
# Fetch the recovery plan for a database in recovery mode
api_instance.get_v1_bdbs_uid_actions_recover(uid)
except ApiException as e:
print("Exception when calling ActionsApi->get_v1_bdbs_uid_actions_recover: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database
body = swagger_client.ActionsExportBody() # ActionsExportBody | The request body should contain a JSON object (optional)
try:
# Initiate a database export.
api_instance.post_v1_bdbs_uid_actions_export(uid, body=body)
except ApiException as e:
print("Exception when calling ActionsApi->post_v1_bdbs_uid_actions_export: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database
body = swagger_client.ActionsImportBody() # ActionsImportBody | (optional)
try:
# Initiate a manual import process.
api_instance.post_v1_bdbs_uid_actions_import(uid, body=body)
except ApiException as e:
print("Exception when calling ActionsApi->post_v1_bdbs_uid_actions_import: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database to recover.
body = swagger_client.ActionsRecoverBody() # ActionsRecoverBody | Optional body -- The request body may be empty, in which case the database will be recovered automatically.
The request may include a request body with an explicit recovery plan. (optional)
try:
# Initiate recovery for a database in recovery state.
api_instance.post_v1_bdbs_uid_actions_recover(uid, body=body)
except ApiException as e:
print("Exception when calling ActionsApi->post_v1_bdbs_uid_actions_recover: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 56 # int | The uid of the db on which the command will be performed.
body = swagger_client.DbCommand() # DbCommand | The request must contain a redis command JSON representation consists of a ‘command’ field. It may also consist of an ‘args’ array. (optional)
try:
# Execute a redis/memcached command
api_response = api_instance.post_v1_bdbs_uid_command(uid, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ActionsApi->post_v1_bdbs_uid_command: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database for which update is requested.
action = 'action_example' # str | Additional action to perform. Currently the supported actions are: flush, reset_admin_pass.
body = swagger_client.Bdb() # Bdb | (optional)
dry_run = 'dry_run_example' # str | Validate the bdb object against the existing bdb, but do not invoke the state machine to update it. (optional)
try:
# Update the configuration of an active database.
api_instance.put_v1_bdbs_uid_action(uid, action, body=body, dry_run=dry_run)
except ApiException as e:
print("Exception when calling ActionsApi->put_v1_bdbs_uid_action: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database
try:
# Reset database current backup status
api_instance.put_v1_bdbs_uid_actions_backup_reset_status(uid)
except ApiException as e:
print("Exception when calling ActionsApi->put_v1_bdbs_uid_actions_backup_reset_status: %s\n" % e)
# Configure HTTP basic authorization: YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
configuration = swagger_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = swagger_client.ActionsApi(swagger_client.ApiClient(configuration))
uid = 'uid_example' # str | The unique ID of the database
try:
# Reset database current export status
api_instance.put_v1_bdbs_uid_actions_export_reset_status(uid)
except ApiException as e:
print("Exception when calling ActionsApi->put_v1_bdbs_uid_actions_export_reset_status: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://localhost:9443
Class | Method | HTTP request | Description |
---|---|---|---|
ActionsApi | get_v1_bdbs_uid_actions_optimize_shards_placement | GET /v1/bdbs/{uid}/actions/optimize_shards_placement | Get optimized shards placement for the given database. |
ActionsApi | get_v1_bdbs_uid_actions_recover | GET /v1/bdbs/{uid}/actions/recover | Fetch the recovery plan for a database in recovery mode |
ActionsApi | post_v1_bdbs_uid_actions_export | POST /v1/bdbs/{uid}/actions/export | Initiate a database export. |
ActionsApi | post_v1_bdbs_uid_actions_import | POST /v1/bdbs/{uid}/actions/import | Initiate a manual import process. |
ActionsApi | post_v1_bdbs_uid_actions_recover | POST /v1/bdbs/{uid}/actions/recover | Initiate recovery for a database in recovery state. |
ActionsApi | post_v1_bdbs_uid_command | POST /v1/bdbs/{uid}/command | Execute a redis/memcached command |
ActionsApi | put_v1_bdbs_uid_action | PUT /v1/bdbs/{uid}/{action} | Update the configuration of an active database. |
ActionsApi | put_v1_bdbs_uid_actions_backup_reset_status | PUT /v1/bdbs/{uid}/actions/backup_reset_status | Reset database current backup status |
ActionsApi | put_v1_bdbs_uid_actions_export_reset_status | PUT /v1/bdbs/{uid}/actions/export_reset_status | Reset database current export status |
BackupApi | post_v1_bdbs_uid_actions_import | POST /v1/bdbs/{uid}/actions/import | Initiate a manual import process. |
BackupsApi | put_v1_bdbs_uid_actions_backup_reset_status | PUT /v1/bdbs/{uid}/actions/backup_reset_status | Reset database current backup status |
BdbsApi | delete_v1_bdbs_uid_passwords | DELETE /v1/bdbs/{uid}/passwords | Delete a password from the bdb’s default user |
BdbsApi | get_v1_bdbs | GET /v1/bdbs | Get all databases in the cluster. |
BdbsApi | get_v1_bdbs_uid | GET /v1/bdbs/{uid} | Get single database (bdb object) as json. |
BdbsApi | get_v1_bdbs_uid_actions_optimize_shards_placement | GET /v1/bdbs/{uid}/actions/optimize_shards_placement | Get optimized shards placement for the given database. |
BdbsApi | get_v1_bdbs_uid_actions_recover | GET /v1/bdbs/{uid}/actions/recover | Fetch the recovery plan for a database in recovery mode |
BdbsApi | post_v1_bdbs | POST /v1/bdbs | Create a new database in the cluster. |
BdbsApi | post_v1_bdbs_uid_actions_export | POST /v1/bdbs/{uid}/actions/export | Initiate a database export. |
BdbsApi | post_v1_bdbs_uid_actions_import | POST /v1/bdbs/{uid}/actions/import | Initiate a manual import process. |
BdbsApi | post_v1_bdbs_uid_actions_recover | POST /v1/bdbs/{uid}/actions/recover | Initiate recovery for a database in recovery state. |
BdbsApi | post_v1_bdbs_uid_command | POST /v1/bdbs/{uid}/command | Execute a redis/memcached command |
BdbsApi | post_v1_bdbs_uid_passwords | POST /v1/bdbs/{uid}/passwords | Add a password to the bdb’s default user |
BdbsApi | post_v1_bdbs_uid_upgrade | POST /v1/bdbs/{uid}/upgrade | Upgrade a BDB |
BdbsApi | put_v1_bdbs_uid | PUT /v1/bdbs/{uid} | Update the configuration of an active database. |
BdbsApi | put_v1_bdbs_uid_action | PUT /v1/bdbs/{uid}/{action} | Update the configuration of an active database. |
BdbsApi | put_v1_bdbs_uid_actions_backup_reset_status | PUT /v1/bdbs/{uid}/actions/backup_reset_status | Reset database current backup status |
BdbsApi | put_v1_bdbs_uid_actions_export_reset_status | PUT /v1/bdbs/{uid}/actions/export_reset_status | Reset database current export status |
ClusterApi | delete_v1_cluster_certificates_certificate_name | DELETE /v1/cluster/certificates/{certificate_name} | Removes specified cluster certificate |
ClusterApi | get_v1_cluster_certificates | GET /v1/cluster/certificates | Get the clusters certificates. |
ClusterApi | post_v1_cluster_certificates_rotate | POST /v1/cluster/certificates/rotate | Regenerate all internal cluster certificates |
ClusterApi | put_v1_cluster_update_cert | PUT /v1/cluster/update_cert | Replaces specified cluster certificate |
CrdbsApi | get_v1_crdb | GET /v1/crdbs | Get a list of all Active-Active database on the cluster. |
CrdbsApi | post_v1_crdbs | POST /v1/crdbs | Create a new Active-Active database. |
DefaultApi | delete_v1_bdbs_uid | DELETE /v1/bdbs/{uid} | Delete an active database. |
DefaultApi | put_v1_bdbs_uid_passwords | PUT /v1/bdbs/{uid}/passwords | Set a (single) password |
ShardsApi | get_v1_bdbs_uid_actions_optimize_shards_placement | GET /v1/bdbs/{uid}/actions/optimize_shards_placement | Get optimized shards placement for the given database. |
UsersApi | delete_v1_users | DELETE /v1/users/{uid} | Delete a RLEC user. |
UsersApi | delete_v1_users_password | DELETE /v1/users/password | Delete a password from a user |
UsersApi | get_v1_users | GET /v1/users/{uid} | Get a single RLEC user. |
UsersApi | post_v1_users | POST /v1/users | Create a new RLEC user. |
UsersApi | post_v1_users_password | POST /v1/users/password | Add a new password to an internal user |
UsersApi | put_v1_users_password | PUT /v1/users/password | Reset the password list of an internal user |
Documentation For Models
- Action
- ActionCluster
- ActionClusterChangeMaster
- ActionNode
- ActionNodeCloneNodeSettings
- ActionNodeEnslaveNode
- ActionNodeMaintenanceOff
- ActionNodeMaintenanceOn
- ActionsExportBody
- ActionsImportBody
- ActionsRecoverBody
- AlertSettingsWithThreshold
- AllOfactionsExportBodyExportLocation
- AllOfbdbCrdtSources
- AllOfbdbCrdtSync
- AllOfbdbImportFailureReason
- AllOfbdbReplicaSources
- AllOfbdbReplicaSync
- AllOfbdbSnapshotPolicy
- AllOfbdbSync
- AllOfclusterAlertSettingsClusterCertsAboutToExpire
- AllOfclusterAlertSettingsNodeCpuUtilization
- AllOfclusterAlertSettingsNodeEphemeralStorage
- AllOfclusterAlertSettingsNodeFreeFlash
- AllOfclusterAlertSettingsNodeInternalCertsAboutToExpire
- AllOfclusterAlertSettingsNodeMemory
- AllOfclusterAlertSettingsNodeNetThroughput
- AllOfclusterAlertSettingsNodePersistentStorage
- AllOfdbAlertsSettingsBdbBackupDelayed
- AllOfdbAlertsSettingsBdbCrdtSrcHighSyncerLag
- AllOfdbAlertsSettingsBdbCrdtSrcSyncerConnectionError
- AllOfdbAlertsSettingsBdbCrdtSrcSyncerGeneralError
- AllOfdbAlertsSettingsBdbHighLatency
- AllOfdbAlertsSettingsBdbHighSyncerLag
- AllOfdbAlertsSettingsBdbHighThroughput
- AllOfdbAlertsSettingsBdbLongRunningAction
- AllOfdbAlertsSettingsBdbLowThroughput
- AllOfdbAlertsSettingsBdbRamDatasetOverhead
- AllOfdbAlertsSettingsBdbRamValues
- AllOfdbAlertsSettingsBdbReplicaSrcHighSyncerLag
- AllOfdbAlertsSettingsBdbReplicaSrcSyncerConnectionError
- AllOfdbAlertsSettingsBdbReplicaSrcSyncerGeneralError
- AllOfdbAlertsSettingsBdbShardNumRamValues
- AllOfdbAlertsSettingsBdbSize
- AllOfdbAlertsSettingsBdbSyncerConnectionError
- AllOfdbAlertsSettingsBdbSyncerGeneralError
- AnyOfactionsImportBodyDatasetImportSourcesItems
- AnyOfbdbBackupLocation
- AnyOfbdbDatasetImportSourcesItems
- AnyOfbdbsUidBody
- AnyOfbootstrap
- AnyOfbootstrapDnsSuffixesSlavesItems
- AnyOfldapMappingBdbsEmailAlerts
- AnyOfnodeIdentityIdentityExternalAddrItems
- AnyOfuserBdbsEmailAlerts
- Bdb
- BdbAuthenticationSslClientCerts
- BdbAzureBlobStorage
- BdbBackgroundOp
- BdbBigstoreRamWeights
- BdbEndpoints
- BdbError
- BdbGoogleStorage
- BdbGroup
- BdbImportFailureReason
- BdbModuleList
- BdbMountPointStorage
- BdbRdbUrl
- BdbRolesPermissions
- BdbS3Storage
- BdbSftpStorage
- BdbShardKeyRegex
- BdbShardsBlueprint
- BdbShardsBlueprintInner
- BdbSnapshotPolicy
- BdbSwiftStorage
- BdbSyncSources
- BdbSyncString
- BdbSyncerSources
- BdbSyncerSourcesInner
- BdbTags
- BdbsUidBody
- Bootstrap
- BootstrapCloud
- BootstrapCloudAzure
- BootstrapCloudEc2
- BootstrapCredentials
- BootstrapDnsSuffixes
- CheckResult
- CheckResultNodes
- Cluster
- ClusterAlertSettings
- ClusterIdentity
- ClusterInfo
- ClusterSettings
- Crdb
- CrdbLocalDatabases
- Credentials
- CronExpression
- DbAlertsSettings
- DbCommand
- InlineResponse200
- InlineResponse2001
- InlineResponse406
- InlineResponse4061
- InstanceId
- InstanceInfo
- JobScheduler
- JobSchedulerBackupJobSettings
- JobSchedulerCertRotationJobSettings
- JobSchedulerLogRotationJobSettings
- JobSchedulerNodeChecksJobSettings
- JobSchedulerRedisCleanupJobSettings
- JobSchedulerRotateCcsJobSettings
- JwtAuthorize
- Ldap
- LdapMapping
- LdapQuery
- Module
- ModuleModuleDependencies
- Node
- NodeIdentity
- NodeIdentityIdentity
- NodeIdentityLimits
- NodeIdentityPaths
- NodeSupportedDatabaseVersions
- OneOfactionsRecoverBody
- OneOfbdbEndpointIpItems
- OneOfbdbEndpointsAddrItems
- OneOfbdbImportFailureReason
- OneOfnodeExternalAddr
- Policy
- Proxy
- RecoveryPlan
- RecoveryPlanDataFiles
- RedisAcl
- Role
- ServicesConfiguration
- ServicesConfigurationCmServer
- ServicesConfigurationCrdbCoordinator
- ServicesConfigurationCrdbWorker
- ServicesConfigurationMdnsServer
- ServicesConfigurationPdnsServer
- ServicesConfigurationSaslauthd
- ServicesConfigurationStatsArchiver
- Shard
- ShardBackup
- ShardLoading
- ShardSync
- Suffix
- Task
- TaskErrors
- UidPasswordsBody
- UidPasswordsBody1
- UidPasswordsBody2
- User
- UsersPasswordBody
- UsersPasswordBody1
Documentation For Authorization
YWRtaW5AcmVkaXNsYWJzLmNvbTppbXRoZWFkbWlu
- Type: HTTP basic authentication
Author
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
Built Distribution
Hashes for redis-enterprise-python-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b4dece36f3c24a4ed28a81f805e559dfb260cf03f84bd3576c47179114adff |
|
MD5 | 15c360a3255ab03139cbf7806df6096d |
|
BLAKE2b-256 | d8d1b536766fe049dcba9adb2e86ebbfdcfbbcedccb3d7f7f01292e8e584fb1a |
Hashes for redis_enterprise_python-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | deebcae1dd941f6e66ce069944d21b4a35a8ab90d39b212e2c63ece0ab59c019 |
|
MD5 | e6ae002f1bf5477b7f1ab516e35f08ff |
|
BLAKE2b-256 | fa046dfdd712c1a0ecf82398ae0644bc3868bc918c6ccf2162fb63b894659474 |