Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
245cd69
feat(): adding new features.
scshitole Nov 13, 2017
9475299
created gtm.go for GTM
scshitole Nov 17, 2017
0612c2b
change gtm.go
scshitole Nov 17, 2017
bad084c
Correct Travis build
gliptak Nov 19, 2017
a65cdad
Correct GetInternalDataGroupRecords processing
gliptak Nov 19, 2017
41ed224
Merge pull request #2 from gliptak/datagroup1
scshitole Nov 19, 2017
b2ec507
Merge pull request #1 from gliptak/json1
scshitole Nov 22, 2017
f168e62
Correct spelling
gliptak Nov 27, 2017
65f5ed5
Correct spelling
gliptak Nov 27, 2017
89198e5
Merge pull request #4 from gliptak/patch-2
scshitole Nov 27, 2017
395e97c
Merge pull request #3 from gliptak/patch-1
scshitole Nov 27, 2017
5883d3a
updated gtm
scshitole Dec 9, 2017
6a067fa
gtm
scshitole Dec 9, 2017
940ff9a
Add new types and associated functions to manage
zlesnr Nov 14, 2017
96d2949
Improve monitor management using monitorType Fixes #39
zlesnr Nov 14, 2017
ea7ea2a
Add description field for VirtualServer struct
zlesnr Nov 14, 2017
442e23d
Update test for CreateMonitor call
zlesnr Nov 14, 2017
e5c0cbe
Add database monitor fields
zlesnr Dec 1, 2017
65c6363
Passing tests
zlesnr Dec 14, 2017
d7fcba7
Merge pull request #5 from zlesnr/f5improvements
scshitole Dec 21, 2017
034b9e5
added support for persistence profiles and their use in virtual servers
lampwins Feb 9, 2018
a28bc07
Merge pull request #6 from lampwins/feature/persist-profiles
scshitole Feb 9, 2018
2fe7b24
updated the files with vendor changes
scshitole Apr 6, 2018
5b70844
removed duplicate funcs
scshitole Apr 6, 2018
9d7f5e5
removed duplicate funcs
scshitole Apr 6, 2018
f74fc32
removed duplicate funcs
scshitole Apr 6, 2018
9523546
removed duplicate funcs
scshitole Apr 6, 2018
519fd8f
Revert "updated the files with vendor changes"
scshitole Apr 6, 2018
8792a6c
device.go same as vendor
scshitole Apr 6, 2018
87383e7
gtm.go same as vendor
scshitole Apr 6, 2018
52b9408
net.go same as vendor
scshitole Apr 6, 2018
c797aa2
net.go same as vendor
scshitole Apr 6, 2018
907a0eb
net.go same as vendor
scshitole Apr 6, 2018
2f05dc7
sys.go same as vendor
scshitole Apr 6, 2018
c4a6191
ltm.go changes
scshitole Apr 6, 2018
ed58d34
ltm.go changes
scshitole Apr 6, 2018
87a70a8
ltm.go changes
scshitole Apr 6, 2018
62236ad
ltm.go changes
scshitole Apr 6, 2018
12ed569
removed ltm_test needs changes
scshitole Apr 7, 2018
720e297
removed comments
scshitole Apr 7, 2018
d2055da
added application.go for iapp
scshitole Apr 7, 2018
282b1ee
added getroute
scshitole Apr 7, 2018
a05e9e3
added profiles struct & funcs
scshitole Apr 10, 2018
93aaa86
The bigip REST API returns a json document for node where the shape
Apr 21, 2018
0ba1f90
Merge pull request #7 from jaloren/bugfix/node-json-encoding
scshitole May 8, 2018
c9a1be2
start using dep for vendoring
May 23, 2018
bee34fd
changes requested in f5devcentral/terraform-provider-bigip#86
May 23, 2018
f965982
Merge pull request #8 from tkellen/support-terraform-provider-bigip-p…
scshitole May 23, 2018
97b238b
Add ~Common~ only when partition name not provided
May 25, 2018
a489c06
Missing import
May 25, 2018
6e8bdf1
Merge pull request #9 from dannyk81/fix_getroute
scshitole Jun 15, 2018
6b592e5
new license resource
Jun 15, 2018
516d847
updated sys.go
Jun 15, 2018
c5fdfcd
Add support for data group resource
Jul 6, 2018
9afdd6b
small typo
Jul 6, 2018
bab44b7
Merge pull request #10 from dannyk81/datagroups
scshitole Jul 9, 2018
d54c551
Revert "Add support for data group resource"
scshitole Jul 9, 2018
94b552d
Merge pull request #11 from f5devcentral/revert-10-datagroups
scshitole Jul 10, 2018
c7511d7
Revert "Revert "Add support for data group resource""
scshitole Jul 10, 2018
cdf3083
Merge pull request #12 from f5devcentral/revert-11-revert-10-datagroups
scshitole Jul 10, 2018
52adf0a
removed vlans_disabled for ltm
Aug 28, 2018
8496344
fix monitor type of gateway
Sep 4, 2018
4f20091
Adds GetVirtualAddress method for ltm BigIP
magliok-wwt Sep 10, 2018
0a3ea95
Merge pull request #1 from wwt/get-virtual-address
kenmaglio Sep 10, 2018
b146654
Adds a new node method on BIG-IP to accept via a node ppec
magliok-wwt Sep 10, 2018
0639470
Fix datagroup DTO to properly transfer records attribute
Sep 17, 2018
6c772df
Merge pull request #14 from xiaopengzhang/master
scshitole Sep 18, 2018
95b899a
Merge pull request #16 from wwt/add-node-method
scshitole Sep 18, 2018
ac2f730
Merge pull request #17 from dannyk81/fix_datagroup_dto
scshitole Sep 18, 2018
7141bf0
Adding GetVlanInterfaces method
Sep 27, 2018
06e040b
Add SelfIP and Vlan methods
Sep 27, 2018
8c9df38
typo
Sep 27, 2018
18f2750
one more typo
Sep 27, 2018
165cdfa
Merge pull request #18 from dannyk81/vlan_interfaces
scshitole Sep 27, 2018
16738c8
added interval for node fqdn issue #9
Oct 12, 2018
b06cf17
added feilds for address_family, downinterval etc
Oct 25, 2018
914aba6
update sys with log destination & publisher func
Nov 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
*.iml
*.back
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
language: go

