Coder Social home page Coder Social logo

jlongstaf / f5-common-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from f5networks/f5-common-python

0.0 2.0 0.0 2.05 MB

Python SDK for configuration and monitoring of F5 BIG-IP devices via the iControl REST API.

Home Page: https://f5-sdk.readthedocs.org

License: Apache License 2.0

Python 100.00%

f5-common-python's Introduction

f5-common-python

Build Status Documentation Status

Introduction

This project implements an SDK for the iControl REST interface for the BIG-IP. Users of this library can create, edit, update, and delete configuration objects on a BIG-IP device.

Submodules

bigip

Python API for configuring objects on a BIG-IP device and gathering information from the device via the REST API.

Installation

$> pip install f5-sdk

NOTE: If you are using a pre-release version you must use the --pre option for the pip command.

Usage

from f5.bigip import BigIP

# Connect to the BigIP
bigip = BigIP("bigip.example.com", "admin", "somepassword")

# Get a list of all pools on the BigIP and print their name and their
# members' name
pools = bigip.ltm.pools.get_collection()
for pool in pools:
    print pool.name
    for member in pool.members_s.get_collection():
        print member.name

# Create a new pool on the BigIP
mypool = bigip.ltm.pools.pool.create(name='mypool', partition='Common')

# Load an existing pool and update its description
pool_a = bigip.ltm.pools.pool.load(name='mypool', partition='Common')
pool_a.description = "New description"
pool_a.update()

# Delete a pool if it exists
if bigip.ltm.pools.pool.exists(name='mypool', partition='Common'):
    pool_b = bigip.ltm.pools.pool.load(name='mypool', partition='Common')
    pool_b.delete()

Documentation

Documentation is hosted on Read the Docs

Filing Issues

See the Issues section of Contributing.

Contributing

See Contributing

Test

Before you open a pull request, your code must have passing pytest unit tests. In addition, you should include a set of functional tests written to use a real BIG-IP device for testing. Information on how to run our set of tests is included below.

Unit Tests

We use pytest for our unit tests.

  1. If you haven't already, install the required test packages listed in requirements.test.txt in your virtual environment.

    $ pip install -r requirements.test.txt
  2. Run the tests and produce a coverage report. The --cov-report=html will create a htmlcov/ directory that you can view in your browser to see the missing lines of code.

    py.test --cov ./icontrol --cov-report=html
    open htmlcov/index.html

Style Checks

We use the hacking module for our style checks (installed as part of step 1 in the Unit Test section).

flake8 ./

Contact

[email protected]

Copyright

Copyright 2014-2016 F5 Networks Inc.

License

Apache V2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Contributor License Agreement

Individuals or business entities who contribute to this project must have completed and submitted the F5 Contributor License Agreement to [email protected] prior to their code submission being included in this project.

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.