https-server rest access-mode

Syntax

https-server rest access-mode {read-only | read-write}

Description

Changes the REST API access mode. The default mode is read-only. Changing the mode to read-write allows POST, PUT, and DELETE operations to be called on all configurable elements in the switch configuration database.

Command context

config

Parameters

read-only

Selects the read-only mode. Write access to most switch resources through the REST API is disabled. This value is the default value.

read-write

Selects the read/write mode. Allows POST, PUT, and DELETE methods to be called on all configurable elements in the switch database.

Authority

Administrators

Usage

Setting the mode to read-write on the REST API allows POST, PUT, and DELETE methods to be called on all configurable elements in the switch database.

The REST API in read/write mode is intended for use by advanced programmers who have a good understanding of the system schema and data relationships in the switch database.

CAUTION:

Because the REST API in read/write mode can access every configurable element in the database, it is powerful but must be used with extreme caution: No semantic validation is performed on the data you write to the database, and configuration errors can destabilize the switch.

Some switch resources allow POST, PUT, and DELETE regardless of REST API mode.

The default is read-only.

Example

switch(config)# https-server rest access-mode read-write