• Stars
    star
    262
  • Rank 155,306 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

f5-common-python

Build Status Documentation Status Slack

NO LONGER UNDER ACTIVE DEVELOPMENT

NOTICE: This project is no longer under active development. F5 may still use internally for other project(s) but is no longer maintaining it publicly.

Introduction

This project implements an SDK for the iControl® REST interface for BIG-IP®. Use this library to use python to automate a BIG-IP® via its REST API.

Documentation

Please see the project documentation on Read the Docs: http://f5-sdk.readthedocs.io.

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 ManagementRoot

# Connect to the BIG-IP
mgmt = ManagementRoot("bigip.example.com", "admin", "somepassword")

# Get a list of all pools on the BigIP and print their name and their
# members' name
pools = mgmt.tm.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 = mgmt.tm.ltm.pools.pool.create(name='mypool', partition='Common')

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

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

Design Patterns

I intend the SDK to be easy to use and easy to hack. These overarching goals have a strong influence on my thinking when I am reviewing contributions, this means it is in their own interest that I make them as explicit as possible!

The original interface specification was given to me by Shawn Wormke, who I believe was influenced by the Jira and Django projects. At the time I was reading Brett Slatkin's 'Effective Python', and I tried to follow its advice where possible.

List of Patterns For Contributing Developers

  1. Hack this list to make it more correct/complete

    For list additions assign @zancas as the PR reviewer.

  2. The call operator () means: "Try to communicate with the device."

    This is a strong contract we offer the consumer of the SDK. If an SDK function is invoked with the call operator () the program is initiating a communication with the device. That communication may fail before reaching the wire, but it has nonetheless been initiated. Conversely, if an SDK user evaluates an SDK expression that DOES NOT invoke the () call operator, then the SDK does NOT initiate a communication with the device. Any extension to the SDK that is not consistent with this contract is unlikely to be incorporated into the supported repository.

  3. The SDK is stupid

    The SDK doesn't decide things for the consumer, it's simply an interface so that Python programs can manipulate device resources without implementing custom URI/HTTP/network logic. Implications:

    1. NO DEFAULTS
      The consumers of this library are themselves Python programs. The Application programmer must say what they mean in their SDK-using program. It violates a critical separation of concerns to add default values to the SDK. Don't do it! (Unless you have a good reason.)
    2. Failures generate exceptions
      If the SDK enters a surprising or unexpected state it raises an exception. That's it. It's not generally up to the SDK to implement decision logic that handles edge-cases.. EXCEPT where the SDK is smoothing known issues in the device REST server. (See below.)
    3. The SDK never interprets responses
      It just records whatever response the device returns as attributes of the relevant object. (Except where handling significant inconsistencies in the device interface.)
  4. public-nonpublic pairs

    e.g. 'create' and '_create' XXX add content here.

  5. Handle known issues in the device REST server.

    The SDK intends to provide a rational interface to consumers that does the right thing. This means that one case where it does NOT simply do the stupid thing is when it handles a known idiosyncrasy in the device REST server. For example, some? resources ignore 'disable' and 'enable' configuration options when they are set to 'False'. Rather than force a consumer to learn about this quirk in the server, the SDK guesses that '"disable": False' means '"enable": True' , and submits that value on the consumers behalf.

  6. Implement-Reimplement-Abstract

    Solve the problem concretely and simply, if the same problem arises again, solve it concretely, then take the two concrete solutions and use them as your specification to generate an abstraction. In the SDK this usually goes something like this:

    1. Add logic to a concrete subclass
    2. Add similar logic to another concrete subclass
    3. Create a new method in a mixin or Abstract 'resource.py' base class and have both concrete subclasses inherit and use that method.

Submodules

bigip

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

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 ./

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.

More Repositories

1

f5-ansible

Imperative Ansible modules for F5 BIG-IP products
Python
359
star
2

k8s-bigip-ctlr

Repository for F5 Container Ingress Services for Kubernetes & OpenShift.
Go
351
star
3

f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
JavaScript
145
star
4

f5-aws-cloudformation

CloudFormation Templates for quickly deploying BIG-IP services in Amazon Web Services EC2
Shell
108
star
5

terraform-provider-bigip

Terraform resources that can configure F5 BIG-IP products
Go
102
star
6

f5-azure-arm-templates

Azure Resource Manager Templates for quickly deploying BIG-IP services in Azure
Shell
85
star
7

f5-declarative-onboarding

F5 BIG-IP Declarative Onboarding
JavaScript
52
star
8

f5-telemetry-streaming

F5 BIG-IP Telemetry Streaming
JavaScript
51
star
9

f5-icontrol-rest-python

Generic python library used by the F5 SDK and other F5 projects to communicate with BIG-IP® via the REST API
Python
34
star
10

f5-ansible-bigip

Declarative Ansible collection for managing F5 BIG-IP/BIG-IQ.
Python
31
star
11

f5-cloud-libs

Node.js libraries to assist in cloud deployments.
JavaScript
30
star
12

bigsuds

Python library for F5 Networks iControl API
Python
30
star
13

f5-google-gdm-templates

Google Deployment Templates for quickly deploying BIG-IP services in Google Cloud Platform
Python
28
star
14

charts

Helm charts for using F5 products and services in Kubernetes and OpenShift environments.
Mustache
28
star
15

quic-lb

An implementation of the QUIC Load Balancing Algorithm, described in https://datatracker.ietf.org/doc/draft-ietf-quic-load-balancers/
C
28
star
16

