ConnectorTypePS
class connector_types.connector_type_ps.ConnectorTypePS
Access a Windows Remote Management (WinRM) service.
This connector type enables you to interact with a Windows Remote Management (WinRM) service. See Windows Remote Management for information about WinRM.
note
Cancelling an active execution created by a PS connector might not be possible if the third party system, that is running the script, doesn't respond. In this case Cloudomation sends the signal to cancel the process on the third party system but as long as the script is running on said system, the execution status will be shown a running in Cloudomation. To cancel the execution you have to kill the process directly in the non-responsive system.
Inputs
Name | Type | Default | Description |
---|---|---|---|
cert_key_pem | str | None | Provide a certificate key in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS. |
cert_pem | str | None | Provide a certificate in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS. |
encoding | str | utf-8 | The character encoding used on the remote host. |
host | str | The hostname (can be a URL like https://some-url.com or a host alias e.g. localhost) or IP of the remote windows host. | |
message_encryption | str | auto | If to use message encryption. See Encryption. |
password | str | The password to use for authentication. | |
run_bat | str | None | A batch script to execute on the remote windows host. One of run_cmd , run_ps , or run_bat is required. |
run_cmd | str | None | A command to execute on the remote windows host. One of run_cmd , run_ps , or run_bat is required. |
run_cmd_args | list | None | Arguments for the command executed by run_cmd. |
run_ps | str | None | A powershell script to execute on the remote windows host. One of run_cmd , run_ps , or run_bat is required. |
server_ca | str | None | The CA certificate of the server. To be used for self-signed certificates. |
transport | str | ssl | Which transport to use. See Valid transport options. |
username | str | The username to use for authentication. | |
verify_ssl | bool | True | Verify TLS certificates. Only takes effect when requesting over https. |
Outputs
Name | Type | Default | Description |
---|---|---|---|
status_code | int | The status code of the executed command. | |
std_err | str | The standard error of the executed command. | |
std_out | str | The standard output of the executed command. |
Constants
input_list = ['cert_key_pem', 'cert_pem', 'encoding', 'host', 'message_encryption', 'password', 'run_bat', 'run_cmd', 'run_cmd_args', 'run_ps', 'server_ca', 'transport', 'username', 'verify_ssl'] output_list = ['status_code', 'std_err', 'std_out'] ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca'] version = 1Methods
execute
details
log
details
one_of_inputs
details
run
details
Example
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution):
this.connect(
connector_type='PS',
host='my-windows-host',
username='kevin',
password='secret',
run_cmd='ipconfig',
)
this.connect(
connector_type='PS',
host='my-windows-host',
username='kevin',
password='secret',
run_ps='Write-Host "Hello World!"',
)
return this.success('all done')