{"id":23138256,"url":"https://github.com/softlayer/softlayer-python","last_synced_at":"2025-04-11T23:16:58.262Z","repository":{"id":37502433,"uuid":"622291","full_name":"softlayer/softlayer-python","owner":"softlayer","description":"A set of Python libraries that assist in calling the SoftLayer API.","archived":false,"fork":false,"pushed_at":"2025-03-31T21:39:18.000Z","size":10532,"stargazers_count":150,"open_issues_count":22,"forks_count":192,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-04-11T23:16:50.134Z","etag":null,"topics":["python","softlayer"],"latest_commit_sha":null,"homepage":"http://softlayer.github.io/softlayer-python/","language":"Python","has_issues":true,"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/softlayer.png","metadata":{"files":{"readme":"README-internal.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-04-21T20:36:31.000Z","updated_at":"2025-02-25T21:58:16.000Z","dependencies_parsed_at":"2023-09-22T08:12:11.866Z","dependency_job_id":"39615b2f-66fc-4052-91ea-9608bd12dc2e","html_url":"https://github.com/softlayer/softlayer-python","commit_stats":{"total_commits":3366,"total_committers":130,"mean_commits":"25.892307692307693","dds":0.8057040998217468,"last_synced_commit":"154e5af6e9c72e9d2553d18ebf314e7c06af740f"},"previous_names":["softlayer/softlayer-api-python-client"],"tags_count":97,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsoftlayer-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsoftlayer-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsoftlayer-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softlayer%2Fsoftlayer-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softlayer","download_url":"https://codeload.github.com/softlayer/softlayer-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492885,"owners_count":21113163,"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":["python","softlayer"],"created_at":"2024-12-17T13:10:17.994Z","updated_at":"2025-04-11T23:16:58.243Z","avatar_url":"https://github.com/softlayer.png","language":"Python","readme":"This document is for internal users wanting to use this library to interact with the internal API. It will not work for `api.softlayer.com`.\n\n## SSL: CERTIFICATE_VERIFY_FAILED fix\nYou need to specify the server certificate to verify the connection to the internal API since its a self signed certificate. Python's request module doesn't use the system SSL cert for some reason, so even if you can use `curl` without SSL errors becuase you installed the certificate on your system, you still need to tell python about it. Further reading: \n\t- https://hackernoon.com/solving-the-dreadful-certificate-issues-in-python-requests-module\n\t- https://levelup.gitconnected.com/using-custom-ca-in-python-here-is-the-how-to-for-k8s-implementations-c450451b6019\n\nOn Mac, after installing the softlayer.local certificate, the following worked for me:\n\n```bash\nsecurity export -t certs -f pemseq -k /System/Library/Keychains/SystemRootCertificates.keychain -o bundleCA.pem\nsudo cp bundleCA.pem /etc/ssl/certs/bundleCA.pem\n```\nThen in the `~/.softlayer` config, set `verify = /etc/ssl/certs/bundleCA.pem` and that should work.\nYou may also need to set `REQUESTS_CA_BUNDLE` -\u003e `export REQUESTS_CA_BUNDLE=/etc/ssl/certs/bundleCA.pem` to force python to load your CA bundle\n\n## Certificate Example\n\nFor use with a utility certificate. In your config file (usually `~/.softlayer`), you need to set the following:\n\n```\n[softlayer]\nendpoint_url = https://\u003cinternal api endpoint\u003e/v3/internal/rest/\ntimeout = 0\ntheme = dark\nauth_cert = /etc/ssl/certs/my_utility_cert-dev.pem\nverify = /etc/ssl/certs/allCAbundle.pem\n```\n\n`auth_cert`: is your utility user certificate\n`server_cert`: is the CA certificate bundle to validate the internal API ssl chain. Otherwise you get self-signed ssl errors without this.\n\n\n```python\nimport SoftLayer\nimport logging\nimport click\n\n@click.command()\ndef testAuthentication():\n\tclient = SoftLayer.CertificateClient()\n\tresult = client.call('SoftLayer_Account', 'getObject', id=12345, mask=\"mask[id,companyName]\")\n\tprint(result)\n\n\nif __name__ == \"__main__\":\n\tlogger = logging.getLogger()\n\tlogger.addHandler(logging.StreamHandler())\n\tlogger.setLevel(logging.DEBUG)\n\ttestAuthentication()\n```\n\n## Employee Example\n\nTo login with your employee username, have your config look something like this\n\n*NOTE*: Currently logging in with the rest endpoint doesn't quite work, so use xmlrpc until I fix [this issue](https://github.ibm.com/SoftLayer/internal-softlayer-cli/issues/10)\n\n```\n[softlayer]\nusername = \u003csoftlayer domain username\u003e\nendpoint_url = https://\u003cinternal api endpoint\u003e/v3/internal/xmlrpc/\nverify = /etc/ssl/certs/allCAbundle.pem\n```\n\nYou can login and use the `slcli` with. Use the `-i` flag to make internal API calls, otherwise it will make SLDN api calls.\n\n```bash\nslcli -i emplogin\n```\n\nIf you want to use any of the built in commands, you may need to use the `-a \u003caccountId\u003e` flag.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlayer%2Fsoftlayer-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftlayer%2Fsoftlayer-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftlayer%2Fsoftlayer-python/lists"}