f5-appsvcs-templates

F5 BIG-IP Application Service Templates (FAST)
JavaScript
27
star
17

f5-openstack-lbaasv2-driver

F5 LBaaSv2 service provider driver for OpenStack Liberty and beyond
Python
21
star
18

terraform-provider-bigip-version0.12

Terraform resources that can configure F5 BIGIP products
Go
18
star
19

f5-azure-arm-templates-v2

Azure Resource Manager Templates for quickly deploying BIG-IP services in Azure
17
star
20

SecondSight

Second Sight - Data Driven Customer Success
Python
15
star
21

f5-cloud-failover-extension

F5 Cloud Failover Extension
JavaScript
15
star
22

f5-openstack-agent

The F5 Agent for OpenStack Neutron allows you to deploy BIG-IP services in an OpenStack environment.
Python
14
star
23

f5-bigip-runtime-init

TypeScript
14
star
24

f5-aws-cloudformation-v2

AWS Cloudformation Templates for quickly deploying BIG-IP services in AWS
11
star
25

terraform-azure-bigip-module

Terraform module for Deploying BIG-IP in azure
HCL
10
star
26

f5-cloud-iapps

iApps specific to BIG-IPs in cloud environments
Shell
10
star
27

terraform-gcp-bigip-module

Terraform module for Deploying BIG-IP in GCP
HCL
9
star
28

f5-openstack-docs

Technical documentation related to the use of F5 products and tools in OpenStack
Shell
9
star
29

terraform-aws-bigip-module

Terraform module for Deploying BIG-IP in AWS
HCL
9
star
30

f5-ipam-controller

The F5 IPAM Controller runs in an orchestration environment like Kubernetes to allocate IP addresses from an IPAM system to BIG-IP Virtual Servers. The purpose is to abstract complexity related to setting up BIG-IP from a networking perspective
Go
9
star
31

f5-openstack-heat

Heat Templates for quickly deploying BIG-IP services in OpenStack
Python
7
star
32

f5-vmware-vcenter-templates

Quickly deploy BIG-IP services in common deployment models in VMware vCenter
JavaScript
7
star
33

f5-openstack-hot

This repository contains OpenStack Heat Orchestration Templates (HOT) that can be used to deploy and/or configure F5® BIG-IP® in an OpenStack cloud.
Shell
7
star
34

f5-openstack-heat-plugins

F5 Networks® OpenStack Heat Plugin Library
Python
7
star
35

f5-ci-docs

Documentation for F5's Container Ingress Services
Batchfile
7
star
36

f5-openstack-lbaasv1

OpenStack Neutron LBaaSv1 plugin and agent to control F5 BIG-IP devices
Python
6
star
37

dynamic-taps

A TAPS implementation with an open interface to accept new transport implementations
C
6
star
38

f5-cloud-libs-azure

Azure specific implementations for f5-cloud-libs
JavaScript
6
star
39

f5-ipam-ctlr

Repository for the F5 IPAM Controller
Go
5
star
40

f5-aci-servicecenter

F5 ACI ServiceCenter
Batchfile
5
star
41

f5-cloud-libs-aws

AWS specific implementations for f5-cloud-libs
JavaScript
5
star
42

apg-iapp

4
star
43

f5-ansible-f5modules

A public facing repository for official releases of f5modules subcollection
Python
4
star
44

f5-azure-stack-arm-templates

Azure Stack Resource Manager Templates for quickly deploying BIG-IP services in Azure
Shell
4
star
45

f5-cloud-libs-gce

Google Compute Engine specific implementations for f5-cloud-libs
JavaScript
4
star
46

f5-google-gdm-templates-v2

Google Deployment Templates for quickly deploying BIG-IP services in Google Cloud Platform
3
star
47

marathon-bigip-ctlr

Repository for F5 BIG-IP Controller for Marathon.
Python
3
star
48

f5-cloud-libs-openstack

OpenStack specific implementations for f5-cloud-libs
JavaScript
2
star
49

terraform-provider-f5os

Go
2
star
50

cf-bigip-ctlr

The F5 BIG-IP Controller for Cloud Foundry makes the F5 BIG-IP Local Traffic Manager services available to applications running in the Cloud Foundry platform.
Go
2
star
51

f5-adcaas-openstack

F5 ADCaaS for OpenStack
Python
2
star
52

f5-nfv-solutions

VNF Manager related plugins, supported blueprints, unsupported blueprints (in an experimental folder) and documentation
Shell
2
star
53

f5networks.github.io

F5s GitHub Landing Page
HTML
2
star
54

f5-openstack-test

F5 Networks® common python modules for OpenStack tests
Python
2
star
55

pytest-symbols

A pytest plugin that adds support for passing test environment symbols into pytest tests.
Python
2
star
56

terraform-provider-bigipnext

Terraform resources that can Manage F5 BIG-IP Next Devices through BIG-Next Central Manager
Go
2
star
57

f5cs-sdk

Go
1
star
58

neutron-lbaas

Clone of the OpenStack project neutron-lbaas
Python
1
star
59

f5-cloud-libs-consul

Consul specific implementations for f5-cloud-libs
JavaScript
1
star
60

pytest_f5sdk

Common pytest fixtures used to test the python f5sdk "f5-common-python", and to test libraries that depend on it.
Python
1
star
61

f5-cloud-workers

REST workers for F5 cloud environments
JavaScript
1
star
62

networking-f5

F5 Networks vendor code for OpenStack Neutron
Python
1
star