WebYaST REST API Documentation

Copyright © 2013 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".

Software Management

Only authenticated users are allowed to access the API. Authentication is done by sending a Basic HTTP Authorisation header, authentication cookie or using token authentication.

Table of Contents

Formats

The software REST service supports only XML and JSON input/output formats.

Overview

This module provides functionality to install software updates and manage software repositories.

PolicyKit Access Rights

The following PolicyKit permissions are needed to perform the actions:

org.opensuse.yast.modules.yapi.patches.read

org.opensuse.yast.modules.yapi.patches.install

org.opensuse.yast.modules.yapi.repositories.read

org.opensuse.yast.modules.yapi.repositories.write

Patch Updates Actions

GET /patches

Return all available and recently installed patches (the status is set in "installed" value)

CURL Example: curl -u <user> https://<hostname>:4984/patches.xml

Result: Example

GET /patches/patch_id.xml

Return information about patch with given ID.

CURL Example: curl -u <user> 'https://<hostname>:4984/patches/slessp2-PackageKit;7256;noarch;nu_novell_com:SLES11-SP2-Updates.xml'

Result: Example

POST /patches/install/patch_id.xml

Install the patch with given ID. Patch installation runs in background, the response code is 202 Accepted when patch installation started. Then the patch index has to be queried to get the actual patch installation result.

CURL example: curl -u <user> -X POST 'https://<hostname>:4984/patches/install/slessp2-PackageKit;7256;noarch;nu_novell_com:SLES11-SP2-Updates.xml'

Repository Management Actions

GET /repositories

Return all configured software repositories

CURL Example: curl -u <user> https://<hostname>:4984/repositories.xml

Result: Example

GET /repositories/repo_id.xml

Return details of the specified repository

CURL Example: curl -u <user> 'https://<hostname>:4984/nu_novell_com:SLES11-SP2-Updates.xml'

Result: Example

PUT /repositories/repo_id.xml

Update repository properties

CURL Example: curl -u <user> -X PUT -H 'Content-type: text/xml' -d @repository.xml 'https://<hostname>:4984/repositories/nu_novell_com:SLES11-SP2-Updates.xml'

Body: Example

POST /repositories

Create a new repository

CURL Example: curl -u <user> -X POST -H 'Content-type: text/xml' -d @repository.xml https://<hostname>:4984/repositories.xml

Body: Example

DELETE /repositories/repo_id

Delete an existing repository.

CURL Example: curl -u <user> -X DELETE 'https://<hostname>:4984/repositories/nu_novell_com:SLES11-SP2-Updates.xml'