Giter Site home page Giter Site logo

icr-php's Introduction

iCR-PHP

PHP Class for managing F5 iControl REST

This includes both a class and a set of standalone functions

  • icr_class.php - iCR class file
  • iCR.php - iCR standalone functions
  • iCR_class_example.txt - example of use of the class
  • iCR_example.txt - example of the use of the standalone functions

Methods:

  • get($url)
  • create($url,$data)
  • modify($url,$data)
  • delete($url)

Class variables:

  • username = "admin"
  • password = "admin"
  • hostname - IP or FQDN of device to connect to
  • timeout = 5 secs
  • code - the response HTTP Status code

Example:

<?php
include("iCR_class.php");
$r = new iCR ("172.24.9.129");

# Try to retrieve a non-existent virtual server
print_r($r->get("/ltm/virtual/iCR_Test_VS"));
echo $r->code;

# Create a new virtual server
$vs = array('name'=>"iCR_Test_VS",'destination'=>'192.168.1.1:80','mask'=>'255.255.255.255','ipProtocol'=>'tcp');
$r->create("/ltm/virtual",$vs);

# Modify a Virtual Server
$description = array('description' => 'This is a modified Virtual Server');
$r->modify("/ltm/virtual/iCR_Test_VS",$description);
echo "Modify HTTP Return Code: $r->code\n";

# Show the created and modified virtual server
print_r($r->get("/ltm/virtual/iCR_Test_VS"));

# Delete the virtual server created above
$r->delete("/ltm/virtual/iCR_Test_VS");
echo "Delete HTTP Return Code: $r->code\n";

# Show that virtual server has been deleted
$r->get("/ltm/virtual/iCR_Test_VS");
echo "Deleted VS Get HTTP Return Code: $r->code\n";

icr-php's People

Contributors

pwhitef5 avatar

Watchers

 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.