do_custom_op Method
Executes an arbitrary WebHDFS operation.
Syntax
def do_custom_op(http_method: str, request_path: str, op: str) -> None: ...
Remarks
This method can be used to execute any WebHDFS operation the class does not explicitly implement.
Valid values for HttpMethod are:
- GET (default if empty)
- POST
- PUT
- DELETE
RequestPath must either be a valid resource path, or empty string. Op must be a valid WebHDFS operation (refer to the Hadoop WebHDFS documentation for a full list of supported operations).
Usage
When this method is called, the class will do the following:
- Build a request URL using url, RequestPath, Op, and the query parameters held by the QueryParam* properties.
- Send the request using the given HttpMethod, the request URL built in step 1, the headers held by other_headers, and the currently-configured authentication (if any; refer to auth_mechanism for more information). The request is always sent with an empty body.
- Store the response headers in the ParsedHeader* properties, and the response body in the specified local_file, or resource_data (using the same logic as download_file).
If the response body is JSON data, the XPath, XText, and other X* configuration settings can then be used to navigate and extract information from it.