go:
- 1.7
- 1.8
- 1.9
- tip
matrix:
include:
- go: 1.8
- go: 1.9
- go: tip
allow_failures:
- go: tip
31 changes: 31 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


[[constraint]]
name = "github.com/stretchr/testify"
version = "1.2.1"

[prune]
go-tests = true
unused-packages = true
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## go-bigip
[![GoDoc](https://godoc.org/github.com/scottdware/go-bigip?status.svg)](https://godoc.org/github.com/scottdware/go-bigip) [![Travis-CI](https://travis-ci.org/scottdware/go-bigip.svg?branch=master)](https://travis-ci.org/scottdware/go-bigip)
[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/scottdware/go-bigip/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/f5devcentral/go-bigip?status.svg)](https://godoc.org/github.com/f5devcentral/go-bigip) [![Travis-CI](https://travis-ci.org/f5devcentral/go-bigip.svg?branch=master)](https://travis-ci.org/f5devcentral/go-bigip)
[![Go Report Card](https://goreportcard.com/badge/github.com/f5devcentral/go-bigip)](https://goreportcard.com/report/github.com/f5devcentral/go-bigip)
[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/f5devcentral/go-bigip/master/LICENSE)

A Go package that interacts with F5 BIG-IP systems using the REST API.

Expand All @@ -24,6 +25,6 @@ A very special thanks to the following who have helped contribute to this softwa
* [Adam Burnett](https://github.com/aburnett)
* [Michael D. Ivey](https://github.com/ivey)

[godoc-go-bigip]: http://godoc.org/github.com/scottdware/go-bigip
[license]: https://github.com/scottdware/go-bigip/blob/master/LICENSE
[godoc-go-bigip]: http://godoc.org/github.com/f5devcentral/go-bigip
[license]: https://github.com/f5devcentral/go-bigip/blob/master/LICENSE
[blog]: http://sdubs.org/go-big-ip-or-go-home/
107 changes: 107 additions & 0 deletions application.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package bigip

import (
//"encoding/json"
"fmt"
"log"
"strings"
)

// LIC contains device license for BIG-IP system.

type Iapps struct {
Iapps []Iapp `json:"items"`
}

type Iapp struct {
Name string `json:"name,omitempty"`
Partition string `json:"partition,omitempty"`
Description string `json:"description,omitempty"`
DeviceGroup string `json:"deviceGroup,omitempty"`
ExecuteAction string `json:"execute-action,omitempty"`
InheritedDevicegroup string `json:"inheritedDevicegroup,omitempty"`
InheritedTrafficGroup string `json:"inheritedTrafficGroup,omitempty"`
StrictUpdates string `json:"strictUpdates,omitempty"`
Template string `json:"template,omitempty"`
TemplateModified string `json:"templateModified,omitempty"`
TemplatePrerequisiteErrors string `json:"templatePrerequisiteErrors,omitempty"`
TrafficGroup string `json:"trafficGroup,omitempty"`
Jsonfile string `json:"apiAnonymous,omitempty"`
Tables []struct {
ColumnNames []string `json:"columnNames"`
Name string `json:"name"`
Rows []struct {
Row []string `json:"row"`
} `json:"rows"`
} `json:"tables,omitempty"`

Lists []struct {
Name string `json:"name"`
Encrypted string `json:"encrypted"`
Value []string `json:"value"`
} `json:"lists,omitempty"`

Variables []struct {
Encrypted string `json:"encrypted"`
Name string `json:"name"`
Value string `json:"value"`
} `json:"variables,omitempty"`

Metadata []struct {
Persist string `json:"persist"`
Value string `json:"value"`
} `json:"metadata,omitempty"`
}

const (
uriApp = "application"
uriService = "service"
uriSysa = "sys"
)

func (b *BigIP) CreateIapp(p *Iapp) error {
return b.post(p, uriSysa, uriApp, uriService)
}

func (b *BigIP) UpdateIapp(name string, p *Iapp) error {

values := []string{}
values = append(values, "~Common~")
values = append(values, name)
values = append(values, ".app~")
values = append(values, name)
// Join three strings into one.
result := strings.Join(values, "")
fmt.Println(result)
return b.patch(p, uriSysa, uriApp, uriService, result)
}

func (b *BigIP) Iapp(name string) (*Iapp, error) {
var iapp Iapp
log.Println(" Value of iapp before read ", &iapp)
values := []string{}
values = append(values, "~Common~")
values = append(values, name)
values = append(values, ".app~")
values = append(values, name)
// Join three strings into one.
result := strings.Join(values, "")
err, _ := b.getForEntity(&iapp, uriSysa, uriApp, uriService, result)
log.Println(" I am here in sdk with ", err)
if err != nil {
return nil, err
}
log.Println(" Value of iapp after reading ", &iapp)
return &iapp, nil
}

func (b *BigIP) DeleteIapp(name string) error {
values := []string{}
values = append(values, "~Common~")
values = append(values, name)
values = append(values, ".app~")
values = append(values, name)
// Join three strings into one.
result := strings.Join(values, "")
return b.delete(uriSys, uriApp, uriService, result)
}
17 changes: 17 additions & 0 deletions bigip.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,23 @@ func (b *BigIP) put(body interface{}, path ...string) error {
return callErr
}

func (b *BigIP) patch(body interface{}, path ...string) error {
marshalJSON, err := jsonMarshal(body)
if err != nil {
return err
}

req := &APIRequest{
Method: "patch",
URL: b.iControlPath(path),
Body: string(marshalJSON),
ContentType: "application/json",
}

_, callErr := b.APICall(req)
return callErr
}

//Get a url and populate an entity. If the entity does not exist (404) then the
//passed entity will be untouched and false will be returned as the second parameter.
//You can use this to distinguish between a missing entity or an actual error.
Expand Down
Loading