GithubHelp home page GithubHelp logo

fernandoojeda / softlayer-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from softlayer/softlayer-python

0.0 2.0 0.0 12.5 MB

A set of Python libraries that assist in calling the SoftLayer API.

Home Page: http://softlayer.github.io/softlayer-python/

License: MIT License

Makefile 0.39% Python 99.57% DIGITAL Command Language 0.04%

softlayer-python's Introduction

SoftLayer API Python Client

https://travis-ci.org/softlayer/softlayer-python.svg?branch=master https://coveralls.io/repos/github/softlayer/softlayer-python/badge.svg?branch=master

This library provides a simple Python client to interact with SoftLayer's XML-RPC API.

A command-line interface is also included and can be used to manage various SoftLayer products and services.

Documentation

Documentation for the Python client is available at http://softlayer.github.io/softlayer-python/.

Additional API documentation can be found on the SoftLayer Development Network:

Installation

Install via pip:

$ pip install softlayer

Or you can install from source. Download source and run:

$ python setup.py install

Another (safer) method of installation is to use the published snap. Snaps are available for any Linux OS running snapd, the service that runs and manage snaps. Snaps are "auto-updating" packages and will not disrupt the current versions of libraries and software packages on your Linux-based system. To learn more, please visit: https://snapcraft.io/

To install the slcli snap:

$ sudo snap install slcli

The most up-to-date version of this library can be found on the SoftLayer GitHub public repositories at http://github.com/softlayer. For questions regarding the use of this library please post to Stack Overflow at https://stackoverflow.com/ and your posts with “SoftLayer” so our team can easily find your post. To report a bug with this library please create an Issue on github.

InsecurePlatformWarning Notice

This library relies on the requests library to make HTTP requests. On Python versions below Python 2.7.9, requests has started emitting a security warning (InsecurePlatformWarning) due to insecurities with creating SSL connections. To resolve this, upgrade to Python 2.7.9+ or follow the instructions here: http://stackoverflow.com/a/29099439.

Getting Help

Bugs and feature requests about this library should have a GitHub issue opened about them.

Issues with the Softlayer API itself should be addressed by opening a ticket.

Examples

A curated list of examples on how to use this library can be found at softlayer.github.io

Debugging

To get the exact API call that this library makes, you can do the following.

For the CLI, just use the -vvv option. If you are using the REST endpoint, this will print out a curl command that you can use, if using XML, this will print the minimal python code to make the request without the softlayer library.

$ slcli -vvv vs list

If you are using the library directly in python, you can do something like this.

.. code-bock:: python

  import SoftLayer
  import logging

  class invoices():

      def __init__(self):
          self.client = SoftLayer.Client()
          debugger = SoftLayer.DebugTransport(self.client.transport)
          self.client.transport = debugger

      def main(self):
          mask = "mask[id]"
          account = self.client.call('Account', 'getObject', mask=mask);
          print("AccountID: %s" % account['id'])

      def debug(self):
          for call in self.client.transport.get_last_calls():
              print(self.client.transport.print_reproduceable(call))

  if __name__ == "__main__":
      main = example()
      main.main()
      main.debug()



System Requirements

  • Python 2.7, 3.3, 3.4, 3.5, 3.6, or 3.7.
  • A valid SoftLayer API username and key.
  • A connection to SoftLayer's private network is required to use our private network API endpoints.

Python Packages

  • six >= 1.7.0
  • prettytable >= 0.7.0
  • click >= 5, < 7
  • requests >= 2.18.4
  • prompt_toolkit >= 0.53
  • pygments >= 2.0.0
  • urllib3 >= 1.22

Copyright

This software is Copyright (c) 2016-2018 SoftLayer Technologies, Inc.

See the bundled LICENSE file for more information.

softlayer-python's People

Contributors

sudorandom avatar allmightyspiff avatar crackerjackmack avatar underscorephil avatar neetuj avatar briancline avatar acamacho82 avatar camporter avatar fisherma91 avatar sergiocarlosmorales avatar fryxxie avatar anasouma avatar kz6fittycent avatar kwienken avatar atge avatar mikewurtz avatar amol avatar slsthompson avatar rodrabe avatar anjana-rajagopal avatar perfectsine avatar jasonjohnson avatar scottied avatar erick-sapp avatar aparnapatil avatar felixonmars avatar suppandi avatar fmiquiza avatar sghatty avatar dtibarra avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.