Tweak doc examples

reviewable/pr18780/r1
Michael DeHaan 12 years ago
parent 93baccce01
commit d9d033fa58

22
uri

@ -33,8 +33,8 @@ DOCUMENTATION = '''
module: uri module: uri
short_description: Interacts with webservices short_description: Interacts with webservices
description: description:
- Interacts with HTTP and HTTPS webservices and supports Digest, Basic and WSSE - Interacts with HTTP and HTTPS web services and supports Digest, Basic and WSSE
HTTP authentication mechanisms. HTTP authentication mechanisms.
version_added: "1.1" version_added: "1.1"
options: options:
url: url:
@ -45,7 +45,7 @@ options:
aliases: [] aliases: []
dest: dest:
description: description:
- path of where to download the file to. - path of where to download the file to (if desired).
- If I(dest) is a directory, the basename of the file on the remote server will be used. - If I(dest) is a directory, the basename of the file on the remote server will be used.
required: false required: false
default: null default: null
@ -72,7 +72,7 @@ options:
default: "GET" default: "GET"
return_content: return_content:
description: description:
- Whether or not to return the body of the request in the "content" register variable. - Whether or not to return the body of the request as a "content" key in the dictionary result.
required: false required: false
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
default: no default: no
@ -120,27 +120,25 @@ examples:
description: "Check that you can connect to a page and it returns a status 200" description: "Check that you can connect to a page and it returns a status 200"
- code: | - code: |
uri: url=http://www.awesome.com method=GET return_content=yes action: uri url=http://www.awesome.com method=GET return_content=yes
register: webpage register: webpage
command: /usr/bin/uptime action: fail
when_string: '"AWESOME" in "${webpage.content}"' when_string: '"AWESOME" not in "${webpage.content}"'
description: Check that a page returns a status 200 and the word AWESOME is in the page contents. description: Check that a page returns a status 200 and the word AWESOME is in the page contents.
- code: | - code: |
uri: url=https://your.jira.server.com/rest/api/2/issue/ method=POST user=your_username password=your_pass body='$FILE(issue.json)' force_basic_auth=yes status_code=201 HEADER_Content-Type="application/json" action: uri url=https://your.jira.server.com/rest/api/2/issue/ method=POST user=your_username password=your_pass body='$FILE(issue.json)' force_basic_auth=yes status_code=201 HEADER_Content-Type="application/json"
description: "Create a JIRA issue." description: "Create a JIRA issue."
- code: | - code: |
uri: url=https://your.form.based.auth.app.com/index.php method=POST body="name=your_username&password=your_password&enter=Sign%20in" status_code=302 HEADER_Content-Type="application/x-www-form-urlencoded" action: uri url=https://your.form.based.auth.app.com/index.php method=POST body="name=your_username&password=your_password&enter=Sign%20in" status_code=302 HEADER_Content-Type="application/x-www-form-urlencoded"
register: login register: login
uri: url=https://your.form.based.auth.app.com/dashboard.php method=GET return_content=yes HEADER_Cookie="${login.set_cookie}" action: uri url=https://your.form.based.auth.app.com/dashboard.php method=GET return_content=yes HEADER_Cookie="${login.set_cookie}"
description: "Login to a form based webpage, then use the cookie that got returned to access the app in later tasks." description: "Login to a form based webpage, then use the cookie that got returned to access the app in later tasks."
notes:
- This module doesn't yet support configuration for proxies.
# informational: requirements for nodes # informational: requirements for nodes
requirements: [ urlparse, httplib2 ] requirements: [ urlparse, httplib2 ]
author: Romeo Theriault author: Romeo Theriault

Loading…
Cancel
Save