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 isread-write.

Command context

config

Parameters

read-write

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

read-only

选择只读模式。对大多数年代写访问witch resources through the REST API is disabled.

Authority

Administrators or local user group members with execution rights for this command.

Usage

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

By default, REST APIs in the device are in the read-write mode. Some switch resources allow POST, PUT, and DELETE regardless of REST API mode. REST APIs that are required to support the Web UI or the Network Analytics Engine expose POST, PUT, or DELETE operations, even if the REST API access mode is set to read-only.

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.

On 6300 switches or 6400 switches, by default, the HTTPS server is enabled inread-writemode on themgmtVRF. If you enable the HTTPS server on a different VRF, the HTTPS server is enabled inread-onlymode.

Example

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