{"id":13450356,"url":"https://github.com/etlweather/gaucho","last_synced_at":"2025-03-23T16:31:21.337Z","repository":{"id":89476952,"uuid":"53816910","full_name":"etlweather/gaucho","owner":"etlweather","description":"A Python CLI tool for Rancher's API","archived":true,"fork":false,"pushed_at":"2019-02-02T19:48:08.000Z","size":44,"stargazers_count":92,"open_issues_count":0,"forks_count":50,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-31T07:15:33.548Z","etag":null,"topics":["ci-cd","deployment","rancher","rancher-api"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/etlweather.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-14T01:10:07.000Z","updated_at":"2023-07-10T00:39:51.000Z","dependencies_parsed_at":"2024-01-21T05:50:12.686Z","dependency_job_id":"f9bc8198-9879-4708-9b9a-eca442748739","html_url":"https://github.com/etlweather/gaucho","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etlweather%2Fgaucho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etlweather%2Fgaucho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etlweather%2Fgaucho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/etlweather%2Fgaucho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/etlweather","download_url":"https://codeload.github.com/etlweather/gaucho/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221856393,"owners_count":16892436,"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":["ci-cd","deployment","rancher","rancher-api"],"created_at":"2024-07-31T07:00:33.899Z","updated_at":"2024-10-28T16:31:04.360Z","avatar_url":"https://github.com/etlweather.png","language":"Python","funding_links":[],"categories":["Rancher 1.0"],"sub_categories":["Community projects 1.0"],"readme":"# Not maintained\n\nThis tool was very useful when I was using Rancher 1.x - but I have since moved to Rancher 2 with Kubernetes and I no longer use this.\n\nFeel free to use this tool, fork the project and improve it.\n\nIf someone would like to take ownership of it, please let me know (open an issue). A few people forked the project and improved upon it already.\n\n\nGaucho\n===========================================\n\nGaucho is simply some Python scripts to access the\n[Rancher](https://github.com/rancher/rancher)'s API to perform tasks which\nI need to have executed through my deployment workflow.\n\nAt this point, it does not contain much but it might grow as I get more\nrequirements.\n\nContributions are welcome if you want to use it and add to it.\n\n## Usage\n\nGaucho can be run directly on a command line provided you have Python installed\nas well as the dependencies listed below.\n\nIt can also be run as a Docker container:\n\n```\ndocker run --rm -it etlweather/gaucho query 1s245\n```\n\n### Rancher Host, Access Key and Secret\n\nGaucho needs to know the Rancher host and must be given an access key and access\nsecret to be able to interact with the Rancher's API. This can be done through\nenvironment variables:\n\n   - `CATTLE_ACCESS_KEY`\n   - `CATTLE_SECRET_KEY`\n   - `CATTLE_URL`\n\n#### SSL Validation\n\nIf you want to turn off SSL validation because you are using a self-signed certificate\nor a private CA-signed certificate, you can pass the environment variable:\n\n    - `SSL_VERIFY=false`\n\nYou can also mount the SSL certificate chain into the container, and pass the path to the\ncertificate as an environment variable:\n\n   - `-v /path/to/ca_chain.crt:/root/ca.crt`\n   - `-e SSL_VERIFY=/root/ca.crt`\n\n#### Rancher Agent Container\n\nIf you run Gaucho in a container on Rancher, rather than set the environment\nvariables manually, use the following labels to have Rancher automatically do it\nfor you.\n\n```\nio.rancher.container.create_agent=true\nio.rancher.container.agent.role=environment\n```\n\nSee [Service Accounts in Rancher](http://docs.rancher.com/rancher/latest/en/rancher-services/service-accounts/)\nfor more information on this feature.\n\n## Supported API\n\n### query\n\n```\nUsage: ./services.py query [\u003cservice_id\u003e]\n\nRetrieves the service information.\n\n    If you don't specify an ID, data for all services will be retrieved.\n\nOptions:\n\n   --service_id  The ID of the service to read (optional)\n```\n\n### id_of\n\nRetrieves the ID of a service given its name.\n\n```\n $ ./services.py id_of cassandra\n1s130\n $\n```\n\n### id_of_env\n\n```\nUsage: ./gaucho id_of_env \u003cenvironment_name\u003e\n\nRetrieves the ID of a environment given its name.\n\nRequired Arguments:\n\n  environment_name   The name of the environment\n```\n\n### start_service\n\n```\nUsage: ./gaucho start_service \u003cservice_id\u003e\n\nStarts the containers of a given service, typically a Start Once service.\n\nRequired Arguments:\n\n  service_id   The ID of the service to start the containers of.\n```\n\n### stop_service\n\n```\nUsage: ./gaucho stop_service \u003cservice_id\u003e\n\nStop the containers of a given service.\n\nRequired Arguments:\n\n  service_id   The ID of the service to stop the containers of.\n```\n\n### restart_service\n\n```\nUsage: ./gaucho restart_service \u003cservice_id\u003e\n\nRestart the containers of a given service.\n\nRequired Arguments:\n\n  service_id   The ID of the service to restart the containers of.\n```\n\n### upgrade\n\n```\nUsage: ./services.py upgrade \u003cservice_id\u003e [\u003cstart_first\u003e] [\u003ccomplete_previous\u003e] [\u003cimageUuid\u003e] [\u003cauto_complete\u003e] [\u003cbatch_size\u003e] [\u003cinterval_millis\u003e] [\u003creplace_env_name\u003e] [\u003creplace_env_value\u003e]\n\nUpgrades a service\n\n    Performs a service upgrade, keeping the same configuration, but\n    otherwise pulling new image as needed and starting new containers,\n    dropping the old ones.\n\nRequired Arguments:\n\n  service_id   The ID of the service to upgrade.\n\nOptions:\n\n   --start_first        Whether or not to start the new instance first before\n                        stopping the old one.\n   --complete_previous  If set and the service was previously upgraded but the\n                        upgrade wasn't completed, it will be first marked as\n                        Finished and then the upgrade will occur.\n   --imageUuid          If set the config will be overwritten to use new\n                        image. Don't forget Rancher Formatting\n                        'docker:\u003cImagename\u003e:tag'\n   --auto_complete      Set this to automatically 'finish upgrade' once\n                        upgrade is complete\n   --batch_size\n   --interval_millis\n   --replace_env_name   The name of an environment variable to be changed in\n                        the launch config (requires replace_env_value).\n   --replace_env_value  The value of the environment variable to be replaced\n                        (requires replace_env_name).\n   --timeout            How many seconds to wait until an upgrade fails\n```\n\n### rollback\n\n```\nUsage: ./services.py rollback \u003cservice_id\u003e\n\nRolls back service\n\n    Performs a service rollback\n\nRequired Arguments:\n\n  service_id   The ID of the service to roll back.\n\nOptions:\n\n   --timeout            How many seconds to wait until an upgrade fails\n```\n\n### execute command\n\n```\nUsage: ./gaucho execute \u003cservice_id\u003e \u003ccommand\u003e\n\nRuns the given *command* on the first container found for the given *service id*.\n\nRequired Arguments:\n\n  service_id   The ID of the service to perform the command on.\n  command      shell command to execute\n```\n\n### activate command\n\n```\nUsage: ./gaucho activate \u003cservice_id\u003e\n\nActivate the given *service id*.\n\nRequired Arguments:\n\n  service_id   The ID of the service to perform the command on.\n\nOptions:\n\n   --timeout            How many seconds to wait until get back prompt on activation\n```\n\n### deactivate command\n\n```\nUsage: ./gaucho deactivate \u003cservice_id\u003e\n\nDeactivate the given *service id*.\n\nRequired Arguments:\n\n  service_id   The ID of the service to perform the command on.\n\nOptions:\n\n   --timeout            How many seconds to wait until get back prompt on deactivation\n```\n\n### remove command\n\n```\nUsage: ./gaucho remove \u003cservice_id\u003e\n\nRemove the given *service id*.\n\nRequired Arguments:\n\n  service_id   The ID of the service to perform the command on.\n\nOptions:\n\n   --timeout            How many seconds to wait until get back prompt on remove\n```\n\n### deactivate environment command\n\n```\nUsage: ./gaucho deactivate_env \u003cenvironment_id\u003e\n\nDeactivate the given *environment id*.\n\nRequired Arguments:\n\n  environment_id   The ID of the environment to perform the command on.\n\nOptions:\n\n   --timeout            How many seconds to wait until get back prompt on deactivation\n```\n\n### remove environment command\n\n```\nUsage: ./gaucho remove_env \u003cenvironment_id\u003e\n\nRemove the given *environment id*.\n\nRequired Arguments:\n\n  environment_id   The ID of the environment to perform the command on.\n\nOptions:\n\n   --timeout            How many seconds to wait until get back prompt on remove\n```\n\n### Get service's state\n\n```\nUsage: ./gaucho state \u003cservice_id\u003e\n\nPrint state of the given *service id*.\n\nRequired Arguments:\n\n  service_id   The ID of the service to check.\n```\n\n\n## Dependencies\n\n - requests==2.18.4 \n - baker==1.3 \n - websocket-client==0.44.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetlweather%2Fgaucho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fetlweather%2Fgaucho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fetlweather%2Fgaucho/lists"}