Date: Fri, 29 Mar 2024 06:13:32 -0500 (CDT) Message-ID: <353455186.30106.1711710812942@bmc1-rhel-confprod1.managed.contegix.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_30105_1758349973.1711710812941" ------=_Part_30105_1758349973.1711710812941 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
discovery.restfulPatch(t=
arget, protocol, path[, headers, body=
em>, port, use_http])
Performs a patch request on the target using the RESTful protocol specified=
and returns a node containing information on the discovered system.
The function takes the following parameters:
target
=E2=80=93 the device against which the request is p=
erformed.protocol
=E2=80=93 distinguishes the RESTful protocol for =
distinguishing credentials and handling any device specific behavior. The f=
ollowing protocols are supported:
"VPLEX"
=E2=80=94 VPLEX protocol""
=E2=80=94 Generic protocol, no authentication"basic_auth"
=E2=80=94 Generic protocol, HTTP ba=
sic authentication"digest_auth"
=E2=80=94 Generic protocol, HTTP D=
igest authentication"oauth2"
=E2=80=94 Generic protocol, OAuth2 auth=
entication. The OAuth2 authentication method used is a client credentia=
ls grant as described on the IETF Tools website.path
=E2=80=94 a string specifying the URL path on th=
e target, for example /api/about
. The IP address and access me=
thod are automatically added according to the credential and endpoint being=
discovered.headers
=E2=80=94 an optional dictionary of HTTP head=
ers to be sent with the request. You can use this to implement custom proto=
cols that require certain HTTP headers to be present. For VPLEX the usernam=
e and password fields are automatically added. It is not possible to overri=
de automatically added values.body
=E2=80=94 string, optional. The HTTP body of the=
request.port
=E2=80=94 an optional integer. Port on which HTTP ser=
ver listens. Default value is 80
if use_http
is&n=
bsp;True
, otherwise 443
is used.use_http
=E2=80=94 boolean, optional. Whether to=
use HTTP instead of HTTPS. Default value is False
(HTTPS).
and returns a DiscoveryAPIResult node containing the following:
response_
status
=E2=80=93 the response status=
.response_
reason
=E2=80=93 the response reason=
.response_header
=E2=80=93 a table of header entries. Sensi=
tive fields are removed.response_body
=E2=80=93 the body of the response. When dat=
a is successfully retrieved and the response_body
is a JSON en=
coded string, it can be decoded using the json.decode function.For example:
// PATCH request, OAut= h2 Authentication, HTTPS on default port // PATCH request modifies a single valu= e=20 message :=3D table(); message['status'] :=3D "stopped"; result :=3D discovery.restfulPatch(process, "oauth2= ", "/api/v1.1/discovery", json.encode(message));
If the request fails, the discovery.restfulPatch function returns <= strong>none.