@@ -326,13 +326,13 @@ func (f BrowserMonitorFields) APIRequest(config SyntheticsMonitorConfig) interfa
326326 }
327327}
328328
329- type KibanaSyntheticsMonitorAdd func (ctx context.Context , config SyntheticsMonitorConfig , fields MonitorFields , namespace string ) (* SyntheticsMonitor , error )
329+ type KibanaSyntheticsMonitorAdd func (ctx context.Context , config SyntheticsMonitorConfig , fields MonitorFields , space string ) (* SyntheticsMonitor , error )
330330
331- type KibanaSyntheticsMonitorUpdate func (ctx context.Context , id MonitorID , config SyntheticsMonitorConfig , fields MonitorFields , namespace string ) (* SyntheticsMonitor , error )
331+ type KibanaSyntheticsMonitorUpdate func (ctx context.Context , id MonitorID , config SyntheticsMonitorConfig , fields MonitorFields , space string ) (* SyntheticsMonitor , error )
332332
333- type KibanaSyntheticsMonitorGet func (ctx context.Context , id MonitorID , namespace string ) (* SyntheticsMonitor , error )
333+ type KibanaSyntheticsMonitorGet func (ctx context.Context , id MonitorID , space string ) (* SyntheticsMonitor , error )
334334
335- type KibanaSyntheticsMonitorDelete func (ctx context.Context , namespace string , ids ... MonitorID ) ([]MonitorDeleteStatus , error )
335+ type KibanaSyntheticsMonitorDelete func (ctx context.Context , space string , ids ... MonitorID ) ([]MonitorDeleteStatus , error )
336336
337337type KibanaSyntheticsPrivateLocationCreate func (ctx context.Context , pLoc PrivateLocationConfig ) (* PrivateLocation , error )
338338
@@ -390,8 +390,8 @@ func newKibanaSyntheticsPrivateLocationDeleteFunc(c *resty.Client) KibanaSynthet
390390}
391391
392392func newKibanaSyntheticsMonitorGetFunc (c * resty.Client ) KibanaSyntheticsMonitorGet {
393- return func (ctx context.Context , id MonitorID , namespace string ) (* SyntheticsMonitor , error ) {
394- path := basePathWithId (namespace , monitorsSuffix , id )
393+ return func (ctx context.Context , id MonitorID , space string ) (* SyntheticsMonitor , error ) {
394+ path := basePathWithId (space , monitorsSuffix , id )
395395 log .Debugf ("URL to get monitor: %s" , path )
396396
397397 resp , err := c .R ().SetContext (ctx ).Get (path )
@@ -403,8 +403,8 @@ func newKibanaSyntheticsMonitorGetFunc(c *resty.Client) KibanaSyntheticsMonitorG
403403}
404404
405405func newKibanaSyntheticsMonitorDeleteFunc (c * resty.Client ) KibanaSyntheticsMonitorDelete {
406- return func (ctx context.Context , namespace string , ids ... MonitorID ) ([]MonitorDeleteStatus , error ) {
407- path := basePath (namespace , monitorsSuffix )
406+ return func (ctx context.Context , space string , ids ... MonitorID ) ([]MonitorDeleteStatus , error ) {
407+ path := basePath (space , monitorsSuffix )
408408 log .Debugf ("URL to delete monitors: %s" , path )
409409
410410 resp , err := c .R ().SetContext (ctx ).SetBody (map [string ]interface {}{
@@ -420,9 +420,9 @@ func newKibanaSyntheticsMonitorDeleteFunc(c *resty.Client) KibanaSyntheticsMonit
420420}
421421
422422func newKibanaSyntheticsMonitorUpdateFunc (c * resty.Client ) KibanaSyntheticsMonitorUpdate {
423- return func (ctx context.Context , id MonitorID , config SyntheticsMonitorConfig , fields MonitorFields , namespace string ) (* SyntheticsMonitor , error ) {
423+ return func (ctx context.Context , id MonitorID , config SyntheticsMonitorConfig , fields MonitorFields , space string ) (* SyntheticsMonitor , error ) {
424424
425- path := basePathWithId (namespace , monitorsSuffix , id )
425+ path := basePathWithId (space , monitorsSuffix , id )
426426 log .Debugf ("URL to update monitor: %s" , path )
427427 data := fields .APIRequest (config )
428428 resp , err := c .R ().SetContext (ctx ).SetBody (data ).Put (path )
@@ -434,9 +434,9 @@ func newKibanaSyntheticsMonitorUpdateFunc(c *resty.Client) KibanaSyntheticsMonit
434434}
435435
436436func newKibanaSyntheticsMonitorAddFunc (c * resty.Client ) KibanaSyntheticsMonitorAdd {
437- return func (ctx context.Context , config SyntheticsMonitorConfig , fields MonitorFields , namespace string ) (* SyntheticsMonitor , error ) {
437+ return func (ctx context.Context , config SyntheticsMonitorConfig , fields MonitorFields , space string ) (* SyntheticsMonitor , error ) {
438438
439- path := basePath (namespace , monitorsSuffix )
439+ path := basePath (space , monitorsSuffix )
440440 log .Debugf ("URL to create monitor: %s" , path )
441441 data := fields .APIRequest (config )
442442 resp , err := c .R ().SetContext (ctx ).SetBody (data ).Post (path )
@@ -510,18 +510,18 @@ func handleKibanaError(err error, resp *resty.Response) error {
510510 return nil
511511}
512512
513- func basePathWithId (namespace , suffix string , id any ) string {
514- return fmt .Sprintf ("%s/%s" , basePath (namespace , suffix ), id )
513+ func basePathWithId (space , suffix string , id any ) string {
514+ return fmt .Sprintf ("%s/%s" , basePath (space , suffix ), id )
515515}
516516
517- func basePath (namespace , suffix string ) string {
518- return namespaceBasesPath ( namespace , basePathKibanaSynthetics , suffix )
517+ func basePath (space , suffix string ) string {
518+ return spaceBasesPath ( space , basePathKibanaSynthetics , suffix )
519519}
520520
521- func namespaceBasesPath ( namespace , basePath , suffix string ) string {
522- if namespace == "" || namespace == "default" {
521+ func spaceBasesPath ( space , basePath , suffix string ) string {
522+ if space == "" || space == "default" {
523523 return fmt .Sprintf ("%s%s" , basePath , suffix )
524524 }
525525
526- return fmt .Sprintf ("/s/%s%s%s" , namespace , basePath , suffix )
526+ return fmt .Sprintf ("/s/%s%s%s" , space , basePath , suffix )
527527}
0 commit comments