netgate-http API (19.02)

This YANG module provides a data-model for the HTTP daemon.

Copyright 2018-2019 Rubicon Communications, LLC.

http-config

returns netgate.http.HttpConfig

get /data/netgate-http:http-config

Example URL

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

HTTP daemon configuration.

Responses

200

netgate.http.HttpConfig

400

Internal error

Request samples

Copy
package main

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

func main() {

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

creates netgate.http.HttpConfig

post /data/netgate-http:http-config

Example URL

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

HTTP daemon configuration.

Request Body schema: application/yang-data+json

netgate.http.HttpConfig to be added to list

restconf
object (netgate.http.httpconfig.Restconf)
encryption
object (netgate.http.httpconfig.Encryption)
authentication
object (netgate.http.httpconfig.Authentication)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "restconf":
    {
    },
  • "encryption":
    {
    },
  • "authentication":
    {
    }
}

creates or updates netgate.http.HttpConfig

put /data/netgate-http:http-config

Example URL

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

HTTP daemon configuration.

Request Body schema: application/yang-data+json

netgate.http.HttpConfig to be added or updated

netgate-http:http-config
object (netgate.http.HttpConfig)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.http.HttpConfig

delete /data/netgate-http:http-config

Example URL

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

HTTP daemon configuration.

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-http:http-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.http.httpconfig.Authentication

get /data/netgate-http:http-config/netgate-http:authentication

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:authentication

Authentication configuration.

Responses

200

netgate.http.httpconfig.Authentication

400

Internal error

Request samples

Copy
package main

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

func main() {

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

	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-http:authentication":
    {
    }
}

creates netgate.http.httpconfig.Authentication

post /data/netgate-http:http-config/netgate-http:authentication

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:authentication

Authentication configuration.

Request Body schema: application/yang-data+json

netgate.http.httpconfig.Authentication to be added to list

auth-type
string (netgate.http.HttpAuthType)
Enum: "client-certificate" "password" "none"
client-cert-ca
string

Client certificate.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "auth-type": "client-certificate",
  • "client-cert-ca": "string"
}

creates or updates netgate.http.httpconfig.Authentication

put /data/netgate-http:http-config/netgate-http:authentication

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:authentication

Authentication configuration.

Request Body schema: application/yang-data+json

netgate.http.httpconfig.Authentication to be added or updated

netgate-http:authentication
object (netgate.http.httpconfig.Authentication)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.http.httpconfig.Authentication

delete /data/netgate-http:http-config/netgate-http:authentication

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:authentication

Authentication configuration.

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-http:http-config/netgate-http:authentication"

	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.http.httpconfig.Encryption

get /data/netgate-http:http-config/netgate-http:encryption

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:encryption

Encryption.

Responses

200

netgate.http.httpconfig.Encryption

400

Internal error

Request samples

Copy
package main

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

func main() {

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

	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-http:encryption":
    {
    }
}

creates netgate.http.httpconfig.Encryption

post /data/netgate-http:http-config/netgate-http:encryption

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:encryption

Encryption.

Request Body schema: application/yang-data+json

netgate.http.httpconfig.Encryption to be added to list

server-certificate
string

Server certificate.

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "server-certificate": "string"
}

creates or updates netgate.http.httpconfig.Encryption

put /data/netgate-http:http-config/netgate-http:encryption

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:encryption

Encryption.

Request Body schema: application/yang-data+json

netgate.http.httpconfig.Encryption to be added or updated

netgate-http:encryption
object (netgate.http.httpconfig.Encryption)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.http.httpconfig.Encryption

delete /data/netgate-http:http-config/netgate-http:encryption

Example URL

https://hostname/restconf/data/netgate-http:http-config/netgate-http:encryption

Encryption.

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-http:http-config/netgate-http:encryption"

	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.http.httpconfig.Restconf

get /data/netgate-http:http-config/netgate-http:restconf

Example URL

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

RESTconf configuration values.

Responses

200

netgate.http.httpconfig.Restconf

400

Internal error

Request samples

Copy
package main

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

func main() {

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

	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-http:restconf":
    {
    }
}

creates netgate.http.httpconfig.Restconf

post /data/netgate-http:http-config/netgate-http:restconf

Example URL

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

RESTconf configuration values.

Request Body schema: application/yang-data+json

netgate.http.httpconfig.Restconf to be added to list

enable
boolean

If true, RESTconf is enabled.

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.http.httpconfig.Restconf

put /data/netgate-http:http-config/netgate-http:restconf

Example URL

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

RESTconf configuration values.

Request Body schema: application/yang-data+json

netgate.http.httpconfig.Restconf to be added or updated

netgate-http:restconf
object (netgate.http.httpconfig.Restconf)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes netgate.http.httpconfig.Restconf

delete /data/netgate-http:http-config/netgate-http:restconf

Example URL

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

RESTconf configuration values.

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-http:http-config/netgate-http:restconf"

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

}

http-state

returns netgate.http.HttpState

get /data/netgate-http:http-state

Example URL

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

HTTP daemon configuration.

Responses

200

netgate.http.HttpState

400

Internal error

Request samples

Copy
package main

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

func main() {

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

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

returns netgate.http.httpstate.Authentication

get /data/netgate-http:http-state/netgate-http:authentication

Example URL

https://hostname/restconf/data/netgate-http:http-state/netgate-http:authentication

Authentication configuration.

Responses

200

netgate.http.httpstate.Authentication

400

Internal error

Request samples

Copy
package main

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

func main() {

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

	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-http:authentication":
    {
    }