netgate-snmp API (21.03)

This YANG module provides a data model for SNMP Services.

Copyright 2019-2020 Rubicon Communications, LLC.

snmp-config

returns netgate.snmp.SnmpConfig

get /data/netgate-snmp:snmp-config

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config

returns netgate.snmp.SnmpConfig

Responses

200

netgate.snmp.SnmpConfig

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-snmp:snmp-config"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-snmp:snmp-config":
    {
    }
}

creates netgate.snmp.SnmpConfig

post /data/netgate-snmp:snmp-config

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config

creates netgate.snmp.SnmpConfig

Request Body schema: application/yang-data+json

netgate.snmp.SnmpConfig to be added to list

dataplane
object (netgate.snmp.snmpconfig.Dataplane)
snmp-access-control
object (netgate.snmp.snmpconfig.SnmpAccessControl)
snmp-enable
boolean
Default: false

Enable the SNMP daemons.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "dataplane":
    {
    },
  • "snmp-access-control":
    {
    },
  • "snmp-enable": false
}

creates or updates netgate.snmp.SnmpConfig

put /data/netgate-snmp:snmp-config

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config

creates or updates netgate.snmp.SnmpConfig

Request Body schema: application/yang-data+json

netgate.snmp.SnmpConfig to be added or updated

netgate-snmp:snmp-config
object (netgate.snmp.SnmpConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-snmp:snmp-config":
    {
    }
}

removes netgate.snmp.SnmpConfig

delete /data/netgate-snmp:snmp-config

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config

removes netgate.snmp.SnmpConfig

Responses

204

Object deleted

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-snmp:snmp-config"

	req, _ := http.NewRequest("DELETE", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

returns netgate.snmp.snmpconfig.Dataplane

get /data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Dataplane-specific parameters of SNMP server.

Responses

200

netgate.snmp.snmpconfig.Dataplane

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:dataplane"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-snmp:dataplane":
    {
    }
}

creates netgate.snmp.snmpconfig.Dataplane

post /data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Dataplane-specific parameters of SNMP server.

Request Body schema: application/yang-data+json

netgate.snmp.snmpconfig.Dataplane to be added to list

enable
boolean

If true, SNMP server is enabled for dataplane interfaces.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "enable": true
}

creates or updates netgate.snmp.snmpconfig.Dataplane

put /data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Dataplane-specific parameters of SNMP server.

Request Body schema: application/yang-data+json

netgate.snmp.snmpconfig.Dataplane to be added or updated

netgate-snmp:dataplane
object (netgate.snmp.snmpconfig.Dataplane)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-snmp:dataplane":
    {
    }
}

removes netgate.snmp.snmpconfig.Dataplane

delete /data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:dataplane

Dataplane-specific parameters of SNMP server.

Responses

204

Object deleted

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:dataplane"

	req, _ := http.NewRequest("DELETE", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

returns netgate.snmp.snmpconfig.SnmpAccessControl

get /data/netgate-snmp:snmp-config/netgate-snmp:snmp-access-control

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:snmp-access-control

returns netgate.snmp.snmpconfig.SnmpAccessControl

Responses

200

netgate.snmp.snmpconfig.SnmpAccessControl

400

Internal error

Request samples

Copy
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "http://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:snmp-access-control"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-snmp:snmp-access-control":
    {
    }
}

creates netgate.snmp.snmpconfig.SnmpAccessControl

post /data/netgate-snmp:snmp-config/netgate-snmp:snmp-access-control

Example URL

https://hostname/restconf/data/netgate-snmp:snmp-config/netgate-snmp:snmp-access-control

creates netgate.snmp.snmpconfig.SnmpAccessControl

Request Body schema: application/yang-data+json

netgate.snmp.snmpconfig.SnmpAccessControl to be added to list

view
Array of objects (netgate.snmp.snmpconfig.snmpaccesscontrol.View)

Defines a subset of the OID tree.

access
Array of objects (netgate.snmp.snmpconfig.snmpaccesscontrol.Access)

Map from group to views.

community-map
Array of objects (netgate.snmp.snmpconfig.snmpaccesscontrol.CommunityMap)

Map community name from SNMP request to security name.

group
Array of objects (netgate.snmp.snmpconfig.snmpaccesscontrol.Group)

Map security name to group.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "view":
    [
    ],
  • "access":
    [
    ],
  • "community-map":
    [
    ],
  • "group":
    [
    ]
}