Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev branch aug #97

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 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
400a456
added funcs for publisher, logs in sys.go
Nov 6, 2018
91447b7
add contentInclude - Exclude fields to httpcompress struct
Jan 4, 2019
6bc0199
added vlans to snat struct
Jan 5, 2019
90b36a8
ran go fmt & added compatibility field in ltm.go
Jan 14, 2019
400e556
added monitor fields for ftp
Feb 15, 2019
33678a2
updated struct for http profile
Mar 22, 2019
071d11d
as3 sdk file
Apr 2, 2019
a7a1700
Getter for the tmPartition entity
Apr 12, 2019
8eb86d0
Merge pull request #1 from gkalele/gkalele-tmPartition-Getter
Apr 12, 2019
041f608
Merge pull request #20 from gkalele/master
scshitole Apr 12, 2019
f59cf74
Ignore VIM swp files.
Apr 15, 2019
2822822
Update println to concatinate values
Apr 15, 2019
8653982
Add new Tunnel CRUD functions and tests
Apr 15, 2019
10c25a5
Merge pull request #21 from pescetto/add_tunnels
scshitole Apr 16, 2019
62f2a15
Add the GetDevices function
Apr 17, 2019
935ed48
Add the test for GetDevices
Apr 17, 2019
118c248
Add the vxlan CRUD functions
Apr 17, 2019
f78d2d1
Add AddTunnel func
Apr 17, 2019
4adf46d
Add test for AddTunnel func
Apr 17, 2019
172388c
add a function to format the resource_id to ensure partition is encluded
Apr 17, 2019
e843c23
Add tests for Vxlan CRUD functions.
Apr 17, 2019
074a72b
Merge pull request #22 from pescetto/add_get_devices
scshitole Apr 26, 2019
c78c19c
Merge pull request #23 from pescetto/add_vxlan_tunnel_profile_funcs
scshitole Apr 26, 2019
5b5cd20
Remove the duplicated and incorrect ConfigsyncIP attribute
May 1, 2019
90a141f
Merge pull request #24 from pescetto/remove_duplicate_device_attribute
scshitole May 1, 2019
748ca33
create changelog
May 10, 2019
e2c35dc
Merge pull request #25 from f5devcentral/dev-branch-0510
scshitole May 10, 2019
be25569
changes to ltm node
Aug 9, 2019
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea
*.iml
*.back
*.swp
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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## 0.1.1 (Unreleased)

## 0.1.0
- Added app.go
- Added vxlan in net.go
- Added net_test.go
- Updated device.go
- Added device_test.go


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/
168 changes: 168 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
/*
AS3 uses a declarative model, meaning you provide a JSON declaration rather than a set of imperative commands. The declaration represents the configuration which AS3 is responsible for creating on a BIG-IP system. AS3 is well-defined according to the rules of JSON Schema, and declarations validate according to JSON Schema. AS3 accepts declaration updates via REST (push), reference (pull), or CLI (flat file editing).
To read more about As3 check https://clouddocs.f5.com/products/extensions/f5-appsvcs-extension/latest/userguide/ */
package bigip

import (
"log"
)

type Appsvcs struct {
Appsvcs []Appsvc01 `json:"items"`
}
type Appsvc01 struct {
Class string `json:"class"`
Action string `json:"action"`
Persist bool `json:"persist"`
Declaration struct {
Class string `json:"class"`
SchemaVersion string `json:"schemaVersion"`
ID string `json:"id"`
Label string `json:"label"`
Remark string `json:"remark"`
Sample01 struct {
Class string `json:"class"`
DefaultRouteDomain int `json:"defaultRouteDomain"`
Application1 struct {
Class string `json:"class"`
Template string `json:"template"`
ServiceMain struct {
Class string `json:"class"`
VirtualAddresses []string `json:"virtualAddresses"`
Pool string `json:"pool"`
} `json:"serviceMain"`
WebPool struct {
Class string `json:"class"`
Monitors []string `json:"monitors"`
Members []struct {
ServicePort int `json:"servicePort"`
ServerAddresses []string `json:"serverAddresses"`
} `json:"members"`
} `json:"web_pool"`
} `json:"Application_1"`
} `json:"Sample_01,omitempty"`
} `json:"declaration,omitempty"`
}

