netgate-sysctl API (19.05)

This YANG module provides a Netgate-defined data-model for Linux Kernel sysctl parameters.

Copyright 2018-2019 Rubicon Communications, LLC.

sysctl-config

returns netgate.sysctl.SysctlConfig

get /data/netgate-sysctl:sysctl-config

Example URL

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

Linux kernel sysctl parameters.

Responses

200

netgate.sysctl.SysctlConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-sysctl:sysctl-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

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

creates netgate.sysctl.SysctlConfig

post /data/netgate-sysctl:sysctl-config

Example URL

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

Linux kernel sysctl parameters.

Request Body schema: application/yang-data+json

netgate.sysctl.SysctlConfig to be added to list

kernel
object (netgate.sysctl.sysctlconfig.Kernel)
vm
object (netgate.sysctl.sysctlconfig.Vm)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "kernel":
    {
    },
  • "vm":
    {
    }
}

creates or updates netgate.sysctl.SysctlConfig

put /data/netgate-sysctl:sysctl-config

Example URL

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

Linux kernel sysctl parameters.

Request Body schema: application/yang-data+json

netgate.sysctl.SysctlConfig to be added or updated

netgate-sysctl:sysctl-config
object (netgate.sysctl.SysctlConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.sysctl.SysctlConfig

delete /data/netgate-sysctl:sysctl-config

Example URL

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

Linux kernel sysctl parameters.

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-sysctl:sysctl-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.sysctl.sysctlconfig.Kernel

get /data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Kernel sysctl parameters.

Responses

200

netgate.sysctl.sysctlconfig.Kernel

400

Internal error

Request samples

Copy
package main

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

func main() {

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

	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

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:kernel":
    {
    }
}

creates netgate.sysctl.sysctlconfig.Kernel

post /data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Kernel sysctl parameters.

Request Body schema: application/yang-data+json

netgate.sysctl.sysctlconfig.Kernel to be added to list

shmmax
integer <int32>

Shared memory maximum.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "shmmax": 0
}

creates or updates netgate.sysctl.sysctlconfig.Kernel

put /data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Kernel sysctl parameters.

Request Body schema: application/yang-data+json

netgate.sysctl.sysctlconfig.Kernel to be added or updated

netgate-sysctl:kernel
object (netgate.sysctl.sysctlconfig.Kernel)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:kernel":
    {
    }
}

removes netgate.sysctl.sysctlconfig.Kernel

delete /data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:kernel

Kernel sysctl parameters.

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-sysctl:sysctl-config/netgate-sysctl:kernel"

	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.sysctl.sysctlconfig.Vm

get /data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

VM sysctl parameters.

Responses

200

netgate.sysctl.sysctlconfig.Vm

400

Internal error

Request samples

Copy
package main

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

func main() {

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

	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

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:vm":
    {
    }
}

creates netgate.sysctl.sysctlconfig.Vm

post /data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

VM sysctl parameters.

Request Body schema: application/yang-data+json

netgate.sysctl.sysctlconfig.Vm to be added to list

max_map_count
integer <int32>

Maximum map count.

nr_hugepages
integer <int32>

Number of hugepages.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "max_map_count": 0,
  • "nr_hugepages": 0
}

creates or updates netgate.sysctl.sysctlconfig.Vm

put /data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

VM sysctl parameters.

Request Body schema: application/yang-data+json

netgate.sysctl.sysctlconfig.Vm to be added or updated

netgate-sysctl:vm
object (netgate.sysctl.sysctlconfig.Vm)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:vm":
    {
    }
}

removes netgate.sysctl.sysctlconfig.Vm

delete /data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-config/netgate-sysctl:vm

VM sysctl parameters.

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-sysctl:sysctl-config/netgate-sysctl:vm"

	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))

}

sysctl-state

returns netgate.sysctl.SysctlState

get /data/netgate-sysctl:sysctl-state

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-state

Linux kernel sysctl parameters.

Responses

200

netgate.sysctl.SysctlState

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-sysctl:sysctl-state"

	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

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:sysctl-state":
    {
    }
}

returns netgate.sysctl.sysctlstate.Kernel

get /data/netgate-sysctl:sysctl-state/netgate-sysctl:kernel

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-state/netgate-sysctl:kernel

Kernel sysctl parameters.

Responses

200

netgate.sysctl.sysctlstate.Kernel

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-sysctl:sysctl-state/netgate-sysctl:kernel"

	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

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:kernel":
    {
    }
}

returns netgate.sysctl.sysctlstate.Vm

get /data/netgate-sysctl:sysctl-state/netgate-sysctl:vm

Example URL

https://hostname/restconf/data/netgate-sysctl:sysctl-state/netgate-sysctl:vm

VM sysctl parameters.

Responses

200

netgate.sysctl.sysctlstate.Vm

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/netgate-sysctl:sysctl-state/netgate-sysctl:vm"

	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

application/yang-data+json
Copy
Expand all Collapse all
{
  • "netgate-sysctl:vm":
    {
    }
}