saws package

Submodules

saws.commands module

class saws.commands.AwsCommands

Bases: object

Encapsulates AWS commands.

All commands are listed in the periodically updated data/SOURCES.txt file.

Attributes:
  • AWS_COMMAND: A string representing the ‘aws’ command.
  • AWS_CONFIGURE: A string representing the ‘configure’ command.
  • AWS_HELP: A string representing the ‘help’ command.
  • AWS_DOCS: A string representing the ‘docs’ command.
  • DATA_DIR: A string representing the directory containing
    data/SOURCES.txt.
  • DATA_PATH: A string representing the full file path of
    data/SOURCES.txt.
  • data_util: An instance of DataUtil().
  • headers: A list denoting the start of each set of command types.
  • header_to_type_map: A dictionary mapping between headers and
    CommandType.
  • all_commands: A list of all commands, sub_commands, options, etc
    from data/SOURCES.txt.
AWS_COMMAND = u'aws'
AWS_CONFIGURE = u'configure'
AWS_DOCS = u'docs'
AWS_HELP = u'help'
class CommandType

Bases: enum.Enum

Enum specifying the command type.

Attributes:
  • COMMANDS: An int representing commands.
  • SUB_COMMANDS: An int representing subcommands.
  • GLOBAL_OPTIONS: An int representing global options.
  • RESOURCE_OPTIONS: An int representing resource options.
  • NUM_TYPES: An int representing the number of command types.
COMMANDS = 0
GLOBAL_OPTIONS = 2
NUM_TYPES = 4
RESOURCE_OPTIONS = 3
SUB_COMMANDS = 1
DATA_DIR = '/home/docs/checkouts/readthedocs.org/user_builds/saws/checkouts/stable/saws'
DATA_PATH = u'/home/docs/checkouts/readthedocs.org/user_builds/saws/checkouts/stable/saws/data/SOURCES.txt'
__init__()

x.__init__(…) initializes x; see help(type(x)) for signature

saws.completer module

class saws.completer.AwsCompleter(aws_completer, all_commands, config, config_obj, log_exception, fuzzy_match=False, shortcut_match=False)

Bases: prompt_toolkit.completion.Completer

Completer for AWS commands, subcommands, options, and parameters.

Attributes:
  • aws_completer: An instance of the official awscli Completer.
  • aws_completions: A set of completions to show the user.
  • all_commands: A list of all commands, sub_commands, options, etc
    from data/SOURCES.txt.
  • config: An instance of Config.
  • config_obj: An instance of ConfigObj, reads from ~/.sawsrc.
  • log_exception: A callable log_exception from SawsLogger.
  • text_utils: An instance of TextUtils.
  • fuzzy_match: A boolean that determines whether to use fuzzy matching.
  • shortcut_match: A boolean that determines whether to match shortcuts.
  • BASE_COMMAND: A string representing the ‘aws’ command.
  • shortcuts: An OrderedDict containing shortcuts commands as keys
    and their corresponding full commands as values.
  • resources: An instance of AwsResources.
  • options: An instance of AwsOptions
__init__(aws_completer, all_commands, config, config_obj, log_exception, fuzzy_match=False, shortcut_match=False)

Initializes AwsCompleter.

Args:
  • aws_completer: The official aws cli completer module.
  • all_commands: A list of all commands, sub_commands, options, etc
    from data/SOURCES.txt.
  • config: An instance of Config.
  • config_obj: An instance of ConfigObj, reads from ~/.sawsrc.
  • log_exception: A callable log_exception from SawsLogger.
  • fuzzy_match: A boolean that determines whether to use
    fuzzy matching.
  • shortcut_match: A boolean that determines whether to
    match shortcuts.
Returns:
None.
get_completions(document, _)

Get completions for the current scope.

Args:
  • document: An instance of prompt_toolkit’s Document.
  • _: An instance of prompt_toolkit’s CompleteEvent (not used).
Returns:
A generator of prompt_toolkit’s Completion objects, containing matched completions.
refresh_resources_and_options(force_refresh=False)

Convenience function to refresh resources for completion.

Args:
  • force_refresh: A boolean determines whether to force a cache
    refresh. This value is set to True when the user presses F5.
Returns:
None.
replace_shortcut(text)

Replaces matched shortcut commands with their full command.

Currently, only one shortcut is replaced before shortcut replacement terminates, although this function could potentially be extended to replace mutliple shortcuts.

Args:
  • text: A string representing the input command text to replace.
Returns:
A string representing input command text with a shortcut
replaced, if one has been found.
replace_substitution(text)

Replaces a %s with the word immediately following it.

Currently, only one substitution is done before replacement terminates, although this function could potentially be extended to do multiple substitutions.

Args:
  • text: A string representing the input command text to replace.
Returns:
A string representing input command text with a substitution, if one has been found.

saws.config module

class saws.config.Config

Bases: object

Reads and writes the config file sawsrc.

Attributes:
  • SHORTCUTS: A string that represents the start of shortcuts in
    the config file ~/.sawsrc.
  • MAIN: A string that represents the main set of configs in
    ~/.sawsrc.
  • THEME: A string that represents the config theme.
  • LOG_FILE: A string that represents the config log file location.
  • LOG_LEVEL: A string that represents the config default log
    file level.
  • COLOR: A string that represents the config color output mode.
  • FUZZY: A string that represents the config fuzzy matching mode.
  • SHORTCUT: A string that represents the config shortcut matching
    mode.
COLOR = u'color_output'
FUZZY = u'fuzzy_match'
LOG_FILE = u'log_file'
LOG_LEVEL = u'log_level'
MAIN = u'main'
SHORTCUT = u'shortcut_match'
SHORTCUTS = u'shortcuts'
THEME = u'theme'
get_shortcuts(config_obj)

Gets the shortcuts from the specified config.

Args:
  • config_obj: An instance of ConfigObj.
Returns:
An OrderedDict containing the shortcut commands as the keys and their corresponding full commands as the values.
read_configuration(config_template=None, config_path=None)

Reads the config file if it exists, else reads the default config.

Args:
  • config_template: A string representing the template file name.
  • config_path: A string representing the template file path.
Returns:
An instance of a ConfigObj.

saws.keys module

class saws.keys.KeyManager(set_color, get_color, set_fuzzy_match, get_fuzzy_match, set_shortcut_match, get_shortcut_match, refresh_resources_and_options, handle_docs)

Bases: object

Creates a Key Manager.

Attributes:
  • manager: An instance of a prompt_toolkit’s KeyBindingManager.
__init__(set_color, get_color, set_fuzzy_match, get_fuzzy_match, set_shortcut_match, get_shortcut_match, refresh_resources_and_options, handle_docs)

Initializes KeyManager.

Args:
  • set_color: A function setting the color output config.
  • get_color: A function getting the color output config.
  • set_fuzzy_match: A function setting the fuzzy match config.
  • get_fuzzy_match: A function getting the fuzzy match config.
  • set_shortcut_match: A function setting the shortcut match config.
  • get_shortcut_match: A function getting the shortcut match config.
Returns:
None.

saws.lexer module

class saws.lexer.CommandLexer(**options)

Bases: pygments.lexer.RegexLexer

Provides highlighting for commands.

Attributes:
  • config: An instance of Config.
  • config_obj: An instance of ConfigObj.
  • shortcuts: An OrderedDict containing the shortcut commands as the
    keys and their corresponding full commands as the values.
  • shortcut_tokens: A list containing words for each shortcut key:
    key: ‘aws ec2 ls’ -> shortcut_tokens: [‘aws’, ‘ec2’, ‘ls’].
  • aws_commands: An instance of AwsCommands.
  • commands: A tuple, where each tuple element is a list of:
    • commands
    • sub_commands
    • global_options
    • resource_options
  • tokens: A dictionary of pygments tokens.
