YaST REST Service Documentation

Copyright © 2009-10 Novell, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled "GNU Free Documentation License".

Network

Only authenticated users are allowed to access the API. Authentication is done by sending a Basic HTTP Authorisation header.

All names aren't allowed to contain spaces, slashes or colons.

Table of Contents

Table of Contents

Overview

This module provides access to network configuration which includes network interfaces, hostname and dns settings, and routes.

PolicyKit Access Rights

The following PolicyKit permissions are defined:

org.opensuse.yast.modules.yapi.network.read

org.opensuse.yast.modules.yapi.network.write

Interfaces

Actually currently it operates on the interface configurations (/etc/sysconfig/network/ifcfg-*)

GET /network/interfaces

Get the list of interfaces.

CURL example: curl -u : -H "Accept: application/xml" http://localhost:4984/network/interfaces

Result: Example

GET /network/interfaces/<id>

Arguments:

Get the details of an interface.

CURL example: curl -u : -H "Accept: application/xml" http://localhost:4984/network/interfaces/eth0

Result: Example

PUT /network/interfaces/<id>

Arguments:

Update an interface configuration.

CURL example: curl -u : -X PUT -H "Accept: application/xml" -H "Content-Type: application/xml" --data @interfaces_eth0_put_request http://localhost:4984/network/interfaces/eth0

Body: interfaces_eth0_put_request

Result: Example

POST /network/interfaces

Create a new custom network interface, e.g vlan

CURL example: curl -u : -X POST -H "Accept: application/xml" -H "Content-Type: application/xml" --data @interfaces_vlan0_post.xml

Body: interfaces_vlan0_post_request

Result: Example

DELETE /network/interfaces/vlan0

Remove existing network interface

CURL example: curl -u : -X DELETE -H "Accept: application/xml"

Result: Example

Hostname

GET /network/hostname

Get the host name and domain.

Result: Example

PUT /network/hostname

Set the host name and domain.

Body: Example

Result: Example

DNS

GET /network/dns

Get the nameservers and DNS search list.

Result: Example

PUT /network/dns

Set the nameservers and DNS search list.

Body: Example

Result: Example

Routes

GET /network/routes

Get the list of configured routes.

Result: Example

GET /network/routes/<id>

Arguments:

Get the details of a route.

Result: Example

PUT /network/routes/<id>

Arguments:

Update a route.

Body: Example

Result: Example