{"id":18777433,"url":"https://github.com/cloudera/cdpcurl","last_synced_at":"2025-04-13T10:32:04.250Z","repository":{"id":51147998,"uuid":"297448565","full_name":"cloudera/cdpcurl","owner":"cloudera","description":"Curl like tool with CDP request signing.","archived":false,"fork":false,"pushed_at":"2024-07-16T14:33:33.000Z","size":59,"stargazers_count":6,"open_issues_count":3,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-05T21:56:05.406Z","etag":null,"topics":["cdp","cloudera"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING/LICENSE.txt","code_of_conduct":null,"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}},"created_at":"2020-09-21T20:05:10.000Z","updated_at":"2024-01-09T18:04:21.000Z","dependencies_parsed_at":"2024-11-07T20:10:56.267Z","dependency_job_id":"41750709-429c-48f8-9e8d-29fc1fe33348","html_url":"https://github.com/cloudera/cdpcurl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudera%2Fcdpcurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudera%2Fcdpcurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudera%2Fcdpcurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudera%2Fcdpcurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudera","download_url":"https://codeload.github.com/cloudera/cdpcurl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248698999,"owners_count":21147571,"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":["cdp","cloudera"],"created_at":"2024-11-07T20:10:50.360Z","updated_at":"2025-04-13T10:31:59.241Z","avatar_url":"https://github.com/cloudera.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdpcurl\n\nCurl like tool with CDP request signing. Inspired by and built from [awscurl](https://github.com/okigan/awscurl). See that repository's [README](https://github.com/okigan/awscurl/tree/master/README.md) for installation and usage instructions beyond what is provided here.\n\n## Building\n\nCreate a virtualenv if desired.\n\n```bash\n# For typical virtualenv\n$ virtualenv cdpcurlenv\n$ . cdpcurlenv/bin/activate\n# For pyenv\n$ pyenv virtualenv cdpcurlenv\n$ pyenv activate cdpcurlenv\n```\n\nThen, in this directory:\n\n```\n$ pip install .\n```\n\n## Usage\n\nRun `cdpcurl --help` for a complete list of options.\n\nBefore using `cdpcurl`, generate an access key / private key pair for your CDP user account using the CDP management console. You have two options for passing those keys to `cdpcurl`:\n\n* pass the keys to `cdpcurl` using the `--access-key` and `--private-key` options\n* (recommended) create a profile in _$HOME/.cdp/credentials_ containing the keys, and then use the `--profile` option in `cdpcurl` calls\n\n```\n[myuserprofile]\ncdp_access_key_id = 6744f22e-c46a-406d-ad28-987584f45351\ncdp_private_key = abcdefgh...................................=\n```\n\nMost CDP API calls are POST requests, so be sure to specify `-X POST`, and provide the request content using the `-d` option. If the `-d` option value begins with \"@\", then the remainder of the value is the path to a file containing the content; otherwise, the value is the content itself.\n\nTo form the URI, start by determining the hostname based on the service being called:\n\n* iam: `iamapi.us-west-1.altus.cloudera.com`\n* all other services: `api.us-west-1.cdp.cloudera.com`\n\nThe correct URI is an https URL at the chosen host, with a path indicated for your desired endpoint in the [API documentation](https://cloudera.github.io/cdp-dev-docs/api-docs/).\n\n## Examples\n\nGet your own account information:\n\n```bash\n$ cdpcurl --profile demo -X POST -d '{}' https://iamapi.us-west-1.altus.cloudera.com/iam/getAccount\n```\n\nList all environments:\n\n```bash\n$ cdpcurl --profile sandbox -X POST -d '{}' https://api.us-west-1.cdp.cloudera.com/api/v1/environments2/listEnvironments\n```\n\n## Request Signing\n\nA CDP API call requires a request signature to be passed in the \"x-altus-auth\" header, along with a corresponding timestamp in the \"x-altus-date\" header. `cdpcurl` constructs the headers automatically. However, if you would rather use a different HTTP client, such as ordinary `curl`, then you may directly use the `cdpv1sign` script within `cdpcurl` to generate these required headers. You may then parse the header values from the script output and feed them to your preferred client. Note that CDP API services will reject calls with timestamps too far in the past, so generate new headers for each call.\n\n```bash\n$ cdpv1sign -X POST https://api.us-west-1.cdp.cloudera.com/api/v1/environments2/listEnvironments\nContent-Type: application/json\nx-altus-date: Fri, 28 Aug 2020 20:38:38 GMT\nx-altus-auth: (very long string value)\n```\n\nThe signature algorithm specification is available from the [API documentation](https://cloudera.github.io/cdp-dev-docs/api-docs/).\n\n## License\n\nCopyright (c) 2020, Cloudera, Inc. All Rights Reserved.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n---\n\nThe GNU AGPL v3 is available in [LICENSE.txt](LICENSE.txt).\n\nAdditional license information is available in [NOTICE.txt](NOTICE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudera%2Fcdpcurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudera%2Fcdpcurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudera%2Fcdpcurl/lists"}