{"id":29571866,"url":"https://github.com/oceanbase/obshell-sdk-python","last_synced_at":"2025-07-19T04:36:25.452Z","repository":{"id":245970557,"uuid":"818166057","full_name":"oceanbase/obshell-sdk-python","owner":"oceanbase","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-10T03:31:38.000Z","size":370,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-10T11:57:27.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oceanbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-21T08:37:32.000Z","updated_at":"2025-07-10T03:31:41.000Z","dependencies_parsed_at":"2024-09-11T08:47:28.759Z","dependency_job_id":"c461cc60-5418-4938-aa2e-5b23e1e44645","html_url":"https://github.com/oceanbase/obshell-sdk-python","commit_stats":null,"previous_names":["oceanbase/obshell-sdk-python"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/oceanbase/obshell-sdk-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oceanbase","download_url":"https://codeload.github.com/oceanbase/obshell-sdk-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oceanbase%2Fobshell-sdk-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265889158,"owners_count":23844539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-19T04:36:24.811Z","updated_at":"2025-07-19T04:36:25.435Z","avatar_url":"https://github.com/oceanbase.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/oceanbase/oceanbase/blob/master/LICENSE\"\u003e\n    \u003cimg alt=\"license\" src=\"https://img.shields.io/badge/license-Apache--2.0-blue\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://en.oceanbase.com/docs/oceanbase-database\"\u003e\n    \u003cimg alt=\"English doc\" src=\"https://img.shields.io/badge/docs-English-blue\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.oceanbase.com/docs/oceanbase-database-cn\"\u003e\n    \u003cimg alt=\"Chinese doc\" src=\"https://img.shields.io/badge/文档-简体中文-blue\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nEnglish | [Chinese](README_CN.md)\n\n**OBShell-SDK-Python**  is an SDK provided by the[OceanBase Community](https://open.oceanbase.com/) to facilitate developers with quick access to OBShell services, allowing them to conveniently call OBShell interfaces using this SDK.\n\n## Install\n```\npip install obshell\n```\n\n## Quick Start\nPlease ensure that OBShell is running when using it.\n### Create a Client\nCreate a specified version client.\n```python\nfrom obshell import ClientV1\nfrom obshell.auth import PasswordAuth\n\ndef main():\n    client = ClientV1(\"11.11.11.1\", 2886, PasswordAuth(\"****\"))\n```\nCreate client_set.\n```python\nfrom obshell import ClientSet\nfrom obshell.auth import PasswordAuth\n\ndef main():\n    client = ClientSet(\"11.11.11.1\", 2886, PasswordAuth(\"****\"))\n```\n### Deploy Cluster\nOBShell-SDK-Python provides two types of methods to deploy an OBShell cluster: the first immediately returns after successfully making a request to the OBShell API, and the second waits for the OBShell task to complete after the API request is successful before returning. The former executes the task asynchronously, while the latter executes the task synchronously.\n\n**Deploy a 1-1-1 cluster:**\n* Asynchronous Task Execution\n```python\nfrom obshell import ClientSet\nfrom obshell.auth import PasswordAuth\ndef main():\n    client = ClientSet(\"11.11.11.1\", 2886, PasswordAuth(\"****\"))\n\n    # join master\n    dag = client.v1.join(\"11.11.11.1\", 2886, \"zone1\")\n    client.v1.wait_dag_succeed(dag.generic_id)\n    # join follower\n    dag = client.v1.join(\"11.11.11.2\", 2886, \"zone2\")\n    client.v1.wait_dag_succeed(dag.generic_id)\n    dag = client.v1.join(\"11.11.11.3\", 2886, \"zone3\")\n    client.v1.wait_dag_succeed(dag.generic_id)\n\n    # configure observer\n    configs = {\n        \"datafile_size\": \"24G\", \"log_disk_size\": \"24G\", \n        \"cpu_count\": \"16\", \"memory_limit\": \"16G\", \"system_memory\": \"8G\", \n        \"enable_syslog_recycle\": \"true\", \"enable_syslog_wf\": \"true\"}\n    dag = client.v1.config_observer(configs, \"GLOBAL\", [])\n    client.v1.wait_dag_succeed(dag.generic_id)\n\n    # configure obcluster\n    dag = client.v1.config_obcluster_sync(\"test-sdk\", 11, \"****\")\n    client.v1.wait_dag_succeed(dag.generic_id)\n\n    # initialize obcluster\n    dag = client.v1.init_sync()\n    client.v1.wait_dag_succeed(dag.generic_id)\n    \n    # get the status of the cluster\n    status = client.v1.get_status()\n    print(status)\n```\n* Synchronous Task Execution\n```python\nfrom obshell import ClientSet\nfrom obshell.auth import PasswordAuth\n\ndef main():\n    client = ClientSet(\"11.11.11.1\", 2886, PasswordAuth(\"****\"))\n\n    # join master\n    client.v1.join_sync(\"11.11.11.1\", 2886, \"zone1\")\n    # join follower\n    client.v1.join_sync(\"11.11.11.2\", 2886, \"zone2\")\n    client.v1.join_sync(\"11.11.11.3\", 2886, \"zone3\")\n\n    # configure observer\n    configs = {\n        \"datafile_size\": \"24G\", \"log_disk_size\": \"24G\", \n        \"cpu_count\": \"16\", \"memory_limit\": \"16G\", \"system_memory\": \"8G\", \n        \"enable_syslog_recycle\": \"true\", \"enable_syslog_wf\": \"true\"}\n    client.v1.config_observer_sync(configs, \"GLOBAL\", [])\n\n    # configure obcluster\n    client.v1.config_obcluster_sync(\"test-sdk\", 11, \"****\")\n\n    # initialize obcluster\n    client.v1.init_sync()\n    \n    # get the status of the cluster\n    status = client.v1.get_status()\n    print(status)\n```\n### Scale out\nScale out the agent '11.11.11.4' into the cluster where the agent '11.11.11.1' is located.\n```python\nfrom obshell import ClientSet\nfrom obshell.auth import PasswordAuth\n\ndef main():\n    client = ClientSet(\"111.11.11.1\", 2886, PasswordAuth(\"****\"))\n\n    # scale out\n    configs = {\n        \"datafile_size\": \"24G\", \"log_disk_size\": \"24G\", \n        \"cpu_count\": \"16\", \"memory_limit\": \"16G\", \"system_memory\": \"8G\", \n        \"enable_syslog_recycle\": \"true\", \"enable_syslog_wf\": \"true\"}\n    client.v1.scale_out_sync(\"11.11.11.4\", 2886, \"zone3\", configs)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foceanbase%2Fobshell-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foceanbase%2Fobshell-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foceanbase%2Fobshell-sdk-python/lists"}