aws_commands = <saws.commands.AwsCommands object>
commands = [[u'acm', u'apigateway', u'application-autoscaling', u'autoscaling', u'cloudformation', u'cloudfront', u'cloudhsm', u'cloudsearch', u'cloudsearchdomain', u'cloudtrail', u'cloudwatch', u'codecommit', u'codepipeline', u'cognito-identity', u'cognito-idp', u'cognito-sync', u'configservice', u'configure', u'datapipeline', u'deploy', u'devicefarm', u'directconnect', u'discovery', u'dms', u'ds', u'dynamodb', u'dynamodbstreams', u'ec2', u'ecr', u'ecs', u'efs', u'elasticache', u'elasticbeanstalk', u'elastictranscoder', u'elb', u'emr', u'es', u'events', u'firehose', u'gamelift', u'glacier', u'iam', u'importexport', u'inspector', u'iot', u'iot-data', u'kinesis', u'kms', u'lambda', u'logs', u'machinelearning', u'marketplacecommerceanalytics', u'meteringmarketplace', u'opsworks', u'rds', u'redshift', u'route53', u'route53domains', u's3', u's3api', u'sdb', u'servicecatalog', u'ses', u'sns', u'sqs', u'ssm', u'storagegateway', u'sts', u'support', u'swf', u'waf', u'workspaces'], [u'abort-environment-update', u'abort-multipart-upload', u'abort-vault-lock', u'accept-certificate-transfer', u'accept-portfolio-share', u'accept-reserved-instances-exchange-quote', u'accept-vpc-peering-connection', u'acknowledge-job', u'acknowledge-third-party-job', u'activate-gateway', u'activate-pipeline', u'add-attachments-to-set', u'add-attributes-to-findings', u'add-cache', u'add-client-id-to-open-id-connect-provider', u'add-communication-to-case', u'add-custom-attributes', u'add-instance-fleet', u'add-instance-groups', u'add-ip-routes', u'add-model', u'add-option-to-option-group', u'add-permission', u'add-role-to-db-cluster', u'add-role-to-instance-profile', u'add-source-identifier-to-subscription', u'add-steps', u'add-tags', u'add-tags-to-certificate', u'add-tags-to-on-premises-instances', u'add-tags-to-resource', u'add-tags-to-stream', u'add-tags-to-vault', u'add-upload-buffer', u'add-user-to-group', u'add-working-storage', u'admin-add-user-to-group', u'admin-confirm-sign-up', u'admin-create-user', u'admin-delete-user', u'admin-delete-user-attributes', u'admin-disable-user', u'admin-enable-user', u'admin-forget-device', u'admin-get-device', u'admin-get-user', u'admin-initiate-auth', u'admin-list-devices', u'admin-list-groups-for-user', u'admin-remove-user-from-group', u'admin-reset-user-password', u'admin-respond-to-auth-challenge', u'admin-set-user-settings', u'admin-update-device-status', u'admin-update-user-attributes', u'admin-user-global-sign-out', u'allocate-address', u'allocate-connection-on-interconnect', u'allocate-hosted-connection', u'allocate-hosts', u'allocate-private-virtual-interface', u'allocate-public-virtual-interface', u'apply-environment-managed-action', u'apply-pending-maintenance-action', u'apply-security-groups-to-load-balancer', u'assign-instance', u'assign-ipv6-addresses', u'assign-private-ip-addresses', u'assign-volume', u'associate-address', u'associate-configuration-items-to-application', u'associate-connection-with-lag', u'associate-dhcp-options', u'associate-elastic-ip', u'associate-hosted-connection', u'associate-iam-instance-profile', u'associate-principal-with-portfolio', u'associate-product-with-portfolio', u'associate-route-table', u'associate-subnet-cidr-block', u'associate-virtual-interface', u'associate-vpc-cidr-block', u'associate-vpc-with-hosted-zone', u'assume-role', u'assume-role-with-saml', u'assume-role-with-web-identity', u'attach-classic-link-vpc', u'attach-elastic-load-balancer', u'attach-group-policy', u'attach-instances', u'attach-internet-gateway', u'attach-load-balancer-target-groups', u'attach-load-balancer-to-subnets', u'attach-load-balancers', u'attach-network-interface', u'attach-principal-policy', u'attach-role-policy', u'attach-thing-principal', u'attach-user-policy', u'attach-volume', u'attach-vpn-gateway', u'authorize-cache-security-group-ingress', u'authorize-cluster-security-group-ingress', u'authorize-db-security-group-ingress', u'authorize-security-group-egress', u'authorize-security-group-ingress', u'authorize-snapshot-access', u'batch-check-layer-availability', u'batch-delete-attributes', u'batch-delete-image', u'batch-get-application-revisions', u'batch-get-applications', u'batch-get-deployment-groups', u'batch-get-deployment-instances', u'batch-get-deployments', u'batch-get-image', u'batch-get-item', u'batch-get-on-premises-instances', u'batch-get-repositories', u'batch-meter-usage', u'batch-put-attributes', u'batch-write-item', u'build-suggesters', u'bulk-publish', u'bundle-instance', u'cancel-archival', u'cancel-bundle-task', u'cancel-certificate-transfer', u'cancel-command', u'cancel-conversion-task', u'cancel-export-task', u'cancel-import-task', u'cancel-job', u'cancel-key-deletion', u'cancel-reserved-instances-listing', u'cancel-retrieval', u'cancel-schema-extension', u'cancel-spot-fleet-requests', u'cancel-spot-instance-requests', u'cancel-steps', u'cancel-update-stack', u'change-message-visibility', u'change-message-visibility-batch', u'change-password', u'change-resource-record-sets', u'change-tags-for-resource', u'check-dns-availability', u'check-domain-availability', u'check-if-phone-number-is-opted-out', u'clone-receipt-rule-set', u'clone-stack', u'complete-layer-upload', u'complete-lifecycle-action', u'complete-multipart-upload', u'complete-vault-lock', u'compose-environments', u'configure-health-check', u'confirm-connection', u'confirm-device', u'confirm-forgot-password', u'confirm-private-virtual-interface', u'confirm-product-instance', u'confirm-public-virtual-interface', u'confirm-sign-up', u'confirm-subscription', u'connect-directory', u'continue-deployment', u'continue-update-rollback', u'copy-cluster-snapshot', u'copy-db-cluster-parameter-group', u'copy-db-cluster-snapshot', u'copy-db-parameter-group', u'copy-db-snapshot', u'copy-image', u'copy-object', u'copy-option-group', u'copy-snapshot', u'count-closed-workflow-executions', u'count-open-workflow-executions', u'count-pending-activity-tasks', u'count-pending-decision-tasks', u'cp', u'create-access-key', u'create-account-alias', u'create-activation', u'create-alias', u'create-api-key', u'create-app', u'create-app-cookie-stickiness-policy', u'create-application', u'create-application-version', u'create-assessment-target', u'create-assessment-template', u'create-association', u'create-association-batch', u'create-authorizer', u'create-auto-scaling-group', u'create-base-path-mapping', u'create-batch-prediction', u'create-bgp-peer', u'create-branch', u'create-bucket', u'create-build', u'create-byte-match-set', u'create-cache-cluster', u'create-cache-parameter-group', u'create-cache-security-group', u'create-cache-subnet-group', u'create-cached-iscsi-volume', u'create-case', u'create-certificate-from-csr', u'create-change-set', u'create-cloud-front-origin-access-identity', u'create-cluster', u'create-cluster-parameter-group', u'create-cluster-security-group', u'create-cluster-snapshot', u'create-cluster-subnet-group', u'create-computer', u'create-conditional-forwarder', u'create-configuration-set', u'create-configuration-set-event-destination', u'create-configuration-template', u'create-connection', u'create-constraint', u'create-custom-action-type', u'create-customer-gateway', u'create-data-source-from-rds', u'create-data-source-from-redshift', u'create-data-source-from-s3', u'create-db-cluster', u'create-db-cluster-parameter-group', u'create-db-cluster-snapshot', u'create-db-instance', u'create-db-instance-read-replica', u'create-db-parameter-group', u'create-db-security-group', u'create-db-snapshot', u'create-db-subnet-group', u'create-default-roles', u'create-delivery-stream', u'create-deployment', u'create-deployment-config', u'create-deployment-group', u'create-device-pool', u'create-dhcp-options', u'create-directory', u'create-distribution', u'create-distribution-with-tags', u'create-document', u'create-documentation-part', u'create-documentation-version', u'create-domain', u'create-domain-name', u'create-egress-only-internet-gateway', u'create-elasticsearch-domain', u'create-endpoint', u'create-environment', u'create-evaluation', u'create-event-source-mapping', u'create-event-subscription', u'create-export-task', u'create-file-system', u'create-fleet', u'create-flow-logs', u'create-function', u'create-game-session', u'create-game-session-queue', u'create-grant', u'create-group', u'create-hapg', u'create-hbase-backup', u'create-health-check', u'create-hosted-zone', u'create-hsm', u'create-hsm-client-certificate', u'create-hsm-configuration', u'create-identity-pool', u'create-image', u'create-instance', u'create-instance-export-task', u'create-instance-profile', u'create-interconnect', u'create-internet-gateway', u'create-invalidation', u'create-ip-set', u'create-job', u'create-key', u'create-key-pair', u'create-keys-and-certificate', u'create-lag', u'create-launch-configuration', u'create-layer', u'create-lb-cookie-stickiness-policy', u'create-load-balancer', u'create-load-balancer-listeners', u'create-load-balancer-policy', u'create-log-group', u'create-log-stream', u'create-login-profile', u'create-luna-client', u'create-maintenance-window', u'create-microsoft-ad', u'create-ml-model', u'create-model', u'create-mount-target', u'create-multipart-upload', u'create-nat-gateway', u'create-network-acl', u'create-network-acl-entry', u'create-network-interface', u'create-network-profile', u'create-nfs-file-share', u'create-open-id-connect-provider', u'create-option-group', u'create-or-update-tags', u'create-patch-baseline', u'create-pipeline', u'create-placement-group', u'create-platform-application', u'create-platform-endpoint', u'create-platform-version', u'create-player-session', u'create-player-sessions', u'create-policy', u'create-policy-version', u'create-portfolio', u'create-portfolio-share', u'create-preset', u'create-private-virtual-interface', u'create-product', u'create-project', u'create-provisioning-artifact', u'create-public-virtual-interface', u'create-queue', u'create-realtime-endpoint', u'create-receipt-filter', u'create-receipt-rule', u'create-receipt-rule-set', u'create-remote-access-session', u'create-replication-group', u'create-replication-instance', u'create-replication-subnet-group', u'create-replication-task', u'create-repository', u'create-reserved-instances-listing', u'create-resource', u'create-resource-group', u'create-rest-api', u'create-reusable-delegation-set', u'create-role', u'create-route', u'create-route-table', u'create-rule', u'create-saml-provider', u'create-security-configuration', u'create-security-group', u'create-service', u'create-service-specific-credential', u'create-size-constraint-set', u'create-snapshot', u'create-snapshot-copy-grant', u'create-snapshot-from-volume-recovery-point', u'create-spot-datafeed-subscription', u'create-sql-injection-match-set', u'create-stack', u'create-stage', u'create-storage-location', u'create-stored-iscsi-volume', u'create-stream', u'create-streaming-distribution', u'create-streaming-distribution-with-tags', u'create-subnet', u'create-subscription', u'create-table', u'create-tags', u'create-tape-with-barcode', u'create-tapes', u'create-thing', u'create-thing-type', u'create-topic', u'create-topic-rule', u'create-traffic-policy', u'create-traffic-policy-instance', u'create-traffic-policy-version', u'create-trail', u'create-trust', u'create-upload', u'create-usage-plan', u'create-usage-plan-key', u'create-user', u'create-user-import-job', u'create-user-pool', u'create-user-pool-client', u'create-user-profile', u'create-vault', u'create-virtual-mfa-device', u'create-volume', u'create-vpc', u'create-vpc-association-authorization', u'create-vpc-endpoint', u'create-vpc-peering-connection', u'create-vpn-connection', u'create-vpn-connection-route', u'create-vpn-gateway', u'create-web-acl', u'create-workspaces', u'create-xss-match-set', u'credential-helper', u'deactivate-mfa-device', u'deactivate-pipeline', u'decode-authorization-message', u'decrease-stream-retention-period', u'decrypt', u'define-analysis-scheme', u'define-expression', u'define-index-field', u'define-suggester', u'delete-access-key', u'delete-account-alias', u'delete-account-password-policy', u'delete-activation', u'delete-alarms', u'delete-alias', u'delete-analysis-scheme', u'delete-api-key', u'delete-app', u'delete-application', u'delete-application-version', u'delete-applications', u'delete-archive', u'delete-assessment-run', u'delete-assessment-target', u'delete-assessment-template', u'delete-association', u'delete-attributes', u'delete-authorizer', u'delete-auto-scaling-group', u'delete-bandwidth-rate-limit', u'delete-base-path-mapping', u'delete-batch-prediction', u'delete-bgp-peer', u'delete-bucket', u'delete-bucket-analytics-configuration', u'delete-bucket-cors', u'delete-bucket-inventory-configuration', u'delete-bucket-lifecycle', u'delete-bucket-metrics-configuration', u'delete-bucket-policy', u'delete-bucket-replication', u'delete-bucket-tagging', u'delete-bucket-website', u'delete-build', u'delete-byte-match-set', u'delete-ca-certificate', u'delete-cache-cluster', u'delete-cache-parameter-group', u'delete-cache-security-group', u'delete-cache-subnet-group', u'delete-certificate', u'delete-change-set', u'delete-chap-credentials', u'delete-client-certificate', u'delete-cloud-front-origin-access-identity', u'delete-cluster', u'delete-cluster-parameter-group', u'delete-cluster-security-group', u'delete-cluster-snapshot', u'delete-cluster-subnet-group', u'delete-conditional-forwarder', u'delete-config-rule', u'delete-configuration-recorder', u'delete-configuration-set', u'delete-configuration-set-event-destination', u'delete-configuration-template', u'delete-connection', u'delete-constraint', u'delete-custom-action-type', u'delete-customer-gateway', u'delete-data-source', u'delete-dataset', u'delete-db-cluster', u'delete-db-cluster-parameter-group', u'delete-db-cluster-snapshot', u'delete-db-instance', u'delete-db-parameter-group', u'delete-db-security-group', u'delete-db-snapshot', u'delete-db-subnet-group', u'delete-delivery-channel', u'delete-delivery-stream', u'delete-deployment', u'delete-deployment-config', u'delete-deployment-group', u'delete-destination', u'delete-device-pool', u'delete-dhcp-options', u'delete-directory', u'delete-distribution', u'delete-document', u'delete-documentation-part', u'delete-documentation-version', u'delete-domain', u'delete-domain-name', u'delete-egress-only-internet-gateway', u'delete-elasticsearch-domain', u'delete-endpoint', u'delete-environment-configuration', u'delete-evaluation', u'delete-evaluation-results', u'delete-event-source-mapping', u'delete-event-subscription', u'delete-expression', u'delete-file-share', u'delete-file-system', u'delete-fleet', u'delete-flow-logs', u'delete-function', u'delete-game-session-queue', u'delete-gateway', u'delete-group', u'delete-group-policy', u'delete-hapg', u'delete-health-check', u'delete-hosted-zone', u'delete-hsm', u'delete-hsm-client-certificate', u'delete-hsm-configuration', u'delete-identities', u'delete-identity', u'delete-identity-policy', u'delete-identity-pool', u'delete-imported-key-material', u'delete-index-field', u'delete-instance', u'delete-instance-profile', u'delete-integration', u'delete-integration-response', u'delete-interconnect', u'delete-internet-gateway', u'delete-ip-set', u'delete-item', u'delete-key-pair', u'delete-lag', u'delete-launch-configuration', u'delete-layer', u'delete-lifecycle-hook', u'delete-load-balancer', u'delete-load-balancer-listeners', u'delete-load-balancer-policy', u'delete-log-group', u'delete-log-stream', u'delete-login-profile', u'delete-luna-client', u'delete-maintenance-window', u'delete-message', u'delete-message-batch', u'delete-method', u'delete-method-response', u'delete-metric-filter', u'delete-ml-model', u'delete-model', u'delete-mount-target', u'delete-nat-gateway', u'delete-network-acl', u'delete-network-acl-entry', u'delete-network-interface', u'delete-network-profile', u'delete-notification-configuration', u'delete-object', u'delete-object-tagging', u'delete-objects', u'delete-open-id-connect-provider', u'delete-option-group', u'delete-parameter', u'delete-patch-baseline', u'delete-pipeline', u'delete-placement-group', u'delete-platform-application', u'delete-platform-version', u'delete-policy', u'delete-policy-version', u'delete-portfolio', u'delete-portfolio-share', u'delete-preset', u'delete-product', u'delete-project', u'delete-provisioning-artifact', u'delete-queue', u'delete-realtime-endpoint', u'delete-receipt-filter', u'delete-receipt-rule', u'delete-receipt-rule-set', u'delete-registration-code', u'delete-remote-access-session', u'delete-replication-group', u'delete-replication-instance', u'delete-replication-subnet-group', u'delete-replication-task', u'delete-repository', u'delete-repository-policy', u'delete-resource', u'delete-rest-api', u'delete-retention-policy', u'delete-reusable-delegation-set', u'delete-role', u'delete-role-policy', u'delete-route', u'delete-route-table', u'delete-rule', u'delete-run', u'delete-saml-provider', u'delete-scaling-policy', u'delete-scheduled-action', u'delete-security-configuration', u'delete-security-group', u'delete-server-certificate', u'delete-service', u'delete-service-specific-credential', u'delete-signing-certificate', u'delete-size-constraint-set', u'delete-snapshot', u'delete-snapshot-copy-grant', u'delete-snapshot-schedule', u'delete-spot-datafeed-subscription', u'delete-sql-injection-match-set', u'delete-ssh-public-key', u'delete-stack', u'delete-stage', u'delete-stream', u'delete-streaming-distribution', u'delete-subnet', u'delete-subscription-filter', u'delete-suggester', u'delete-table', u'delete-tags', u'delete-tags-for-domain', u'delete-tape', u'delete-tape-archive', u'delete-thing', u'delete-thing-shadow', u'delete-thing-type', u'delete-topic', u'delete-topic-rule', u'delete-traffic-policy', u'delete-traffic-policy-instance', u'delete-trail', u'delete-trust', u'delete-upload', u'delete-usage-plan', u'delete-usage-plan-key', u'delete-user', u'delete-user-attributes', u'delete-user-policy', u'delete-user-pool', u'delete-user-pool-client', u'delete-user-profile', u'delete-vault', u'delete-vault-access-policy', u'delete-vault-notifications', u'delete-virtual-interface', u'delete-virtual-mfa-device', u'delete-volume', u'delete-vpc', u'delete-vpc-association-authorization', u'delete-vpc-endpoints', u'delete-vpc-peering-connection', u'delete-vpn-connection', u'delete-vpn-connection-route', u'delete-vpn-gateway', u'delete-web-acl', u'delete-xss-match-set', u'deliver-config-snapshot', u'deploy', u'deprecate-activity-type', u'deprecate-domain', u'deprecate-thing-type', u'deprecate-workflow-type', u'deregister', u'deregister-container-instance', u'deregister-ecs-cluster', u'deregister-elastic-ip', u'deregister-event-topic', u'deregister-image', u'deregister-instance', u'deregister-instances-from-load-balancer', u'deregister-managed-instance', u'deregister-on-premises-instance', u'deregister-patch-baseline-for-patch-group', u'deregister-rds-db-instance', u'deregister-scalable-target', u'deregister-target-from-maintenance-window', u'deregister-task-definition', u'deregister-task-from-maintenance-window', u'deregister-volume', u'describe-account-attributes', u'describe-account-limits', u'describe-activations', u'describe-active-receipt-rule-set', u'describe-activity-type', u'describe-addresses', u'describe-adjustment-types', u'describe-agent-versions', u'describe-agents', u'describe-alarm-history', u'describe-alarms', u'describe-alarms-for-metric', u'describe-alias', u'describe-analysis-schemes', u'describe-application-versions', u'describe-applications', u'describe-apps', u'describe-assessment-runs', u'describe-assessment-targets', u'describe-assessment-templates', u'describe-association', u'describe-attachment', u'describe-auto-scaling-groups', u'describe-auto-scaling-instances', u'describe-auto-scaling-notification-types', u'describe-automation-executions', u'describe-availability-options', u'describe-availability-zones', u'describe-available-patches', u'describe-bandwidth-rate-limit', u'describe-batch-predictions', u'describe-build', u'describe-bundle-tasks', u'describe-ca-certificate', u'describe-cache', u'describe-cache-clusters', u'describe-cache-engine-versions', u'describe-cache-parameter-groups', u'describe-cache-parameters', u'describe-cache-security-groups', u'describe-cache-subnet-groups', u'describe-cached-iscsi-volumes', u'describe-cases', u'describe-certificate', u'describe-certificates', u'describe-change-set', u'describe-chap-credentials', u'describe-classic-link-instances', u'describe-cluster', u'describe-cluster-parameter-groups', u'describe-cluster-parameters', u'describe-cluster-security-groups', u'describe-cluster-snapshots', u'describe-cluster-subnet-groups', u'describe-cluster-versions', u'describe-clusters', u'describe-commands', u'describe-communications', u'describe-compliance-by-config-rule', u'describe-compliance-by-resource', u'describe-conditional-forwarders', u'describe-config-rule-evaluation-status', u'describe-config-rules', u'describe-configuration-options', u'describe-configuration-recorder-status', u'describe-configuration-recorders', u'describe-configuration-set', u'describe-configuration-settings', u'describe-configurations', u'describe-connection-loa', u'describe-connections', u'describe-connections-on-interconnect', u'describe-constraint', u'describe-container-instances', u'describe-conversion-tasks', u'describe-cross-account-access-role', u'describe-customer-gateways', u'describe-data-sources', u'describe-dataset', u'describe-db-cluster-parameter-groups', u'describe-db-cluster-parameters', u'describe-db-cluster-snapshot-attributes', u'describe-db-cluster-snapshots', u'describe-db-clusters', u'describe-db-engine-versions', u'describe-db-instances', u'describe-db-log-files', u'describe-db-parameter-groups', u'describe-db-parameters', u'describe-db-security-groups', u'describe-db-snapshot-attributes', u'describe-db-snapshots', u'describe-db-subnet-groups', u'describe-default-cluster-parameters', u'describe-delivery-channel-status', u'describe-delivery-channels', u'describe-delivery-stream', u'describe-deployments', u'describe-destinations', u'describe-dhcp-options', u'describe-directories', u'describe-document', u'describe-document-permission', u'describe-domain', u'describe-domains', u'describe-ec2-instance-limits', u'describe-ecs-clusters', u'describe-effective-instance-associations', u'describe-effective-patches-for-patch-baseline', u'describe-egress-only-internet-gateways', u'describe-elastic-ips', u'describe-elastic-load-balancers', u'describe-elasticsearch-domain', u'describe-elasticsearch-domain-config', u'describe-elasticsearch-domains', u'describe-elasticsearch-instance-type-limits', u'describe-endpoint', u'describe-endpoint-types', u'describe-endpoints', u'describe-engine-default-cluster-parameters', u'describe-engine-default-parameters', u'describe-environment-health', u'describe-environment-managed-action-history', u'describe-environment-managed-actions', u'describe-environment-resources', u'describe-environments', u'describe-evaluations', u'describe-event-categories', u'describe-event-subscriptions', u'describe-event-topics', u'describe-events', u'describe-export-configurations', u'describe-export-tasks', u'describe-expressions', u'describe-file-systems', u'describe-findings', u'describe-fleet-attributes', u'describe-fleet-capacity', u'describe-fleet-events', u'describe-fleet-port-settings', u'describe-fleet-utilization', u'describe-flow-logs', u'describe-game-session-details', u'describe-game-session-placement', u'describe-game-session-queues', u'describe-game-sessions', u'describe-gateway-information', u'describe-hapg', u'describe-host-reservation-offerings', u'describe-host-reservations', u'describe-hosted-connections', u'describe-hosts', u'describe-hsm', u'describe-hsm-client-certificates', u'describe-hsm-configurations', u'describe-iam-instance-profile-associations', u'describe-id-format', u'describe-identity', u'describe-identity-id-format', u'describe-identity-pool', u'describe-identity-pool-usage', u'describe-identity-usage', u'describe-image-attribute', u'describe-images', u'describe-import-image-tasks', u'describe-import-snapshot-tasks', u'describe-index-fields', u'describe-instance-associations-status', u'describe-instance-attribute', u'describe-instance-health', u'describe-instance-information', u'describe-instance-patch-states', u'describe-instance-patch-states-for-patch-group', u'describe-instance-patches', u'describe-instance-status', u'describe-instances', u'describe-instances-health', u'describe-interconnect-loa', u'describe-interconnects', u'describe-internet-gateways', u'describe-job', u'describe-key', u'describe-key-pairs', u'describe-lags', u'describe-launch-configurations', u'describe-layers', u'describe-lifecycle-hook-types', u'describe-lifecycle-hooks', u'describe-limits', u'describe-loa', u'describe-load-balancer-attributes', u'describe-load-balancer-policies', u'describe-load-balancer-policy-types', u'describe-load-balancer-target-groups', u'describe-load-balancers', u'describe-load-based-auto-scaling', u'describe-locations', u'describe-log-groups', u'describe-log-streams', u'describe-logging-status', u'describe-luna-client', u'describe-maintenance-start-time', u'describe-maintenance-window-execution-task-invocations', u'describe-maintenance-window-execution-tasks', u'describe-maintenance-window-executions', u'describe-maintenance-window-targets', u'describe-maintenance-window-tasks', u'describe-maintenance-windows', u'describe-metric-collection-types', u'describe-metric-filters', u'describe-ml-models', u'describe-mount-target-security-groups', u'describe-mount-targets', u'describe-moving-addresses', u'describe-my-user-profile', u'describe-nat-gateways', u'describe-network-acls', u'describe-network-interface-attribute', u'describe-network-interfaces', u'describe-nfs-file-shares', u'describe-notification-configurations', u'describe-objects', u'describe-option-group-options', u'describe-option-groups', u'describe-orderable-cluster-options', u'describe-orderable-db-instance-options', u'describe-orderable-replication-instances', u'describe-parameters', u'describe-patch-baselines', u'describe-patch-group-state', u'describe-patch-groups', u'describe-pending-maintenance-actions', u'describe-permissions', u'describe-pipelines', u'describe-placement-groups', u'describe-platform-version', u'describe-player-sessions', u'describe-policies', u'describe-portfolio', u'describe-prefix-lists', u'describe-product', u'describe-product-as-admin', u'describe-product-view', u'describe-provisioning-artifact', u'describe-provisioning-parameters', u'describe-raid-arrays', u'describe-rds-db-instances', u'describe-receipt-rule', u'describe-receipt-rule-set', u'describe-record', u'describe-refresh-schemas-status', u'describe-regions', u'describe-replication-groups', u'describe-replication-instances', u'describe-replication-subnet-groups', u'describe-replication-tasks', u'describe-repositories', u'describe-reserved-cache-nodes', u'describe-reserved-cache-nodes-offerings', u'describe-reserved-db-instances', u'describe-reserved-db-instances-offerings', u'describe-reserved-instances', u'describe-reserved-instances-listings', u'describe-reserved-instances-modifications', u'describe-reserved-instances-offerings', u'describe-reserved-node-offerings', u'describe-reserved-nodes', u'describe-resize', u'describe-resource-groups', u'describe-route-tables', u'describe-rule', u'describe-rules-packages', u'describe-runtime-configuration', u'describe-scalable-targets', u'describe-scaling-activities', u'describe-scaling-parameters', u'describe-scaling-policies', u'describe-scaling-process-types', u'describe-scheduled-actions', u'describe-scheduled-instance-availability', u'describe-scheduled-instances', u'describe-schemas', u'describe-security-configuration', u'describe-security-group-references', u'describe-security-groups', u'describe-service-access-policies', u'describe-service-errors', u'describe-services', u'describe-severity-levels', u'describe-snapshot-attribute', u'describe-snapshot-copy-grants', u'describe-snapshot-schedule', u'describe-snapshots', u'describe-source-regions', u'describe-spot-datafeed-subscription', u'describe-spot-fleet-instances', u'describe-spot-fleet-request-history', u'describe-spot-fleet-requests', u'describe-spot-instance-requests', u'describe-spot-price-history', u'describe-stack-events', u'describe-stack-provisioning-parameters', u'describe-stack-resource', u'describe-stack-resources', u'describe-stack-summary', u'describe-stacks', u'describe-stale-security-groups', u'describe-step', u'describe-stored-iscsi-volumes', u'describe-stream', u'describe-subnets', u'describe-subscription-filters', u'describe-suggesters', u'describe-table', u'describe-table-restore-status', u'describe-table-statistics', u'describe-tags', u'describe-tape-archives', u'describe-tape-recovery-points', u'describe-tapes', u'describe-task-definition', u'describe-tasks', u'describe-termination-policy-types', u'describe-thing', u'describe-thing-type', u'describe-time-based-auto-scaling', u'describe-time-to-live', u'describe-trails', u'describe-trusted-advisor-check-refresh-statuses', u'describe-trusted-advisor-check-result', u'describe-trusted-advisor-check-summaries', u'describe-trusted-advisor-checks', u'describe-trusts', u'describe-upload-buffer', u'describe-user-import-job', u'describe-user-pool', u'describe-user-pool-client', u'describe-user-profiles', u'describe-vault', u'describe-virtual-gateways', u'describe-virtual-interfaces', u'describe-volume-attribute', u'describe-volume-status', u'describe-volumes', u'describe-volumes-modifications', u'describe-vpc-attribute', u'describe-vpc-classic-link', u'describe-vpc-classic-link-dns-support', u'describe-vpc-endpoint-services', u'describe-vpc-endpoints', u'describe-vpc-peering-connections', u'describe-vpcs', u'describe-vpn-connections', u'describe-vpn-gateways', u'describe-vtl-devices', u'describe-workflow-execution', u'describe-workflow-type', u'describe-working-storage', u'describe-workspace-bundles', u'describe-workspace-directories', u'describe-workspaces', u'describe-workspaces-connection-status', u'detach-classic-link-vpc', u'detach-elastic-load-balancer', u'detach-group-policy', u'detach-instances', u'detach-internet-gateway', u'detach-load-balancer-from-subnets', u'detach-load-balancer-target-groups', u'detach-load-balancers', u'detach-network-interface', u'detach-principal-policy', u'detach-role-policy', u'detach-thing-principal', u'detach-user-policy', u'detach-volume', u'detach-vpn-gateway', u'disable-alarm-actions', u'disable-availability-zones-for-load-balancer', u'disable-domain-auto-renew', u'disable-domain-transfer-lock', u'disable-enhanced-monitoring', u'disable-gateway', u'disable-hbase-backups', u'disable-key', u'disable-key-rotation', u'disable-logging', u'disable-metrics-collection', u'disable-radius', u'disable-rule', u'disable-snapshot-copy', u'disable-sso', u'disable-stage-transition', u'disable-topic-rule', u'disable-vgw-route-propagation', u'disable-vpc-classic-link', u'disable-vpc-classic-link-dns-support', u'disassociate-address', u'disassociate-configuration-items-from-application', u'disassociate-connection-from-lag', u'disassociate-elastic-ip', u'disassociate-iam-instance-profile', u'disassociate-principal-from-portfolio', u'disassociate-product-from-portfolio', u'disassociate-route-table', u'disassociate-subnet-cidr-block', u'disassociate-vpc-cidr-block', u'disassociate-vpc-from-hosted-zone', u'discover-poll-endpoint', u'domain-metadata', u'download-db-log-file-portion', u'enable-alarm-actions', u'enable-availability-zones-for-load-balancer', u'enable-domain-auto-renew', u'enable-domain-transfer-lock', u'enable-enhanced-monitoring', u'enable-key', u'enable-key-rotation', u'enable-logging', u'enable-metrics-collection', u'enable-mfa-device', u'enable-radius', u'enable-rule', u'enable-snapshot-copy', u'enable-sso', u'enable-stage-transition', u'enable-topic-rule', u'enable-vgw-route-propagation', u'enable-volume-io', u'enable-vpc-classic-link', u'enable-vpc-classic-link-dns-support', u'encrypt', u'enter-standby', u'estimate-template-cost', u'evaluate-expression', u'execute-change-set', u'execute-policy', u'exit-standby', u'export-configurations', u'failover-db-cluster', u'filter-log-events', u'flush-stage-authorizers-cache', u'flush-stage-cache', u'forget-device', u'forgot-password', u'generate-client-certificate', u'generate-credential-report', u'generate-data-key', u'generate-data-key-without-plaintext', u'generate-data-set', u'generate-random', u'get', u'get-access-key-last-used', u'get-account', u'get-account-authorization-details', u'get-account-password-policy', u'get-account-settings', u'get-account-summary', u'get-alias', u'get-api-key', u'get-api-keys', u'get-application', u'get-application-revision', u'get-attributes', u'get-authorization-token', u'get-authorizer', u'get-authorizers', u'get-automation-execution', u'get-base-path-mapping', u'get-base-path-mappings', u'get-batch-prediction', u'get-blob', u'get-branch', u'get-bucket-accelerate-configuration', u'get-bucket-acl', u'get-bucket-analytics-configuration', u'get-bucket-cors', u'get-bucket-inventory-configuration', u'get-bucket-lifecycle', u'get-bucket-lifecycle-configuration', u'get-bucket-location', u'get-bucket-logging', u'get-bucket-metrics-configuration', u'get-bucket-notification', u'get-bucket-notification-configuration', u'get-bucket-policy', u'get-bucket-replication', u'get-bucket-request-payment', u'get-bucket-tagging', u'get-bucket-versioning', u'get-bucket-website', u'get-bulk-publish-details', u'get-byte-match-set', u'get-caller-identity', u'get-certificate', u'get-change', u'get-change-token', u'get-change-token-status', u'get-checker-ip-ranges', u'get-client-certificate', u'get-client-certificates', u'get-cloud-front-origin-access-identity', u'get-cloud-front-origin-access-identity-config', u'get-cluster-credentials', u'get-cognito-events', u'get-command-invocation', u'get-commit', u'get-compliance-details-by-config-rule', u'get-compliance-details-by-resource', u'get-compliance-summary-by-config-rule', u'get-compliance-summary-by-resource-type', u'get-config', u'get-console-output', u'get-console-screenshot', u'get-contact-reachability-status', u'get-context-keys-for-custom-policy', u'get-context-keys-for-principal-policy', u'get-credential-report', u'get-credentials-for-identity', u'get-csv-header', u'get-data-retrieval-policy', u'get-data-source', u'get-default-patch-baseline', u'get-deployable-patch-snapshot-for-instance', u'get-deployment', u'get-deployment-config', u'get-deployment-group', u'get-deployment-instance', u'get-deployments', u'get-device', u'get-device-pool', u'get-device-pool-compatibility', u'get-differences', u'get-directory-limits', u'get-discovery-summary', u'get-distribution', u'get-distribution-config', u'get-document', u'get-documentation-part', u'get-documentation-parts', u'get-documentation-version', u'get-documentation-versions', u'get-domain-detail', u'get-domain-name', u'get-domain-names', u'get-domain-suggestions', u'get-download-url-for-layer', u'get-endpoint-attributes', u'get-evaluation', u'get-event-selectors', u'get-event-source-mapping', u'get-export', u'get-federation-token', u'get-function', u'get-function-configuration', u'get-game-session-log', u'get-game-session-log-url', u'get-geo-location', u'get-group', u'get-group-policy', u'get-health-check', u'get-health-check-count', u'get-health-check-last-failure-reason', u'get-health-check-status', u'get-host-reservation-purchase-preview', u'get-hosted-zone', u'get-hosted-zone-count', u'get-hostname-suggestion', u'get-id', u'get-identity-dkim-attributes', u'get-identity-mail-from-domain-attributes', u'get-identity-notification-attributes', u'get-identity-policies', u'get-identity-pool-configuration', u'get-identity-pool-roles', u'get-identity-verification-attributes', u'get-instance-access', u'get-instance-profile', u'get-integration', u'get-integration-response', u'get-invalidation', u'get-inventory', u'get-inventory-schema', u'get-ip-set', u'get-item', u'get-job', u'get-job-details', u'get-job-output', u'get-key-policy', u'get-key-rotation-status', u'get-log-events', u'get-logging-options', u'get-login', u'get-login-profile', u'get-maintenance-window', u'get-maintenance-window-execution', u'get-maintenance-window-execution-task', u'get-method', u'get-method-response', u'get-metric-statistics', u'get-ml-model', u'get-model', u'get-model-template', u'get-models', u'get-network-profile', u'get-object', u'get-object-acl', u'get-object-tagging', u'get-object-torrent', u'get-offering-status', u'get-on-premises-instance', u'get-open-id-connect-provider', u'get-open-id-token', u'get-open-id-token-for-developer-identity', u'get-operation-detail', u'get-parameter-history', u'get-parameters', u'get-parameters-for-import', u'get-password-data', u'get-patch-baseline', u'get-patch-baseline-for-patch-group', u'get-pipeline', u'get-pipeline-definition', u'get-pipeline-execution', u'get-pipeline-state', u'get-platform-application-attributes', u'get-policy', u'get-policy-version', u'get-project', u'get-queue-attributes', u'get-queue-url', u'get-records', u'get-registration-code', u'get-remote-access-session', u'get-repository', u'get-repository-policy', u'get-repository-triggers', u'get-reserved-instances-exchange-quote', u'get-resource', u'get-resource-config-history', u'get-resources', u'get-rest-api', u'get-rest-apis', u'get-reusable-delegation-set', u'get-role', u'get-role-policy', u'get-rule', u'get-run', u'get-saml-provider', u'get-sampled-requests', u'get-sdk', u'get-sdk-type', u'get-sdk-types', u'get-send-quota', u'get-send-statistics', u'get-server-certificate', u'get-session-token', u'get-shard-iterator', u'get-shipping-label', u'get-size-constraint-set', u'get-sms-attributes', u'get-snapshot-limits', u'get-sql-injection-match-set', u'get-ssh-public-key', u'get-stack-policy', u'get-stage', u'get-stages', u'get-status', u'get-streaming-distribution', u'get-streaming-distribution-config', u'get-subscription-attributes', u'get-suite', u'get-telemetry-metadata', u'get-template', u'get-template-summary', u'get-test', u'get-thing-shadow', u'get-third-party-job-details', u'get-topic-attributes', u'get-topic-rule', u'get-traffic-policy', u'get-traffic-policy-instance', u'get-traffic-policy-instance-count', u'get-trail-status', u'get-upload', u'get-usage', u'get-usage-plan', u'get-usage-plan-key', u'get-usage-plan-keys', u'get-usage-plans', u'get-user', u'get-user-attribute-verification-code', u'get-user-policy', u'get-vault-access-policy', u'get-vault-lock', u'get-vault-notifications', u'get-web-acl', u'get-workflow-execution-history', u'get-xss-match-set', u'global-sign-out', u'grant-access', u'head-bucket', u'head-object', u'import-api-keys', u'import-certificate', u'import-documentation-parts', u'import-image', u'import-key-material', u'import-key-pair', u'import-rest-api', u'import-snapshot', u'increase-stream-retention-period', u'index-documents', u'initiate-auth', u'initiate-job', u'initiate-layer-upload', u'initiate-multipart-upload', u'initiate-vault-lock', u'install', u'install-applications', u'install-to-remote-access-session', u'invoke', u'invoke-async', u'list', u'list-accepted-portfolio-shares', u'list-access-keys', u'list-account-aliases', u'list-action-types', u'list-activity-types', u'list-aliases', u'list-allowed-node-type-modifications', u'list-application-revisions', u'list-applications', u'list-artifacts', u'list-assessment-run-agents', u'list-assessment-runs', u'list-assessment-targets', u'list-assessment-templates', u'list-associations', u'list-attached-group-policies', u'list-attached-role-policies', u'list-attached-user-policies', u'list-attributes', u'list-available-solution-stacks', u'list-available-zones', u'list-branches', u'list-bucket-analytics-configurations', u'list-bucket-inventory-configurations', u'list-bucket-metrics-configurations', u'list-buckets', u'list-builds', u'list-byte-match-sets', u'list-ca-certificates', u'list-certificates', u'list-certificates-by-ca', u'list-change-sets', u'list-closed-workflow-executions', u'list-cloud-front-origin-access-identities', u'list-clusters', u'list-command-invocations', u'list-commands', u'list-configuration-sets', u'list-configurations', u'list-constraints-for-portfolio', u'list-container-instances', u'list-datasets', u'list-dead-letter-source-queues', u'list-delivery-streams', u'list-deployment-configs', u'list-deployment-groups', u'list-deployment-instances', u'list-deployments', u'list-device-pools', u'list-devices', u'list-discovered-resources', u'list-distributions', u'list-distributions-by-web-acl-id', u'list-document-versions', u'list-documents', u'list-domain-names', u'list-domains', u'list-elasticsearch-instance-types', u'list-elasticsearch-versions', u'list-endpoints-by-platform-application', u'list-entities-for-policy', u'list-event-source-mappings', u'list-event-subscriptions', u'list-exports', u'list-file-shares', u'list-findings', u'list-fleets', u'list-functions', u'list-gateways', u'list-geo-locations', u'list-grants', u'list-group-policies', u'list-groups', u'list-groups-for-user', u'list-hapgs', u'list-health-checks', u'list-hosted-zones', u'list-hosted-zones-by-name', u'list-hsms', u'list-identities', u'list-identity-policies', u'list-identity-pool-usage', u'list-identity-pools', u'list-images', u'list-imports', u'list-instance-fleets', u'list-instance-profiles', u'list-instance-profiles-for-role', u'list-instances', u'list-invalidations', u'list-inventory-entries', u'list-ip-routes', u'list-ip-sets', u'list-jobs', u'list-jobs-by-pipeline', u'list-jobs-by-status', u'list-key-policies', u'list-keys', u'list-launch-paths', u'list-local-disks', u'list-luna-clients', u'list-metrics', u'list-mfa-devices', u'list-multipart-uploads', u'list-network-profiles', u'list-object-versions', u'list-objects', u'list-objects-v2', u'list-offering-transactions', u'list-offerings', u'list-on-premises-instances', u'list-open-id-connect-providers', u'list-open-workflow-executions', u'list-operations', u'list-outgoing-certificates', u'list-parts', u'list-phone-numbers-opted-out', u'list-pipelines', u'list-platform-applications', u'list-platform-versions', u'list-policies', u'list-policy-principals', u'list-policy-versions', u'list-portfolio-access', u'list-portfolios', u'list-portfolios-for-product', u'list-presets', u'list-principal-policies', u'list-principal-things', u'list-principals-for-portfolio', u'list-projects', u'list-provisioned-capacity', u'list-provisioning-artifacts', u'list-public-keys', u'list-queues', u'list-receipt-filters', u'list-receipt-rule-sets', u'list-record-history', u'list-records', u'list-remote-access-sessions', u'list-repositories', u'list-resource-record-sets', u'list-resource-tags', u'list-retirable-grants', u'list-reusable-delegation-sets', u'list-role-policies', u'list-roles', u'list-rule-names-by-target', u'list-rules', u'list-rules-packages', u'list-runs', u'list-saml-providers', u'list-samples', u'list-schema-extensions', u'list-security-configurations', u'list-server-certificates', u'list-server-neighbors', u'list-service-specific-credentials', u'list-services', u'list-signing-certificates', u'list-size-constraint-sets', u'list-sql-injection-match-sets', u'list-ssh-public-keys', u'list-stack-resources', u'list-stacks', u'list-steps', u'list-streaming-distributions', u'list-streams', u'list-subscriptions', u'list-subscriptions-by-topic', u'list-suites', u'list-tables', u'list-tags', u'list-tags-for-certificate', u'list-tags-for-domain', u'list-tags-for-resource', u'list-tags-for-resources', u'list-tags-for-stream', u'list-tags-for-vault', u'list-tags-log-group', u'list-tags-of-resource', u'list-tapes', u'list-targets-by-rule', u'list-task-definition-families', u'list-task-definitions', u'list-tasks', u'list-tests', u'list-thing-principals', u'list-thing-types', u'list-things', u'list-topic-rules', u'list-topics', u'list-traffic-policies', u'list-traffic-policy-instances', u'list-traffic-policy-instances-by-hosted-zone', u'list-traffic-policy-instances-by-policy', u'list-traffic-policy-versions', u'list-unique-problems', u'list-uploads', u'list-user-import-jobs', u'list-user-policies', u'list-user-pool-clients', u'list-user-pools', u'list-users', u'list-users-in-group', u'list-vaults', u'list-versions-by-function', u'list-virtual-mfa-devices', u'list-volume-initiators', u'list-volume-recovery-points', u'list-volumes', u'list-vpc-association-authorizations', u'list-web-acls', u'list-workflow-types', u'list-xss-match-sets', u'lookup-developer-identity', u'lookup-events', u'ls', u'mb', u'merge-developer-identities', u'merge-shards', u'meter-usage', u'modify-cache-cluster', u'modify-cache-parameter-group', u'modify-cache-subnet-group', u'modify-cluster', u'modify-cluster-attributes', u'modify-cluster-iam-roles', u'modify-cluster-parameter-group', u'modify-cluster-subnet-group', u'modify-db-cluster', u'modify-db-cluster-parameter-group', u'modify-db-cluster-snapshot-attribute', u'modify-db-instance', u'modify-db-parameter-group', u'modify-db-snapshot', u'modify-db-snapshot-attribute', u'modify-db-subnet-group', u'modify-document-permission', u'modify-endpoint', u'modify-event-subscription', u'modify-hapg', u'modify-hosts', u'modify-hsm', u'modify-id-format', u'modify-identity-id-format', u'modify-image-attribute', u'modify-instance-attribute', u'modify-instance-fleet', u'modify-instance-groups', u'modify-instance-placement', u'modify-load-balancer-attributes', u'modify-luna-client', u'modify-mount-target-security-groups', u'modify-network-interface-attribute', u'modify-replication-group', u'modify-replication-instance', u'modify-replication-subnet-group', u'modify-replication-task', u'modify-reserved-instances', u'modify-snapshot-attribute', u'modify-snapshot-copy-retention-period', u'modify-spot-fleet-request', u'modify-subnet-attribute', u'modify-volume', u'modify-volume-attribute', u'modify-vpc-attribute', u'modify-vpc-endpoint', u'modify-vpc-peering-connection-options', u'modify-workspace-properties', u'monitor-instances', u'move-address-to-vpc', u'mv', u'opt-in-phone-number', u'package', u'poll-for-activity-task', u'poll-for-decision-task', u'poll-for-jobs', u'poll-for-task', u'poll-for-third-party-jobs', u'predict', u'presign', u'preview-agents', u'promote-read-replica', u'promote-read-replica-db-cluster', u'provision-product', u'publish', u'publish-version', u'purchase-host-reservation', u'purchase-offering', u'purchase-provisioned-capacity', u'purchase-reserved-cache-nodes-offering', u'purchase-reserved-db-instances-offering', u'purchase-reserved-instances-offering', u'purchase-reserved-node-offering', u'purchase-scheduled-instances', u'purge-queue', u'push', u'put', u'put-action-revision', u'put-approval-result', u'put-attributes', u'put-auto-scaling-policy', u'put-bucket-accelerate-configuration', u'put-bucket-acl', u'put-bucket-analytics-configuration', u'put-bucket-cors', u'put-bucket-inventory-configuration', u'put-bucket-lifecycle', u'put-bucket-lifecycle-configuration', u'put-bucket-logging', u'put-bucket-metrics-configuration', u'put-bucket-notification', u'put-bucket-notification-configuration', u'put-bucket-policy', u'put-bucket-replication', u'put-bucket-request-payment', u'put-bucket-tagging', u'put-bucket-versioning', u'put-bucket-website', u'put-config-rule', u'put-configuration-recorder', u'put-delivery-channel', u'put-destination', u'put-destination-policy', u'put-evaluations', u'put-event-selectors', u'put-events', u'put-group-policy', u'put-identity-policy', u'put-image', u'put-integration', u'put-integration-response', u'put-inventory', u'put-item', u'put-job-failure-result', u'put-job-success-result', u'put-key-policy', u'put-lifecycle-hook', u'put-log-events', u'put-method', u'put-method-response', u'put-metric-alarm', u'put-metric-data', u'put-metric-filter', u'put-notification-configuration', u'put-object', u'put-object-acl', u'put-object-tagging', u'put-parameter', u'put-pipeline-definition', u'put-record', u'put-record-batch', u'put-records', u'put-repository-triggers', u'put-rest-api', u'put-retention-policy', u'put-role-policy', u'put-rule', u'put-scaling-policy', u'put-scheduled-update-group-action', u'put-subscription-filter', u'put-targets', u'put-third-party-job-failure-result', u'put-third-party-job-success-result', u'put-user-policy', u'query', u'query-objects', u'rb', u're-encrypt', u'read-job', u'read-pipeline', u'read-preset', u'reboot-cache-cluster', u'reboot-cluster', u'reboot-db-instance', u'reboot-instance', u'reboot-instances', u'reboot-workspaces', u'rebuild-environment', u'rebuild-workspaces', u'receive-message', u'record-activity-task-heartbeat', u'record-lifecycle-action-heartbeat', u'refresh-cache', u'refresh-schemas', u'refresh-trusted-advisor-check', u'register', u'register-activity-type', u'register-application-revision', u'register-ca-certificate', u'register-certificate', u'register-container-instance', u'register-cross-account-access-role', u'register-default-patch-baseline', u'register-device', u'register-domain', u'register-ecs-cluster', u'register-elastic-ip', u'register-event-topic', u'register-image', u'register-instance', u'register-instances-with-load-balancer', u'register-on-premises-instance', u'register-patch-baseline-for-patch-group', u'register-rds-db-instance', u'register-scalable-target', u'register-target-with-maintenance-window', u'register-task-definition', u'register-task-with-maintenance-window', u'register-volume', u'register-workflow-type', u'reject-certificate-transfer', u'reject-portfolio-share', u'reject-vpc-peering-connection', u'release-address', u'release-hosts', u'remove-attributes-from-findings', u'remove-auto-scaling-policy', u'remove-client-id-from-open-id-connect-provider', u'remove-ip-routes', u'remove-option-from-option-group', u'remove-permission', u'remove-role-from-db-cluster', u'remove-role-from-instance-profile', u'remove-source-identifier-from-subscription', u'remove-tags', u'remove-tags-from-certificate', u'remove-tags-from-on-premises-instances', u'remove-tags-from-resource', u'remove-tags-from-stream', u'remove-tags-from-vault', u'remove-targets', u'remove-user-from-group', u'renew-domain', u'renew-offering', u'reorder-receipt-rule-set', u'replace-iam-instance-profile-association', u'replace-network-acl-association', u'replace-network-acl-entry', u'replace-route', u'replace-route-table-association', u'replace-topic-rule', u'report-instance-status', u'report-task-progress', u'report-task-runner-heartbeat', u'request-cancel-workflow-execution', u'request-certificate', u'request-environment-info', u'request-spot-fleet', u'request-spot-instances', u'request-upload-credentials', u'resend-confirmation-code', u'resend-contact-reachability-email', u'resend-validation-email', u'reset-cache', u'reset-cache-parameter-group', u'reset-cluster-parameter-group', u'reset-db-cluster-parameter-group', u'reset-db-parameter-group', u'reset-image-attribute', u'reset-instance-attribute', u'reset-network-interface-attribute', u'reset-service-specific-credential', u'reset-snapshot-attribute', u'resolve-alias', u'resolve-case', u'resolve-customer', u'respond-activity-task-canceled', u'respond-activity-task-completed', u'respond-activity-task-failed', u'respond-decision-task-completed', u'respond-to-auth-challenge', u'restart-app-server', u'restore-address-to-classic', u'restore-db-cluster-from-s3', u'restore-db-cluster-from-snapshot', u'restore-db-cluster-to-point-in-time', u'restore-db-instance-from-db-snapshot', u'restore-db-instance-to-point-in-time', u'restore-from-cluster-snapshot', u'restore-from-hbase-backup', u'restore-from-snapshot', u'restore-object', u'restore-table-from-cluster-snapshot', u'resume-processes', u'resync-mfa-device', u'retire-grant', u'retrieve-domain-auth-code', u'retrieve-environment-info', u'retrieve-tape-archive', u'retrieve-tape-recovery-point', u'retry-stage-execution', u'revoke-cache-security-group-ingress', u'revoke-cluster-security-group-ingress', u'revoke-db-security-group-ingress', u'revoke-grant', u'revoke-security-group-egress', u'revoke-security-group-ingress', u'revoke-snapshot-access', u'rm', u'rotate-encryption-key', u'run-instances', u'run-scheduled-instances', u'run-task', u'scan', u'scan-provisioned-products', u'schedule-hbase-backup', u'schedule-key-deletion', u'schedule-run', u'search', u'search-game-sessions', u'search-products', u'search-products-as-admin', u'select', u'send-bounce', u'send-command', u'send-email', u'send-message', u'send-message-batch', u'send-raw-email', u'set', u'set-active-receipt-rule-set', u'set-alarm-state', u'set-cognito-events', u'set-data-retrieval-policy', u'set-default-policy-version', u'set-desired-capacity', u'set-endpoint-attributes', u'set-identity-dkim-enabled', u'set-identity-feedback-forwarding-enabled', u'set-identity-headers-in-notifications-enabled', u'set-identity-mail-from-domain', u'set-identity-notification-topic', u'set-identity-pool-configuration', u'set-identity-pool-roles', u'set-instance-health', u'set-instance-protection', u'set-load-balancer-listener-ssl-certificate', u'set-load-balancer-policies-for-backend-server', u'set-load-balancer-policies-of-listener', u'set-load-based-auto-scaling', u'set-local-console-password', u'set-logging-options', u'set-permission', u'set-platform-application-attributes', u'set-queue-attributes', u'set-receipt-rule-position', u'set-repository-policy', u'set-sms-attributes', u'set-stack-policy', u'set-status', u'set-subscription-attributes', u'set-tags-for-resource', u'set-task-status', u'set-time-based-auto-scaling', u'set-topic-attributes', u'set-user-settings', u'set-vault-access-policy', u'set-vault-notifications', u'shutdown-gateway', u'sign', u'sign-up', u'signal-resource', u'signal-workflow-execution', u'simulate-custom-policy', u'simulate-principal-policy', u'skip-wait-time-for-instance-termination', u'socks', u'split-shard', u'ssh', u'start-assessment-run', u'start-automation-execution', u'start-config-rules-evaluation', u'start-configuration-recorder', u'start-data-collection-by-agent-ids', u'start-export-task', u'start-game-session-placement', u'start-gateway', u'start-instance', u'start-instances', u'start-logging', u'start-pipeline-execution', u'start-replication-task', u'start-schema-extension', u'start-stack', u'start-support-data-export', u'start-task', u'start-user-import-job', u'start-workflow-execution', u'start-workspaces', u'stop-assessment-run', u'stop-automation-execution', u'stop-configuration-recorder', u'stop-data-collection-by-agent-ids', u'stop-deployment', u'stop-game-session-placement', u'stop-instance', u'stop-instances', u'stop-logging', u'stop-remote-access-session', u'stop-replication-task', u'stop-run', u'stop-stack', u'stop-task', u'stop-user-import-job', u'stop-workspaces', u'submit-container-state-change', u'submit-task-state-change', u'subscribe', u'subscribe-to-dataset', u'subscribe-to-event', u'suggest', u'suspend-processes', u'swap-environment-cnames', u'sync', u'tag-log-group', u'tag-resource', u'terminate-clusters', u'terminate-environment', u'terminate-instance-in-auto-scaling-group', u'terminate-instances', u'terminate-provisioned-product', u'terminate-workflow-execution', u'terminate-workspaces', u'test-connection', u'test-dns-answer', u'test-event-pattern', u'test-failover', u'test-invoke-authorizer', u'test-invoke-method', u'test-metric-filter', u'test-repository-triggers', u'test-role', u'transfer-certificate', u'transfer-domain', u'unassign-instance', u'unassign-ipv6-addresses', u'unassign-private-ip-addresses', u'unassign-volume', u'uninstall', u'unlink-developer-identity', u'unlink-identity', u'unmonitor-instances', u'unsubscribe', u'unsubscribe-from-dataset', u'unsubscribe-from-event', u'untag-log-group', u'untag-resource', u'update-access-key', u'update-account', u'update-account-password-policy', u'update-alias', u'update-api-key', u'update-app', u'update-application', u'update-application-resource-lifecycle', u'update-application-version', u'update-assessment-target', u'update-association', u'update-association-status', u'update-assume-role-policy', u'update-authorizer', u'update-auto-scaling-group', u'update-availability-options', u'update-bandwidth-rate-limit', u'update-base-path-mapping', u'update-batch-prediction', u'update-build', u'update-byte-match-set', u'update-ca-certificate', u'update-certificate', u'update-chap-credentials', u'update-client-certificate', u'update-cloud-front-origin-access-identity', u'update-conditional-forwarder', u'update-configuration-set-event-destination', u'update-configuration-template', u'update-constraint', u'update-container-agent', u'update-container-instances-state', u'update-data-source', u'update-default-branch', u'update-deployment', u'update-deployment-group', u'update-destination', u'update-device-pool', u'update-device-status', u'update-distribution', u'update-document', u'update-document-default-version', u'update-documentation-part', u'update-documentation-version', u'update-domain-contact', u'update-domain-contact-privacy', u'update-domain-name', u'update-domain-nameservers', u'update-elastic-ip', u'update-elasticsearch-domain-config', u'update-environment', u'update-evaluation', u'update-event-source-mapping', u'update-fleet-attributes', u'update-fleet-capacity', u'update-fleet-port-settings', u'update-function-code', u'update-function-configuration', u'update-game-session', u'update-game-session-queue', u'update-gateway-information', u'update-gateway-software-now', u'update-group', u'update-health-check', u'update-hosted-zone-comment', u'update-identity-pool', u'update-instance', u'update-integration', u'update-integration-response', u'update-ip-set', u'update-item', u'update-job', u'update-key-description', u'update-lag', u'update-layer', u'update-login-profile', u'update-maintenance-start-time', u'update-maintenance-window', u'update-managed-instance-role', u'update-method', u'update-method-response', u'update-ml-model', u'update-model', u'update-my-user-profile', u'update-network-profile', u'update-nfs-file-share', u'update-open-id-connect-provider-thumbprint', u'update-patch-baseline', u'update-pipeline', u'update-pipeline-notifications', u'update-pipeline-status', u'update-portfolio', u'update-product', u'update-project', u'update-provisioned-product', u'update-provisioning-artifact', u'update-radius', u'update-rds-db-instance', u'update-receipt-rule', u'update-records', u'update-repository-description', u'update-repository-name', u'update-resource', u'update-rest-api', u'update-rule', u'update-runtime-configuration', u'update-saml-provider', u'update-scaling-parameters', u'update-server-certificate', u'update-service', u'update-service-access-policies', u'update-service-specific-credential', u'update-shard-count', u'update-signing-certificate', u'update-size-constraint-set', u'update-snapshot-schedule', u'update-sql-injection-match-set', u'update-ssh-public-key', u'update-stack', u'update-stage', u'update-streaming-distribution', u'update-subscription', u'update-table', u'update-tags-for-domain', u'update-thing', u'update-thing-shadow', u'update-time-to-live', u'update-traffic-policy-comment', u'update-traffic-policy-instance', u'update-trail', u'update-usage', u'update-usage-plan', u'update-user', u'update-user-attributes', u'update-user-pool', u'update-user-pool-client', u'update-user-profile', u'update-volume', u'update-vtl-device-type', u'update-web-acl', u'update-xss-match-set', u'upload-archive', u'upload-build', u'upload-documents', u'upload-layer-part', u'upload-multipart-part', u'upload-part', u'upload-part-copy', u'upload-server-certificate', u'upload-signing-certificate', u'upload-ssh-public-key', u'validate-configuration-settings', u'validate-logs', u'validate-pipeline-definition', u'validate-template', u'verify-domain-dkim', u'verify-domain-identity', u'verify-email-identity', u'verify-trust', u'verify-user-attribute', u'view-billing', u'wait', u'website'], [u'--color', u'--debug', u'--endpoint-url', u'--no-paginate', u'--no-sign-request', u'--no-verify-ssl', u'--output', u'--profile', u'--query', u'--region', u'--version'], [u'--bucket', u'--cluster-states', u'--instance-ids']]
config = <saws.config.Config object>
config_obj = {'main': {'theme': 'vim', 'color_output': 'True', 'fuzzy_match': 'True', 'shortcut_match': 'True', 'log_file': '~/.saws.log', 'log_level': 'INFO'}}
shortcut = 'dynamodb ls'
shortcut_tokens = ['ec2', 'ls', '--instance-ids', 'emr', 'ls', '--cluster-states', 'ec2', 'start-instances', '--instance-ids', 'ec2', 'stop-instances', '--instance-ids', 'ec2', 'ls', '--ec2-tag-key', 'ec2', 'ls', '--ec2-tag-value', 'ec2', 'ls', '--ec2-state', 'ec2', 'ls', 'emr', 'ls', 'elb', 'ls', 'dynamodb', 'ls']
shortcuts = {'dynamodb ls': 'dynamodb list-tables', 'ec2 ls': 'ec2 describe-instances', 'ec2 ls --ec2-state': 'ec2 describe-instances --filters "Name=instance-state-name,Values=%s"', 'ec2 ls --ec2-tag-key': 'ec2 describe-instances --filters "Name=tag-key,Values=%s"', 'ec2 ls --ec2-tag-value': 'ec2 describe-instances --filters "Name=tag-value,Values=%s"', 'ec2 ls --instance-ids': 'ec2 describe-instances --instance-ids', 'ec2 start-instances --instance-ids': 'ec2 start-instances --instance-ids', 'ec2 stop-instances --instance-ids': 'ec2 stop-instances --instance-ids', 'elb ls': 'elb describe-load-balancers', 'emr ls': 'emr list-clusters', 'emr ls --cluster-states': 'emr list-clusters --cluster-states'}
token = 'ls'
tokens = {'root': [(<pygments.lexer.words object at 0x7f2c222c2c10>, Token.Literal.String), (<pygments.lexer.words object at 0x7f2c222c2f10>, Token.Literal.Number), (<pygments.lexer.words object at 0x7f2c222c2fd0>, Token.Name.Class), (<pygments.lexer.words object at 0x7f2c222c2e90>, Token.Keyword.Declaration), (<pygments.lexer.words object at 0x7f2c222c2f90>, Token.Generic.Output), (<pygments.lexer.words object at 0x7f2c222c2e10>, Token.Operator.Word), (<pygments.lexer.words object at 0x7f2c222c2d90>, Token.Name.Exception)]}

