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.
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 Engine 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 Engine. To cancel the execution you have to kill the process directly in the non-responsive system.
Input Schema
-
hostThe hostname (can be a URL like https://some-url.com or a host alias e.g. localhost) or IP of the remote windows host.
Type:
string -
usernameThe username to use for authentication.
Type:
string -
passwordThe password to use for authentication.
Type:
string -
transportWhich transport to use.
Type:
anyOfOptions: -
message_encryptionIf to use message encryption.
Type:
anyOfOptions: -
run_cmdA command to execute on the remote windows host. One of
run_cmd,run_ps, orrun_batis required.Type:
anyOfOptions: -
run_cmd_argsArguments for the command executed by run_cmd.
Type:
arrayItems: -
run_psA powershell script to execute on the remote windows host. One of
run_cmd,run_ps, orrun_batis required.Type:
anyOfOptions: -
run_batA batch script to execute on the remote windows host. One of
run_cmd,run_ps, orrun_batis required.Type:
anyOfOptions: -
cert_pemProvide a certificate in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS.
Type:
anyOfOptions: -
cert_key_pemProvide a certificate key in PEM format when using SSL transport, otherwise transport is reverted to basic auth over HTTPS.
Type:
anyOfOptions: -
encodingThe character encoding used on the remote host.
Type:
stringDefault:
utf-8 -
verify_sslPerform validation of ssl certificates. This can be disabled to use self-signed certificates where the CA certificate is not available.
Type:
booleanDefault:
True -
server_caType:
anyOfOptions:
Output Schema
-
status_codeThe status code of the executed command.
Type:
integer -
std_outThe standard output of the executed command.
Type:
string -
std_errThe standard error of the executed command.
Type:
string
Constants
ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca']Example
import flow_api
def handler(system: flow_api.System, this: flow_api.Execution, inputs: dict):
this.connect(
connector_type='PS',
host='https://my-windows-host:5986',
username='kevin',
password='secret',
run_cmd='ipconfig',
)
this.connect(
connector_type='PS',
host='https://my-windows-host:5986',
username='kevin',
password='secret',
run_ps='Write-Host "Hello World!"',
)
return this.success('all done')