|
ADCT Python
Python client API implementation for publishing ADCT data
|
Web server publisher implementation using the requests library. More...


Public Member Functions | |
| __init__ (self) | |
| post_method (self) | |
| old_publish (self, builder) | |
| int | config (self, **kwargs) |
| int | initialize (self) |
| Set up any resources needed for reuse in publish(). | |
| int | publish (self, Builder b) |
| publish_str (self, json_string) | |
| publish_obj (self, obj) | |
| None | finalize (self) |
| Clean up any resources set up in initialize (files, pipes, etc). | |
Public Member Functions inherited from adctk.publisher.Publisher | |
| str | name (self) |
| Get the name which a factory or error message should use. | |
| str | version (self) |
| dict[str, str] | get_option_defaults (self) |
| None | pause (self) |
| Cause publish calls to be ignored until resume is called. | |
| None | resume (self) |
| Cancel an prior calls to pause. | |
Public Attributes | |
| plugin_prefix | |
| mode | |
| state | |
Public Attributes inherited from adctk.publisher.Publisher | |
| defaults | |
| plugin_prefix | |
| paused | |
| state | |
| mode | |
Protected Attributes | |
| _base_url | |
| _base_port | |
| _timeouts | |
| _headers | |
| _post_method | |
Additional Inherited Members | |
Static Public Member Functions inherited from adctk.publisher.Publisher | |
| tuple[float] | get_timeout_defaults () |
| Get the adc server connect and response timeouts defined in the environment ADC_SERVER_CONNECT_TIMEOUT and ADC_SERVER_POST_TIMEOUT as a tuple or default values if not defined. | |
| str | get_url_default () |
| Get the alleged adc server url base from environment ADC_SERVER_URL or the default if it is not present. | |
| str | get_port_default () |
| Get the adc server port number to use if it is properly defined in the environment ADC_SERVER_PORT or the default if it is not. | |
Static Public Attributes inherited from adctk.publisher.Publisher | |
| API_VERSION = adc_version.AdcVersion()._dict() | |
Protected Member Functions inherited from adctk.publisher.Publisher | |
| str | _get (self, dict[str, str] opts, str field) |
| bool | _get_bool (self, dict[str, str] opts, str field) |
Static Protected Attributes inherited from adctk.publisher.Publisher | |
| str | _name = "unknown" |
| str | _version = "0.0.0" |
Web server publisher implementation using the requests library.
This plugin generates a message sends it to the configured web service. Multiple independent instances of this plugin may be used simultaneously. Timeouts are applied, so applications will not hang on failures.
Environment Variables
| adctk.http_publisher.HttpPublisher.__init__ | ( | self | ) |
Reimplemented from adctk.publisher.Publisher.
| int adctk.http_publisher.HttpPublisher.config | ( | self, | |
| ** | kwargs | ||
| ) |
The config options for the http plugin are url=<URL>,
port=<PORT NUMBER>, timeouts=<timeout_connect:timeout_post>.
If not specified, then the environment variables ADC_HTTP_PLUGIN_*
are checked, where * is URL or PORT or TIMEOUTS.
Bad timeout values will be ignored.
Reimplemented from adctk.publisher.Publisher.
| None adctk.http_publisher.HttpPublisher.finalize | ( | self | ) |
Clean up any resources set up in initialize (files, pipes, etc).
Reimplemented from adctk.publisher.Publisher.
| int adctk.http_publisher.HttpPublisher.initialize | ( | self | ) |
Set up any resources needed for reuse in publish().
Reimplemented from adctk.publisher.Publisher.
| adctk.http_publisher.HttpPublisher.old_publish | ( | self, | |
| builder | |||
| ) |
publish json extracted from builder to _base_url server
| adctk.http_publisher.HttpPublisher.post_method | ( | self | ) |
@return requests.post, or an alternative if debugging
| int adctk.http_publisher.HttpPublisher.publish | ( | self, | |
| Builder | b | ||
| ) |
publish json extracted from builder.
Reimplemented from adctk.publisher.Publisher.
| adctk.http_publisher.HttpPublisher.publish_obj | ( | self, | |
| obj | |||
| ) |
publish obj from caller to _base_url server
Reimplemented from adctk.publisher.Publisher.
| adctk.http_publisher.HttpPublisher.publish_str | ( | self, | |
| json_string | |||
| ) |
publish json_raw from caller to _base_url server
Reimplemented from adctk.publisher.Publisher.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| adctk.http_publisher.HttpPublisher.mode |
| adctk.http_publisher.HttpPublisher.plugin_prefix |
| adctk.http_publisher.HttpPublisher.state |