Skip to content

Commit 49808de

Browse files
authored
feat(synthetics): add synthetics http monitor and private location API support to go-kibana-rest (#692)
1 parent 2c84cb0 commit 49808de

File tree

8 files changed

+638
-6
lines changed

8 files changed

+638
-6
lines changed

libs/go-kibana-rest/docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2.3'
22
services:
33
elasticsearch:
4-
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.1
4+
image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
55
environment:
66
cluster.name: test
77
discovery.type: single-node
@@ -12,7 +12,7 @@ services:
1212
ports:
1313
- "9200:9200/tcp"
1414
set-kibana-password:
15-
image: docker.elastic.co/kibana/kibana:8.14.1
15+
image: docker.elastic.co/kibana/kibana:8.14.3
1616
restart: on-failure
1717
links:
1818
- elasticsearch
@@ -23,12 +23,14 @@ services:
2323
elasticsearch:
2424
condition: service_started
2525
kibana:
26-
image: docker.elastic.co/kibana/kibana:8.14.1
26+
image: docker.elastic.co/kibana/kibana:8.14.3
2727
environment:
2828
ELASTICSEARCH_HOSTS: http://es:9200
2929
ELASTICSEARCH_USERNAME: kibana_system
3030
ELASTICSEARCH_PASSWORD: changeme
31+
xpack.security.http.ssl.enabled: false
3132
xpack.license.self_generated.type: trial
33+
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: min-32-byte-long-strong-encryption-key
3234
links:
3335
- elasticsearch:es
3436
ports:

libs/go-kibana-rest/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.19
44

55
require (
66
github.com/go-resty/resty/v2 v2.7.0
7+
github.com/google/uuid v1.6.0
78
github.com/sirupsen/logrus v1.9.0
89
github.com/stretchr/testify v1.8.1
910
github.com/x-cray/logrus-prefixed-formatter v0.5.2

libs/go-kibana-rest/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
1818
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
1919
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
2020
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
21+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
22+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
2123
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
2224
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
2325
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=

libs/go-kibana-rest/kbapi/api._.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type API struct {
1313
KibanaStatus *KibanaStatusAPI
1414
KibanaLogstashPipeline *KibanaLogstashPipelineAPI
1515
KibanaShortenURL *KibanaShortenURLAPI
16+
KibanaSynthetics *KibanaSyntheticsAPI
1617
}
1718

1819
// KibanaSpacesAPI handle the spaces API
@@ -68,6 +69,11 @@ type KibanaShortenURLAPI struct {
6869
Create KibanaShortenURLCreate
6970
}
7071

72+
type KibanaSyntheticsAPI struct {
73+
Monitor *KibanaSyntheticsMonitorAPI
74+
PrivateLocation *KibanaSyntheticsPrivateLocationAPI
75+
}
76+
7177
// New initialise the API implementation
7278
func New(c *resty.Client) *API {
7379
return &API{
@@ -110,5 +116,18 @@ func New(c *resty.Client) *API {
110116
KibanaShortenURL: &KibanaShortenURLAPI{
111117
Create: newKibanaShortenURLCreateFunc(c),
112118
},
119+
KibanaSynthetics: &KibanaSyntheticsAPI{
120+
Monitor: &KibanaSyntheticsMonitorAPI{
121+
Add: newKibanaSyntheticsMonitorAddFunc(c),
122+
Delete: newKibanaSyntheticsMonitorDeleteFunc(c),
123+
Get: newKibanaSyntheticsMonitorGetFunc(c),
124+
Update: newKibanaSyntheticsMonitorUpdateFunc(c),
125+
},
126+
PrivateLocation: &KibanaSyntheticsPrivateLocationAPI{
127+
Create: newKibanaSyntheticsPrivateLocationCreateFunc(c),
128+
Delete: newKibanaSyntheticsPrivateLocationDeleteFunc(c),
129+
Get: newKibanaSyntheticsPrivateLocationGetFunc(c),
130+
},
131+
},
113132
}
114133
}

libs/go-kibana-rest/kbapi/api.kibana_spaces_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (s *KBAPITestSuite) TestKibanaSpaces() {
4242
Objects: []KibanaSpaceObjectParameter{
4343
{
4444
Type: "config",
45-
ID: "8.14.1",
45+
ID: "8.14.3",
4646
},
4747
},
4848
}

0 commit comments

Comments
 (0)