saws.logger module

class saws.logger.SawsLogger(name, log_file, log_level)

Bases: object

Handles Saws logging.

Attributes:
  • logger: An instance of Logger.
__init__(name, log_file, log_level)

Initializes a Logger for Saws.

Args:
  • name: A string that represents the logger’s name.
  • log_file: A string that represents the log file name.
  • log_level: A string that represents the logging level.
Returns:
None.

saws.main module

saws.resources module

class saws.resources.AwsResources(log_exception)

Bases: object

Encapsulates AWS resources such as ec2 tags and buckets.

Attributes:
  • resources_path: A string representing the full file path of
    data/RESOURCES.txt.
  • log_exception: A callable log_exception from SawsLogger.
  • resource_lists: A list where each element is a list of completions
    for each resource.
  • resources_headers_map: A dict mapping resource headers to
    resources to complete. Headers denote the start of each set of resources in the RESOURCES.txt file.
  • resources_options_map: A dict mapping resource options to
    resources to complete.
  • resource_headers: A list of headers that denote the start of each
    set of resources in the RESOURCES.txt file.
  • data_util: An instance of DataUtil().
  • header_to_type_map: A dict mapping headers as they appear in the
    RESOURCES.txt file to their corresponding ResourceType.
class ResourceType

Bases: enum.Enum

