uri doc fixes

This commit is contained in:
Romeo Theriault 2013-02-18 13:03:19 -10:00
parent 8f02a2fca3
commit c2fdb768e5

42
uri
View file

@ -45,8 +45,7 @@ options:
aliases: [] aliases: []
dest: dest:
description: description:
- path of where to download the file to (if desired). - 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
user: user:
@ -61,7 +60,7 @@ options:
default: null default: null
body: body:
description: description:
- The body of the http request/response to the webservice. - The body of the http request/response to the web service.
required: false required: false
default: null default: null
method: method:
@ -75,7 +74,7 @@ options:
- Whether or not to return the body of the request as a "content" key in the dictionary result. - 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"
force_basic_auth: force_basic_auth:
description: description:
- httplib2, the library used by the uri module only sends authentication information when a webservice - httplib2, the library used by the uri module only sends authentication information when a webservice
@ -84,13 +83,13 @@ options:
upon initial request. upon initial request.
required: false required: false
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
default: no default: "no"
follow_redirects: follow_redirects:
description: description:
- Whether or not the URI module should follow all redirects. - Whether or not the URI module should follow all redirects.
required: false required: false
choices: [ "yes", "no" ] choices: [ "yes", "no" ]
default: no default: "no"
creates: creates:
description: description:
- a filename, when it already exists, this step will not be run. - a filename, when it already exists, this step will not be run.
@ -112,6 +111,37 @@ options:
description: description:
- all arguments accepted by the M(file) module also work here - all arguments accepted by the M(file) module also work here
required: false required: false
examples:
- code: "uri: url=http://www.awesome.com"
description: "Check that you can connect (GET) to a page and it returns a status 200"
- code: |
action: uri url=http://www.awesome.com return_content=yes
register: webpage
action: fail
when_string: '"AWESOME" not in "${webpage.content}"'
description: Check that a page returns a status 200 and fail if the word AWESOME is not in the page contents.
- code: |
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."
- code: |
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
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."
# informational: requirements for nodes # informational: requirements for nodes
requirements: [ urlparse, httplib2 ] requirements: [ urlparse, httplib2 ]
author: Romeo Theriault author: Romeo Theriault