type Appsvc02 struct {
Class string `json:"class"`
Action string `json:"action"`
Persist bool `json:"persist"`
Declaration struct {
Class string `json:"class"`
SchemaVersion string `json:"schemaVersion"`
ID string `json:"id"`
Label string `json:"label"`
Remark string `json:"remark"`
Sample02 struct {
Class string `json:"class"`
A1 struct {
Class string `json:"class"`
Template string `json:"template"`
ServiceMain struct {
Class string `json:"class"`
VirtualAddresses []string `json:"virtualAddresses"`
Pool string `json:"pool"`
ServerTLS string `json:"serverTLS"`
} `json:"serviceMain"`
WebPool struct {
Class string `json:"class"`
LoadBalancingMode string `json:"loadBalancingMode"`
Monitors []string `json:"monitors"`
Members []struct {
ServicePort int `json:"servicePort"`
ServerAddresses []string `json:"serverAddresses"`
} `json:"members"`
} `json:"web_pool"`
Webtls struct {
Class string `json:"class"`
Certificates []struct {
Certificate string `json:"certificate"`
} `json:"certificates"`
} `json:"webtls"`
Webcert struct {
Class string `json:"class"`
Remark string `json:"remark"`
Certificate string `json:"certificate"`
PrivateKey string `json:"privateKey"`
Passphrase struct {
Ciphertext string `json:"ciphertext"`
Protected string `json:"protected"`
} `json:"passphrase"`
} `json:"webcert"`
} `json:"A1"`
} `json:"Sample_02"`
} `json:"declaration"`
}

const (
uriSha = "shared"
uriAppsvcs = "appsvcs"
uriDecl = "declare"
uriSam01 = "Sample_01"
uriSam02 = "Sample_02"
)

// Appsvcss returns a list of appsvcs
func (b *BigIP) Appsvc01() (*Appsvc01, error) {
var appsvc01 Appsvc01
err, _ := b.getForEntity(uriSam01, uriSha, uriAppsvcs, uriDecl)
log.Printf("i am here in sdk %+v ", appsvc01)
if err != nil {
return nil, err
}

return &appsvc01, nil
}
func (b *BigIP) Appsvc02() (*Appsvc02, error) {
var appsvc02 Appsvc02
err, _ := b.getForEntity(uriSam02, uriSha, uriAppsvcs, uriDecl)
log.Printf("i am here in sdk %+v ", appsvc02)
if err != nil {
return nil, err
}

return &appsvc02, nil
}

// CreateAppsvcs creates a new iAppsvcs on the system.
func (b *BigIP) CreateAppsvc01(p *Appsvc01) error {
log.Printf("++++++ Here is what terraform is sending to bigip ................ : %+v ", p)
err := b.post(p, uriMgmt, uriSha, uriAppsvcs, uriDecl)
if err != nil {
log.Println(" API call not successfull ", err)
}
return nil
}
func (b *BigIP) CreateAppsvc02(p *Appsvc02) error {
log.Printf("++++++ Here is what terraform is sending to bigip ................ : %+v ", p)
err := b.post(p, uriMgmt, uriSha, uriAppsvcs, uriDecl)
if err != nil {
log.Println(" API call not successfull ", err)
}
return nil
}
func (b *BigIP) DeleteAppsvc01() error {
return b.delete(uriMgmt, uriSha, uriAppsvcs, uriDecl, uriSam01)
}
func (b *BigIP) DeleteAppsvc02() error {
return b.delete(uriMgmt, uriSha, uriAppsvcs, uriDecl, uriSam02)
}

func (b *BigIP) ModifyAppsvc01(p *Appsvc01) error {
log.Printf("++++++ Here is what terraform is sending to bigip ................ : %+v ", p)
err := b.patch(p, uriMgmt, uriSha, uriAppsvcs, uriDecl)
log.Println("value of p in modify +++++++++++++++", p)
if err != nil {
log.Println(" API call not successfull ", err)
}
return nil
}
func (b *BigIP) ModifyAppsvc02(p *Appsvc02) error {
log.Printf("++++++ Here is what terraform is sending to bigip ................ : %+v ", p)
err := b.patch(p, uriMgmt, uriSha, uriAppsvcs, uriDecl)
if err != nil {
log.Println(" API call not successfull ", err)
}
return nil
}
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)
}
Loading