ZFS Storage Appliance REST API Client Programmatic Interface
Bases: exceptions.Exception
Exception for ZFS REST API client errors
Bases: object
ZFSSA urllib client
Make an HTTP DELETE request
Parameters: | path – Path to resource that will be deleted. |
---|
Make an HTTP GET request
Parameters: | path – Path to resource. |
---|
Make an HTTP HEAD request
Parameters: | path – Path to resource. |
---|
return if client is login
Login to an appliance using a user name and password.
Start a session like what is done logging into the BUI. This is not a requirement to run REST commands, since the protocol is stateless. What is does is set up a cookie session so that some server side caching can be done. If login is used remember to call logout when finished.
Parameters: | auth_str – Authorization string (base64) |
---|
Logout of an appliance
Make a path?query string for making a REST request
Cmd_params args: | |
---|---|
The path part | |
Cmd_params kwargs: | |
The query part |
Make an HTTP POST request
Parameters: |
|
---|
Make an HTTP PUT request
Parameters: |
|
---|
Make an HTTP request and return the results
Parameters: |
|
---|---|
Key accept: | Set HTTP ‘Accept’ header with this value |
Key base_path: | Override the base_path for this request |
Key content: | Set HTTP ‘Content-Type’ header with this value |
Bases: object
Result from a REST API operation
Get an HTTP header with the given name from the results
Parameters: | name – HTTP header name |
---|---|
Returns: | The header value or None if no value is found |
Bases: object
Result HTTP Status
Command accepted
Bad Request
Service Unavailable
Invalid request
New resource created successfully
The request is not allowed
The request is not allowed
The requested resource was not found
Command returned OK but no data will be returned
Request return OK
Request timed out
User is not authorized