(T) Protokół Restconf*

Protokół Restconf

Wstęp do protokołu Restconf

Budowa nagłówka URL

  • https://Adres-IP:Port/root/datastore/YangModule:Container/leaf
    • Adres-IP – Adres IP.
    • Port
    • root – (restconf)
    • datastore – (data)
    • YangModule
    • Container
    • leaf

Kody błędów Restconf

  • 100 Continue – informational status response code indicates that everything so far is OK and that the client should continue with the request or ignore it if it is already finished.
  • 200 OK – success status response code indicates that the request has succeeded. A 200 response is cacheable by default. The meaning of a success depends on the HTTP request method:
    • GET – The resource has been fetched and is transmitted in the message body.
    • HEAD – The entity headers are in the message body.
    • POST – The resource describing the result of the action is transmitted in the message body.
    • TRACE – The message body contains the request message as received by the server.
    • The successful result of a PUT or a DELETE is often not a 200 OK but a 204 No Content (or a 201 Created when the resource is uploaded for the first time).
  • 201 Created – success status response code indicates that the request has succeeded and has led to the creation of a resource. The new resource is effectively created before this response is sent back and the new resource is returned in the body of the message, its location being either the URL of the request, or the content of the Location header.
  • 202 Accepted – response status code indicates that the request has been accepted for processing, but the processing has not been completed; in fact, processing may not have started yet. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
  • 204 No Content – success status response code indicates that the request has succeeded, but that the client doesn’t need to go away from its current page. A 204 response is cacheable by default. An ETag header is included in such a response.
  • 206 Partial Content – success status response code indicates that the request has succeeded and has the body contains the requested ranges of data, as described in the Range header of the request.
  • 400 Bad Request – response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)
  • 401 Unauthorized – client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.
  • 403 Forbidden – client error status response code indicates that the server understood the request but refuses to authorize it.
  • 404 Not Found – client error response code indicates that the server can’t find the requested resource. Links which lead to a 404 page are often called broken or dead links, and can be subject to link rot.

Restconf konfiguracja systemu IOS XE

(config)# username login privilege 15 secret hasło

Tworzy nowego użytkownika, umożliwiającego uwierzytelnianie za pomocą połączenia SSH.

(config)# ip http server

Wyłącza / Włącza funkcję zarządzania zdalnego za pomocą protokołu HTTP.

(config)# ip http secure-server

Wyłącza / Włącza funkcję zarządzania zdalnego za pomocą protokołu HTTPS.

(config)# ip http authentication {local / enable / aaa}

Określa metodę uwierzytelniania połączenia zdalnego.
* local – Rozpoczyna uwierzytelnianie połączenia zdalnego za pomocą konta lokalnego.
* enable – Rozpoczyna uwierzytelnianie połączenia zdalnego za pomocą hasła do trybu uprzywilejowanego.
* aaa – Rozpoczyna uwierzytelnianie połączenia zdalnego za pomocą zdalnego serwera AAA.

(config)# restconf

Aktywuje protokół Restconf na konfigurowanym urządzeniu sieciowym.

Pozostałe tematy związane z automatyzacją sieci

PDFPRINT

Robert T Kucharski

Cisco Network Engineer in GPW.

2 komentarze

  1. 2 maja 2020

    […] Artykuł związany z teorią protokołu Requests jest dostępny pod tym linkiem. […]

  2. 5 września 2020

    […] Artykuł związany z teorią protokołu Requests jest dostępny pod tym linkiem. […]

Dodaj komentarz