Enum specifying the resource type.

Append new resource class instances here and increment NUM_TYPES. Note: Order is important, new resources should be added to the end.

Attributes:
  • INSTANCE_IDS: An int representing instance ids.
  • INSTANCE_TAG_KEYS: An int representing instance tag keys.
  • INSTANCE_TAG_VALUES: An int representing instance tag values.
  • BUCKET_NAMES: An int representing bucket names.
  • BUCKET_URIS: An int representing bucket uris.
  • NUM_TYPES: An int representing the number of resource types.
BUCKET_NAMES = 3
BUCKET_URIS = 4
INSTANCE_IDS = 0
INSTANCE_TAG_KEYS = 1
INSTANCE_TAG_VALUES = 2
NUM_TYPES = 5
__init__(log_exception)

Initializes AwsResources.

Args:
  • log_exception: A callable log_exception from SawsLogger.
Returns:
None.
clear_resources()

Clears all resources.

Args:
  • None.
Returns:
None.
refresh(force_refresh=False)

Refreshes the AWS resources and caches them to a file.

This function is called on startup. If no cache exists, it queries AWS to build the resource lists. Pressing the F5 key will set force_refresh to True, which proceeds to refresh the list regardless of whether a cache exists. Before returning, it saves the resource lists to cache.

Args:
  • force_refresh: A boolean determines whether to force a cache
    refresh. This value is set to True when the user presses F5.
