clixon-restconf API (23.06)

This YANG module provides a data-model for the Clixon RESTCONF daemon. There is also clixon-config also including some restconf options. The separation is not always logical but there are some reasons for the split:

  1. Some data (ie 'socket') is structurally complex and cannot be expressed as a simple option
  2. clixon-restconf is defined as a macro/grouping and can be included in other YANGs. In particular, it can be used inside a datastore, which is not possible for clixon-config.
  3. Related to (2), options that should not be settable in a datastore should be in clixon-config

Some of this spec if in-lined from ietf-restconf-server@2022-05-24.yang

restconf

returns clixon.restconf.Restconf

get /data/clixon-restconf:restconf

Example URL

https://hostname/restconf/data/clixon-restconf:restconf

This presence is strictly not necessary since the enable flag in clixon-restconf is the flag bearing the actual semantics. However, removing the presence leads to default config in all clixon installations, even those which do not use backend-started restconf. One could see this as mostly cosmetically annoying. Alternative would be to make the inclusion of this yang conditional.

Responses

200

clixon.restconf.Restconf

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/clixon-restconf: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
{
  • "clixon-restconf:restconf-wrapper":
    {
    }
}

creates clixon.restconf.Restconf

post /data/clixon-restconf:restconf

Example URL

https://hostname/restconf/data/clixon-restconf:restconf

This presence is strictly not necessary since the enable flag in clixon-restconf is the flag bearing the actual semantics. However, removing the presence leads to default config in all clixon installations, even those which do not use backend-started restconf. One could see this as mostly cosmetically annoying. Alternative would be to make the inclusion of this yang conditional.

Request Body schema: application/yang-data+json

clixon.restconf.Restconf to be added to list

clixon-restconf:restconf
object (clixon.restconf.Restconf)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates clixon.restconf.Restconf

put /data/clixon-restconf:restconf

Example URL

https://hostname/restconf/data/clixon-restconf:restconf

This presence is strictly not necessary since the enable flag in clixon-restconf is the flag bearing the actual semantics. However, removing the presence leads to default config in all clixon installations, even those which do not use backend-started restconf. One could see this as mostly cosmetically annoying. Alternative would be to make the inclusion of this yang conditional.

Request Body schema: application/yang-data+json

clixon.restconf.Restconf to be added or updated

clixon-restconf:restconf-wrapper
object (clixon.restconf.RestconfWrapper)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

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

removes clixon.restconf.Restconf

delete /data/clixon-restconf:restconf

Example URL

https://hostname/restconf/data/clixon-restconf:restconf

This presence is strictly not necessary since the enable flag in clixon-restconf is the flag bearing the actual semantics. However, removing the presence leads to default config in all clixon installations, even those which do not use backend-started restconf. One could see this as mostly cosmetically annoying. Alternative would be to make the inclusion of this yang conditional.

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/clixon-restconf: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))

}

creates clixon.restconf.clixonrestconf.Socket

post /data/clixon-restconf:restconf/socket

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket

List of server sockets that the restconf daemon listens to. Not fcgi

Request Body schema: application/yang-data+json

clixon.restconf.clixonrestconf.Socket to be added to list

socket
object (clixon.restconf.clixonrestconf.Socket)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

returns clixon.restconf.clixonrestconf.Socket

get /data/clixon-restconf:restconf/socket={namespace},{address},{port}

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}

List of server sockets that the restconf daemon listens to. Not fcgi

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

Responses

200

clixon.restconf.clixonrestconf.Socket

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/clixon-restconf:restconf/socket=%7Bnamespace%7D,%7Baddress%7D,%7Bport%7D"

	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
{
  • "clixon-restconf:socket-wrapper":
    {
    }
}

creates or updates clixon.restconf.clixonrestconf.Socket

put /data/clixon-restconf:restconf/socket={namespace},{address},{port}

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}

List of server sockets that the restconf daemon listens to. Not fcgi

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

Request Body schema: application/yang-data+json

clixon.restconf.clixonrestconf.Socket to be added or updated

clixon-restconf:socket-wrapper
object (clixon.restconf.clixonrestconf.SocketWrapper)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "clixon-restconf:socket-wrapper":
    {
    }
}

removes clixon.restconf.clixonrestconf.Socket

delete /data/clixon-restconf:restconf/socket={namespace},{address},{port}

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}

List of server sockets that the restconf daemon listens to. Not fcgi

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

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/clixon-restconf:restconf/socket=%7Bnamespace%7D,%7Baddress%7D,%7Bport%7D"

	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 clixon.restconf.clixonrestconf.socket.CallHome

get /data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

See RFC 8071 NETCONF Call Home and RESTCONF Call Home

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

Responses

200

clixon.restconf.clixonrestconf.socket.CallHome

400

Internal error

Request samples

Copy
package main

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

func main() {

	url := "http://hostname/restconf/data/clixon-restconf:restconf/socket=%7Bnamespace%7D,%7Baddress%7D,%7Bport%7D/call-home"

	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
{
  • "clixon-restconf:call-home-wrapper":
    {
    }
}

creates clixon.restconf.clixonrestconf.socket.CallHome

post /data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

See RFC 8071 NETCONF Call Home and RESTCONF Call Home

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

Request Body schema: application/yang-data+json

clixon.restconf.clixonrestconf.socket.CallHome to be added to list

call-home
object (clixon.restconf.clixonrestconf.socket.CallHome)

Responses

201

Object created

400

Internal error

409

Object already exists

Request samples

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

creates or updates clixon.restconf.clixonrestconf.socket.CallHome

put /data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

See RFC 8071 NETCONF Call Home and RESTCONF Call Home

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

Request Body schema: application/yang-data+json

clixon.restconf.clixonrestconf.socket.CallHome to be added or updated

clixon-restconf:call-home-wrapper
object (clixon.restconf.clixonrestconf.socket.CallHomeWrapper)

Responses

201

Object created

204

Object modified

400

Internal error

Request samples

Content type
application/yang-data+json
Copy
Expand all Collapse all
{
  • "clixon-restconf:call-home-wrapper":
    {
    }
}

removes clixon.restconf.clixonrestconf.socket.CallHome

delete /data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

Example URL

https://hostname/restconf/data/clixon-restconf:restconf/socket={namespace},{address},{port}/call-home

See RFC 8071 NETCONF Call Home and RESTCONF Call Home

path Parameters
namespace
required
string

Id of socket

address
required
string

Id of socket

port
required
integer <int32>

Id of socket

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/clixon-restconf:restconf/socket=%7Bnamespace%7D,%7Baddress%7D,%7Bport%7D/call-home"

	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