From 62e8f46390dd60af30bc5c01e689b1300bf0c389 Mon Sep 17 00:00:00 2001 From: Corwin Brown Date: Wed, 2 Mar 2016 08:36:53 -0600 Subject: [PATCH] Converting result to snake_case before returning --- lib/ansible/modules/extras/windows/win_uri.ps1 | 15 +++++++++++++-- lib/ansible/modules/extras/windows/win_uri.py | 18 +++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/lib/ansible/modules/extras/windows/win_uri.ps1 b/lib/ansible/modules/extras/windows/win_uri.ps1 index 3dd1d491bf1..b02418e8912 100644 --- a/lib/ansible/modules/extras/windows/win_uri.ps1 +++ b/lib/ansible/modules/extras/windows/win_uri.ps1 @@ -1,7 +1,7 @@ #!powershell # This file is part of Ansible # -# Copyright 2015, Corwin Brown +# Copyright 2015, Corwin Brown # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,6 +25,15 @@ $result = New-Object psobject @{ win_uri = New-Object psobject } +# Functions ############################################### + +Function ConvertTo-SnakeCase($input_string) { + $snake_case = $input_string -csplit "(? +# (c) 2015, Corwin Brown # # This file is part of Ansible # @@ -27,7 +27,7 @@ module: win_uri version_added: "2.1" short_description: Interacts with webservices. description: - - Interacts with HTTP and HTTPS services. + - Interacts with HTTP and HTTPS web services and supports Digest, Basic and WSSE HTTP authentication mechanisms. options: url: description: @@ -55,7 +55,7 @@ options: - The body of the HTTP request/response to the web service. headers: description: - - Key Value pairs for headers. Example "Host: www.somesite.com" + - 'Key Value pairs for headers. Example "Host: www.somesite.com"' use_basic_parsing: description: - This module relies upon 'Invoke-WebRequest', which by default uses the Internet Explorer Engine to parse a webpage. There's an edge-case where if a user hasn't run IE before, this will fail. The only advantage to using the Internet Explorer praser is that you can traverse the DOM in a powershell script. That isn't useful for Ansible, so by default we toggle 'UseBasicParsing'. However, you can toggle that off here. @@ -81,7 +81,7 @@ EXAMPLES = """ url: http://my.internal.server.com method: GET headers: - host: "www.somesite.com + host: "www.somesite.com" # Do a HEAD request on an endpoint --- @@ -120,27 +120,27 @@ use_basic_parsing: returned: always type: bool sample: True -StatusCode: +status_code: description: The HTTP Status Code of the response. returned: success type: int sample: 200 -StatusDescription: +status_description: description: A summery of the status. returned: success type: string stample: "OK" -RawContent: +raw_content: description: The raw content of the HTTP response. returned: success type: string sample: 'HTTP/1.1 200 OK\nX-XSS-Protection: 1; mode=block\nX-Frame-Options: SAMEORIGIN\nAlternate-Protocol: 443:quic,p=1\nAlt-Svc: quic="www.google.com:443"; ma=2592000; v="30,29,28,27,26,25",quic=":443"; ma=2...' -Headers: +headers: description: The Headers of the response. returned: success type: dict sample: {"Content-Type": "application/json"} -RawContentLength: +raw_content_length: description: The byte size of the response. returned: success type: int