Returns:
None.

saws.saws module

class saws.saws.Saws(refresh_resources=True)

Bases: object

Encapsulates the Saws CLI.

Attributes:
  • aws_cli: An instance of prompt_toolkit’s CommandLineInterface.
  • key_manager: An instance of KeyManager.
  • config: An instance of Config.
  • config_obj: An instance of ConfigObj, reads from ~/.sawsrc.
  • theme: A string representing the lexer theme.
  • logger: An instance of SawsLogger.
  • all_commands: A list of all commands, sub_commands, options, etc
    from data/SOURCES.txt.
  • commands: A list of commands from data/SOURCES.txt.
  • sub_commands: A list of sub_commands from data/SOURCES.txt.
  • completer: An instance of AwsCompleter.
PYGMENTS_CMD = u' | pygmentize -l json'
__init__(refresh_resources=True)

Inits Saws.

Args:
  • refresh_resources: A boolean that determines whether to
    refresh resources.
Returns:
None.
get_color()

Getter for color output mode.

Used by prompt_toolkit’s KeyBindingManager. KeyBindingManager expects this function to be callable so we can’t use @property and @attrib.setter.

Args:
  • None.
Returns:
A boolean that represents the color flag.
get_fuzzy_match()

Getter for fuzzy matching mode

Used by prompt_toolkit’s KeyBindingManager. KeyBindingManager expects this function to be callable so we can’t use @property and @attrib.setter.

Args:
  • None.
Returns:
A boolean that represents the fuzzy flag.
get_shortcut_match()

Getter for shortcut matching mode

Used by prompt_toolkit’s KeyBindingManager. KeyBindingManager expects this function to be callable so we can’t use @property and @attrib.setter.

Args:
  • None.
Returns:
A boolean that represents the shortcut flag.
handle_docs(text=None, from_fkey=False)

Displays contextual web docs for F9 or the docs command.

Displays the web docs specific to the currently entered:

  • (optional) command
  • (optional) subcommand

If no command or subcommand is present, the docs index page is shown.

Docs are only displayed if:

  • from_fkey is True
  • from_fkey is False and docs is found in text
Args:
  • text: A string representing the input command text.
  • from_fkey: A boolean representing whether this function is
    being executed from an F9 key press.
Returns:
A boolean representing whether the web docs were shown.
log_exception(e, traceback, echo=False)

Logs the exception and traceback to the log file ~/.saws.log.

Args:
  • e: A Exception that specifies the exception.
  • traceback: A Traceback that specifies the traceback.
  • echo: A boolean that specifies whether to echo the exception
    to the console using click.
Returns:
None.
refresh_resources_and_options()

Convenience function to refresh resources and options for completion.

Used by prompt_toolkit’s KeyBindingManager.

Args:
  • None.
Returns:
None.
run_cli()

Runs the main loop.

Args:
  • None.
Returns:
None.
set_color(color)

Setter for color output mode.

Used by prompt_toolkit’s KeyBindingManager. KeyBindingManager expects this function to be callable so we can’t use @property and @attrib.setter.

Args:
  • color: A boolean that represents the color flag.
Returns:
None.
set_fuzzy_match(fuzzy)

Setter for fuzzy matching mode

Used by prompt_toolkit’s KeyBindingManager. KeyBindingManager expects this function to be callable so we can’t use @property and @attrib.setter.

Args:
  • color: A boolean that represents the fuzzy flag.
Returns:
None.
set_shortcut_match(shortcut)

Setter for shortcut matching mode

Used by prompt_toolkit’s KeyBindingManager. KeyBindingManager expects this function to be callable so we can’t use @property and @attrib.setter.

Args:
  • color: A boolean that represents the shortcut flag.
Returns:
None.

saws.style module

class saws.style.StyleFactory(name)

Bases: object

Creates a custom saws style.

Provides styles for the completions menu and toolbar.

Attributes:
  • style: An instance of a Pygments Style.
__init__(name)

Initializes StyleFactory.

Args:
  • name: A string representing the pygments style.
Returns:
An instance of CliStyle.
style_factory(name)

Retrieves the specified pygments style.

If the specified style is not found, the native style is returned.

Args:
  • name: A string representing the pygments style.
Returns:
An instance of CliStyle.

saws.toolbar module

class saws.toolbar.Toolbar(color_cfg, fuzzy_cfg, shortcuts_cfg)

Bases: object

Encapsulates the bottom toolbar.

Attributes:
  • handler: A callable get_toolbar_items.
__init__(color_cfg, fuzzy_cfg, shortcuts_cfg)

Initializes ToolBar.

Args:
  • color_cfg: A boolean that spedifies whether to color the output.
  • fuzzy_cfg: A boolean that spedifies whether to do fuzzy matching.
  • shortcuts_cfg: A boolean that spedifies whether to match
    shortcuts.
Returns:
None

saws.utils module

class saws.utils.TextUtils

Bases: object

Utilities for parsing and matching text.

Attributes:
  • None.
find_matches(word, collection, fuzzy)

Finds all matches in collection for word.

Args:
  • word: A string representing the word before
    the cursor.
  • collection: A collection of words to match.
  • fuzzy: A boolean that specifies whether to use fuzzy matching.
Yields:
A generator of prompt_toolkit’s Completions.
get_token_index(text, collection)

Given a text return the index in the collection.

Args:
  • text: A string to find and obtain the index.
  • collection: A collection of words to match.
Returns:
An integer representing the index in the collection where the text was found.
get_tokens(text)

Parses out all tokens.

Args:
  • text: A string to split into tokens.
Returns:
A list of strings for each word in the text.

Module contents